diff --git a/lang/en/qtype_stack.php b/lang/en/qtype_stack.php index ea2d30f5ae..e26fedb4b3 100644 --- a/lang/en/qtype_stack.php +++ b/lang/en/qtype_stack.php @@ -1544,7 +1544,7 @@ $string['castext_debug_header_value_no_simp'] = 'Value'; $string['castext_debug_header_disp_simp'] = 'Simplified displayed value'; $string['castext_debug_header_disp_no_simp'] = 'Displayed value'; -$string['castext_debug_no_vars'] = 'This question has no question variables to debug!'; +$string['castext_debug_no_vars'] = 'This question has no variables to debug here! Display question variables in question text and feedback variables in node feedback.'; $string['castext_error_header'] = 'Rendering of text content failed.'; $string['castext_error_unevaluated'] = 'This text content was never evaluated.'; diff --git a/questiontype.php b/questiontype.php index 002e5ab7f1..96d9abc2fb 100644 --- a/questiontype.php +++ b/questiontype.php @@ -2529,7 +2529,6 @@ public function get_inputs_used_by_prt($prtname, $question) { // Just do the full compile it does all the checking including feedback. $compile['required'] = []; try { - //$compile = $prt->compile($inputkeys, [], 0.0, new stack_cas_security(), '/p/0', new castext2_static_replacer([])); $compile = $prt->compile($inputkeys, [], 0.0, new stack_cas_security(), '/p/0', null); } catch (Exception $e) { // Avoids dealing with an error in the PRT definition that a latter part handles. diff --git a/stack/cas/castext2/blocks/debug.block.php b/stack/cas/castext2/blocks/debug.block.php index 90faa85084..42a7fa7478 100644 --- a/stack/cas/castext2/blocks/debug.block.php +++ b/stack/cas/castext2/blocks/debug.block.php @@ -74,7 +74,8 @@ public function compile($format, $options): ?MP_Node { // phpcs:ignore moodle.Commenting.MissingDocblock.Function public function is_flat(): bool { - return true; + //ISS1085 - Change to false. Common strings need to be evaluated. + return false; } // phpcs:ignore moodle.Commenting.MissingDocblock.Function diff --git a/stack/prt.class.php b/stack/prt.class.php index 2ae8af1249..4f92785488 100644 --- a/stack/prt.class.php +++ b/stack/prt.class.php @@ -441,18 +441,6 @@ public function compile(array $inputs, array $boundvars, $defaultpenalty, $secur // For the feedback we might want to provide extra information related to // feedback vars. Basically, for the debug-block we tell that these are // the bound ones. - // ISS1085 - Add question variables as well. - /* $bvars = array_merge($fv['references']['write']); - if (!empty($this->question->questionvariables)) { - $kv = new stack_cas_keyval($this->question->questionvariables); - if (!$kv->get_valid()) { - throw new stack_exception('Error(s) in question-variables: ' . implode('; ', $kv->get_errors())); - } - $c = $kv->compile('/qv', $map); - $bvars = array_merge($fv['references']['write'], $c['references']['write']); - } - $ct2options = ['bound-vars' => $bvars, 'static string extractor' => $map]; - */ $ct2options = ['bound-vars' => $fv['references']['write'], 'static string extractor' => $map]; if ($fv['statement'] !== null) { diff --git a/tests/walkthrough_adaptive_test.php b/tests/walkthrough_adaptive_test.php index d11de027d0..421dd3cc20 100644 --- a/tests/walkthrough_adaptive_test.php +++ b/tests/walkthrough_adaptive_test.php @@ -4422,7 +4422,10 @@ public function test_test3_debug(): void { $this->check_output_does_not_contain_prt_feedback(); $this->check_output_does_not_contain_stray_placeholders(); $this->check_current_output( - new question_pattern_expectation('/This question has no question variables to debug/'), + new question_pattern_expectation( + '/This question has no variables to debug here! ' . + 'Display question variables in question text and feedback variables in node feedback./' + ), $this->get_does_not_contain_feedback_expectation(), $this->get_does_not_contain_num_parts_correct(), $this->get_no_hint_visible_expectation()