public function upgrade(context $oldcontext,
                            stdClass $oldassignment,
                            stdClass $oldsubmission,
                            stdClass $grade,
                            & $log) {
        global $DB;

        $feedbackcomments = new stdClass();
        $feedbackcomments->commenttext = $oldsubmission->submissioncomment;
        $feedbackcomments->commentformat = FORMAT_HTML;

        $feedbackcomments->grade = $grade->id;
        $feedbackcomments->assignment = $this->assignment->get_instance()->id;
        if (!$DB->insert_record('assignfeedback_comments', $feedbackcomments) > 0) {
            $log .= get_string('couldnotconvertgrade', 'mod_assign', $grade->userid);
            return false;
        }

        return true;
    }
public function upgrade(context $oldcontext,
                            stdClass $oldassignment,
                            stdClass $oldsubmission,
                            stdClass $grade,
                            & $log) {
        global $DB;

        $feedbackcomments = new stdClass();
        $feedbackcomments->commenttext = $oldsubmission->submissioncomment;
        $feedbackcomments->commentformat = FORMAT_HTML;

        $feedbackcomments->grade = $grade->id;
        $feedbackcomments->assignment = $this->assignment->get_instance()->id;
        if (!$DB->insert_record('assignfeedback_comments', $feedbackcomments) > 0) {
            $log .= get_string('couldnotconvertgrade', 'mod_assign', $grade->userid);
            return false;
        }

        return true;
    }
public function upgrade ( context $ oldcontext , stdClass $ oldassignment , stdClass $ oldsubmission , stdClass $ grade , & $ log ) { global $ DB ; $ feedbackcomments = new stdClass ( ) ; $ feedbackcomments -> commenttext = $ oldsubmission -> submissioncomment ; $ feedbackcomments -> commentformat = FORMAT_HTML ; $ feedbackcomments -> grade = $ grade -> id ; $ feedbackcomments -> assignment = $ this -> assignment -> get_instance ( ) -> id ; if ( ! $ DB -> insert_record ( 'assignfeedback_comments' , $ feedbackcomments ) > 0 ) { $ log .= get_string ( 'couldnotconvertgrade' , 'mod_assign' , $ grade -> userid ) ; return false ; } return true ; }
Upgrade the feedback from the old assignment to the new one

@param context $oldcontext - the database for the old assignment context
@param stdClass $oldassignment The data record for the old assignment
@param stdClass $oldsubmission The data record for the old submission
@param stdClass $grade The data record for the new grade
@param string $log Record upgrade messages in the log
@return bool true or false - false will trigger a rollback
Upgrade the feedback from the old assignment to the new one