legacy_instructor_dashboard.html 26.9 KB
Newer Older
1 2 3
## NOTE: This is the template for the LEGACY instructor dashboard         ##
## We are no longer supporting this file or accepting changes into it.    ##
## Please see lms/templates/instructor for instructor dashboard templates ##
4

5
<%! from django.utils.translation import ugettext as _ %>
6
<%! from django.core.urlresolvers import reverse %>
7 8

<%inherit file="../main.html" />
9
<%namespace name='static' file='/static_content.html'/>
10

11
<%block name="pagetitle">${_("Legacy Instructor Dashboard")}</%block>
12 13
<%block name="nav_skip">#instructor-dashboard-content</%block>

14
<%block name="headextra">
15
<%static:css group='style-course-vendor'/>
16 17
<%static:css group='style-vendor-tinymce-content'/>
<%static:css group='style-vendor-tinymce-skin'/>
18 19
<%static:css group='style-course'/>

20 21 22 23 24 25 26
  <script type="text/javascript">
    // This is a hack to get tinymce to work correctly in Firefox until the annotator tool is refactored to not include
    // tinymce globally.
    if(typeof window.Range.prototype === "undefined") {
        window.Range.prototype = { };
    }
  </script>
27 28
  <script type="text/javascript" src="${static.url('js/vendor/flot/jquery.flot.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/flot/jquery.flot.axislabels.js')}"></script>
29 30
  <script type="text/javascript" src="${static.url('js/vendor/jquery-jvectormap-1.1.1/jquery-jvectormap-1.1.1.min.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/jquery-jvectormap-1.1.1/jquery-jvectormap-world-mill-en.js')}"></script>
31
  <script type="text/javascript" src="${static.url('js/course_groups/cohorts.js')}"></script>
32
  <script type="text/javascript" src="${static.url('js/vendor/codemirror-compressed.js')}"></script>
33 34
  <script type="text/javascript" src="${static.url('js/vendor/tinymce/js/tinymce/tinymce.full.min.js')}"></script>
  <script type="text/javascript" src="${static.url('js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js')}"></script>
35 36 37
  <script type="text/javascript">
    (function() {window.baseUrl = "${settings.STATIC_URL}";})(this);
  </script>
38
  <%static:js group='module-descriptor-js'/>
39
%if instructor_tasks is not None:
40
  <script type="text/javascript" src="${static.url('js/pending_tasks.js')}"></script>
41
%endif
42 43
</%block>

44
<%include file="/courseware/course_navigation.html" args="active_page='instructor'" />
45

46 47
<style type="text/css">
table.stat_table {
48 49 50 51 52 53
    font-family: verdana,arial,sans-serif;
    font-size:11px;
    color:#333333;
    border-width: 1px;
    border-color: #666666;
    border-collapse: collapse;
54 55
}
table.stat_table th {
56 57 58 59 60
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #666666;
    background-color: #dedede;
61 62
}
table.stat_table td {
63 64 65 66 67
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #666666;
    background-color: #ffffff;
68
}
69
.divScroll {
70 71
    height: 200px;
    overflow: scroll;
72
}
73 74 75

a.selectedmode { background-color: yellow; }

76 77 78
textarea {
  height: 200px;
}
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117

.jvectormap-label {
    position: absolute;
    display: none;
    border: solid 1px #CDCDCD;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    background: #292929;
    color: white;
    font-family: sans-serif, Verdana;
    font-size: smaller;
    padding: 3px;
}

.jvectormap-zoomin, .jvectormap-zoomout {
    position: absolute;
    left: 10px;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    background: #292929;
    padding: 3px;
    color: white;
    width: 10px;
    height: 10px;
    cursor: pointer;
    line-height: 10px;
    text-align: center;
}

.jvectormap-zoomin {
    top: 10px;
}

.jvectormap-zoomout {
    top: 30px;
}

118 119
</style>

