Skip to content

Commit c6b5357

Browse files
committed
Fix bug #254 The presence of a CodeRunner question in the course's question bank causes the duplication of quizzes to fail.
1 parent cde9a3b commit c6b5357

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CodeRunner
22

3-
Version: 5.7.2 August 8, 2025. Requires **MOODLE V4.3 or later + PHP >=8.1**. Earlier versions
3+
Version: 5.7.2+ August 15, 2025. Requires **MOODLE V4.3 or later + PHP >=8.1**. Earlier versions
44
of Moodle must use CodeRunner V4.
55

66

changehistory.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGE HISTORY
22

3+
### 15 August 2025, 5.7.2+
4+
5+
* Bug fix #254 The presence of a CodeRunner question in the course's question bank causes the duplication of quizzes to fail.
6+
37
### 8 August 2025, 5.7.2
48

59
* Updates to grade caching.

questiontype.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -423,15 +423,13 @@ public function get_question_options($question) {
423423
if ($options->prototypetype != 0) { // Question prototype?
424424
// Yes. It's 100% customised with nothing to inherit.
425425
$options->customise = true;
426-
} else {
426+
} else if (!($question->export_process ?? false)) {
427+
// Don't inherit fields when exporting during quiz duplication or backup restore.
427428
$qtype = $options->coderunnertype;
428429
$context = $this->question_context($question);
429430
$prototype = $this->get_prototype($qtype, $context);
430-
if (!($question->export_process ?? false)) {
431-
// Don't inherit fields when exporting during quiz duplication or backup restore.
432-
$this->set_inherited_fields($options, $prototype);
433-
$question->prototype = $prototype;
434-
}
431+
$this->set_inherited_fields($options, $prototype);
432+
$question->prototype = $prototype;
435433
}
436434

437435
// Add in any testcases.

0 commit comments

Comments
 (0)