staff_problem_info.html 5.07 KB
Newer Older
1
<%namespace name='static' file='/static_content.html'/>
2 3 4 5
<%!
from django.utils.translation import ugettext as _
from django.template.defaultfilters import escapejs
%>
6

7
## The JS for this is defined in xqa_interface.html
8
${block_content}
9
%  if edit_link:
10 11 12 13
  <div>
      <a href="${edit_link}">Edit</a>
      % if xqa_key:
          / <a href="#${element_id}_xqa-modal" onclick="javascript:getlog('${element_id}', {
14 15 16 17
          'location': '${location | h}',
          'xqa_key': '${xqa_key | h}',
          'category': '${category | h}',
          'user': '${user | h}'
18 19 20
       })" id="${element_id}_xqa_log">QA</a>
      % endif
  </div>
21
%  endif
22 23
%  if not disable_staff_debug_info:
<div class="wrap-instructor-info" aria-hidden="true">
24
  <a class="instructor-info-action" href="#${element_id}_debug" id="${element_id}_trig">${_("Staff Debug Info")}</a>
25

26 27 28 29 30
  %  if settings.FEATURES.get('ENABLE_STUDENT_HISTORY_VIEW') and \
    location.category == 'problem':
    <a class="instructor-info-action" href="#${element_id}_history" id="${element_id}_history_trig">${_("Submission history")}</a>
  %  endif
</div>
31
%  endif
32

33
<section aria-hidden="true" id="${element_id}_xqa-modal" class="modal xqa-modal" style="width:80%; left:20%; height:80%; overflow:auto" >
34 35
  <div class="inner-wrapper">
    <header>
36
      <h2>${_("{platform_name} Content Quality Assessment").format(platform_name=settings.PLATFORM_NAME)}</h2>
37 38 39
    </header>

    <form id="${element_id}_xqa_form" class="xqa_form">
40
      <label for="${element_id}_xqa_entry">${_("Comment")}</label>
41
      <input id="${element_id}_xqa_entry" type="text" placeholder="${_('comment')}">
42
      <label for="${element_id}_xqa_tag">${_("Tag")}</label>
43
      <span style="color:black;vertical-align: -10pt">${_('Optional tag (eg "done" or "broken"):') + '&nbsp; '}      </span>
44
      <input id="${element_id}_xqa_tag" type="text" placeholder="${_('tag')}" style="width:80px;display:inline">
45
      <div class="submit">
46
        <button name="submit" type="submit">${_('Add comment')}</button>
47 48 49 50 51 52 53 54
      </div>
      <hr>
      <div id="${element_id}_xqa_log_data"></div>
    </form>

  </div>
</section>

55
<section aria-hidden="true" class="modal staff-modal" id="${element_id}_debug" style="width:80%; left:20%; height:80%; overflow:auto; display:none" >
56 57
  <div class="inner-wrapper" style="color:black">
    <header>
58
      <h2>${_('Staff Debug')}</h2>
59
    </header>
60

61 62 63 64
    <hr />
    <div class="staff_actions">
      <h3>${_('Actions')}</h3>
      <div>
65 66
        <label for="sd_fu_${location.name | h}">${_('Username')}:</label>
        <input type="text" id="sd_fu_${location.name | h}" placeholder="${user.username}"/>
67
      </div>
68
      <div data-location="${location | h}" data-location-name="${location.name | h}">
69 70 71 72 73 74 75 76 77
        [
        <a href="#" class="staff-debug-reset">${_('Reset Student Attempts')}</a>
        % if has_instructor_access:
        |
        <a href="#" class="staff-debug-sdelete">${_('Delete Student State')}</a>
        |
        <a href="#" class="staff-debug-rescore">${_('Rescore Student Submission')}</a>
        % endif
        ]
78
      </div>
79
      <div id="result_${location.name | h}"/>
80
    </div>
81

82
    <div class="staff_info" style="display:block">
ichuang committed
83
is_released = ${is_released}
84
location = ${location.to_deprecated_string() | h}
85
<table summary="${_('Module Fields')}">
86
  <tr><th>${_('Module Fields')}</th></tr>
87
  %for name, field in fields:
88
  <tr><td>${name}</td><td><pre style="display:inline-block; margin: 0;">${field | h}</pre></td></tr>
89
  %endfor
90 91
</table>
<table>
92
  <tr><th>${_('XML attributes')}</th></tr>
93 94 95 96
  %for name, field in xml_attributes.items():
  <tr><td>${name}</td><td><pre style="display:inline-block; margin: 0;">${field | h}</pre></td></tr>
  %endfor
</table>
97 98 99 100 101 102 103 104
category = ${category | h}
    </div>
    %if render_histogram:
    <div id="histogram_${element_id}" class="histogram" data-histogram="${histogram}"></div>
    %endif
  </div>
</section>

105
<section aria-hidden="true" class="modal history-modal" id="${element_id}_history" style="width:80%; left:20%; height:80%; overflow:auto;" >
106 107
  <div class="inner-wrapper" style="color:black">
    <header>
108
      <h2>${_("Submission History Viewer")}</h2>
109 110
    </header>
    <form id="${element_id}_history_form">
111
      <label for="${element_id}_history_student_username">${_("User:")}</label>
112
      <input id="${element_id}_history_student_username" type="text" placeholder=""/>
113
      <input type="hidden" id="${element_id}_history_location" value="${location | h}"/>
114
      <div class="submit">
115
        <button name="submit" type="submit">${_("View History")}</button>
116 117
      </div>
    </form>
118

119 120 121 122 123 124
    <div id="${element_id}_history_text" class="staff_info" style="display:block">
    </div>
  </div>
</section>

<div id="${element_id}_setup"></div>
125 126

<script type="text/javascript">
127
// assumes courseware.html's loaded this method.
128
$(function () {
129 130 131 132 133 134 135
    setup_debug('${element_id}',
        %if edit_link:
        '${edit_link}',
        %else:
        null,
        %endif
        {
136
            'location': '${location | escapejs}',
137 138 139 140 141 142
            'xqa_key': '${xqa_key}',
            'category': '${category}',
            'user': '${user}'
        }
    );
});
143
</script>