120 121 122 123 124 125 126 127
<script language="JavaScript" type="text/javascript">
function goto( mode)
{
  document.idashform.idash_mode.value = mode;
  document.idashform.submit() ;
}
</script>

128 129
<section class="container">
<div class="instructor-dashboard-wrapper">
130

131
  <section class="instructor-dashboard-content" id="instructor-dashboard-content">
132 133 134 135
    <div class="wrap-instructor-info studio-view beta-button-wrapper">
      %if studio_url:
        <a class="instructor-info-action" href="${studio_url}">${_("View Course in Studio")}</a>
      %endif
136
      <a class="instructor-info-action beta-button" href="${ standard_dashboard_url }">${_("Back To Instructor Dashboard")}</a>
137
    </div>
138

139
    <h1>${_("Legacy Instructor Dashboard")}</h1>
140

141 142
    %if settings.FEATURES.get('IS_EDX_DOMAIN', False):
    ## Only show this banner on the edx.org website (other sites may choose to show this if they wish)
143
    <div class="wrapper-msg urgency-low msg-warning is-shown">
144
        <p>${_("You are using the legacy instructor dashboard, which we will retire in the near future.")} <a href="${ standard_dashboard_url }">${_("Return to the Instructor Dashboard")} <i class="icon fa fa-double-angle-right"></i></a></p>
145
          <p class="note">${_("If the Instructor Dashboard is missing functionality, please contact your PM to let us know.")}</p>
146
    </div>
147
    %endif
148

149
    <h2 class="navbar">[ <a href="#" onclick="goto('Grades');" class="${modeflag.get('Grades')}">Grades</a> |
150
          %if settings.FEATURES.get('ENABLE_PSYCHOMETRICS'):
151
            <a href="#" onclick="goto('Psychometrics');" class="${modeflag.get('Psychometrics')}">${_("Psychometrics")}</a> |
152
          %endif
153 154 155 156 157
          <a href="#" onclick="goto('Admin');" class="${modeflag.get('Admin')}">${_("Admin")}</a> |
          <a href="#" onclick="goto('Forum Admin');" class="${modeflag.get('Forum Admin')}">${_("Forum Admin")}</a> |
          <a href="#" onclick="goto('Enrollment');" class="${modeflag.get('Enrollment')}">${_("Enrollment")}</a> |
          <a href="#" onclick="goto('Data');" class="${modeflag.get('Data')}">${_("DataDump")}</a> |
          <a href="#" onclick="goto('Manage Groups');" class="${modeflag.get('Manage Groups')}">${_("Manage Groups")}</a>
158
          %if show_email_tab:
159
             | <a href="#" onclick="goto('Email')" class="${modeflag.get('Email')}">${_("Email")}</a>
160
          %endif
161
          %if settings.FEATURES.get('ENABLE_INSTRUCTOR_ANALYTICS'):
162
             | <a href="#" onclick="goto('Analytics');" class="${modeflag.get('Analytics')}">${_("Analytics")}</a>
163
          %endif
164 165 166
          %if settings.FEATURES.get('CLASS_DASHBOARD'):
             | <a href="#" onclick="goto('Metrics');" class="${modeflag.get('Metrics')}">${_("Metrics")}</a>
          %endif
167
      ]
168 169 170
    </h2>

    <form name="idashform" method="POST">
171
    <input type="hidden" name="csrfmiddlewaretoken" value="${ csrf_token }">
172
    <input type="hidden" name="idash_mode" value="">
173

174
##-----------------------------------------------------------------------------
175
%if modeflag.get('Grades'):
176 177

    %if offline_grade_log:
178 179
      <p>
        <span class="copy-warning">Pre-computed grades ${offline_grade_log} available: Use?
180
          <input type='checkbox' name='use_offline_grades' value="yes">
181 182
        </span>
      </p>
183 184
    %endif

185 186 187 188

    <hr width="40%" style="align:left">
    <h2>${_("Grade Downloads")}</h2>
    % if disable_buttons:
