Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
ba643847
Commit
ba643847
authored
Feb 21, 2011
by
Tim Hunt
Browse files
MDL-20636 Fix top of file boilerplate in mod/quiz.
parent
b04a4319
Changes
64
Hide whitespace changes
Inline
Side-by-side
mod/quiz/accessrules.php
View file @
ba643847
...
...
@@ -18,10 +18,10 @@
/**
* Sets up the tabs used by the quiz pages based on the users capabilites.
*
* @package mod
* @package
mod
* @subpackage quiz
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright
2009 Tim Hunt
* @license
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
...
...
@@ -430,6 +430,7 @@ class quiz_access_manager {
}
}
/**
* A base class that defines the interface for the various quiz access rules.
* Most of the methods are defined in a slightly unnatural way because we either
...
...
mod/quiz/addrandom.php
View file @
ba643847
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Fallback page of /mod/quiz/edit.php add random question dialog,
* for users who do not use javascript.
*
* @
author Olli Savolainen, as a part of the Quiz UI Redesign project in Summer 2008
*
{@link http://docs.moodle.org/en/Development:Quiz_UI_redesign}.
* @
license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @
package quiz
* @
package mod
*
@subpackage quiz
* @
copyright 2008 Olli Savolainen
* @
license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once
(
'../../config.php'
);
require_once
(
$CFG
->
dirroot
.
'/mod/quiz/editlib.php'
);
require_once
(
$CFG
->
dirroot
.
'/mod/quiz/addrandomform.php'
);
...
...
mod/quiz/addrandomform.php
View file @
ba643847
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the Moodle forum used to add random questions to the quiz.
*
* @package mod
* @subpackage quiz
* @copyright 2008 Olli Savolainen
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once
(
$CFG
->
libdir
.
'/formslib.php'
);
/**
* The add random questions form.
*
* @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class
quiz_add_random_form
extends
moodleform
{
function
definition
()
{
...
...
mod/quiz/attempt.php
View file @
ba643847
...
...
@@ -18,10 +18,10 @@
/**
* This script displays a particular page of a quiz attempt that is in progress.
*
* @package mod
* @package
mod
* @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright
1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once
(
dirname
(
__FILE__
)
.
'/../../config.php'
);
...
...
mod/quiz/attemptlib.php
View file @
ba643847
...
...
@@ -21,10 +21,10 @@
* There are classes for loading all the information about a quiz and attempts,
* and for displaying the navigation panel.
*
* @package mod
* @package
mod
* @subpackage quiz
* @copyright 2008 onwards Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright
2008 onwards Tim Hunt
* @license
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
...
...
mod/quiz/comment.php
View file @
ba643847
...
...
@@ -19,10 +19,10 @@
* This page allows the teacher to enter a manual grade for a particular question.
* This page is expected to only be used in a popup window.
*
* @package mod
* @package
mod
* @subpackage quiz
* @copyright gustav delius 2006
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright
gustav delius 2006
* @license
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once
(
'../../config.php'
);
...
...
mod/quiz/db/access.php
View file @
ba643847
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Capability definitions for the quiz module.
*
* For naming conventions, see lib/db/access.php.
* @package mod
* @subpackage quiz
* @copyright 2006 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$capabilities
=
array
(
// Ability to see that the quiz exists, and the basic information
...
...
mod/quiz/db/install.php
View file @
ba643847
<?php
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Post-install code for the quiz module.
*
* @package mod
* @subpackage quiz
* @copyright 2009 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Code run after the quiz module database tables have been created.
*/
function
xmldb_quiz_install
()
{
global
$DB
;
...
...
@@ -22,5 +45,4 @@ function xmldb_quiz_install() {
$record
->
name
=
'grading'
;
$record
->
displayorder
=
'6000'
;
$DB
->
insert_record
(
'quiz_report'
,
$record
);
}
mod/quiz/db/log.php
View file @
ba643847
...
...
@@ -16,7 +16,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Definition of log events
* Definition of log events
for the quiz module.
*
* @package mod
* @subpackage quiz
...
...
mod/quiz/db/messages.php
View file @
ba643847
...
...
@@ -16,12 +16,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines message providers (types of message
s being sent)
* Defines message providers (types of message
sent) for the quiz module.
*
* @package mod
* @package
mod
* @subpackage quiz
* @copyright 2010
onwards
Andrew Davis
http://moodle.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright
2010 Andrew Davis http://moodle.com
* @license
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$messageproviders
=
array
(
...
...
mod/quiz/db/subplugins.php
View file @
ba643847
<?php
$subplugins
=
array
(
'quiz'
=>
'mod/quiz/report'
);
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Sub-plugin definitions for the quiz module.
*
* @package mod
* @subpackage quiz
* @copyright 2010 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$subplugins
=
array
(
'quiz'
=>
'mod/quiz/report'
);
mod/quiz/db/upgrade.php
View file @
ba643847
<?php
// This file keeps track of upgrades to
// the quiz module
// This file is part of Moodle - http://moodle.org/
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installation to the current version.
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Upgrade script for the quiz module.
*
* @package mod
* @subpackage quiz
* @copyright 2006 Eloy Lafuente (stronk7)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Quiz module upgrade function.
* @param string $oldversion the version we are upgrading from.
*/
function
xmldb_quiz_upgrade
(
$oldversion
)
{
global
$CFG
,
$DB
;
...
...
mod/quiz/edit.js
View file @
ba643847
...
...
@@ -16,10 +16,10 @@
/**
* JavaScript library for the quiz module editing interface.
*
* @package mod
* @package
mod
* @subpackage quiz
* @copyright 2008 Olli Savolainen
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright
2008 Olli Savolainen
* @license
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
...
...
mod/quiz/edit.php
View file @
ba643847
...
...
@@ -36,10 +36,10 @@
* delete Removes a question from the quiz
* savechanges Saves the order and grades for questions in the quiz
*
* @package mod
* @package
mod
* @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright
1999 onwards Martin Dougiamas and others {@link http://moodle.com}
* @license
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
...
...
mod/quiz/editlib.php
View file @
ba643847
...
...
@@ -23,10 +23,10 @@
* the module-indpendent code for handling questions and which in turn
* initialises all the questiontype classes.
*
* @package mod
* @package
mod
* @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright
1999 onwards Martin Dougiamas and others {@link http://moodle.com}
* @license
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
...
...
mod/quiz/grade.php
View file @
ba643847
<?php
require_once
(
"../../config.php"
);
$id
=
required_param
(
'id'
,
PARAM_INT
);
// Course module ID
if
(
!
$cm
=
get_coursemodule_from_id
(
'quiz'
,
$id
))
{
print_error
(
'invalidcoursemodule'
);
}
if
(
!
$quiz
=
$DB
->
get_record
(
'quiz'
,
array
(
'id'
=>
$cm
->
instance
)))
{
print_error
(
'invalidquizid'
);
}
if
(
!
$course
=
$DB
->
get_record
(
'course'
,
array
(
'id'
=>
$quiz
->
course
)))
{
print_error
(
'coursemisconf'
);
}
require_login
(
$course
->
id
,
false
,
$cm
);
if
(
has_capability
(
'mod/quiz:viewreports'
,
get_context_instance
(
CONTEXT_MODULE
,
$cm
->
id
)))
{
redirect
(
'report.php?id='
.
$cm
->
id
);
}
else
{
redirect
(
'view.php?id='
.
$cm
->
id
);
}
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This page is the entry page into the quiz UI. Displays information about the
* quiz to students and teachers, and lets students see their previous attempts.
*
* @package mod
* @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once
(
dirname
(
__FILE__
)
.
'/../../config.php'
);
require_once
(
$CFG
->
dirroot
.
'/mod/quiz/report/reportlib.php'
);
$id
=
required_param
(
'id'
,
PARAM_INT
);
if
(
!
$cm
=
get_coursemodule_from_id
(
'quiz'
,
$id
))
{
print_error
(
'invalidcoursemodule'
);
}
if
(
!
$quiz
=
$DB
->
get_record
(
'quiz'
,
array
(
'id'
=>
$cm
->
instance
)))
{
print_error
(
'invalidquizid'
);
}
if
(
!
$course
=
$DB
->
get_record
(
'course'
,
array
(
'id'
=>
$quiz
->
course
)))
{
print_error
(
'coursemisconf'
);
}
require_login
(
$course
,
false
,
$cm
);
$reportlist
=
quiz_report_list
(
get_context_instance
(
CONTEXT_MODULE
,
$cm
->
id
));
if
(
!
empty
(
$reportlist
))
{
redirect
(
new
moodle_url
(
'/mod/quiz/report.php'
,
array
(
'id'
=>
$cm
->
id
,
'mode'
=>
reset
(
$reportlist
))));
}
else
{
redirect
(
new
moodle_url
(
'/mod/quiz/view.php'
,
array
(
'id'
=>
$cm
->
id
)));
}
mod/quiz/index.php
View file @
ba643847
...
...
@@ -15,15 +15,16 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This script lists all the instances of quiz in a particular course
*
* @package mod
* @package
mod
* @subpackage quiz
* @
author Martin Dougiamas and many others.
* @license http://www.gnu.org/copyleft/gpl.html GNU
Public License
* @
copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license
http://www.gnu.org/copyleft/gpl.html GNU
GPL v3 or later
*/
require_once
(
"../../config.php"
);
require_once
(
"locallib.php"
);
...
...
mod/quiz/lang/en/quiz.php
View file @
ba643847
...
...
@@ -18,9 +18,10 @@
/**
* Strings for component 'quiz', language 'en', branch 'MOODLE_20_STABLE'
*
* @package quiz
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package mod
* @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string
[
'acceptederror'
]
=
'Accepted error'
;
...
...
mod/quiz/lib.php
View file @
ba643847
...
...
@@ -21,10 +21,10 @@
* This contains functions that are called also from outside the quiz module
* Functions that are only called by the quiz module itself are in {@link locallib.php}
*
* @package mod
* @package
mod
* @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright
1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
...
...
mod/quiz/locallib.php
View file @
ba643847
...
...
@@ -24,10 +24,10 @@
* the module-indpendent code for handling questions and which in turn
* initialises all the questiontype classes.
*
* @package mod
* @package
mod
* @subpackage quiz
* @copyright 1999 onwards Martin Dougiamas and others {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright
1999 onwards Martin Dougiamas and others {@link http://moodle.com}
* @license
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
if
(
!
defined
(
'MOODLE_INTERNAL'
))
{
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment