Repository navigation
Conversation
Set level proctoring previously required a fake "set_id:<set>" user with a login_proctor permission level and a hashed password. That user had to be created, deleted, and copied alongside the set, and filtered out of user lists throughout the code. Replace the restricted_login_proctor set field with restricted_login_password, which holds the password in plain text. A set uses a set level proctor password if and only if this field is non-empty. The password is shown to the instructor on the set detail page and copied with the set. The password is now an ordinary set field on the set detail page, and so it can be overridden to set a different password for individual users. That was not possible with the fake user. This also fixes saving a value of 0 for any set field when editing for users. Previously 0 was treated as empty, and so the user's value was reset to the set default. The proctor login form now posts a set_level_proctor flag instead of the fake user ID. When a set has a password, only that password can authorize starting the test, and other user credentials are rejected. This means that when getting all users from the database, it is no longer necessary to filter on users that are not like `set_id:%`. When a course database is upgraded and the restricted_login_password field is added to the set table, the password of each "set_id:<set>" user is copied into restricted_login_password for sets that have restricted_login_proctor set to "Yes", and the "set_id:<set>" users are deleted. Those passwords are crypt hashes, so the proctor login also accepts a password that matches a hashed set level proctor password. On the set detail page a hashed password is shown as "********", which keeps the hashed password if it is left unchanged. User IDs of the form "set_id:<set>" are no longer valid. Since check_user_id croaks on an invalid user ID rather than returning false, the class list imports now catch that so that lines with invalid user IDs are skipped instead of aborting the import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Set level proctoring previously required a fake "set_id:" user with a login_proctor permission level and a hashed password. That user had to be created, deleted, and copied alongside the set, and filtered out of user lists throughout the code.
Replace the restricted_login_proctor set field with restricted_login_password, which holds the password in plain text. A set uses a set level proctor password if and only if this field is non-empty. The password is shown to the instructor on the set detail page and copied with the set.
The password is now an ordinary set field on the set detail page, and so it can be overridden to set a different password for individual users. That was not possible with the fake user. This also fixes saving a value of 0 for any set field when editing for users. Previously 0 was treated as empty, and so the user's value was reset to the set default.
The proctor login form now posts a set_level_proctor flag instead of the fake user ID. When a set has a password, only that password can authorize starting the test, and other user credentials are rejected.
This means that when getting all users from the database, it is no longer necessary to filter on users that are not like
set_id:%.When a course database is upgraded and the restricted_login_password field is added to the set table, the password of each "set_id:" user is copied into restricted_login_password for sets that have restricted_login_proctor set to "Yes", and the "set_id:" users are deleted. Those passwords are crypt hashes, so the proctor login also accepts a password that matches a hashed set level proctor password. On the set detail page a hashed password is shown as "********", which keeps the hashed password if it is left unchanged.
User IDs of the form "set_id:" are no longer valid. Since check_user_id croaks on an invalid user ID rather than returning false, the class list imports now catch that so that lines with invalid user IDs are skipped instead of aborting the import.
This is another step toward a "hack free" database structure!