189 190 191 192 193 194

    <div class="msg msg-warning">

      <div class="copy">
        <p>
          ${_("Note: some of these buttons are known to time out for larger "
195 196
              "courses. We have disabled those features for courses "
              "with more than {max_enrollment} students.").format(
197
              max_enrollment=settings.FEATURES['MAX_ENROLLMENT_INSTR_BUTTONS']
198 199 200 201
            )}
        </p>
      </div>
    </div>
202 203
    % endif

204
    <p>
205
    <input type="submit" name="action" value="Dump list of enrolled students" class="${'is-disabled' if disable_buttons else ''}" aria-disabled="${'true' if disable_buttons else 'false'}">
206
    </p>
207 208

    <p>
209 210
    <input type="submit" name="action" value="Dump all RAW grades for all students in this course" class="${'is-disabled' if disable_buttons else ''}" aria-disabled="${'true' if disable_buttons else 'false'}">
    <input type="submit" name="action" value="Download CSV of all RAW grades" class="${'is-disabled' if disable_buttons else ''}" aria-disabled="${'true' if disable_buttons else 'false'}" >
211
    </p>
212 213

    <p>
214
  %if not settings.FEATURES.get('ENABLE_ASYNC_ANSWER_DISTRIBUTION'):
215
    <input type="submit" name="action" value="Download CSV of answer distributions" class="${'is-disabled' if disable_buttons else ''}" aria-disabled="${'true' if disable_buttons else 'false'}" >
216
  %endif
217
    <p  class="is-deprecated">
218 219 220 221
      ${_("To download student grades and view the grading configuration for your course, visit the Data Download section of the Instructor Dashboard.")}
    </p>
    <p class="is-deprecated">
      ${_("To view the Gradebook (only available for courses with a small number of enrolled students), visit the Student Admin section of the Instructor Dashboard.")}
222
    </p>
223
    </p>
224 225
    <hr width="40%" style="align:left">

226
  %if settings.FEATURES.get('REMOTE_GRADEBOOK_URL','') and instructor_access:
227

228
    <%
229
        rg = course.remote_gradebook
230 231
    %>

232 233
    <h3>${_("Export grades to remote gradebook")}</h3>
    <p>${_("The assignments defined for this course should match the ones stored in the gradebook, for this to work properly!")}</p>
234 235

    <ul>
236
    <li>${_("Gradebook name:")} <span class="copy-confirm">${rg.get('name','None defined!')}</span>
237 238
    <br/>
    <br/>
Adam Palay committed
239 240
    <input type="submit" name="action" value="List assignments available in remote gradebook">
    <input type="submit" name="action" value="List enrolled students matching remote gradebook">
241 242 243
    <br/>
    <br/>
    </li>
Adam Palay committed
244
    <li><input type="submit" name="action" value="List assignments available for this course">
245 246 247
    <br/>
    <br/>
    </li>
248
    <li>${_("Assignment name:")} <input type="text" name="assignment_name" size=40 >
249 250
    <br/>
    <br/>
Adam Palay committed
251 252 253
    <input type="submit" name="action" value="Display grades for assignment">
    <input type="submit" name="action" value="Export grades for assignment to remote gradebook">
    <input type="submit" name="action" value="Export CSV file of grades for assignment">
254 255
    </li>
    </ul>
256
    <hr width="40%" style="align:left">
257 258

  %endif
259
  %if settings.FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS'):
260
    <H2>${_("Course-specific grade adjustment")}</h2>
261

262
    <p class="is-deprecated">${_("To perform these actions, visit the Student Admin section of the Instructor Dashboard.")}</p>
263

264 265
  %endif

266
    <h2>${_("Student-specific grade inspection and adjustment")}</h2>
267

268
    <p class="is-deprecated">${_("To perform these actions, visit the Student Admin section of the Instructor Dashboard.")}</p>
269

270 271
 %endif

272
##-----------------------------------------------------------------------------
273 274
%if modeflag.get('Psychometrics'):

275
    <p>${_("Select a problem and an action:")}
