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

View file

@ -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;
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;
if (quiz_allows_multiple_tries($this->quiz)) {
$toform->whichtries = $this->whichtries;
}
return $toform;
}
@ -73,8 +77,10 @@ class quiz_responses_options extends mod_quiz_attempts_report_options {
$this->showqtext = $fromform->qtext;
$this->showresponses = $fromform->resp;
$this->showright = $fromform->right;
if (quiz_allows_multiple_tries($this->quiz)) {
$this->whichtries = $fromform->whichtries;
}
}
public function setup_from_params() {
parent::setup_from_params();
@ -82,8 +88,10 @@ 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);
if (quiz_allows_multiple_tries($this->quiz)) {
$this->whichtries = optional_param('whichtries', $this->whichtries, PARAM_ALPHA);
}
}
public function setup_from_user_preferences() {
parent::setup_from_user_preferences();
@ -91,8 +99,10 @@ 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);
if (quiz_allows_multiple_tries($this->quiz)) {
$this->whichtries = get_user_preferences('quiz_report_responses_which_tries', $this->whichtries);
}
}
public function update_user_preferences() {
parent::update_user_preferences();
@ -100,8 +110,10 @@ 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);
if (quiz_allows_multiple_tries($this->quiz)) {
set_user_preference('quiz_report_responses_which_tries', $this->whichtries);
}
}
public function resolve_dependencies() {
parent::resolve_dependencies();