Skip to content
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

Creating a course named "OPL" is not possible and causes a problem #2289

Open
Alex-Jordan opened this issue Dec 18, 2023 · 4 comments
Open

Comments

@Alex-Jordan
Copy link
Contributor

If you create a course with ID "OPL", then first, it fails. It fails because the OPL tables in the database already include OPL_problem and maybe more, which clash with the would-be OPL_problem table for the new course.

Worse, it seems that as part of cleanup after the fail, that these tables are deleted. Running OPL-update brings them back.

I discovered this trying to make an "OPL" course for some OPL development.

@drgrice1
Copy link
Member

Probably the only fix would be to add a check when a course is created that ensures that the course id will not cause a conflict with other tables in the database, and if so refuse to create the course.

This is a consequence of the table structure of webwork2, and there really isn't a fix that would allow full freedom to choose course ids without using a relational database structure like what webwork3 will use.

@drgrice1
Copy link
Member

Note that there are other conflicts that can occur as well. For example, create a course by the name "first", and then try to create another course with the name "first_problem". The "first" course will have a table named "first_problem_user" created, and creation of the "first_problem" course fails with errors, because that table already exists. Furthermore, the "first_problem_user" table gets deleted in clean up from that failure. Thus breaking the "first" course.

It seems that webwork2's table structure using the course name for its database tables is really quite fragile.

@Alex-Jordan
Copy link
Contributor Author

If we wanted to avoid a complete overhaul, is there a character (not underscore) that is illegal in course names, that could more reliably separate the course name from the table type? Like having first&problem, first&problem_user, and first_problem&user?

@drgrice1
Copy link
Member

That might work. Then OPL&problem would not conflict with OPL_problem either. Of course, assuming & works for this (or that some other character can be found that does).

An upgrade path for existing courses and figuring out how to unarchive courses would be challenging.

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

No branches or pull requests

2 participants