Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/quiz/db/access.php
Go to the documentation of this file.
00001 <?php
00002 // This file is part of Moodle - http://moodle.org/
00003 //
00004 // Moodle is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // Moodle is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00016 
00026 defined('MOODLE_INTERNAL') || die();
00027 
00028 $capabilities = array(
00029 
00030     // Ability to see that the quiz exists, and the basic information
00031     // about it, for example the start date and time limit.
00032     'mod/quiz:view' => array(
00033         'captype' => 'read',
00034         'contextlevel' => CONTEXT_MODULE,
00035         'archetypes' => array(
00036             'guest' => CAP_ALLOW,
00037             'student' => CAP_ALLOW,
00038             'teacher' => CAP_ALLOW,
00039             'editingteacher' => CAP_ALLOW,
00040             'manager' => CAP_ALLOW
00041         )
00042     ),
00043 
00044     // Ability to do the quiz as a 'student'.
00045     'mod/quiz:attempt' => array(
00046         'riskbitmask' => RISK_SPAM,
00047         'captype' => 'write',
00048         'contextlevel' => CONTEXT_MODULE,
00049         'archetypes' => array(
00050             'student' => CAP_ALLOW
00051         )
00052     ),
00053 
00054     // Ability for a 'Student' to review their previous attempts. Review by
00055     // 'Teachers' is controlled by mod/quiz:viewreports.
00056     'mod/quiz:reviewmyattempts' => array(
00057         'captype' => 'read',
00058         'contextlevel' => CONTEXT_MODULE,
00059         'archetypes' => array(
00060             'student' => CAP_ALLOW
00061         ),
00062         'clonepermissionsfrom' => 'moodle/quiz:attempt'
00063     ),
00064 
00065     // Edit the quiz settings, add and remove questions.
00066     'mod/quiz:manage' => array(
00067         'riskbitmask' => RISK_SPAM,
00068         'captype' => 'write',
00069         'contextlevel' => CONTEXT_MODULE,
00070         'archetypes' => array(
00071             'editingteacher' => CAP_ALLOW,
00072             'manager' => CAP_ALLOW
00073         )
00074     ),
00075 
00076     // Edit the quiz overrides
00077     'mod/quiz:manageoverrides' => array(
00078         'captype' => 'write',
00079         'contextlevel' => CONTEXT_MODULE,
00080         'archetypes' => array(
00081             'editingteacher' => CAP_ALLOW,
00082             'manager' => CAP_ALLOW
00083         )
00084     ),
00085 
00086     // Preview the quiz.
00087     'mod/quiz:preview' => array(
00088         'captype' => 'write', // Only just a write.
00089         'contextlevel' => CONTEXT_MODULE,
00090         'archetypes' => array(
00091             'teacher' => CAP_ALLOW,
00092             'editingteacher' => CAP_ALLOW,
00093             'manager' => CAP_ALLOW
00094         )
00095     ),
00096 
00097     // Manually grade and comment on student attempts at a question.
00098     'mod/quiz:grade' => array(
00099         'riskbitmask' => RISK_SPAM,
00100         'captype' => 'write',
00101         'contextlevel' => CONTEXT_MODULE,
00102         'archetypes' => array(
00103             'teacher' => CAP_ALLOW,
00104             'editingteacher' => CAP_ALLOW,
00105             'manager' => CAP_ALLOW
00106         )
00107     ),
00108 
00109     // Regrade quizzes.
00110     'mod/quiz:regrade' => array(
00111         'riskbitmask' => RISK_SPAM,
00112         'captype' => 'write',
00113         'contextlevel' => CONTEXT_MODULE,
00114         'archetypes' => array(
00115             'teacher' => CAP_ALLOW,
00116             'editingteacher' => CAP_ALLOW,
00117             'manager' => CAP_ALLOW
00118         ),
00119         'clonepermissionsfrom' =>  'mod/quiz:grade'
00120     ),
00121 
00122     // View the quiz reports.
00123     'mod/quiz:viewreports' => array(
00124         'riskbitmask' => RISK_PERSONAL,
00125         'captype' => 'read',
00126         'contextlevel' => CONTEXT_MODULE,
00127         'archetypes' => array(
00128             'teacher' => CAP_ALLOW,
00129             'editingteacher' => CAP_ALLOW,
00130             'manager' => CAP_ALLOW
00131         )
00132     ),
00133 
00134     // Delete attempts using the overview report.
00135     'mod/quiz:deleteattempts' => array(
00136         'riskbitmask' => RISK_DATALOSS,
00137         'captype' => 'write',
00138         'contextlevel' => CONTEXT_MODULE,
00139         'archetypes' => array(
00140             'editingteacher' => CAP_ALLOW,
00141             'manager' => CAP_ALLOW
00142         )
00143     ),
00144 
00145     // Do not have the time limit imposed. Used for accessibility legislation compliance.
00146     'mod/quiz:ignoretimelimits' => array(
00147         'captype' => 'read',
00148         'contextlevel' => CONTEXT_MODULE,
00149         'archetypes' => array()
00150     ),
00151 
00152     // Receive a confirmation message of own quiz submission.
00153     'mod/quiz:emailconfirmsubmission' => array(
00154         'captype' => 'read',
00155         'contextlevel' => CONTEXT_MODULE,
00156         'archetypes' => array()
00157     ),
00158 
00159     // Receive a notification message of other peoples' quiz submissions.
00160     'mod/quiz:emailnotifysubmission' => array(
00161         'captype' => 'read',
00162         'contextlevel' => CONTEXT_MODULE,
00163         'archetypes' => array()
00164     )
00165 );
00166 
 All Data Structures Namespaces Files Functions Variables Enumerations