This PR contains several changes to the back-end code that performs the Gradebook Import:
- Reduce the amount of logging performed during the saving routine, change the log level appropriately
- Currently an INFO level log message is produced for each grade, and each comment, for each user in each "sheet" that is processed
- For large imports, this equates to a lot of logging statements, which contributes to log bloat and probably reduces performance on some level
- It also could be argued that it's a security concern to log grades and user identifiers at INFO level OOTB
- Bulk save grades and comments per assignment/gradebook item
- The current process saves each grade and each comment for each student in each item serially, and waits for a return code from each save/update
- This slows down the import process immensely; massive improvements in processing time are achieved by saving grades and comments in bulk, one assignment/grade item at a time
- Also, the return value was never being used. I think originally it was designed this way to have real-time feedback in case someone else was editing the same item/grade/comment; however there's no code to actually perform this. Even if we were to implement this, what decision should be made? Does the Import suddenly abort or fail? Does the exact item that was concurrently edited get skipped? In our opinion, concurrent edits don't really matter for the context of an Import; the last saved value should always take precedence and there is always the grade log to see who made changes and when.
- Instead of returning one return code per grade/student/assignment, return one code per saveGradesAndComments() call
- Eliminate String->Double conversion where appropriate
- Reduce double/triple/etc querying
- There are multiple places where the same data is being re-queried multiple times and then tossed out, rather than being passed down the line for use in other places. Refactoring these places to utilize the already retrieved data correlates to large performance increases
- AJAX panel swap the CreateGradeItemStep/GradeImportConfirmationStep panels into place to avoid a page refresh and the associated loading/rendering time between each step
- Fixed a bug when navigating back and forwards through the Import wizard, which causes loss of user data:
- To reproduce, import a gradebook item with no points, assign points in the import wizard, hit next, hit back, and see that your points are now missing.
- Also, when going back and forth in the wizard and changing your mind about things like points, you'll be presented with "Title required and must be unique" when you finally try to save, although it does still create your item, but only the first version you set up (ie. if you picked 10 points and then went back to make it 15 points, you'll be presented with the title error but the item will be created with 10 points behind the scenes even if you just leave the wizard.
- Fixed a bug where if you import an item with no points possible in the header, grading data would not be imported for this column. The item would be created, but all the grades in the corresponding spreadsheet column would be ignored.
- To reproduce, import a spreadsheet containing one new gradebook item and a corresponding comment column. Do not give the item a points possible value in the header, but give some students both grades and comments. Import the file, notice that the wizard forces you to give the item a points possible value in the next step, finish the wizard; notice the item was created, all comments were imported but none of the grades were imported.