Commit 167fa09
committed
Fix an LTI grade passback issue.
The issue occurs when the `$LTIGradeMode` is "course",
`$LTIGradeOnSubmit` is 1, `$LTISendScoresAfterDate` is
"reduced_scoring_datae', and `$LTISendGradesEarlyThreshold` is
"attempted".
In this case if a user grades a test and receives a score of 0 (and all
versions of this test have a score of 0), then the `grade_gateway`
method returns the default `$bestSetData` array defined at the beginning
of the method with only two elements. It does not have the array of
problem records. So when the `getSetPassbackScore` method gets the
return value and assigns it to `($totalRight, $total, $problemRecords, $setVersions)`
the set versions that are returned end up assigned to the
`$problemRecords` variable. That causes an exception when the
`setAttempted` method tries to call the `attempted` method on a set
version which does not have that method.
So just add an empty array as the third value in the default
`$bsetSetData` array. This works in all calling scenarios.1 parent 6d54327 commit 167fa09
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
0 commit comments