Skip to content

Commit 21d0189

Browse files
mchurchwardclaude
andcommitted
Declare \$cmid, \$cmidnumber, \$courseid on questionnaire class
These fields are set via the constructor object-copy loop (from Moodle's generator framework output and test helpers). The property_exists() guard introduced earlier silently dropped them; declaring them explicitly restores the prior behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bc1ebbf commit 21d0189

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

questionnaire.class.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ class questionnaire {
9696
/** @var int $removeafter Days after which to remove responses. */
9797
public $removeafter = 0;
9898

99+
/** @var int $cmid The course module id; added by Moodle's generator framework. */
100+
public $cmid = 0;
101+
102+
/** @var string $cmidnumber The course module id number; may be set externally. */
103+
public $cmidnumber = '';
104+
105+
/** @var int $courseid The course id; may be set externally. */
106+
public $courseid = 0;
107+
99108
// Properties set explicitly in the constructor.
100109

101110
/** @var \stdClass|null $survey The survey record loaded from questionnaire_survey. */

0 commit comments

Comments
 (0)