Closed Alex-Jordan closed 7 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.
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.
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.
This is a first stab at making it easier to randomize seeds, as discussed in #1151.
In a Set Detail page for one user:
type='number'
to give a quick way to shift a seed by 1 at a time, which I find helpful if there might be a need to revert to some previous seed.After any changes, the Save button still needs to be used to submit the form.
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.