Skip to content

Commit

Permalink
Merge branch 'MDL-45110-master' of git://github.com/jamiepratt/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Apr 18, 2014
2 parents aee0117 + f87675f commit f658717
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions mod/quiz/report/responses/responses_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ protected function get_url_params() {
$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;
}

Expand All @@ -62,7 +64,9 @@ public function get_initial_form_data() {
$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;
}
Expand All @@ -73,7 +77,9 @@ public function setup_from_form_data($fromform) {
$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() {
Expand All @@ -82,7 +88,9 @@ public function setup_from_params() {
$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() {
Expand All @@ -91,7 +99,9 @@ public function setup_from_user_preferences() {
$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() {
Expand All @@ -100,7 +110,9 @@ public function update_user_preferences() {
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() {
Expand Down

0 comments on commit f658717

Please sign in to comment.