Merge pull request #13194 from open-craft/mtyaka/hide-instructor-tools
Hide 'Reset Attempts' and 'Rescore Problem' on unsupported blocks.
This commit is contained in:
@@ -68,13 +68,17 @@ ${block_content}
|
||||
</div>
|
||||
<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>
|
||||
% if has_instructor_access:
|
||||
|
|
||||
% endif
|
||||
% if has_instructor_access:
|
||||
<a href="#" class="staff-debug-sdelete">${_('Delete Student State')}</a>
|
||||
% if can_rescore_problem:
|
||||
|
|
||||
<a href="#" class="staff-debug-rescore">${_('Rescore Student Submission')}</a>
|
||||
% endif
|
||||
% endif
|
||||
]
|
||||
</div>
|
||||
<div id="result_${location.name | h}"/>
|
||||
@@ -83,16 +87,17 @@ ${block_content}
|
||||
<div class="staff_info" style="display:block">
|
||||
is_released = ${is_released}
|
||||
location = ${location.to_deprecated_string() | h}
|
||||
|
||||
<table summary="${_('Module Fields')}">
|
||||
<tr><th>${_('Module Fields')}</th></tr>
|
||||
%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
|
||||
</table>
|
||||
<table>
|
||||
<tr><th>${_('XML attributes')}</th></tr>
|
||||
%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
|
||||
</table>
|
||||
category = ${category | h}
|
||||
|
||||
@@ -382,6 +382,8 @@ def add_staff_markup(user, has_instructor_access, disable_staff_debug_info, bloc
|
||||
'block_content': frag.content,
|
||||
'is_released': is_released,
|
||||
'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,
|
||||
}
|
||||
return wrap_fragment(frag, render_to_string("staff_problem_info.html", staff_context))
|
||||
|
||||
Reference in New Issue
Block a user