Repository navigation
Conversation
drgrice1
force-pushed
the
api-add-problem-updates
branch
from
November 17, 2026 19:30
0530d4c to
aba3e60
Compare
pstaabp
approved these changes
Nov 17, 2026
pstaabp
left a comment
Member
There was a problem hiding this comment.
Looks good. I test by adding 160 problems to a set. On develop, that took about 5-6 seconds. On this, less than 1.
The library browser's "Add All" button sent a separate `addProblem` request for each problem. So add an `addProblems` API method that adds multiple problems to a set in one request, and use it in the library browser instead. Note that the request timeout that was previously set to 10 seconds is now 10 seconds times the number of problems being added to account for the additional processing needed for more problems. This fixes the FIXME in `htdocs/js/SetMaker/setmaker.js` that I added about four years ago. Both the `addProblem` and `addProblems` API methods now use the new internal `addProblemToSet` method. This method fixes the incorrect handling of the `maxAttempts`, `att_to_open_children`, and `counts_parent_grade` parameters that the previous `addProblem` method had. Assigning a problem to all set users inserted the user problems one at a time in a loop, which is very slow for sets assigned to many users. So the `assignProblemsToAllSetUsers` utility method was added that assigns several problems to all set users at once using `_assignMultipleProblemsToGivenUsers`. The `assignProblemsToAllSetUsers` method is used in the previous `assignProblemToAllSetUsers` utility method, the API methods, and when adding blank problems in the set detail page. When adding multiple blank problems in the set detail page, the blank problem template is now copied to the set directory once instead of being read and written for each problem, and a failure to copy it is reported to the user. Also delete the unused add_selected method of SetMaker.pm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
drgrice1
force-pushed
the
api-add-problem-updates
branch
from
November 17, 2026 23:06
aba3e60 to
bb25873
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The library browser's "Add All" button sent a separate
addProblemrequest for each problem. So add anaddProblemsAPI method that adds multiple problems to a set in one request, and use it in the library browser instead. Note that the request timeout that was previously set to 10 seconds is now 10 seconds times the number of problems being added to account for the additional processing needed for more problems. This fixes the FIXME inhtdocs/js/SetMaker/setmaker.jsthat I added about four years ago.Both the
addProblemandaddProblemsAPI methods now use the new internaladdProblemToSetmethod. This method fixes the incorrect handling of themaxAttempts,att_to_open_children, andcounts_parent_gradeparameters that the previousaddProblemmethod had.Assigning a problem to all set users inserted the user problems one at a time in a loop, which is very slow for sets assigned to many users. So the
assignProblemsToAllSetUsersutility method was added that assigns several problems to all set users at once using_assignMultipleProblemsToGivenUsers. TheassignProblemsToAllSetUsersmethod is used in the previousassignProblemToAllSetUsersutility method, the API methods, and when adding blank problems in the set detail page.When adding multiple blank problems in the set detail page, the blank problem template is now copied to the set directory once instead of being read and written for each problem, and a failure to copy it is reported to the user.
Also delete the unused add_selected method of SetMaker.pm.