Skip to content

Store the set level proctor password in the set - #3283

Open
drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:set-level-proctor-rework
Open

drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:set-level-proctor-rework

Conversation

@drgrice1

Copy link
Copy Markdown
Member

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!

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant