-
Bug
-
Resolution: Won't Fix
-
Minor
-
None
-
3.11.10
-
MOODLE_311_STABLE
When the grade_get_course_grades() function is called on a newly created course that has students but no activity, the function calls grade_regrade_final_grades($courseid); to initialize the grade item but does not store the initialized object and returns a badly constructed one instead
Exemples :
- Return value without storing the constructed object from grade_regrade_final_grades($courseid);
object(stdClass)#175 (8) {
["scaleid"]=>
int(0)
["name"]=>
string(14) "Total du cours"
["grademin"]=>
string(7) "0.00000"
["grademax"]=>
string(9) "100.00000"
["gradepass"]=>
string(7) "0.00000"
["locked"]=>
bool(false)
["hidden"]=>
bool(false)
["grades"]=>
array(1) {
[4]=>
object(stdClass)#174 (12) {
["grade"]=>
bool(false)
["locked"]=>
bool(false)
["hidden"]=>
bool(false)
["overridden"]=>
int(0)
["feedback"]=>
NULL
["feedbackformat"]=>
int(0)
["usermodified"]=>
NULL
["dategraded"]=>
NULL
["datesubmitted"]=>
NULL
["str_grade"]=>
string(6) "Erreur"
["str_long_grade"]=>
string(6) "Erreur"
["str_feedback"]=>
string(0) ""
}
}
}
- Return value with the correctly built object :
object(stdClass)#176 (8) {
["scaleid"]=>
int(0)
["name"]=>
string(14) "Total du cours"
["grademin"]=>
string(7) "0.00000"
["grademax"]=>
string(7) "0.00000"
["gradepass"]=>
string(7) "0.00000"
["locked"]=>
bool(false)
["hidden"]=>
bool(false)
["grades"]=>
array(1) {
[4]=>
object(stdClass)#467 (12) {
["grade"]=>
NULL
["locked"]=>
bool(false)
["hidden"]=>
bool(false)
["overridden"]=>
int(0)
["feedback"]=>
NULL
["feedbackformat"]=>
int(0)
["usermodified"]=>
NULL
["dategraded"]=>
NULL
["datesubmitted"]=>
NULL
["str_grade"]=>
string(1) "-"
["str_long_grade"]=>
string(1) "-"
["str_feedback"]=>
string(0) ""
}
}
}