mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-37422 Quiz: Group fields related to 'Settings for multiple tries.'
This commit is contained in:
parent
1918a2452e
commit
6dbc346095
3 changed files with 22 additions and 5 deletions
|
@ -335,6 +335,7 @@ $string['generalfeedback_help'] = 'General feedback is shown to the student afte
|
||||||
You can use the general feedback to give students a fully worked answer and perhaps a link to more information they can use if they did not understand the questions.';
|
You can use the general feedback to give students a fully worked answer and perhaps a link to more information they can use if they did not understand the questions.';
|
||||||
$string['hidden'] = 'Hidden';
|
$string['hidden'] = 'Hidden';
|
||||||
$string['hintn'] = 'Hint {no}';
|
$string['hintn'] = 'Hint {no}';
|
||||||
|
$string['hintnoptions'] = 'Hint {no} options';
|
||||||
$string['hinttext'] = 'Hint text';
|
$string['hinttext'] = 'Hint text';
|
||||||
$string['howquestionsbehave'] = 'How questions behave';
|
$string['howquestionsbehave'] = 'How questions behave';
|
||||||
$string['howquestionsbehave_help'] = 'Students can interact with the questions in the quiz in various different ways. For example, you may wish the students to enter an answer to each question and then submit the entire quiz, before anything is graded or they get any feedback. That would be \'Deferred feedback\' mode.
|
$string['howquestionsbehave_help'] = 'Students can interact with the questions in the quiz in various different ways. For example, you may wish the students to enter an answer to each question and then submit the entire quiz, before anything is graded or they get any feedback. That would be \'Deferred feedback\' mode.
|
||||||
|
|
|
@ -371,24 +371,36 @@ abstract class question_edit_form extends question_wizard_form {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the form elements required by one hint.
|
||||||
|
* @param string $withclearwrong whether this quesiton type uses the 'Clear wrong' option on hints.
|
||||||
|
* @param string $withshownumpartscorrect whether this quesiton type uses the 'Show num parts correct' option on hints.
|
||||||
|
* @return array form field elements for one hint.
|
||||||
|
*/
|
||||||
protected function get_hint_fields($withclearwrong = false, $withshownumpartscorrect = false) {
|
protected function get_hint_fields($withclearwrong = false, $withshownumpartscorrect = false) {
|
||||||
$mform = $this->_form;
|
$mform = $this->_form;
|
||||||
|
|
||||||
|
$repeatedoptions = array();
|
||||||
$repeated = array();
|
$repeated = array();
|
||||||
$repeated[] = $mform->createElement('header', 'hinthdr', get_string('hintn', 'question'));
|
$repeated[] = $mform->createElement('editor', 'hint', get_string('hintn', 'question'),
|
||||||
$repeated[] = $mform->createElement('editor', 'hint', get_string('hinttext', 'question'),
|
|
||||||
array('rows' => 5), $this->editoroptions);
|
array('rows' => 5), $this->editoroptions);
|
||||||
$repeatedoptions['hint']['type'] = PARAM_RAW;
|
$repeatedoptions['hint']['type'] = PARAM_RAW;
|
||||||
|
|
||||||
|
$optionelements = array();
|
||||||
if ($withclearwrong) {
|
if ($withclearwrong) {
|
||||||
$repeated[] = $mform->createElement('advcheckbox', 'hintclearwrong',
|
$optionelements[] = $mform->createElement('advcheckbox', 'hintclearwrong',
|
||||||
get_string('options', 'question'), get_string('clearwrongparts', 'question'));
|
get_string('options', 'question'), get_string('clearwrongparts', 'question'));
|
||||||
}
|
}
|
||||||
if ($withshownumpartscorrect) {
|
if ($withshownumpartscorrect) {
|
||||||
$repeated[] = $mform->createElement('advcheckbox', 'hintshownumcorrect', '',
|
$optionelements[] = $mform->createElement('advcheckbox', 'hintshownumcorrect', '',
|
||||||
get_string('shownumpartscorrect', 'question'));
|
get_string('shownumpartscorrect', 'question'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count($optionelements)) {
|
||||||
|
$repeated[] = $mform->createElement('group', 'hintoptions',
|
||||||
|
get_string('hintnoptions', 'question'), $optionelements, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
return array($repeated, $repeatedoptions);
|
return array($repeated, $repeatedoptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,7 +449,7 @@ abstract class question_edit_form extends question_wizard_form {
|
||||||
list($repeated, $repeatedoptions) = $this->get_hint_fields(
|
list($repeated, $repeatedoptions) = $this->get_hint_fields(
|
||||||
$withclearwrong, $withshownumpartscorrect);
|
$withclearwrong, $withshownumpartscorrect);
|
||||||
$this->repeat_elements($repeated, $repeatsatstart, $repeatedoptions,
|
$this->repeat_elements($repeated, $repeatsatstart, $repeatedoptions,
|
||||||
'numhints', 'addhint', 1, get_string('addanotherhint', 'question'));
|
'numhints', 'addhint', 1, get_string('addanotherhint', 'question'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set_data($question) {
|
public function set_data($question) {
|
||||||
|
|
|
@ -40,6 +40,10 @@
|
||||||
#combinedfeedbackhdr div.fhtmleditor {padding: 0;}
|
#combinedfeedbackhdr div.fhtmleditor {padding: 0;}
|
||||||
#combinedfeedbackhdr div.fcheckbox {margin-bottom: 1em;}
|
#combinedfeedbackhdr div.fcheckbox {margin-bottom: 1em;}
|
||||||
|
|
||||||
|
#multitriesheader div.fitem_feditor {margin-top: 1em;}
|
||||||
|
#multitriesheader div.fitem_fgroup {margin-bottom: 1em;}
|
||||||
|
#multitriesheader div.fitem_fgroup fieldset.felement label {margin-left: 0.3em; margin-right: 0.3em;}
|
||||||
|
|
||||||
.que {clear: left;text-align: left;margin: 0 auto 1.8em auto;}
|
.que {clear: left;text-align: left;margin: 0 auto 1.8em auto;}
|
||||||
.dir-rtl .que {text-align: right;}
|
.dir-rtl .que {text-align: right;}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue