Skip to content

Commit

Permalink
Remove unneeded and wrong update_attempt_state_data_for_new_version
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed May 2, 2024
1 parent 9b82705 commit df09c0e
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions question.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,6 @@ public function validate_can_regrade_with_other_version(question_definition $oth
return null;
}

public function update_attempt_state_data_for_new_version(
question_attempt_step $oldstep, question_definition $otherversion) {
$startdata = parent::update_attempt_state_data_for_new_version($oldstep, $otherversion);

$mapping = array_combine(array_keys($otherversion->rows), array_keys($this->rows));

$oldorder = explode(',', $oldstep->get_qt_var('_roworder'));
$neworder = [];
foreach ($oldorder as $oldid) {
$neworder[] = $mapping[$oldid] ?? $oldid;
}
$startdata['_roworder'] = implode(',', $neworder);

return $startdata;
}

/**
* Check whether question has any specific feedback.
*
Expand Down

0 comments on commit df09c0e

Please sign in to comment.