276 277 278 279 280 281 282 283 284 285
    </p>

    <p>
    <select name="Problem">
    %for problem, count in sorted(problems.items(), key=lambda x: x[0]):
        <option value="${problem}">${problem} [${count}]</option>
    %endfor
    </select>
    </p>
    <p>
Adam Palay committed
286
    <input type="submit" name="action" value="Generate Histogram and IRT Plot">
287
    </p>
288

289 290 291 292
    <p></p>

%endif

293
##-----------------------------------------------------------------------------
294
%if modeflag.get('Admin'):
295

296 297
  %if instructor_access or admin_access:
    <p class="is-deprecated">${_("To add or remove course staff or instructors, visit the Membership section of the Instructor Dashboard.")}</p>
298 299
  %endif

300
  %if settings.FEATURES['ENABLE_MANUAL_GIT_RELOAD'] and admin_access:
301
    <p>
Adam Palay committed
302 303
    <input type="submit" name="action" value="Reload course from XML files">
    <input type="submit" name="action" value="GIT pull and Reload course">
304
  %endif
305 306
%endif

307
##-----------------------------------------------------------------------------
308
%if modeflag.get('Forum Admin'):
309
    <p class="is-deprecated">${_("To manage forum roles, visit the Membership section of the Instructor Dashboard.")}</p>
310 311
%endif

312
##-----------------------------------------------------------------------------
313 314 315
%if modeflag.get('Enrollment'):

    <hr width="40%" style="align:left">
316 317
    <h2>${_("Enrollment Data")}</h2>
    % if disable_buttons:
318 319 320 321 322

    <div class="msg msg-warning">
      <div class="copy">
        <p>
          ${_("Note: some of these buttons are known to time out for larger "
323 324
              "courses. We have disabled those features for courses "
              "with more than {max_enrollment} students.").format(
325
              max_enrollment=settings.FEATURES['MAX_ENROLLMENT_INSTR_BUTTONS']
326 327 328 329
            )}
        </p>
      </div>
    </div>
330 331
    % endif

332 333
    <input type="submit" name="action" value="List enrolled students" class="${'is-disabled' if disable_buttons else ''}" aria-disabled="${'true' if disable_buttons else 'false'}">
    <input type="submit" name="action" value="List students who may enroll but may not have yet signed up" class="${'is-disabled' if disable_buttons else ''}" aria-disabled="${'true' if disable_buttons else 'false'}" >
334 335
    <hr width="40%" style="align:left">

336
  %if settings.FEATURES.get('REMOTE_GRADEBOOK_URL','') and instructor_access:
337

338
    <%
339
        rg = course.remote_gradebook
340 341
    %>

342
    <p>${_("Pull enrollment from remote gradebook")}</p>
343
    <ul>
344
    <li>${_("Gradebook name:")} <span class="copy-confirm">${rg.get('name','None defined!')}</span>
345
    <li>${_("Section:")} <input type="text" name="gradebook_section" size=40 value="${rg.get('section','')}"></li>
346
    </ul>
Adam Palay committed
347 348 349 350
    <input type="submit" name="action" value="List sections available in remote gradebook">
    <input type="submit" name="action" value="List students in section in remote gradebook">
    <input type="submit" name="action" value="Overload enrollment list using remote gradebook">
    <input type="submit" name="action" value="Merge enrollment list with remote gradebook">
351
    <hr width="40%" style="align:left">
352

353 354 355
  %endif
%endif

356
##-----------------------------------------------------------------------------
357

358 359
%if modeflag.get('Data'):
    <hr width="40%" style="align:left">
360
    <p> ${_("Problem urlname:")}
361
        <input type="text" name="problem_to_dump" size="40">
Adam Palay committed
362
        <input type="submit" name="action" value="Download CSV of all responses to problem">
363
    </p>
364

365
    <p class="is-deprecated">
366
      ${_("To download student profile data and anonymized IDs, visit the Data Download section of the Instructor Dashboard.")}
