MDL-80127 question engine: don't convert null to '' before storing
This commit is contained in:
@@ -149,6 +149,7 @@ class question_engine_data_mapper {
|
||||
|
||||
/**
|
||||
* Helper method used by insert_question_attempt_step and update_question_attempt_step
|
||||
*
|
||||
* @param question_attempt_step $step the step to store.
|
||||
* @param int $questionattemptid the question attept id this step belongs to.
|
||||
* @param int $seq the sequence number of this stop.
|
||||
@@ -158,7 +159,7 @@ class question_engine_data_mapper {
|
||||
$record = new stdClass();
|
||||
$record->questionattemptid = $questionattemptid;
|
||||
$record->sequencenumber = $seq;
|
||||
$record->state = (string) $step->get_state();
|
||||
$record->state = $step->get_state()?->__toString();
|
||||
$record->fraction = $step->get_fraction();
|
||||
$record->timecreated = $step->get_timecreated();
|
||||
$record->userid = $step->get_user_id();
|
||||
|
||||
Reference in New Issue
Block a user