public function format_text($text, $format, $qa, $component, $filearea, $itemid, $clean = false) { $text = qtype_omerocommon_question::localize_text($text, $format, $qa, $component, $filearea, $itemid, $clean); return parent::format_text($text, $format, $qa, $component, $filearea, $itemid, $clean); }
protected function disable_hint_settings_when_too_many_selected(question_hint_with_parts $hint) { parent::disable_hint_settings_when_too_many_selected($hint); $hint->showchoicefeedback = false; }
public function apply_attempt_state(question_attempt_step $step) { qtype_calculated_question_helper::apply_attempt_state($this, $step); parent::apply_attempt_state($step); }
public function get_variants_selection_seed() { if (!empty($this->synchronised) && $this->datasetloader->datasets_are_synchronised($this->category)) { return 'category' . $this->category; } else { return parent::get_variants_selection_seed(); } }
/** * * * @param array $answers The overall answers array that handles the count of answers * @param \question_attempt $qa * @param \qtype_multichoice_multi_question $questiondef */ protected function update_answers_multi(&$answers, $qa, $questiondef) { // get the order first so we can get the field ids $answerorder = $questiondef->get_order($qa); // make sure there are options, if so, look for the last step with choice0 if (count($answerorder) > 0) { $lastanswerstep = $qa->get_last_step_with_qt_var('choice0'); if ($lastanswerstep->has_qt_var('choice0')) { // may not as if the step doesn't exist get last step will return empty read only step $response = $lastanswerstep->get_qt_data(); // next loop through the order to check if the 'choice' . $key are equal to 1 // (signifies that the student answered with that answer) foreach ($answerorder as $key => $ansid) { if (!empty($response['choice' . $key])) { // update the count of the answerid on the answers array if (isset($answers[$ansid])) { $current = (int) $answers[$ansid]; $answers[$ansid] = $current + 1; } else { $answers[$ansid] = 1; } } } } } }