Skip to content

Commit

Permalink
hints working
Browse files Browse the repository at this point in the history
  • Loading branch information
catalyst-marcus-green committed Jun 25, 2024
1 parent e32acbe commit a4c7ed5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion question.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
10 changes: 5 additions & 5 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', []);
Expand All @@ -130,9 +130,9 @@ public function feedback(question_attempt $qa, question_display_options $options
$showprompt .= '<div id="fullprompt" class="hidden">'.$prompt .'</div>';
$comment[0] = $comment[0].$showprompt;
}
return $comment[0];
return $hint->hint.$comment[0];
}
return '';
return $hint->hint;
}

/**
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a4c7ed5

Please sign in to comment.