-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
3 changed files
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
{% macro backup_style(backup_id) %} | ||
<tt>{{ backup_id }}</tt> | ||
{% endmacro %} | ||
|
||
{% macro js_scores(var_name, assigns, show_hidden=False) %} | ||
<script> | ||
var {{ var_name }} = { | ||
{% for assign, subm_time, group, fs, scores in assigns %} | ||
"{{ assign.name.split('/')[-1] }}": { | ||
{% for score in scores %} | ||
{% if score.public or show_hidden %} | ||
"{{ score.kind }}": {{ score.score }}, | ||
{% endif %} | ||
{% endfor %} | ||
}, | ||
{% endfor %} | ||
}; | ||
</script> | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters