Commit 451c0d38 by cahrens

Prototype of passing "graded" through to capa template.

parent a5610294
...@@ -399,6 +399,7 @@ class CapaMixin(CapaFields): ...@@ -399,6 +399,7 @@ class CapaMixin(CapaFields):
'ajax_url': self.runtime.ajax_url, 'ajax_url': self.runtime.ajax_url,
'progress_status': Progress.to_js_status_str(progress), 'progress_status': Progress.to_js_status_str(progress),
'progress_detail': Progress.to_js_detail_str(progress), 'progress_detail': Progress.to_js_detail_str(progress),
'graded': self.graded,
'content': self.get_problem_html(encapsulate=False), 'content': self.get_problem_html(encapsulate=False),
}) })
......
...@@ -65,6 +65,7 @@ class @Problem ...@@ -65,6 +65,7 @@ class @Problem
renderProgressState: => renderProgressState: =>
detail = @el.data('progress_detail') detail = @el.data('progress_detail')
status = @el.data('progress_status') status = @el.data('progress_status')
graded = @el.data('graded')
# Render 'x/y point(s)' if student has attempted question # Render 'x/y point(s)' if student has attempted question
if status != 'none' and detail? and detail.indexOf('/') > 0 if status != 'none' and detail? and detail.indexOf('/') > 0
...@@ -84,6 +85,7 @@ class @Problem ...@@ -84,6 +85,7 @@ class @Problem
progress_template = ngettext("(%(num_points)s point possible)", "(%(num_points)s points possible)", possible) progress_template = ngettext("(%(num_points)s point possible)", "(%(num_points)s points possible)", possible)
progress = interpolate(progress_template, {'num_points': possible}, true) progress = interpolate(progress_template, {'num_points': possible}, true)
progress = progress + interpolate("; Graded=%(graded)s", {"graded": graded}, true)
@$('.problem-progress').html(progress) @$('.problem-progress').html(progress)
updateProgress: (response) => updateProgress: (response) =>
......
<div id="problem_${element_id}" class="problems-wrapper" data-problem-id="${id}" data-url="${ajax_url}" data-progress_status="${progress_status}" data-progress_detail="${progress_detail}" data-content="${content | h}"></div> <div id="problem_${element_id}" class="problems-wrapper" data-problem-id="${id}" data-url="${ajax_url}" data-progress_status="${progress_status}" data-progress_detail="${progress_detail}" data-graded="${graded}" data-content="${content | h}"></div>
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