Quiz Access Rule - saving settings

Re: Quiz Access Rule - saving settings

by Jose Velazquez-Torres -
Number of replies: 0
Im using this code:
public static function save_settings($quiz) {
global $DB;
$quizid = $DB->get_record('grade_items', ['itemname' =>$quiz->name]);
$quiz1 = new stdclass;
$quiz1->id = $quizid->id;
$quiz1->iteminstance=$quiz->id;
$quiz1->itemname = $quiz->name;
$quiz1->itemmodule = quiz;
$quiz1->grademin = $quiz->minimumgrade;


$DB->update_record_raw('grade_items', $quiz1, $bulk=true);
}

and currently there is not change to the item on the DB it remains with the same info. I want to add to the grademin a value that is being given in the form and stored in minimumgrade. Could someone tell if Im missing something or doing something wrong?