1
0
mirror of https://github.com/moodle/moodle.git synced 2025-03-04 16:10:59 +01:00

MDL-45110 quiz responses : Notice when behaviour does not allow

multiple tries at a question
This commit is contained in:
James Pratt 2014-04-15 18:29:50 +07:00
parent 1a727e121e
commit f87675fc1c

@ -53,7 +53,9 @@ class quiz_responses_options extends mod_quiz_attempts_report_options {
$params['qtext'] = $this->showqtext;
$params['resp'] = $this->showresponses;
$params['right'] = $this->showright;
$params['whichtries'] = $this->whichtries;
if (quiz_allows_multiple_tries($this->quiz)) {
$params['whichtries'] = $this->whichtries;
}
return $params;
}
@ -62,7 +64,9 @@ class quiz_responses_options extends mod_quiz_attempts_report_options {
$toform->qtext = $this->showqtext;
$toform->resp = $this->showresponses;
$toform->right = $this->showright;
$toform->whichtries = $this->whichtries;
if (quiz_allows_multiple_tries($this->quiz)) {
$toform->whichtries = $this->whichtries;
}
return $toform;
}
@ -73,7 +77,9 @@ class quiz_responses_options extends mod_quiz_attempts_report_options {
$this->showqtext = $fromform->qtext;
$this->showresponses = $fromform->resp;
$this->showright = $fromform->right;
$this->whichtries = $fromform->whichtries;
if (quiz_allows_multiple_tries($this->quiz)) {
$this->whichtries = $fromform->whichtries;
}
}
public function setup_from_params() {
@ -82,7 +88,9 @@ class quiz_responses_options extends mod_quiz_attempts_report_options {
$this->showqtext = optional_param('qtext', $this->showqtext, PARAM_BOOL);
$this->showresponses = optional_param('resp', $this->showresponses, PARAM_BOOL);
$this->showright = optional_param('right', $this->showright, PARAM_BOOL);
$this->whichtries = optional_param('whichtries', $this->whichtries, PARAM_ALPHA);
if (quiz_allows_multiple_tries($this->quiz)) {
$this->whichtries = optional_param('whichtries', $this->whichtries, PARAM_ALPHA);
}
}
public function setup_from_user_preferences() {
@ -91,7 +99,9 @@ class quiz_responses_options extends mod_quiz_attempts_report_options {
$this->showqtext = get_user_preferences('quiz_report_responses_qtext', $this->showqtext);
$this->showresponses = get_user_preferences('quiz_report_responses_resp', $this->showresponses);
$this->showright = get_user_preferences('quiz_report_responses_right', $this->showright);
$this->whichtries = get_user_preferences('quiz_report_responses_which_tries', $this->whichtries);
if (quiz_allows_multiple_tries($this->quiz)) {
$this->whichtries = get_user_preferences('quiz_report_responses_which_tries', $this->whichtries);
}
}
public function update_user_preferences() {
@ -100,7 +110,9 @@ class quiz_responses_options extends mod_quiz_attempts_report_options {
set_user_preference('quiz_report_responses_qtext', $this->showqtext);
set_user_preference('quiz_report_responses_resp', $this->showresponses);
set_user_preference('quiz_report_responses_right', $this->showright);
set_user_preference('quiz_report_responses_which_tries', $this->whichtries);
if (quiz_allows_multiple_tries($this->quiz)) {
set_user_preference('quiz_report_responses_which_tries', $this->whichtries);
}
}
public function resolve_dependencies() {