public static function set_page_rotation($gradeid, $pageno, $isrotated, $pathnamehash, $degree = 0) {
        global $DB;
        $oldrecord = self::get_page_rotation($gradeid, $pageno);
        if ($oldrecord == null) {
            $record = new \stdClass();
            $record->gradeid = $gradeid;
            $record->pageno = $pageno;
            $record->isrotated = $isrotated;
            $record->pathnamehash = $pathnamehash;
            $record->degree = $degree;
            $DB->insert_record('assignfeedback_editpdf_rot', $record, false);
        } else {
            $oldrecord->isrotated = $isrotated;
            $oldrecord->pathnamehash = $pathnamehash;
            $oldrecord->degree = $degree;
            $DB->update_record('assignfeedback_editpdf_rot', $oldrecord, false);
        }
    }