Commit 8eae59d4 by Jason Bau

make a bunch customizability in LTI modules

parent 6f2af37b
...@@ -191,6 +191,21 @@ class LTIFields(object): ...@@ -191,6 +191,21 @@ class LTIFields(object):
default=False, default=False,
scope=Scope.settings scope=Scope.settings
) )
title_postscript = String(
display_name="Post-script to component title",
default="(External Resource)",
scope=Scope.settings
)
grader_feedback_label = String(
display_name="String label for grader feedback",
default="Feedback on your work from the grader:",
scope=Scope.settings
)
instruction_text = String(
display_name="Additional instruction text for component",
default="",
scope=Scope.settings
)
class LTIModule(LTIFields, LTI20ModuleMixin, XModule): class LTIModule(LTIFields, LTI20ModuleMixin, XModule):
...@@ -370,6 +385,9 @@ class LTIModule(LTIFields, LTI20ModuleMixin, XModule): ...@@ -370,6 +385,9 @@ class LTIModule(LTIFields, LTI20ModuleMixin, XModule):
'weight': self.weight, 'weight': self.weight,
'module_score': self.module_score, 'module_score': self.module_score,
'comment': sanitized_comment, 'comment': sanitized_comment,
'title_postscript': self.title_postscript,
'grader_feedback_label': self.grader_feedback_label,
'instruction_text': self.instruction_text,
} }
def get_html(self): def get_html(self):
......
...@@ -327,3 +327,7 @@ section.foldit { ...@@ -327,3 +327,7 @@ section.foldit {
border-radius: 5px; border-radius: 5px;
font-weight: bold; font-weight: bold;
} }
h4.problem-feedback-label{
margin-top: 1em;
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<h2 class="problem-header"> <h2 class="problem-header">
## Translators: "External resource" means that this learning module is hosted on a platform external to the edX LMS ## Translators: "External resource" means that this learning module is hosted on a platform external to the edX LMS
${display_name} (${_('External resource')}) ${display_name} ${title_postscript}
</h2> </h2>
% if has_score and weight: % if has_score and weight:
...@@ -22,7 +22,10 @@ ...@@ -22,7 +22,10 @@
id="${element_id}" id="${element_id}"
class="${element_class}" class="${element_class}"
> >
<div class="problem-instruction">
${instruction_text}
</div>
</div>
% if launch_url and launch_url != 'http://www.example.com' and not hide_launch: % if launch_url and launch_url != 'http://www.example.com' and not hide_launch:
% if open_in_a_new_page: % if open_in_a_new_page:
<div class="wrapper-lti-link"> <div class="wrapper-lti-link">
...@@ -46,7 +49,9 @@ ...@@ -46,7 +49,9 @@
%endif %endif
% if has_score and comment: % if has_score and comment:
<h4 class="problem-feedback-label">${_("Feedback on your work from the grader:")}</h4> % if grader_feedback_label:
<h4 class="problem-feedback-label">${grader_feedback_label}</h4>
% endif
<div class="problem-feedback"> <div class="problem-feedback">
## sanitized with bleach in view ## sanitized with bleach in view
${comment} ${comment}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment