openwebwork / webwork2

Course management front end for WeBWorK
http://webwork.maa.org/wiki/Main_Page
Other
143 stars 165 forks source link

button to randomize individual seeds on set detail page for one user #2271

Closed Alex-Jordan closed 7 months ago

Alex-Jordan commented 9 months ago

This is a first stab at making it easier to randomize seeds, as discussed in #1151.

In a Set Detail page for one user:

After any changes, the Save button still needs to be used to submit the form.

Screenshot 2023-12-05 at 10 28 55 AM

If this is on the right track, I will add a button somewhere at the top to randomize all of the seeds at once. If it is not too much clutter, there will be an option to only randomize those seeds with status less than 1.

A future PR will have a button on the "Set Detail page for multiple users" that randomizes seeds for all users and goes ahead with the action, reloading the page. And this PR will add a tool to Instructor Tools for doing the same thing, possible with multiple sets too.

drgrice1 commented 9 months ago

The button itself looks fine. I added a pull request to this branch with suggestions for code improvement. Most importantly the inline javascript is moved out of the Perl module, and into the htdocs/js/ProblemSetDetail/problemsetdetail.js file.

Alex-Jordan commented 9 months ago

Now with a button to randomize all seeds for one user for one set.

I strongly suspect the javascript can be improved upon. One thing for sure is it looks up the checkbox state over and over within the loop. I couldn't work out how to do that better without getting js errors.

Alex-Jordan commented 8 months ago

Rebased, including with the correction mentioned here.

This is as far as I plan to take this PR. The other tools I want to add for randomization can come later.