PL: teacher application now requires numbers for length of class #27813
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Just over 14% of the 19-20 teacher applications have a non-numeric entry for
cs_how_many_minutes
,cs_how_many_days_per_week
, orcs_how_many_weeks_per_year
- the three entries that are multiplied together (and divided by 60) to getcs_total_coursehours
. This leads to0
total course hours, and then the field's not visible in the application details.Firstly, this change forces the field to be shown in the application details, regardless of its value. Here's a sample:
Secondly, this change enforces numbers in those three fields in the teacher application at the time of entry by the user, and gets the benefit of a recent improvement to that input enforcement. Numbers with an optional decimal point are accepted.
The existing logic to truncate the values to integers and multiply them together is unchanged. Here's a sample result in application details (9 * 9 * 9 / 60 = 12.15):
There is one known issue with this approach. For a user resuming an existing teacher application which already has non-numeric content in the relevant input field, attempting to modify one character at a time (e.g. by backspacing) will have no effect if the resulting text is still non-numeric. The workaround is to select the entire field and delete it at once. This feels rare enough to not be worth special-casing, but wanted to call it out.