add xqa interface to staff_problem_info, make staff_debug a modal

window, add xqa modal window, add xqa_key to course metadata
This commit is contained in:
ichuang
2012-08-11 20:12:37 -04:00
parent 241d445f30
commit da64c8f0a1
5 changed files with 126 additions and 14 deletions

View File

@@ -69,14 +69,14 @@ def grade_histogram(module_id):
return grades
def add_histogram(get_html, module):
def add_histogram(get_html, module, user):
"""
Updates the supplied module with a new get_html function that wraps
the output of the old get_html function with additional information
for admin users only, including a histogram of student answers and the
definition of the xmodule
Does nothing if module is a SequenceModule
Does nothing if module is a SequenceModule or a VerticalModule.
"""
@wraps(get_html)
def _get_html():
@@ -104,8 +104,12 @@ def add_histogram(get_html, module):
staff_context = {'definition': module.definition.get('data'),
'metadata': json.dumps(module.metadata, indent=4),
'element_id': module.location.html_id(),
'location': module.location,
'xqa_key': module.metadata.get('xqa_key',''),
'category': str(module.__class__.__name__),
'element_id': module.location.html_id().replace('-','_'),
'edit_link': edit_link,
'user': user,
'histogram': json.dumps(histogram),
'render_histogram': render_histogram,
'module_content': get_html()}