Gradebook

Moodle 2.7 Gradebook only updating 1 student at a time.

 
 
Picture of Jason Allshorn
Moodle 2.7 Gradebook only updating 1 student at a time.
 

Please help, we are desperate to fix the is error. 

When multiple student's grades are manually updated in Moodle 2.7 gradebook. The broswer goes to a blank page and reports this bug. 

Class 'mod_dataform\observer\grade_item' not found in D:\DATA100\WEBAPPs\moodle\mod\dataform\classes\observer\completion.php on line 94


When I click to go back into the the gradebook, only one student has been updated. 


This issue only happen in the native grader - in the LAE grader there is not problem at all. 



Picture of Jason Allshorn
Re: Moodle 2.7 Gradebook only updating 1 student at a time.
 

Our IT guy Mr. Trun found and fixed the error. 


Here is problem of module dataform:

Detail:

File: mod/dataform/classes/observer/completion.php

Line number: 94 (red hightline)

Original code:

/**

     * Updates activity completion status.

     *

     * @return void

     */

    public static function update_require_specific_grade(\core\event\base $event) {

        global $DB;

        $entryuserid = $event->relateduserid;

        $giid = $event->other['itemid'];

$gitem = grade_item::fetch(array('id' => $giid));

        $dataformid = $gitem->iteminstance;

        $df = \mod_dataform_dataform::instance($dataformid);

        // Currently only completion by require entries.

        if ($df->completionspecificgrade) {

            $completion = new \completion_info($df->course);

            if ($completion->is_enabled($df->cm) != COMPLETION_TRACKING_AUTOMATIC) {

                return;

            }

            $completion->update_state($df->cm, COMPLETION_UNKNOWN, $entryuserid);

        }

    }

Fixed code:

/**

     * Updates activity completion status.

     *

     * @return void

     */

    public static function update_require_specific_grade(\core\event\base $event) {

        global $DB;

        $entryuserid = $event->relateduserid;

        $giid = $event->other['itemid'];

$gitem = \grade_item::fetch(array('id' => $giid));

        $dataformid = $gitem->iteminstance;

        $df = \mod_dataform_dataform::instance($dataformid);

        // Currently only completion by require entries.

        if ($df->completionspecificgrade) {

            $completion = new \completion_info($df->course);

            if ($completion->is_enabled($df->cm) != COMPLETION_TRACKING_AUTOMATIC) {

                return;

            }

            $completion->update_state($df->cm, COMPLETION_UNKNOWN, $entryuserid);

        }

    }