-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.1.16, 4.5.2
-
MOODLE_401_STABLE, MOODLE_405_STABLE
-
MDL-84390-main
-
-
-
During rendering of the assign submission summary table for students, there is the following code:
https://github.com/moodle/moodle/blob/main/mod/assign/locallib.php#L5556
$submissionstatus = $this->get_assign_submission_status_renderable($user, $showlinks); |
$o .= $this->get_renderer()->render($submissionstatus); |
In the get_assign_submission_status_renderable function, we get the user submission and later pass it to $submissionstatus which we then return from this function.
https://github.com/moodle/moodle/blob/main/mod/assign/locallib.php#L5322
public function get_assign_submission_status_renderable($user, $showlinks) { |
...
|
$submission = $this->get_user_submission($user->id, false); |
...
|
$gradingstatus = $this->get_grading_status($user->id); |
|
$submissionstatus = new assign_submission_status(<pass $submission>) |
}
|
When a user is viewing this submission for the first time, $submission is empty. However, the entry in the assign_submission table is created in the get_user_grade function which is called from get_grading_status:
https://github.com/moodle/moodle/blob/main/mod/assign/locallib.php#L3949
public function get_user_grade($userid, $create, $attemptnumber=-1) { |
$submission = $this->get_user_submission($userid, true, $attemptnumber); |
So we incorrectly pass an empty submission to $submissionstatus. The effect of this is that some rows of the table will only be rendered on the next page load.
- is duplicated by
-
MDL-85681 Assign: Inconsistent status display on first view as student
-
- Closed
-