-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Manage Submissions] Score popup modal styling + fixes #1952
base: feature/new-manage-submissions
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,14 +44,20 @@ $(document).ready(function () { | |
|
||
// Fetch data and render it in the modal | ||
get_score_details(course_user_datum_id).then((data) => { | ||
const sorting_icons = | ||
` <i class="material-icons tiny sort-icon sort-icon__both" aria-hidden="true">swap_vert</i> | ||
<i class="material-icons tiny sort-icon sort-icon__up" aria-hidden="true">arrow_upward</i> | ||
<i class="material-icons tiny sort-icon sort-icon__down" aria-hidden="true">arrow_downward</i>`; | ||
|
||
const problem_headers = data.submissions[0].problems.map((problem) => { | ||
const max_score = problem.max_score; | ||
const autograded = problem.grader_id < 0 ? " (Autograded)" : ""; | ||
return `<th class="submission-th"> | ||
${problem.name} | ||
<br> | ||
<i> ${max_score} ${autograded} </i> | ||
const autograded = data.autograded ? " (Autograded)" : ""; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that |
||
return `<th class="submission-th submissions-problem-bg"> | ||
<div class="sorting-th"> | ||
${problem.name} | ||
${sorting_icons} | ||
</div> | ||
<span class="score-styling"> ${max_score} ${autograded} </span> | ||
</th>`; | ||
}).join(''); | ||
|
||
|
@@ -109,7 +115,10 @@ $(document).ready(function () { | |
</td> | ||
${submission.problems. | ||
map((problem) => | ||
`<td class="submissions-td">${data.scores[submission.id][problem.id]?.['score']}</td>` | ||
data.scores[submission.id] ? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might want to strengthen the check to This happens e.g. for manually graded problems for which no annotations have been created yet. |
||
`<td class="submissions-td submissions-problem-bg">${data.scores[submission.id][problem.id]?.['score']}</td>` | ||
: | ||
`<td class="submissions-td submissions-problem-bg">undefined</td>` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps you could use a dash instead of |
||
).join('')} | ||
<td class="submissions-td"> | ||
${submission.late_penalty} | ||
|
@@ -131,11 +140,31 @@ $(document).ready(function () { | |
<table class="prettyBorder" id="score-details-table"> | ||
<thead> | ||
<tr> | ||
<th class="submission-th">Version No.</th> | ||
<th class="submission-th">Submission Date</th> | ||
<th class="submission-th">Final Score</th> | ||
<th class="submission-th"> | ||
<div class="sorting-th"> | ||
Version No. | ||
${sorting_icons} | ||
</div> | ||
</th> | ||
<th class="submission-th"> | ||
<div class="sorting-th"> | ||
Submission Date | ||
${sorting_icons} | ||
</div> | ||
</th> | ||
<th class="submission-th"> | ||
<div class="sorting-th"> | ||
Final Score | ||
${sorting_icons} | ||
</div> | ||
</th> | ||
${problem_headers} | ||
<th class="submission-th">Late Penalty</th> | ||
<th class="submission-th"> | ||
<div class="sorting-th"> | ||
Late Penalty | ||
${sorting_icons} | ||
</div> | ||
</th> | ||
<th class="submission-th">Tweak</th> | ||
<th class="submission-th">Actions</th> | ||
</tr> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that once datatables-rows is correctly included, there are existing sorting icons, so there is actually no need to implement your own