367
    </p>
368 369
    <hr width="40%" style="align:left">
%endif
370 371

##-----------------------------------------------------------------------------
372

373 374
%if modeflag.get('Manage Groups'):
  %if instructor_access:
375
    %if course_is_cohorted:
376
      <p class="is-deprecated">${_("To manage beta tester roles and cohorts, visit the Membership section of the Instructor Dashboard.")}</p>
377 378
    %else:
      <p class="is-deprecated">${_("To manage beta tester roles, visit the Membership section of the Instructor Dashboard.")}</p>
379
    %endif
380 381 382
  %endif
%endif

383 384 385
##-----------------------------------------------------------------------------

%if modeflag.get('Email'):
386
    <p class="is-deprecated">${_("To send email, visit the Email section of the Instructor Dashboard.")}</p>
387 388
%endif

389
    </form>
390
##-----------------------------------------------------------------------------
391

392
%if msg:
393
    <p></p><p id="idash_msg">${msg}</p>
394
%endif
395 396

##-----------------------------------------------------------------------------
397

398
%if modeflag.get('Analytics'):
399

400
  %if not any(analytics_results.values()):
401
    <p>${_("No Analytics are available at this time.")}</p>
402 403
  %endif

404
  %if analytics_results.get("StudentsDropoffPerDay"):
405
    <p>
406
      ${_("Student activity day by day")}
407 408
      (${analytics_results["StudentsDropoffPerDay"]['time']})
    </p>
409 410 411
    <div>
      <table class="stat_table">
        <tr>
412 413
          <th>${_("Day")}</th>
          <th>${_("Students")}</th>
414 415 416 417 418 419 420 421 422 423 424 425 426
        </tr>
      %for row in analytics_results['StudentsDropoffPerDay']['data']:
        <tr>
          ## For now, just discard the non-date portion
          <td>${row['last_day'].split("T")[0]}</td>
          <td>${row['num_students']}</td>
        </tr>
      %endfor
      </table>
    </div>
  %endif
  <br/>
  %if analytics_results.get("ProblemGradeDistribution"):
427
    <p>
428
      ${_("Score distribution for problems")}
429 430
      (${analytics_results["ProblemGradeDistribution"]['time']})
    </p>
431 432 433
    <div>
      <table class="stat_table">
        <tr>
434 435 436
          <th>${_("Problem")}</th>
          <th>${_("Max")}</th>
          <th colspan="99">${_("Points Earned (Num Students)")}</th>
437 438 439
        </tr>
      %for row in analytics_results['ProblemGradeDistribution']['data']:
        <tr>
440
          <td>${row['block_id']}</td>
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455
          <td>${max(grade_record['max_grade'] for grade_record in row["grade_info"])}
          %for grade_record in row["grade_info"]:
          <td>
            %if isinstance(grade_record["grade"], float):
              ${"{grade:.2f}".format(**grade_record)}
            %else:
              ${"{grade}".format(**grade_record)}
            %endif
            (${grade_record["num_students"]})
          </td>
          %endfor
        </tr>
      %endfor
      </table>
    </div>
456
  %endif
457 458
%endif

459 460 461 462 463 464 465 466 467 468 469 470
%if modeflag.get('Metrics'):
  %if not any (metrics_results.values()):
    <p>${_("There is no data available to display at this time.")}</p>
  %else:
    <%namespace name="d3_stacked_bar_graph" file="/class_dashboard/d3_stacked_bar_graph.js"/>
    <%namespace name="all_section_metrics" file="/class_dashboard/all_section_metrics.js"/>

    <script>
      ${d3_stacked_bar_graph.body()}
    </script>

    <div id="metrics"></div>
471

