Merge branch 'MDL-32739' of git://github.com/timhunt/moodle

This commit is contained in:
Dan Poltawski
2012-05-03 21:23:19 +08:00
4 changed files with 14 additions and 12 deletions
+2 -2
View File
@@ -681,7 +681,7 @@ function quiz_update_all_final_grades($quiz) {
$join
WHERE
$where
quiza.quiza.state = :statefinished AND
quiza.state = :statefinished AND
quiza.preview = 0 AND
quiza.quiz = :quizid3
GROUP BY quiza.userid";
@@ -697,7 +697,7 @@ function quiz_update_all_final_grades($quiz) {
SELECT DISTINCT userid
FROM {quiz_attempts} quiza2
WHERE
quiza2.quiza.state = :statefinished2 AND
quiza2.state = :statefinished2 AND
quiza2.preview = 0 AND
quiza2.quiz = :quizid2
) users
+4 -2
View File
@@ -277,17 +277,19 @@ abstract class quiz_attempts_report extends quiz_default_report {
/**
* Process any submitted actions.
* @param object $quiz the quiz settings.
* @param object $cm the cm object for the quiz.
* @param int $currentgroup the currently selected group.
* @param array $groupstudents the students in the current group.
* @param array $allowed the users whose attempt this user is allowed to modify.
* @param moodle_url $redirecturl where to redircet to after a successful action.
*/
protected function process_actions($quiz, $currentgroup, $groupstudents, $allowed) {
protected function process_actions($quiz, $cm, $currentgroup, $groupstudents, $allowed, $redirecturl) {
if (empty($currentgroup) || $groupstudents) {
if (optional_param('delete', 0, PARAM_BOOL) && confirm_sesskey()) {
if ($attemptids = optional_param_array('attemptid', array(), PARAM_INT)) {
require_capability('mod/quiz:deleteattempts', $this->context);
$this->delete_selected_attempts($quiz, $cm, $attemptids, $allowed);
redirect($options->get_url());
redirect($redirecturl);
}
}
}
+7 -7
View File
@@ -78,7 +78,7 @@ class quiz_overview_report extends quiz_attempts_report {
raise_memory_limit(MEMORY_EXTRA);
}
$this->process_actions($quiz, $currentgroup, $groupstudents, $allowed);
$this->process_actions($quiz, $cm, $currentgroup, $groupstudents, $allowed, $options->get_url());
// Start output.
if (!$table->is_downloading()) {
@@ -266,15 +266,15 @@ class quiz_overview_report extends quiz_attempts_report {
return true;
}
protected function process_actions($quiz, $currentgroup, $groupstudents, $allowed) {
parent::process_actions($quiz, $currentgroup, $groupstudents, $allowed);
protected function process_actions($quiz, $cm, $currentgroup, $groupstudents, $allowed, $redirecturl) {
parent::process_actions($quiz, $cm, $currentgroup, $groupstudents, $allowed, $redirecturl);
if (empty($currentgroup) || $groupstudents) {
if (optional_param('regrade', 0, PARAM_BOOL) && confirm_sesskey()) {
if ($attemptids = optional_param_array('attemptid', array(), PARAM_INT)) {
require_capability('mod/quiz:regrade', $this->context);
$this->regrade_attempts($quiz, false, $groupstudents, $attemptids);
redirect($options->get_url());
redirect($redirecturl, '', 5);
}
}
}
@@ -282,17 +282,17 @@ class quiz_overview_report extends quiz_attempts_report {
if (optional_param('regradeall', 0, PARAM_BOOL) && confirm_sesskey()) {
require_capability('mod/quiz:regrade', $this->context);
$this->regrade_attempts($quiz, false, $groupstudents);
redirect($options->get_url(), '', 5);
redirect($redirecturl, '', 5);
} else if (optional_param('regradealldry', 0, PARAM_BOOL) && confirm_sesskey()) {
require_capability('mod/quiz:regrade', $this->context);
$this->regrade_attempts($quiz, true, $groupstudents);
redirect($options->get_url(), '', 5);
redirect($redirecturl, '', 5);
} else if (optional_param('regradealldrydo', 0, PARAM_BOOL) && confirm_sesskey()) {
require_capability('mod/quiz:regrade', $this->context);
$this->regrade_attempts_needing_it($quiz, $groupstudents);
redirect($options->get_url(), '', 5);
redirect($redirecturl, '', 5);
}
}
+1 -1
View File
@@ -86,7 +86,7 @@ class quiz_responses_report extends quiz_attempts_report {
raise_memory_limit(MEMORY_EXTRA);
}
$this->process_actions($quiz, $currentgroup, $groupstudents, $allowed);
$this->process_actions($quiz, $cm, $currentgroup, $groupstudents, $allowed, $options->get_url());
// Start output.
if (!$table->is_downloading()) {