You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
3.1 KiB

<?php // $Id: access.php,v 1.1.2.4 2011/07/23 08:45:06 bdaloukas Exp $
/**
* Capability definitions for the game module.
*
* For naming conventions, see lib/db/access.php.
*/
$mod_game_capabilities = array(
// Ability to see that the game exists, and the basic information
// about it, for example the start date and time limit.
'mod/game:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'guest' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
// Ability to do the game.
'mod/game:attempt' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'riskbitmask' => RISK_SPAM,
'legacy' => array(
'guest' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
// Ability for a 'Student' to review their previous attempts. Review by
// 'Teachers' is controlled by mod/game:viewreports.
'mod/game:reviewmyattempts' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'student' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/game:attempt'
),
// Edit the game settings, add and remove questions.
'mod/game:manage' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
// Preview the game.
'mod/game:preview' => array(
'captype' => 'write', // Only just a write.
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
// Manually grade and comment on student attempts at a question, and regrade games.
'mod/game:grade' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
// View the game reports.
'mod/game:viewreports' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
// Delete attempts using the overview report.
'mod/game:deleteattempts' => array(
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
)
);
?>