472 473 474 475 476 477 478 479
    <h3 class="attention">${_("Loading the latest graphs for you; depending on your class size, this may take a few minutes.")}</h3>

    %for i in range(0,len(metrics_results['section_display_name'])):
        <div class="metrics-container" id="metrics_section_${i}">
          <h2>${_("Section:")} ${metrics_results['section_display_name'][i]}</h2>
          <div class="metrics-tooltip" id="metric_tooltip_${i}"></div>
          <div class="metrics-left" id="metric_opened_${i}">
            <h3>${_("Count of Students that Opened a Subsection")}</h3>
Bertrand Marron committed
480
            <p class="loading"><i class="icon fa fa-spinner fa-spin fa-large"></i>${_("Loading")}</p>
481 482 483 484 485 486
          </div>
          <div class="metrics-right" id="metric_grade_${i}">
            <h3>${_("Grade Distribution per Problem")}</h3>
            %if not metrics_results['section_has_problem'][i]:
              <p>${_("There are no problems in this section.")}</p>
            %else:
Bertrand Marron committed
487
              <p class="loading"><i class="icon fa fa-spinner fa-spin fa-large"></i>${_("Loading")}</p>
488 489 490 491 492
            %endif
          </div>
        </div>
    %endfor
      <script>
493 494 495
        var allSubsectionTooltipArr = new Array();
        var allProblemTooltipArr = new Array();
        ${all_section_metrics.body("metric_opened_","metric_grade_","metric_attempts_","metric_tooltip_",course.id, allSubsectionTooltipArr, allProblemTooltipArr)}
496 497 498 499 500
      </script>

  %endif
%endif

501
%if modeflag.get('Analytics In Progress'):
502 503 504 505

  ##This is not as helpful as it could be -- let's give full point distribution
  ##instead.
  %if analytics_results.get("StudentsPerProblemCorrect"):
506
    <p>
507
      ${_("Students answering correctly")}
508 509
      (${analytics_results["StudentsPerProblemCorrect"]['time']})
    </p>
510 511 512
    <div class="divScroll">
      <table class="stat_table">
        <tr>
513 514
          <th>${_("Problem")}</th>
          <th>${_("Number of students")}</th>
515 516 517 518 519 520 521 522 523 524
        </tr>
      %for row in analytics_results['StudentsPerProblemCorrect']['data']:
        <tr>
          <td>${row['module_id'].split('/')[-1]}</td>
          <td>${row['count']}</td>
        </tr>
      %endfor
      </table>
    </div>
  %endif
525

526
   <p>
527
     ${_("Student distribution per country, all courses, Sep 12 to Oct 17, 1 server (shown here as an example):")}
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554
   </p>

