diff --git a/question.php b/question.php index f3b634d..65294f4 100755 --- a/question.php +++ b/question.php @@ -467,7 +467,8 @@ public function get_question_definition_for_external_rendering(question_attempt 'minwordlimit' => $this->minwordlimit, 'maxwordlimit' => $this->maxwordlimit, ]; - + xdebug_break(); + $hint = $qa->get_applicable_hint(); return $settings; } diff --git a/renderer.php b/renderer.php index 27cfaaa..5b3ff85 100755 --- a/renderer.php +++ b/renderer.php @@ -120,8 +120,8 @@ public function formulation_and_controls(question_attempt $qa, public function feedback(question_attempt $qa, question_display_options $options) { // Get data written in the question.php grade_response method. - // This probably should be retrieved by an api call. - $comment = $qa->get_current_manual_comment(); + // This probably should be retrieved by a $comment = $qa->get_current_manual_comment(); + $hint = $qa->get_applicable_hint() ?? ((object) ['hint' => '']); if ($this->page->pagetype == 'question-bank-previewquestion-preview') { if ($comment[0] > '') { $this->page->requires->js_call_amd('qtype_aitext/showprompt', 'init', []); @@ -130,9 +130,9 @@ public function feedback(question_attempt $qa, question_display_options $options $showprompt .= ''; $comment[0] = $comment[0].$showprompt; } - return $comment[0]; + return $hint->hint.$comment[0]; } - return ''; + return $hint->hint; } /** @@ -244,7 +244,7 @@ public function files_input(question_attempt $qa, $numallowed, * @copyright 2024 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -abstract class qtype_aitext_format_renderer_base extends plugin_renderer_base { +abstract class qtype_aitext_format_renderer_base extends qtype_with_combined_feedback_renderer { /** @var question_display_options Question display options instance for any necessary information for rendering the question. */ protected $displayoptions;