Skip to content

Move the version_id into its own field. - #3179

Open
drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:version-id-separate-field
Open

Move the version_id into its own field.#3179
drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:version-id-separate-field

Conversation

@drgrice1

@drgrice1 drgrice1 commented Aug 31, 2026

Copy link
Copy Markdown
Member

The version_id field has been added to the set_user, problem_user, and past_answers tables. If a user set has type "default" or "jitar" then it has version 0. If a user set has type "gateway" or "proctored_gateway" then it has version 0 if it is the user's template set. Otherwise it is a versioned set. The same is true for user problems associated with those sets.

When a course database is upgraded the old <setID>,v<versionID> in the set_id field is separated into the set_id without the version, and the version_id in its own field. This is done anytime it is detected that the previous database table did not have the version_id and it is one of the tables that field has been added to.

This makes database interaction for versioned sets much cleaner and straight forward. Since a version_id is an actual database table column, you can use it directly in where and order clauses without hackery. All of the "groking" for a set version is eliminated.

Note that it is now the case that when a user with the proctor_quiz_login permission attempts to enter a proctored test (either their own or to view another user's test when acting as that user), the user will not need to enter the proctor credentials (and will skip the proctor login page entirely). Also, a user with the proctor_quiz_grade permission will not see the proctor login page when grading a test (again for either their own test or when allowed to grade a test when acting as another user).

Note that the $authen{proctor_module} option has been removed from the defaults.config file. There is only one proctor authentication module WeBWorK::Authen::Proctor, and it is now hardcoded. No need for the option.

Other than the change to the proctor login noted above, everything else should work the same as before.

The `version_id` field has been added to the `set_user`, `problem_user`,
and `past_answers` tables. If a user set that has type "default" or
"jitar" then it has version 0.  If a user set has type "gateway" or
"proctored_gateway" then it has version 0 if it is the user's template
set.  Otherwise it is a versioned set. The same is true for user
problems associated with those sets.

When a course database is upgraded the old `<setID>,v<versionID>` in the
`set_id` field is separated into the `set_id` without the version, and
the `version_id` in its own field. This is done anytime it is detected
that the previous database table did not have the `version_id` and it
is one of the tables that field has been added to.

This makes database interaction for versioned sets much cleaner and
straight forward. Since a `version_id` is an actual database table
column, you can use it directly in where and order clauses without
hackery.  All of the "groking" for a set version is eliminated.

Note that it is now the case that when a user with the
`proctor_quiz_login` permission attempts to enter a proctored test
(either their own or to view another user's test when acting as that
user), the user will not need to enter the proctor credentials (and will
skip the proctor login page entirely).  Also, a user with the
`proctor_quiz_grade` permission will not see the proctor login page when
grading a test (again for either their own test or when allowed to grade
a test when acting as another user).

Note that the `$authen{proctor_module}` option has been removed from the
`defaults.config` file.  There is only one proctor authentication module
`WeBWorK::Authen::Proctor`, and it is now hardcoded.  No need for the
option.

Other than the change to the proctor login noted above, everything else
should work the same as before.
@drgrice1

drgrice1 commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

Note that in testing this you should create an archive of the course you test with and revert back to that archive after switching back to the develop branch. Once the course is upgraded, there is not downgrade!

Note also that the admin course will work without upgrading (since it never uses versioned sets or problems).

@drgrice1

Copy link
Copy Markdown
Member Author

Note that this will conflict with #3175 and #3177, but already includes fixes for those issues. I will fix this pull request if those are merged first. If this is merged first, then those pull requests will be closed and not merged.

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