<div id="posts-list" class="clearfix">
<figure>
    <div id="world-map-students" style="width: 720px; height: 400px"></div>
    <script>
      var student_data = {BD : '300', BE : '156', BF : '7', BG : '246', BA : '62', BB : '1', BN : '7', BO : '61', JP : '153', BI : '4', BJ : '6', BT : '11', JM : '32', JO : '67', WS : '1', BR : '1941', BS : '5', JE : '6', BY : '166', BZ : '4', RU : '1907', RW : '50', RS : '128', TL : '1', RE : '2', A2 : '59', TJ : '9', RO : '232', GU : '3', GT : '76', GR : '565', BH : '22', GY : '6', GG : '2', GF : '1', GE : '22', GD : '7', GB : '2023', GA : '4', GM : '18', GL : '2', GI : '1', GH : '393', OM : '25', TN : '143', BW : '26', HR : '76', HT : '38', HU : '259', HK : '103', HN : '51', AD : '1', PR : '40', PS : '38', PT : '487', PY : '38', PA : '21', PG : '11', PE : '342', PK : '1833', PH : '571', TM : '1', PL : '736', ZM : '61', EE : '67', EG : '961', ZA : '184', EC : '118', AL : '44', AO : '10', SB : '2', EU : '183', ET : '153', SO : '1', ZW : '42', KY : '3', ES : '1954', ER : '3', ME : '6', MD : '26', MG : '10', UY : '64', UZ : '40', MM : '21', ML : '4', MO : '3', MN : '49', US : '11899', MU : '11', MT : '15', MW : '41', MV : '5', MP : '4', MR : '1', IM : '2', UG : '133', MY : '207', MX : '844', AT : '83', FR : '446', MA : '175', A1 : '167', AX : '1', FI : '97', FJ : '9', NI : '23', NL : '240', NO : '110', NA : '27', NC : '1', NE : '4', NG : '753', NZ : '98', NP : '200', CI : '9', CH : '144', CO : '851', CN : '282', CM : '82', CL : '243', CA : '1129', CD : '7', CZ : '161', CY : '26', CR : '137', CV : '11', CU : '15', SZ : '6', SY : '58', KG : '47', KE : '282', SR : '5', KI : '1', KH : '40', SV : '155', KM : '1', ST : '1', SK : '66', KR : '141', SI : '70', KP : '1', KW : '28', SN : '16', SL : '11', KZ : '174', SA : '352', SG : '217', SE : '172', SD : '61', DO : '104', DM : '5', DJ : '6', DK : '105', DE : '941', YE : '90', DZ : '281', MK : '28', TZ : '124', LC : '5', LA : '7', TW : '115', TT : '33', TR : '288', LK : '96', LV : '52', TO : '2', LT : '114', LU : '21', LR : '9', LS : '9', TH : '84', TG : '11', LY : '15', VC : '6', AE : '151', VE : '180', AG : '1', AF : '21', IQ : '29', VI : '1', IS : '14', IR : '153', AM : '37', IT : '365', VN : '269', AP : '23', AR : '258', AU : '661', IL : '159', AW : '3', IN : '7836', LB : '28', AZ : '22', IE : '210', ID : '382', UA : '860', QA : '23', MZ : '8'};
      $(function(){
        $('#world-map-students').vectorMap({
          map: 'world_mill_en',
          backgroundColor: '#eeeeee',
          series: {
            regions: [{
              values: student_data,
              scale: ['#C8EEFF', '#0071A4'],
              normalizeFunction: 'polynomial'
            }]
          },
          onRegionLabelShow: function(event, label, code){
            label.text(label.text() + ': ' + (student_data[code] != null ? student_data[code] : 0));
          }
        });
      });
    </script>
</figure>
</div>

555

556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588
##     <p>Number of students who dropped off per day before becoming inactive:</p>
##
##     % if dropoff_per_day is not None:
##     % if dropoff_per_day['status'] == 'success':
##     <div class="divScroll">
##     <table class="stat_table">
##     <tr><th>Day</th><th>Number of students</th></tr>
##     % for k,v in dropoff_per_day['data'].items():
##     <tr> <td>${k}</td> <td>${v}</td> </tr>
##     % endfor
##     </table>
##     </div>
##     % else:
##     <i> ${dropoff_per_day['error']}</i>
##     % endif
##     % else:
##     <i> null data </i>
##     % endif
##   </p>
##


##   <p>
##     <h2>Daily activity (online version):</h2>
##     <table class="stat_table">
##     <tr><th>Day</td><th>Number of students</td></tr>
##     % for k,v in daily_activity_json['data'].items():
##     <tr>
##     <td>${k}</td> <td>${v}</td>
##     </tr>
##     % endfor
##     </table>
##   </p>
589

590

591 592
%endif

593
##-----------------------------------------------------------------------------
jmvt committed
594

595 596 597 598 599 600 601 602 603
%if datatable and modeflag.get('Psychometrics') is None:

    <br/>
    <br/>
    <p>
      <hr width="100%">
      <h2>${datatable['title'] | h}</h2>
      <table class="stat_table">
        <tr>
604 605 606 607
        %for hname in datatable['header']:
          <th>${hname | h}</th>
        %endfor
        </tr>
608 609
        %for row in datatable['data']:
          <tr>
610 611 612 613
          %for value in row:
            <td>${value | h}</td>
          %endfor
          </tr>
614 615 616 617 618
        %endfor
      </table>
    </p>
%endif

619 620
## Output tasks in progress

