mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 05:54:19 +02:00
MDL-20636 You can now create a quiz, and edit the settings.
Little else works, but this is just the first step.
This commit is contained in:
parent
25302dee78
commit
f255782339
@ -131,7 +131,7 @@ function cron_run() {
|
||||
plagiarism_cron();
|
||||
|
||||
mtrace("Starting quiz reports");
|
||||
if ($reports = $DB->get_records_select('quiz_report', "cron > 0 AND ((? - lastcron) > cron)", array($timenow))) {
|
||||
if ($reports = $DB->get_records_select('quiz_reports', "cron > 0 AND ((? - lastcron) > cron)", array($timenow))) {
|
||||
foreach ($reports as $report) {
|
||||
$cronfile = "$CFG->dirroot/mod/quiz/report/$report->name/cron.php";
|
||||
if (file_exists($cronfile)) {
|
||||
@ -143,7 +143,7 @@ function cron_run() {
|
||||
$pre_dbqueries = $DB->perf_get_queries();
|
||||
$pre_time = microtime(1);
|
||||
if ($cron_function()) {
|
||||
$DB->set_field('quiz_report', "lastcron", $timenow, array("id"=>$report->id));
|
||||
$DB->set_field('quiz_reports', "lastcron", $timenow, array("id"=>$report->id));
|
||||
}
|
||||
if (isset($pre_dbqueries)) {
|
||||
mtrace("... used " . ($DB->perf_get_queries() - $pre_dbqueries) . " dbqueries");
|
||||
|
@ -18,4 +18,30 @@ function xmldb_local_qedatabase_upgrade($oldversion) {
|
||||
|
||||
upgrade_plugin_savepoint(true, 2008000700, 'local', 'qedatabase');
|
||||
}
|
||||
|
||||
if ($oldversion < 2008000701) {
|
||||
// Define table quiz_report to be renamed to quiz_reports
|
||||
$table = new xmldb_table('quiz_report');
|
||||
|
||||
// Launch rename table for quiz_reports
|
||||
if ($dbman->table_exists($table)) {
|
||||
$dbman->rename_table($table, 'quiz_reports');
|
||||
}
|
||||
|
||||
upgrade_plugin_savepoint(true, 2008000701, 'local', 'qedatabase');
|
||||
}
|
||||
|
||||
if ($oldversion < 2008000702) {
|
||||
// Define index name (unique) to be added to quiz_reports
|
||||
$table = new xmldb_table('quiz_reports');
|
||||
$index = new xmldb_index('name', XMLDB_INDEX_UNIQUE, array('name'));
|
||||
|
||||
// Conditionally launch add index name
|
||||
if (!$dbman->index_exists($table, $index)) {
|
||||
$dbman->add_index($table, $index);
|
||||
}
|
||||
|
||||
upgrade_plugin_savepoint(true, 2008000702, 'local', 'qedatabase');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -26,5 +26,5 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$plugin->version = 2008000700;
|
||||
$plugin->version = 2008000702;
|
||||
$plugin->requires = 2010080300;
|
||||
|
@ -11,16 +11,16 @@ function xmldb_quiz_install() {
|
||||
$record = new stdClass();
|
||||
$record->name = 'overview';
|
||||
$record->displayorder = '10000';
|
||||
$DB->insert_record('quiz_report', $record);
|
||||
$DB->insert_record('quiz_reports', $record);
|
||||
|
||||
$record = new stdClass();
|
||||
$record->name = 'responses';
|
||||
$record->displayorder = '9000';
|
||||
$DB->insert_record('quiz_report', $record);
|
||||
$DB->insert_record('quiz_reports', $record);
|
||||
|
||||
$record = new stdClass();
|
||||
$record->name = 'grading';
|
||||
$record->displayorder = '6000';
|
||||
$DB->insert_record('quiz_report', $record);
|
||||
$DB->insert_record('quiz_reports', $record);
|
||||
|
||||
}
|
||||
|
@ -12,16 +12,21 @@
|
||||
<FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" COMMENT="The introductory text desplayed on the view.php page." PREVIOUS="name" NEXT="introformat"/>
|
||||
<FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="intro" NEXT="timeopen"/>
|
||||
<FIELD NAME="timeopen" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time at which students may start attempting this quiz." PREVIOUS="introformat" NEXT="timeclose"/>
|
||||
<FIELD NAME="timeclose" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time by which students must have completed their attempt." PREVIOUS="timeopen" NEXT="optionflags"/>
|
||||
<FIELD NAME="optionflags" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="This stores the adaptive mode setting for this quiz." PREVIOUS="timeclose" NEXT="penaltyscheme"/>
|
||||
<FIELD NAME="penaltyscheme" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Stores the apply penaties setting." PREVIOUS="optionflags" NEXT="attempts"/>
|
||||
<FIELD NAME="attempts" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="The maximum number of attempts that a student is allowed at this quiz. 0 mean no limit." PREVIOUS="penaltyscheme" NEXT="attemptonlast"/>
|
||||
<FIELD NAME="attemptonlast" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Whether each attempt builds on last mode is on." PREVIOUS="attempts" NEXT="grademethod"/>
|
||||
<FIELD NAME="grademethod" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" COMMENT="How individual attempt grades are combined to get the overall grade. From the top of mod/quiz/lib.php: 1 = QUIZ_GRADEHIGHEST, 2 = QUIZ_GRADEAVERAGE, 3 = QUIZ_ATTEMPTFIRST, 4 = QUIZ_ATTEMPTLAST." PREVIOUS="attemptonlast" NEXT="decimalpoints"/>
|
||||
<FIELD NAME="timeclose" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Time by which students must have completed their attempt." PREVIOUS="timeopen" NEXT="preferredbehaviour"/>
|
||||
<FIELD NAME="preferredbehaviour" TYPE="char" LENGTH="32" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="timeclose" NEXT="attemptonlast"/>
|
||||
<FIELD NAME="attemptonlast" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="preferredbehaviour" NEXT="attempts"/>
|
||||
<FIELD NAME="attempts" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="The maximum number of attempts that a student is allowed at this quiz. 0 mean no limit." PREVIOUS="attemptonlast" NEXT="grademethod"/>
|
||||
<FIELD NAME="grademethod" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" COMMENT="How individual attempt grades are combined to get the overall grade. From the top of mod/quiz/lib.php: 1 = QUIZ_GRADEHIGHEST, 2 = QUIZ_GRADEAVERAGE, 3 = QUIZ_ATTEMPTFIRST, 4 = QUIZ_ATTEMPTLAST." PREVIOUS="attempts" NEXT="decimalpoints"/>
|
||||
<FIELD NAME="decimalpoints" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="2" SEQUENCE="false" COMMENT="Number of decimal points to display when printing scores belonging to this quiz." PREVIOUS="grademethod" NEXT="questiondecimalpoints"/>
|
||||
<FIELD NAME="questiondecimalpoints" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="-2" SEQUENCE="false" COMMENT="The number of decimal digits to use when displaying question grades. -1 = use decimalpoints, otherwise a separate setting." PREVIOUS="decimalpoints" NEXT="review"/>
|
||||
<FIELD NAME="review" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="A bitfield encoding the Review options setting. Read the code of function quiz_get_reviewoptions from mod/quiz/locallib.php to see what each bit means." PREVIOUS="questiondecimalpoints" NEXT="questionsperpage"/>
|
||||
<FIELD NAME="questionsperpage" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="This does not do exactly what the name suggests, and the behaviour depends on the shufflequestions setting." PREVIOUS="review" NEXT="shufflequestions"/>
|
||||
<FIELD NAME="questiondecimalpoints" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="-2" SEQUENCE="false" COMMENT="The number of decimal digits to use when displaying question grades. -1 = use decimalpoints, otherwise a separate setting." PREVIOUS="decimalpoints" NEXT="reviewattempt"/>
|
||||
<FIELD NAME="reviewattempt" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether users are allowed to review their quiz attempts at various times. This is a bit field, decoded by the mod_quiz_display_options class. It is formed by ORing together the constants defined there." PREVIOUS="questiondecimalpoints" NEXT="reviewcorrectness"/>
|
||||
<FIELD NAME="reviewcorrectness" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether users are allowed to review their quiz attempts at various times. A bit field, like reviewattempt." PREVIOUS="reviewattempt" NEXT="reviewmarks"/>
|
||||
<FIELD NAME="reviewmarks" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether users are allowed to review their quiz attempts at various times. A bit field, like reviewattempt." PREVIOUS="reviewcorrectness" NEXT="reviewspecificfeedback"/>
|
||||
<FIELD NAME="reviewspecificfeedback" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether users are allowed to review their quiz attempts at various times. A bit field, like reviewattempt." PREVIOUS="reviewmarks" NEXT="reviewgeneralfeedback"/>
|
||||
<FIELD NAME="reviewgeneralfeedback" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether users are allowed to review their quiz attempts at various times. A bit field, like reviewattempt." PREVIOUS="reviewspecificfeedback" NEXT="reviewrightanswer"/>
|
||||
<FIELD NAME="reviewrightanswer" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether users are allowed to review their quiz attempts at various times. A bit field, like reviewattempt." PREVIOUS="reviewgeneralfeedback" NEXT="reviewoverallfeedback"/>
|
||||
<FIELD NAME="reviewoverallfeedback" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether users are allowed to review their quiz attempts at various times. A bit field, like reviewattempt." PREVIOUS="reviewrightanswer" NEXT="questionsperpage"/>
|
||||
<FIELD NAME="questionsperpage" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="This does not do exactly what the name suggests, and the behaviour depends on the shufflequestions setting." PREVIOUS="reviewoverallfeedback" NEXT="shufflequestions"/>
|
||||
<FIELD NAME="shufflequestions" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Whether the list of questions in the quiz should be randomly shuffled at the start of each attempt." PREVIOUS="questionsperpage" NEXT="shuffleanswers"/>
|
||||
<FIELD NAME="shuffleanswers" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Whether, in question types that support it, individual parts of a question should be shuffled." PREVIOUS="shufflequestions" NEXT="questions"/>
|
||||
<FIELD NAME="questions" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" COMMENT="Comma-separated list of questionids, with 0s for page breaks. The layout of questions in this quiz." PREVIOUS="shuffleanswers" NEXT="sumgrades"/>
|
||||
@ -61,7 +66,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="uniqueid"/>
|
||||
<KEY NAME="uniqueid" TYPE="foreign-unique" FIELDS="uniqueid" REFTABLE="question_attempts" REFFIELDS="id" PREVIOUS="primary" NEXT="quiz"/>
|
||||
<KEY NAME="uniqueid" TYPE="foreign-unique" FIELDS="uniqueid" REFTABLE="question_usages" REFFIELDS="id" PREVIOUS="primary" NEXT="quiz"/>
|
||||
<KEY NAME="quiz" TYPE="foreign" FIELDS="quiz" REFTABLE="quiz" REFFIELDS="id" PREVIOUS="uniqueid"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
@ -97,7 +102,7 @@
|
||||
<KEY NAME="question" TYPE="foreign" FIELDS="question" REFTABLE="question" REFFIELDS="id" PREVIOUS="quiz"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="quiz_feedback" COMMENT="Feedback given to students based on which grade band their overall score lies." PREVIOUS="quiz_question_instances" NEXT="quiz_report">
|
||||
<TABLE NAME="quiz_feedback" COMMENT="Feedback given to students based on which grade band their overall score lies." PREVIOUS="quiz_question_instances" NEXT="quiz_reports">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="quizid"/>
|
||||
<FIELD NAME="quizid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Foreign key references quiz.id." PREVIOUS="id" NEXT="feedbacktext"/>
|
||||
@ -111,7 +116,7 @@
|
||||
<KEY NAME="quizid" TYPE="foreign" FIELDS="quizid" REFTABLE="quiz" REFFIELDS="id" PREVIOUS="primary"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="quiz_report" COMMENT="Lists all the installed quiz reports and their display order and so on. No need to worry about deleting old records. Only records with an equivalent directory are displayed." PREVIOUS="quiz_feedback" NEXT="quiz_overrides">
|
||||
<TABLE NAME="quiz_reports" COMMENT="Lists all the installed quiz reports and their display order and so on. No need to worry about deleting old records. Only records with an equivalent directory are displayed." PREVIOUS="quiz_feedback" NEXT="quiz_overrides">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
|
||||
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="name of the report, same as the directory name" PREVIOUS="id" NEXT="displayorder"/>
|
||||
@ -123,8 +128,11 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="name" UNIQUE="true" FIELDS="name" COMMENT="Report name must be unique."/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="quiz_overrides" COMMENT="The overrides to quiz settings on a per-user and per-group basis." PREVIOUS="quiz_report">
|
||||
<TABLE NAME="quiz_overrides" COMMENT="The overrides to quiz settings on a per-user and per-group basis." PREVIOUS="quiz_reports">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="quiz"/>
|
||||
<FIELD NAME="quiz" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Foreign key references quiz.id" PREVIOUS="id" NEXT="groupid"/>
|
||||
|
@ -18,24 +18,20 @@
|
||||
/**
|
||||
* Defines message providers (types of messages being sent)
|
||||
*
|
||||
* @package mod-quiz
|
||||
* @copyright 2010 onwards Andrew Davis http://moodle.com
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @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
|
||||
*/
|
||||
|
||||
$messageproviders = array (
|
||||
|
||||
// notify teacher that a student has submitted a quiz attempt
|
||||
// Notify teacher that a student has submitted a quiz attempt
|
||||
'submission' => array (
|
||||
'capability' => 'mod/quiz:emailnotifysubmission'
|
||||
),
|
||||
|
||||
// confirm a student's quiz attempt
|
||||
|
||||
// Confirm a student's quiz attempt
|
||||
'confirmation' => array (
|
||||
'capability' => 'mod/quiz:emailconfirmsubmission'
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
@ -33,19 +33,8 @@ $string['addarandomquestion'] = 'Add a random question ...';
|
||||
$string['addarandomquestion_help'] = 'When a random question is added, it results in a randomly-chosen question from the category being inserted into the quiz. This means that different students are likely to get a different selection of questions, and when a quiz allows multiple attempts then each attempt is likely to contain a new selection of questions.';
|
||||
$string['addcategory'] = 'Add category';
|
||||
$string['adddescriptionlabel'] = 'Add description/label';
|
||||
$string['addingcalculated'] = 'Adding a calculated question';
|
||||
$string['addingdescription'] = 'Adding a description';
|
||||
$string['addingessay'] = 'Adding essay';
|
||||
$string['addingmatch'] = 'Adding a matching question';
|
||||
$string['addingmultianswer'] = 'Adding embedded answers (cloze)';
|
||||
$string['addingmultichoice'] = 'Adding a multiple choice question';
|
||||
$string['addingnumerical'] = 'Adding a numerical question';
|
||||
$string['addingquestion'] = 'Adding a question';
|
||||
$string['addingquestions'] = 'This side of the page is where you manage your database of questions. Questions are stored in categories to help you keep them organised, and can be used by any quiz in your course or even other courses if you choose to \'publish\' them. <br /><br />After you select or create a question category you will be able to create or edit questions. You can select any of these questions to add to your quiz over on the other side of this page.';
|
||||
$string['addingrandom'] = 'Adding a random question';
|
||||
$string['addingrandomsamatch'] = 'Adding a random short-answer matching question';
|
||||
$string['addingshortanswer'] = 'Adding a short-answer question';
|
||||
$string['addingtruefalse'] = 'Adding a true/false question';
|
||||
$string['addmoreoverallfeedbacks'] = 'Add {no} more feedback fields';
|
||||
$string['addnewgroupoverride'] = 'Add group override';
|
||||
$string['addnewpagesafterselected'] = 'Add new pages after selected questions';
|
||||
@ -89,7 +78,7 @@ $string['aon'] = 'AON format';
|
||||
$string['areyousureremoveselected'] = 'Are you sure you want to remove all the selected questions?';
|
||||
$string['asshownoneditscreen'] = 'As shown on the edit screen';
|
||||
$string['attempt'] = 'Attempt {$a}';
|
||||
$string['attemptalreadyclosed'] = 'This attempt has already be finished.';
|
||||
$string['attemptalreadyclosed'] = 'This attempt has already been finished.';
|
||||
$string['attemptclosed'] = 'Attempt has not closed yet';
|
||||
$string['attemptduration'] = 'Time taken';
|
||||
$string['attemptedon'] = 'Attempted on';
|
||||
@ -144,6 +133,7 @@ $string['cannotsavenumberofquestion'] = 'Could not save number of questions per
|
||||
$string['cannotsavequestion'] = 'Cannot save question list';
|
||||
$string['cannotsetgrade'] = 'Could not set a new maximum grade for the quiz';
|
||||
$string['cannotsetsumgrades'] = 'Failed to set sumgrades';
|
||||
$string['cannotstartmissingquestion'] = 'Cannot start an attempt at this quiz. The quiz definition includes a question that does not exist.';
|
||||
$string['cannotwrite'] = 'Cannot write to export file ({$a})';
|
||||
$string['caseno'] = 'No, case is unimportant';
|
||||
$string['casesensitive'] = 'Case sensitivity';
|
||||
@ -249,7 +239,6 @@ $string['deleteselected'] = 'Delete selected';
|
||||
$string['deletingquestionattempts'] = 'Deleting question attempts';
|
||||
$string['description'] = 'Description';
|
||||
$string['disabled'] = 'Disabled';
|
||||
$string['discrimination'] = 'Discrim. index';
|
||||
$string['displayoptions'] = 'Display options';
|
||||
$string['download'] = 'Click to download the exported category file';
|
||||
$string['downloadextra'] = '(file is also stored in the course files in the /backupdata/quiz folder)';
|
||||
@ -259,13 +248,6 @@ $string['eachattemptbuildsonthelast_help'] = 'If multiple attempts are allowed a
|
||||
$string['editcategories'] = 'Edit categories';
|
||||
$string['editcategory'] = 'Edit category';
|
||||
$string['editcatquestions'] = 'Edit category questions';
|
||||
$string['editingcalculated'] = 'Editing a calculated question';
|
||||
$string['editingdescription'] = 'Editing a description';
|
||||
$string['editingessay'] = 'Editing essay';
|
||||
$string['editingmatch'] = 'Editing a matching question';
|
||||
$string['editingmultianswer'] = 'Editing embedded answers (cloze)';
|
||||
$string['editingmultichoice'] = 'Editing a multiple choice question';
|
||||
$string['editingnumerical'] = 'Editing a numerical question';
|
||||
$string['editingquestion'] = 'Editing a question';
|
||||
$string['editingquiz'] = 'Editing quiz';
|
||||
$string['editingquiz_help'] = 'When creating a quiz, the main concepts are:
|
||||
@ -274,11 +256,6 @@ $string['editingquiz_help'] = 'When creating a quiz, the main concepts are:
|
||||
* The question bank, which stores copies of all questions organised into categories
|
||||
* Random questions - A student gets different questions each time they attempt the quiz and different students can get different questions';
|
||||
$string['editingquiz_link'] = 'mod/quiz/edit';
|
||||
$string['editingrandom'] = 'Editing a random question';
|
||||
$string['editingrandomsamatch'] = 'Editing a random short-answer matching question';
|
||||
$string['editingrqp'] = '{$a}: editing a question';
|
||||
$string['editingshortanswer'] = 'Editing a short-answer question';
|
||||
$string['editingtruefalse'] = 'Editing a true/false question';
|
||||
$string['editoverride'] = 'Edit override';
|
||||
$string['editqcats'] = 'Edit questions categories';
|
||||
$string['editquestions'] = 'Edit questions';
|
||||
@ -316,14 +293,6 @@ $string['errorsdetected'] = '{$a} error(s) detected';
|
||||
$string['errorunexpectedevent'] = 'Unexpected event code {$a->event} found for question {$a->questionid} in attempt {$a->attemptid}.';
|
||||
$string['essay'] = 'Essay';
|
||||
$string['essayquestions'] = 'Questions';
|
||||
$string['event1'] = 'Autosave';
|
||||
$string['event2'] = 'Save';
|
||||
$string['event3'] = 'Grade';
|
||||
$string['event5'] = 'Validate';
|
||||
$string['event6'] = 'Close&grade';
|
||||
$string['event7'] = 'Submit';
|
||||
$string['event8'] = 'Close';
|
||||
$string['event9'] = 'Manual grade';
|
||||
$string['everynquestions'] = 'Every {$a} questions';
|
||||
$string['everyquestion'] = 'Every question';
|
||||
$string['everythingon'] = 'Everything on';
|
||||
@ -401,15 +370,8 @@ $string['guestsno'] = 'Sorry, guests cannot see or attempt quizzes';
|
||||
$string['hidebreaks'] = 'Hide page breaks';
|
||||
$string['hidereordertool'] = 'Hide the reordering tool';
|
||||
$string['history'] = 'History of responses:';
|
||||
$string['changessaved'] = 'Grading changes saved';
|
||||
$string['changessavedwitherrors'] = 'Some errors occurred while saving the grading changes';
|
||||
$string['checkanswer'] = 'Check';
|
||||
$string['choice'] = 'Choice';
|
||||
$string['choices'] = 'Available choices';
|
||||
$string['choosefile'] = 'Choose a file';
|
||||
$string['illegalformulasyntax'] = 'Illegal formula syntax starting with \'{$a}\'';
|
||||
$string['imagedisplay'] = 'Image to display';
|
||||
$string['imagemissing'] = 'Image not available at line {$a}. The filename will be ignored';
|
||||
$string['import'] = 'Import';
|
||||
$string['import_help'] = 'This function allows you to import questions from external text files.
|
||||
|
||||
@ -445,11 +407,6 @@ $string['invalidquizid'] = 'Invalid quiz ID';
|
||||
$string['invalidsource'] = 'The source is not accepted as valid.';
|
||||
$string['invalidsourcetype'] = 'Invalid source type.';
|
||||
$string['invalidstateid'] = 'Invalid state id';
|
||||
$string['itemanal'] = 'Item response analysis';
|
||||
$string['itemdefinition'] = 'Definition';
|
||||
$string['itemsource'] = 'Item source';
|
||||
$string['itemsourceformat'] = 'Item source format';
|
||||
$string['itemtypes'] = 'Remote question types';
|
||||
$string['lastanswer'] = 'Your last answer was';
|
||||
$string['layout'] = 'Layout';
|
||||
$string['layoutasshown'] = 'Page layout as shown.';
|
||||
@ -506,6 +463,7 @@ $string['newpage_help'] = 'For longer quizzes it makes sense to stretch the quiz
|
||||
$string['newpageevery'] = 'Automatically start a new page';
|
||||
$string['noanswers'] = 'No answers were selected!';
|
||||
$string['noattempts'] = 'No attempts have been made on this quiz';
|
||||
$string['noattemptsfound'] = 'No attempts found.';
|
||||
$string['noattemptstoshow'] = 'There are no attempts to show';
|
||||
$string['nocategory'] = 'Incorrect or no category specified';
|
||||
$string['noclose'] = 'No close date';
|
||||
@ -538,8 +496,10 @@ $string['noscript'] = 'JavaScript must be enabled to continue!';
|
||||
$string['notavailable'] = 'This quiz is not currently available';
|
||||
$string['notavailabletostudents'] = 'Note: This quiz is not currently available to your students';
|
||||
$string['notenoughanswers'] = 'This type of question requires at least {$a} answers';
|
||||
$string['notenoughrandomquestions'] = 'There are not enough questions in category {$a->category} to create the question {$a->name} ({$a->id}).';
|
||||
$string['notenoughsubquestions'] = 'Not enough sub-questions have been defined!<br />Do you want to go back and fix this question?';
|
||||
$string['notimedependentitems'] = 'Time dependent items are not currently supported by the quiz module. As a work around, set a time limit for the whole quiz. Do you wish to choose a different item (or use the current item regardless)?';
|
||||
$string['notyetgraded'] = 'Not yet graded';
|
||||
$string['notyourattempt'] = 'This is not your attempt!';
|
||||
$string['noview'] = 'Logged-in user is not allowed to view this quiz';
|
||||
$string['numattempts'] = '{$a->studentnum} {$a->studentstring} have made {$a->attemptnum} attempts';
|
||||
@ -549,6 +509,7 @@ $string['numerical'] = 'Numerical';
|
||||
$string['numquestionsx'] = 'Questions: {$a}';
|
||||
$string['onlyteachersexport'] = 'Only teachers can export questions';
|
||||
$string['onlyteachersimport'] = 'Only teachers with editing rights can import questions';
|
||||
$string['onthispage'] = 'On this page';
|
||||
$string['open'] = 'Not answered';
|
||||
$string['openclosedatesupdated'] = 'Quiz open and close dates updated';
|
||||
$string['optional'] = 'optional';
|
||||
@ -574,7 +535,6 @@ $string['overrides'] = 'Overrides';
|
||||
$string['overrideuser'] = 'Override user';
|
||||
$string['overrideusereventname'] = '{$a->quiz} - Override';
|
||||
$string['pagesize'] = 'Attempts shown per page:';
|
||||
$string['paragraphquestion'] = 'Paragraph question not supported at line {$a}. The question will be ignored.';
|
||||
$string['parent'] = 'Parent';
|
||||
$string['parentcategory'] = 'Parent category';
|
||||
$string['parsingquestions'] = 'Parsing questions from import file.';
|
||||
@ -600,6 +560,7 @@ $string['previous'] = 'Previous state';
|
||||
$string['publish'] = 'Publish';
|
||||
$string['publishedit'] = 'You must have permission in the publishing course to add or edit questions in this category';
|
||||
$string['qname'] = 'name';
|
||||
$string['qbrief'] = 'Q. {$a}';
|
||||
$string['qti'] = 'IMS QTI format';
|
||||
$string['qti_two'] = 'IMS QTI 2.0 format';
|
||||
$string['qtypename'] = 'type, name';
|
||||
@ -614,6 +575,8 @@ $string['questionmissing'] = 'Question for this session is missing';
|
||||
$string['questionname'] = 'Question name';
|
||||
$string['questionnametoolong'] = 'Question name too long at line {$a} (255 char. max). It has been truncated.';
|
||||
$string['questionno'] = 'Question {$a}';
|
||||
$string['questionnonav'] = '<span class=\"accesshide\">Question </span>{$a->number}<span class=\"accesshide\"> {$a->attributes}</span>';
|
||||
$string['questionnonavinfo'] = '<span class=\"accesshide\">Information </span>{$a->number}<span class=\"accesshide\"> {$a->attributes}</span>';
|
||||
$string['questionnotloaded'] = 'Question {$a} has not been loaded from the database';
|
||||
$string['questionorder'] = 'Question order';
|
||||
$string['questions'] = 'Questions';
|
||||
@ -646,6 +609,8 @@ $string['quiz:manageoverrides'] = 'Manage quiz overrides';
|
||||
$string['quiznavigation'] = 'Quiz navigation';
|
||||
$string['quiznotavailable'] = 'The quiz will not be available until {$a}';
|
||||
$string['quizopen'] = 'Open the quiz';
|
||||
$string['quizopenclose'] = 'Open and close dates';
|
||||
$string['quizopenclose_help'] = 'Students can only start their attempt(s) after the open time and they must complete their attempts before the close time.';
|
||||
$string['quizopened'] = 'This quiz is open.';
|
||||
$string['quizopenedon'] = 'This quiz opened at {$a}';
|
||||
$string['quizopens'] = 'Quiz opens';
|
||||
@ -659,6 +624,7 @@ $string['quizsettings'] = 'Quiz settings';
|
||||
$string['quiztimelimit'] = 'Time limit: {$a}';
|
||||
$string['quiz:view'] = 'View quiz information';
|
||||
$string['quiz:viewreports'] = 'View quiz reports';
|
||||
$string['quiztimer'] = 'Quiz Timer';
|
||||
$string['quizwillopen'] = 'This quiz will open {$a}';
|
||||
$string['random'] = 'Random question';
|
||||
$string['randomcreate'] = 'Create random questions';
|
||||
@ -666,10 +632,6 @@ $string['randomfromcategory'] = 'Random question from category:';
|
||||
$string['randomfromexistingcategory'] = 'Random question from an existing category';
|
||||
$string['randomnosubcat'] = 'Questions from this category only, not its subcategories.';
|
||||
$string['randomquestionusinganewcategory'] = 'Random question using a new category';
|
||||
$string['randomsamatch'] = 'Random short-answer matching';
|
||||
$string['randomsamatchcreate'] = 'Create random short-answer matching questions';
|
||||
$string['randomsamatchintro'] = 'For each of the following questions, select the matching answer from the menu.';
|
||||
$string['randomsamatchnumber'] = 'Number of questions to select';
|
||||
$string['randomwithsubcat'] = 'Questions from this category and its subcategories.';
|
||||
$string['readytosend'] = 'You are about to send your whole quiz to be graded. Are you sure you want to continue?';
|
||||
$string['reattemptquiz'] = 'Re-attempt quiz';
|
||||
@ -725,6 +687,7 @@ $string['reviewalways'] = 'Allow review at any time';
|
||||
$string['reviewattempt'] = 'Review attempt';
|
||||
$string['reviewbefore'] = 'Allow review while quiz is open';
|
||||
$string['reviewclosed'] = 'After the quiz is closed';
|
||||
$string['reviewduring'] = 'During the attempt';
|
||||
$string['reviewimmediately'] = 'Immediately after the attempt';
|
||||
$string['reviewnever'] = 'Never allow review';
|
||||
$string['reviewofattempt'] = 'Review of attempt {$a}';
|
||||
@ -752,6 +715,9 @@ $string['savemyanswers'] = 'Save my answers';
|
||||
$string['savenosubmit'] = 'Save without submitting';
|
||||
$string['saveoverrideandstay'] = 'Save and enter another override';
|
||||
$string['savequiz'] = 'Save this whole quiz';
|
||||
$string['saving'] = 'Saving';
|
||||
$string['savingnewgradeforquestion'] = 'Saving new grade for question id $a.';
|
||||
$string['savingnewmaximumgrade'] = 'Saving new maximum grade.';
|
||||
$string['score'] = 'Raw score';
|
||||
$string['scores'] = 'Scores';
|
||||
$string['select'] = 'Select';
|
||||
@ -764,7 +730,6 @@ $string['selectquestiontype'] = '-- Select question type --';
|
||||
$string['serveradded'] = 'Server added';
|
||||
$string['serveridentifier'] = 'Identifier';
|
||||
$string['serverinfo'] = 'Server information';
|
||||
$string['serverinuse'] = 'The server that you are about to delete is the last {$a} server and there are already questions which will not work any more if you delete this server.';
|
||||
$string['servers'] = 'Servers';
|
||||
$string['serverurl'] = 'Server URL';
|
||||
$string['settingsoverrides'] = 'Settings overrides';
|
||||
@ -817,6 +782,7 @@ $string['substitutedby'] = 'will be substituted by';
|
||||
$string['summaryofattempt'] = 'Summary of attempt';
|
||||
$string['summaryofattempts'] = 'Summary of your previous attempts';
|
||||
$string['temporaryblocked'] = 'You are temporarily not allowed to re-attempt the quiz.<br /> You will be able to take another attempt on:';
|
||||
$string['theattempt'] = 'The attempt';
|
||||
$string['time'] = 'Time';
|
||||
$string['timecompleted'] = 'Completed';
|
||||
$string['timedelay'] = 'You are not allowed to do the quiz since you have not passed the time delay before attempting another quiz';
|
||||
@ -848,6 +814,9 @@ $string['unknowntype'] = 'Question type not supported at line {$a}. The question
|
||||
$string['unsupportedformulafunction'] = 'The function {$a} is not supported';
|
||||
$string['unusedcategorydeleted'] = 'This category has been deleted because, after deleting the course, its questions weren\'t used any more.';
|
||||
$string['updatesettings'] = 'Update quiz settings';
|
||||
$string['updatingatttemptgrades'] = 'Updating attempt grades.';
|
||||
$string['updatingfinalgrades'] = 'Updating final grades.';
|
||||
$string['updatingthegradebook'] = 'Updating the gradebook.';
|
||||
$string['upgradesure'] = '<div>In particular the quiz module will perform an extensive change of the quiz tables and this upgrade has not yet been sufficiently tested. You are very strongly urged to backup your database tables before proceeding.</div>';
|
||||
$string['url'] = 'URL';
|
||||
$string['usedcategorymoved'] = 'This category has been preserved and moved to the site level because it is a published category still in use by other courses.';
|
||||
@ -876,8 +845,3 @@ $string['youmustwait'] = 'You must wait before you may re-attempt this quiz. You
|
||||
$string['youneedtoenrol'] = 'You need to enrol in this course before you can attempt this quiz';
|
||||
$string['yourfinalgradeis'] = 'Your final grade for this quiz is {$a}.';
|
||||
$string['zerosignificantfiguresnotallowed'] = 'The correct answer cannot have zero significant figures!';
|
||||
$string['1day'] = '1 Day';
|
||||
$string['1hour'] = '1 Hour';
|
||||
$string['2hours'] = '2 Hours';
|
||||
$string['30minutes'] = '30 Minutes';
|
||||
$string['6hours'] = '6 Hours';
|
||||
|
@ -99,7 +99,7 @@ function quiz_update_instance($quiz, $mform) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
$oldquiz = get_record('quiz', 'id', $quiz->instance);
|
||||
$oldquiz = $DB->get_record('quiz', array('id' => $quiz->instance));
|
||||
|
||||
// Repaginate, if asked to.
|
||||
if (!$quiz->shufflequestions && !empty($quiz->repaginatenow)) {
|
||||
|
@ -43,7 +43,7 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
protected $_feedbacks;
|
||||
protected static $reviewfields = array(); // Initialised in the constructor.
|
||||
|
||||
public function __construct($instance, $section, $cm) {
|
||||
public function __construct($current, $section, $cm, $course) {
|
||||
self::$reviewfields = array(
|
||||
'attempt' => get_string('theattempt', 'quiz'),
|
||||
'correctness' => get_string('whethercorrect', 'question'),
|
||||
@ -53,7 +53,7 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
'rightanswer' => get_string('rightanswer', 'question'),
|
||||
'overallfeedback' => get_string('overallfeedback', 'quiz'),
|
||||
);
|
||||
parent::__construct($instance, $section, $cm);
|
||||
parent::__construct($current, $section, $cm, $course);
|
||||
}
|
||||
|
||||
function definition() {
|
||||
@ -80,11 +80,10 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
/// Open and close dates.
|
||||
$mform->addElement('date_time_selector', 'timeopen', get_string('quizopen', 'quiz'),
|
||||
array('optional' => true, 'step' => 1));
|
||||
$mform->addHelpButton('timeopen', 'quiz');
|
||||
$mform->addHelpButton('timeopen', 'quizopenclose', 'quiz');
|
||||
|
||||
$mform->addElement('date_time_selector', 'timeclose', get_string('quizclose', 'quiz'),
|
||||
array('optional' => true, 'step' => 1));
|
||||
$mform->addHelpButton('timeclose', 'quiz');
|
||||
|
||||
/// Time limit.
|
||||
$mform->addElement('duration', 'timelimit', get_string('timelimit', 'quiz'), array('optional' => true));
|
||||
@ -150,16 +149,14 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
$mform->setDefault('shuffleanswers', $quizconfig->shuffleanswers);
|
||||
|
||||
/// How questions behave (question behaviour).
|
||||
if (!empty($this->_instance)) {
|
||||
// This is a nasty hack, but I can't think of a good way to get the
|
||||
// current value of $quiz->preferredbehaviour here.
|
||||
$currentbehaviour = get_field('quiz', 'preferredbehaviour', 'id', $this->_instance);
|
||||
if (!empty($this->current->preferredbehaviour)) {
|
||||
$currentbehaviour = $this->current->preferredbehaviour;
|
||||
} else {
|
||||
$currentbehaviour = '';
|
||||
}
|
||||
$behaviours = question_engine::get_behaviour_options($currentbehaviour);
|
||||
$mform->addElement('select', 'preferredbehaviour', get_string('howquestionsbehave', 'question'), $behaviours);
|
||||
$mform->setHelpButton('preferredbehaviour', array('howquestionsbehave', get_string('howquestionsbehave','question'), 'question'));
|
||||
$mform->addHelpButton('preferredbehaviour', 'howquestionsbehave', 'question');
|
||||
$mform->setAdvanced('preferredbehaviour', $CFG->quiz_fix_preferredbehaviour);
|
||||
$mform->setDefault('preferredbehaviour', $CFG->quiz_preferredbehaviour);
|
||||
|
||||
@ -277,11 +274,11 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
|
||||
$mform->addElement('hidden', 'grade', $quizconfig->maximumgrade);
|
||||
$mform->setType('grade', PARAM_RAW);
|
||||
if (empty($this->_cm)) {
|
||||
$needwarning = $quizconfig->maximumgrade == 0;
|
||||
|
||||
if (isset($this->current->grade)) {
|
||||
$needwarning = $this->current->grade === 0;
|
||||
} else {
|
||||
$quizgrade = $DB->get_field('quiz', 'grade', array('id' => $this->_instance));
|
||||
$needwarning = $quizgrade == 0;
|
||||
$needwarning = $quizconfig->maximumgrade == 0;
|
||||
}
|
||||
if ($needwarning) {
|
||||
$mform->addElement('static', 'nogradewarning', '', get_string('nogradewarning', 'quiz'));
|
||||
|
@ -361,7 +361,7 @@ function quiz_report_list($context) {
|
||||
if (!is_null($reportlist)){
|
||||
return $reportlist;
|
||||
}
|
||||
$reports = $DB->get_records('quiz_report', null, 'displayorder DESC', 'name, capability');
|
||||
$reports = $DB->get_records('quiz_reports', null, 'displayorder DESC', 'name, capability');
|
||||
$reportdirs = get_plugin_list('quiz');
|
||||
|
||||
// Order the reports tab in descending order of displayorder
|
||||
|
@ -11,6 +11,6 @@ function xmldb_quiz_statistics_install() {
|
||||
$record->displayorder = 8000;
|
||||
$record->cron = 18000;
|
||||
$record->capability = 'quizreport/statistics:view';
|
||||
$DB->insert_record('quiz_report', $record);
|
||||
$DB->insert_record('quiz_reports', $record);
|
||||
|
||||
}
|
@ -72,8 +72,8 @@ DONE mod/quiz/attempt_close_js.php | 27 -
|
||||
mod/quiz/backuplib.php | 16 +-
|
||||
mod/quiz/comment.php | 171 +-
|
||||
mod/quiz/config.html | 304 ++-
|
||||
mod/quiz/db/access.php | 19 +-
|
||||
mod/quiz/db/install.xml | 191 +-
|
||||
DONE mod/quiz/db/access.php | 19 +-
|
||||
DONE mod/quiz/db/install.xml | 191 +-
|
||||
DONE mod/quiz/db/mysql.php | 1163 --------
|
||||
DONE mod/quiz/db/postgres7.php | 1497 ----------
|
||||
DONE mod/quiz/db/upgrade.php | 1204 ++++++++-
|
||||
@ -82,26 +82,26 @@ DONE mod/quiz/defaults.php | 12 +-
|
||||
mod/quiz/edit.php | 118 +-
|
||||
mod/quiz/editlib.php | 79 +-
|
||||
mod/quiz/index.php | 6 +-
|
||||
mod/quiz/jstimer.php | 58 -
|
||||
DONE mod/quiz/jstimer.php | 58 -
|
||||
DONE mod/quiz/lib.php | 454 ++--
|
||||
DONE mod/quiz/locallib.php | 848 +++++--
|
||||
DONE mod/quiz/mod_form.php | 475 ++--
|
||||
mod/quiz/pix/de.gif | Bin 117 -> 0 bytes
|
||||
mod/quiz/pix/ma.gif | Bin 201 -> 0 bytes
|
||||
mod/quiz/pix/mc.gif | Bin 214 -> 0 bytes
|
||||
mod/quiz/pix/mu.gif | Bin 183 -> 0 bytes
|
||||
mod/quiz/pix/nu.gif | Bin 84 -> 0 bytes
|
||||
mod/quiz/pix/rm.gif | Bin 204 -> 0 bytes
|
||||
mod/quiz/pix/rs.gif | Bin 143 -> 0 bytes
|
||||
mod/quiz/pix/sa.gif | Bin 74 -> 0 bytes
|
||||
mod/quiz/pix/tf.gif | Bin 190 -> 0 bytes
|
||||
DONE mod/quiz/pix/de.gif | Bin 117 -> 0 bytes
|
||||
DONE mod/quiz/pix/ma.gif | Bin 201 -> 0 bytes
|
||||
DONE mod/quiz/pix/mc.gif | Bin 214 -> 0 bytes
|
||||
DONE mod/quiz/pix/mu.gif | Bin 183 -> 0 bytes
|
||||
DONE mod/quiz/pix/nu.gif | Bin 84 -> 0 bytes
|
||||
DONE mod/quiz/pix/rm.gif | Bin 204 -> 0 bytes
|
||||
DONE mod/quiz/pix/rs.gif | Bin 143 -> 0 bytes
|
||||
DONE mod/quiz/pix/sa.gif | Bin 74 -> 0 bytes
|
||||
DONE mod/quiz/pix/tf.gif | Bin 190 -> 0 bytes
|
||||
mod/quiz/processattempt.php | 126 +
|
||||
DONE mod/quiz/protect_js.php | 56 -
|
||||
mod/quiz/quiz.js | 355 ++-
|
||||
mod/quiz/restorelib.php | 113 +-
|
||||
mod/quiz/restorelibpre15.php | 41 +-
|
||||
mod/quiz/review.php | 520 ++--
|
||||
mod/quiz/reviewoptions.html | 124 +-
|
||||
DONE mod/quiz/reviewoptions.html | 124 +-
|
||||
mod/quiz/reviewquestion.php | 267 +-
|
||||
mod/quiz/simpletest/testaccessrules.php | 518 ++++
|
||||
mod/quiz/simpletest/testlib.php | 58 +
|
||||
@ -110,8 +110,8 @@ DONE mod/quiz/protect_js.php | 56 -
|
||||
mod/quiz/startattempt.php | 189 ++
|
||||
mod/quiz/styles.php | 28 +
|
||||
mod/quiz/summary.php | 154 ++
|
||||
mod/quiz/tabs.php | 70 +-
|
||||
mod/quiz/version.php | 6 +-
|
||||
DONE mod/quiz/tabs.php | 70 +-
|
||||
DONE mod/quiz/version.php | 6 +-
|
||||
mod/quiz/view.php | 773 +++---
|
||||
|
||||
mod/quiz/report.php | 161 +-
|
||||
|
Loading…
x
Reference in New Issue
Block a user