Workshop grades report lost last submission's name

Workshop grades report lost last submission's name

by Jinxing Chen -
Number of replies: 0

Hi, all

Moodle version 3.1, Workshop phase Closed. When view the participant grade report, the last student's full name is missing, it doesn't matter how sort it the table for viewing, only the last one missing.

In the course code file /mod/workshop/renderer.php around line 994, has a function called helper_grading_report_participant, the code looks like:

/**
     * @param stdClass $participant
     * @param array $userinfo
     * @return string
     */
    protected function helper_grading_report_participant(stdclass $participant, array $userinfo) {
        $userid = $participant->userid;
        $out  = $this->output->user_picture($userinfo[$userid], array('courseid' => $this->page->course->id, 'size' => 35));
        $out .= html_writer::tag('span', fullname($userinfo[$userid]));
        return $out;
    }

I try to debug why whole list of participant shows correct full name not the last one.

$userid = $participant-userid;

The above code return whole list of participant's id, including last one, so id has been identified, why not showing the full name? I created two more variable called $firstname and $lastname, and debugging as below:

protected function helper_grading_report_participant(stdclass $participant, array $userinfo) {
    $userid = $participant->userid;
    $firstname = $participant->firstname;
    $lastname = $participant->lastname;
    echo fullname($userinfo[$userid])."<br>";
    echo $firstname." ".$lastname."<br>";
    echo "<hr>";
    $out  = $this->output->user_picture($userinfo[$userid], array('courseid' => $this->page->course->id, 'size' => 35));
    $out .= html_writer::tag('span', fullname($userinfo[$userid]))

      
    return $out;
}

The last participant's full name still not show when fullname function called, but able to display by echo the $firstname and $lastname. Please checkout the attached file as screen shot for the page display.

Anybody knows why is that?

Attachment Capture.PNG
Average of ratings: -