-
Notifications
You must be signed in to change notification settings - Fork 318
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
Convert manual grading assessment question page to TS #10052
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10052 +/- ##
==========================================
- Coverage 71.76% 71.67% -0.09%
==========================================
Files 508 514 +6
Lines 80432 80955 +523
Branches 6792 6811 +19
==========================================
+ Hits 57718 58028 +310
- Misses 22256 22469 +213
Partials 458 458 ☔ View full report in Codecov by Sentry. |
All images
|
csrfToken, | ||
popoverId, | ||
}: { | ||
field: 'points' | 'auto_points' | 'manual_points' | 'score_perc'; |
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.
This now combines the points and score forms, as they were very similar to each other, with the only difference being the suffix of the input element and the __action of the form (which is also combined, see below).
@@ -119,23 +122,6 @@ router.post( | |||
} else { | |||
res.send({}); | |||
} | |||
} else if (req.body.__action === 'edit_question_score_perc') { |
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.
This action was removed and replaced with an update to the edit_question_points
action that performs either the update of points or score percentage. The code was almost identical anyway. Same thing in the assessment instance page.
buttonId, | ||
}: { | ||
field: 'points' | 'auto_points' | 'manual_points' | 'score_perc'; | ||
instance_question: Omit<InstanceQuestion, 'modified_at'> & { modified_at: string }; |
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.
modified_at
is a string because it needs to have the same precision as the PG code that retrieves it.
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.
Checking my understanding: this is because Postgres dates have microsecond precision but JavaScript dates only have millisecond precision? Presumably we could clean this up by moving this check from SQL into JS?
PrairieLearn/apps/prairielearn/src/lib/manualGrading.sql
Lines 382 to 383 in c11b173
$check_modified_at::TIMESTAMPTZ IS NOT NULL | |
AND $check_modified_at != iq.modified_at AS modified_at_conflict |
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.
Indeed. That would for sure be a valid alternative, but I'd prefer to do that in a separate PR.
Given that this PR will create a merging conflict with #9887 and it's easier to fix that conflict here than there, this will remain as a draft until that PR is merged. |
apps/prairielearn/assets/scripts/instructorAssessmentManualGradingAssessmentQuestionClient.ts
Outdated
Show resolved
Hide resolved
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.
I did my best to review this but there's a lot here and my eyes glazed over after a while. As always, please let me know if there's anything specific you want me to look at or if you need help manually testing any of these changes.
...ielearn/src/pages/instructorAssessmentManualGrading/assessmentQuestion/assessmentQuestion.ts
Outdated
Show resolved
Hide resolved
buttonId, | ||
}: { | ||
field: 'points' | 'auto_points' | 'manual_points' | 'score_perc'; | ||
instance_question: Omit<InstanceQuestion, 'modified_at'> & { modified_at: string }; |
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.
Checking my understanding: this is because Postgres dates have microsecond precision but JavaScript dates only have millisecond precision? Presumably we could clean this up by moving this check from SQL into JS?
PrairieLearn/apps/prairielearn/src/lib/manualGrading.sql
Lines 382 to 383 in c11b173
$check_modified_at::TIMESTAMPTZ IS NOT NULL | |
AND $check_modified_at != iq.modified_at AS modified_at_conflict |
No description provided.