Skip to content

Commit

Permalink
Adding phpdoc for the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusgreen committed Mar 7, 2024
1 parent 4d7da79 commit 2906a3a
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ public function set_displayoptions(question_display_options $displayoptions): vo

/**
* Render the students respone when the question is in read-only mode.
*
* @param string $name the variable name this input edits.
* @param question_attempt $qa the question attempt being display.
* @param question_attempt_step $step the current step.
Expand All @@ -292,35 +293,13 @@ abstract public function response_area_input($name, question_attempt $qa,
question_attempt_step $step, $lines, $context);

/**
* @return string specific class name to add to the input element.
* Specific class name to add to the input element.
*
* @return string
*/
abstract protected function class_name();
}

/**
* An aitext format renderer for aitexts where the student should not enter
* any inline response.
*
* @copyright 2013 Binghamton University
* @author Marcus Green 2024 (building on work of Binghampton University)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qtype_aitext_format_noinline_renderer extends qtype_aitext_format_renderer_base {

protected function class_name() {
return 'qtype_aitext_noinline';
}

public function response_area_read_only($name, $qa, $step, $lines, $context) {
return '';
}

public function response_area_input($name, $qa, $step, $lines, $context) {
return '';
}

}

/**
* An aitext format renderer for aitexts where the student should use the HTML
* editor without the file picker.
Expand All @@ -329,11 +308,17 @@ public function response_area_input($name, $qa, $step, $lines, $context) {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qtype_aitext_format_editor_renderer extends qtype_aitext_format_renderer_base {
/**
* Specific class name to add to the input element.
*
* @return string
*/
protected function class_name() {
return 'qtype_aitext_editor';
}

public function response_area_read_only($name, $qa, $step, $lines, $context) {
xdebug_break();
$labelbyid = $qa->get_qt_field_name($name) . '_label';
$responselabel = $this->displayoptions->add_question_identifier_to_label(get_string('answertext', 'qtype_aitext'));
$output = html_writer::tag('h4', $responselabel, ['id' => $labelbyid, 'class' => 'sr-only']);
Expand Down Expand Up @@ -471,6 +456,11 @@ protected function filepicker_html($inputname, $draftitemid) {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qtype_aitext_format_editorfilepicker_renderer extends qtype_aitext_format_editor_renderer {
/**
* Specific class name to add to the input element.
*
* @return string
*/
protected function class_name() {
return 'qtype_aitext_editorfilepicker';
}
Expand Down Expand Up @@ -578,6 +568,11 @@ protected function textarea($response, $lines, $attributes) {
return html_writer::tag('textarea', s($response), $attributes);
}

/**
* Specific class name to add to the input element.
*
* @return string
*/
protected function class_name() {
return 'qtype_aitext_plain';
}
Expand Down Expand Up @@ -614,6 +609,11 @@ public function response_area_input($name, $qa, $step, $lines, $context) {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qtype_aitext_format_monospaced_renderer extends qtype_aitext_format_plain_renderer {
/**
* Specific class name to add to the input element.
*
* @return string
*/
protected function class_name() {
return 'qtype_aitext_monospaced';
}
Expand Down

0 comments on commit 2906a3a

Please sign in to comment.