Skip to content

Commit

Permalink
MDL-38557 quiz manual grading should check mod/quiz:grade
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Mar 22, 2013
1 parent 8bb0c27 commit 23149b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions mod/quiz/db/install.php
Expand Up @@ -46,5 +46,6 @@ function xmldb_quiz_install() {
$record = new stdClass();
$record->name = 'grading';
$record->displayorder = '6000';
$record->capability = 'mod/quiz:grade';
$DB->insert_record('quiz_reports', $record);
}
8 changes: 8 additions & 0 deletions mod/quiz/db/upgrade.php
Expand Up @@ -392,6 +392,14 @@ function xmldb_quiz_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2012061704, 'quiz');
}

if ($oldversion < 2012061705) {
// Quiz manual grading UI should be controlled by mod/quiz:grade, not :viewreports.
$DB->set_field('quiz_reports', 'capability', 'mod/quiz:grade', array('name' => 'grading'));

// Mod quiz savepoint reached.
upgrade_mod_savepoint(true, 2012061705, 'quiz');
}

return true;
}

2 changes: 1 addition & 1 deletion mod/quiz/version.php
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2012061704; // The current module version (Date: YYYYMMDDXX).
$module->version = 2012061705; // The current module version (Date: YYYYMMDDXX).
$module->requires = 2012061700; // Requires this Moodle version.
$module->component = 'mod_quiz'; // Full name of the plugin (used for diagnostics).
$module->cron = 60;

0 comments on commit 23149b2

Please sign in to comment.