From 9b5518b19befbb61e43693ac0113e87e7f1b18e1 Mon Sep 17 00:00:00 2001 From: Jen Thakar Date: Sat, 5 May 2018 13:55:55 -0700 Subject: [PATCH] Add scores and allScores JS objects to staff view (#1267) * Add scores and allScores JS objects to staff view Staff can now access scores as a JS object on their overview page for a student. `scores` should match the object embedded on the student view (only inactive assignments and public scores) while `allScores` includes active assignments and hidden scores. * Add newlines --- server/templates/_globalhelpers.html | 16 ++++++++++++++++ server/templates/staff/student/overview.html | 4 ++++ server/templates/student/course/index.html | 13 ++----------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/server/templates/_globalhelpers.html b/server/templates/_globalhelpers.html index bc162613f..8707376cb 100644 --- a/server/templates/_globalhelpers.html +++ b/server/templates/_globalhelpers.html @@ -1,3 +1,19 @@ {% macro backup_style(backup_id) %} {{ backup_id }} {% endmacro %} + +{% macro js_scores(var_name, assigns, show_hidden=False) %} + +{% endmacro %} diff --git a/server/templates/staff/student/overview.html b/server/templates/staff/student/overview.html index 4d89e564b..003443d4b 100644 --- a/server/templates/staff/student/overview.html +++ b/server/templates/staff/student/overview.html @@ -1,4 +1,5 @@ {% extends "staff/base.html" %} +{% import "_globalhelpers.html" as helpers %} {% block title %} {{ student.identifier }} - {{ current_course.display_name_with_semester }}{% endblock %} @@ -96,4 +97,7 @@
{{ student.role | capitalize }}
{% endblock %} {% block page_js %} + +{{ helpers.js_scores('scores', assignments['inactive']) }} +{{ helpers.js_scores('allScores', assignments['active'] + assignments['inactive'], True)}} {% endblock %} diff --git a/server/templates/student/course/index.html b/server/templates/student/course/index.html index fa7eaa50f..89338897d 100644 --- a/server/templates/student/course/index.html +++ b/server/templates/student/course/index.html @@ -1,5 +1,6 @@ {% extends "student/base.html" %} {% import 'student/course/_assigntable.html' as table %} +{% import '_globalhelpers.html' as helpers %} {% block title %} {{ course.display_name_with_semester }} | Ok {% endblock %} @@ -37,15 +38,5 @@

{{ course.display_name_with_semester}}

{% endblock %} {% block js %} - +{{ helpers.js_scores('scores', inactive) }} {% endblock %}