MDL-77090 questions: regrade of interactive attempts lose tries count

The behaviour-specific data was getting corrupted when the regrade
recreated the first step, because $oldstep->get_behaviour_data() was
stripping off the leading '-' characters from the names, and they were
not being added back.
This commit is contained in:
Tim Hunt
2023-02-03 10:53:56 +00:00
parent a2b88160d7
commit 23e26675ff
3 changed files with 42 additions and 5 deletions
+3 -1
View File
@@ -362,7 +362,9 @@ class question_attempt_step {
/**
* Get all the behaviour variables.
* @param array name => value pairs.
*
* @return array name => value pairs. NOTE! the name has the leading - stripped off.
* (If you don't understand the note, read the comment at the top of this class :-))
*/
public function get_behaviour_data() {
$result = array();