How to Create Criteria/Activity Links When Creating Your Moodle Assignment

In order to create criteria/activity links during the assignment creation process (and bypass the extra step of having to create the assignment first, then create the links), you will need to make some changes to your Moodle code, as described below:


Assignments

FILE: /mod/assign/mod_form.php
LINE: 191 (just before the line which says "$this->standard_grading_coursemodule_elements()"
ADD:

        /********************** >>BedCollCore Change ***********************/

        require_once $CFG->dirroot . '/blocks/gradetracker/hook.php';

        \gt_mod_hook($mform);

        /********************** End of BedCollCoreChange *******************/


FILE: /mod/assign/locallib.php
LINE: 693  (just after the line which says "$DB->update_record('assign', $update)"
ADD:

        /********************** >>BedCollCoreChange ***********************/

        global $CFG;

        require_once $CFG->dirroot . '/blocks/gradetracker/hook.php';

        \gt_mod_hook_process($formdata->coursemodule, $this->get_course());

        /********************** End of BedCollCoreChange ***********************/


FILE: /mod/assign/locallib.php
LINE: 1080 (just after the line which says "$DB->update_record('assign', $update)"
ADD:

        /********************** >>BedCollCoreChange ***********************/

        global $CFG;

        require_once $CFG->dirroot . '/blocks/gradetracker/hook.php';

        \gt_mod_hook_process($formdata->coursemodule, $this->get_course());

        /********************** End of BedCollCoreChange ***********************/


Turnitin Assignments

FILE: /mod/turnitintooltwo/mod_form.php
LINE: 334 (just after the line which says "$dateoptions = array('startyear', etc......)")
ADD:

        /********************** >>BedCollCore Change ***********************/

        require_once $CFG->dirroot . '/blocks/gradetracker/hook.php';

        \gt_mod_hook($mform, $this->_cm);

        /********************** End of BedCollCoreChange *******************/


FILE: /mod/turnitintooltwo/lib.php
LINE: 293 (just before the line which says "return $id")
ADD:

    /********************** >>BedCollCoreChange ***********************/

    global $CFG;

    require_once $CFG->dirroot . '/blocks/gradetracker/hook.php';

    \gt_mod_hook_process($turnitintooltwo->coursemodule, \gt_get_course($turnitintooltwo->course));

    /********************** End of BedCollCoreChange ***********************/


Last modified: Wednesday, 21 June 2017, 12:31 PM