621
%if instructor_tasks is not None and len(instructor_tasks) > 0:
622
    <hr width="100%">
623
    <h2>${_("Pending Instructor Tasks")}</h2>
624 625 626
    <div id="task-progress-wrapper">
      <table class="stat_table">
        <tr>
627 628 629 630 631 632 633 634
          <th>${_("Task Type")}</th>
          <th>${_("Task inputs")}</th>
          <th>${_("Task Id")}</th>
          <th>${_("Requester")}</th>
          <th>${_("Submitted")}</th>
          <th>${_("Task State")}</th>
          <th>${_("Duration (sec)")}</th>
          <th>${_("Task Progress")}</th>
635
        </tr>
636
      %for tasknum, instructor_task in enumerate(instructor_tasks):
637
        <tr id="task-progress-entry-${tasknum}" class="task-progress-entry"
638 639
            data-task-id="${instructor_task.task_id}"
            data-in-progress="true">
640 641 642 643 644 645
          <td>${instructor_task.task_type}</td>
          <td>${instructor_task.task_input}</td>
          <td class="task-id">${instructor_task.task_id}</td>
          <td>${instructor_task.requester}</td>
          <td>${instructor_task.created}</td>
          <td class="task-state">${instructor_task.task_state}</td>
646 647
          <td class="task-duration">${_("unknown")}</td>
          <td class="task-progress">${_("unknown")}</td>
648 649 650 651 652 653 654 655 656 657
        </tr>
      %endfor
      </table>
    </div>
  <br/>

%endif

##-----------------------------------------------------------------------------

658
%if modeflag.get('Admin') and course_stats:
659 660 661 662
    <br/>
    <br/>
    <p>
      <hr width="100%">
663
      <h2>${course_stats['title'] | h}</h2>
664 665
      <table class="stat_table">
        <tr>
666 667 668 669
        %for hname in course_stats['header']:
          <th>${hname | h}</th>
        %endfor
        </tr>
670
        %for row in course_stats['data']:
671
          <tr>
672 673 674 675
            %for value in row:
              <td>${value | h}</td>
            %endfor
          </tr>
676 677 678
        %endfor
      </table>
    </p>
679 680 681 682
%else:
    <br/>
    <br/>
    <h2>${_("Course Statistics At A Glance")}</h2>
683
    <p class="is-deprecated">
684
      ${_("View course statistics in the Admin section of this legacy instructor dashboard.")}
685
    </p>
686 687
%endif

688
##-----------------------------------------------------------------------------
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708
%if modeflag.get('Psychometrics'):

    %for plot in plots:
      <br/>
      <h3>${plot['title']}</h3>
      <br/>
      <p>${plot['info']}</p>
      <br/>
      <div id="plot_${plot['id']}" style="width:600px;height:300px;"></div>
      <script type="text/javascript">
          $(function () {
              ${plot['data']}
              $.plot($("#plot_${plot['id']}"), ${plot['cmd']}  );
          });
      </script>
      <br/>
      <br/>
    %endfor

%endif
709 710

##-----------------------------------------------------------------------------
711
## always show msg
712 713


714
##-----------------------------------------------------------------------------
715 716
%if modeflag.get('Admin'):
 % if course_errors is not UNDEFINED:
717
    <h2>${_("Course errors")}</h2>
Victor Shnayder committed
718
    <div id="course-errors">
719 720 721
    %if not course_errors:
          None
    %else:
Victor Shnayder committed
722 723 724
      <ul>
        % for (summary, err) in course_errors:
        <li>${summary | h}
725
        % if err:
Victor Shnayder committed
726
          <ul><li><pre>${err | h}</pre></li></ul>
727 728 729
        % else:
          <p>&nbsp;</p>
        % endif
Victor Shnayder committed
730 731 732
        </li>
        % endfor
        </ul>
733
      %endif
Victor Shnayder committed
734
      </div>
735
  % endif
736
%endif
737

738 739 740
  </section>
</div>
</section>