Commit d9e3038
committed
Copy set level proctors when adding a course and copying sets.
If sets are copied then everything for that set should be copied. These
set level proctor users belong to the set.
This fixes issue #2652.
Also add a missing `maketext` call in the related template.
Also fix some database list/get usage that I missed when these copy
options were implemented. Never list all database records if you are
going to subsequently get all records anyway. Listing records is the
equivalent of calling `SELECT id from table` and getting all records is
the equivalent of calling `SELECT * from table`. Why would you
inneficiently first list to get id's and then select everything
separately? Note that you can get always get all records by using the
webwork2 db `Where` methods with no where clause.
Note that the copying of sets that is done here is still highly
inneficient. The current approach gets all sets, and then loops through
those sets, then gets the problems for that set and loops through those
adding one at a time, then gets set locations and loops through adding
one of those at a time, and now adds the set level proctor (of which
there can be only one). Instead since all sets are being copyied all
sets could be fetched and added at once, then all problems for all sets
fetched and added at once, then all set level proctors for all sets
fetched and added at once. However, adding all at once like that takes
for effort because there aren't convenience database methods for doing
that. This is now done when assigning sets to multiple users (I helped
@taniwallach implement that) and the same could be done here. Note that
for a course with a large number of sets and a lot of problems the
current approach is quite slow.1 parent 28b21ed commit d9e3038
File tree
2 files changed
+26
-11
lines changed- lib/WeBWorK/Utils
- templates/ContentGenerator/CourseAdmin
2 files changed
+26
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
387 | | - | |
388 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
402 | 416 | | |
403 | 417 | | |
404 | 418 | | |
| |||
408 | 422 | | |
409 | 423 | | |
410 | 424 | | |
411 | | - | |
| 425 | + | |
| 426 | + | |
412 | 427 | | |
413 | 428 | | |
414 | 429 | | |
415 | 430 | | |
416 | | - | |
417 | | - | |
418 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
419 | 434 | | |
420 | 435 | | |
421 | 436 | | |
422 | 437 | | |
423 | | - | |
| 438 | + | |
424 | 439 | | |
425 | 440 | | |
426 | 441 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
0 commit comments