Commit 98a03f68 by Tim Krones Committed by GitHub

Merge pull request #13194 from open-craft/mtyaka/hide-instructor-tools

Hide 'Reset Attempts' and 'Rescore Problem' on unsupported blocks.
parents fbabef2d 32fb5517
...@@ -68,13 +68,17 @@ ${block_content} ...@@ -68,13 +68,17 @@ ${block_content}
</div> </div>
<div data-location="${location | h}" data-location-name="${location.name | h}"> <div data-location="${location | h}" data-location-name="${location.name | h}">
[ [
% if can_reset_attempts:
<a href="#" class="staff-debug-reset">${_('Reset Student Attempts')}</a> <a href="#" class="staff-debug-reset">${_('Reset Student Attempts')}</a>
% if has_instructor_access:
| |
% endif
% if has_instructor_access:
<a href="#" class="staff-debug-sdelete">${_('Delete Student State')}</a> <a href="#" class="staff-debug-sdelete">${_('Delete Student State')}</a>
% if can_rescore_problem:
| |
<a href="#" class="staff-debug-rescore">${_('Rescore Student Submission')}</a> <a href="#" class="staff-debug-rescore">${_('Rescore Student Submission')}</a>
% endif % endif
% endif
] ]
</div> </div>
<div id="result_${location.name | h}"/> <div id="result_${location.name | h}"/>
...@@ -83,16 +87,17 @@ ${block_content} ...@@ -83,16 +87,17 @@ ${block_content}
<div class="staff_info" style="display:block"> <div class="staff_info" style="display:block">
is_released = ${is_released} is_released = ${is_released}
location = ${location.to_deprecated_string() | h} location = ${location.to_deprecated_string() | h}
<table summary="${_('Module Fields')}"> <table summary="${_('Module Fields')}">
<tr><th>${_('Module Fields')}</th></tr> <tr><th>${_('Module Fields')}</th></tr>
%for name, field in fields: %for name, field in fields:
<tr><td>${name}</td><td><pre style="display:inline-block; margin: 0;">${field | h}</pre></td></tr> <tr><td style="width:25%">${name}</td><td><pre style="display:inline-block; margin: 0;">${field | h}</pre></td></tr>
%endfor %endfor
</table> </table>
<table> <table>
<tr><th>${_('XML attributes')}</th></tr> <tr><th>${_('XML attributes')}</th></tr>
%for name, field in xml_attributes.items(): %for name, field in xml_attributes.items():
<tr><td>${name}</td><td><pre style="display:inline-block; margin: 0;">${field | h}</pre></td></tr> <tr><td style="width:25%">${name}</td><td><pre style="display:inline-block; margin: 0;">${field | h}</pre></td></tr>
%endfor %endfor
</table> </table>
category = ${category | h} category = ${category | h}
......
...@@ -382,6 +382,8 @@ def add_staff_markup(user, has_instructor_access, disable_staff_debug_info, bloc ...@@ -382,6 +382,8 @@ def add_staff_markup(user, has_instructor_access, disable_staff_debug_info, bloc
'block_content': frag.content, 'block_content': frag.content,
'is_released': is_released, 'is_released': is_released,
'has_instructor_access': has_instructor_access, 'has_instructor_access': has_instructor_access,
'can_reset_attempts': 'attempts' in block.fields,
'can_rescore_problem': hasattr(block, 'rescore_problem'),
'disable_staff_debug_info': disable_staff_debug_info, 'disable_staff_debug_info': disable_staff_debug_info,
} }
return wrap_fragment(frag, render_to_string("staff_problem_info.html", staff_context)) return wrap_fragment(frag, render_to_string("staff_problem_info.html", staff_context))
......
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