split quiz lib.php into a locallib.php for functions that are only used from within the quiz module and a much smaller lib.php for functions that are used from elsewhere in Moodle.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// This page prints a particular instance of quiz
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("locallib.php");
|
||||
|
||||
optional_variable($id); // Course Module ID, or
|
||||
optional_variable($q); // quiz ID
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Allows a teacher to create, edit and delete categories
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("locallib.php");
|
||||
|
||||
require_variable($id); // course
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<?php // $Id$
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("locallib.php");
|
||||
|
||||
require_login();
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Import quiz questions into the given category
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("locallib.php");
|
||||
|
||||
require_variable($category);
|
||||
optional_variable($format);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Import quiz questions into the given category
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("locallib.php");
|
||||
|
||||
require_variable($category);
|
||||
optional_variable($format);
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
// This page lists all the instances of quiz in a particular course
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("locallib.php");
|
||||
|
||||
require_variable($id); // course
|
||||
|
||||
|
||||
-1904
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -31,7 +31,7 @@
|
||||
</script>
|
||||
|
||||
<?php
|
||||
require_once("$CFG->dirroot/mod/quiz/lib.php");
|
||||
require_once("$CFG->dirroot/mod/quiz/locallib.php");
|
||||
// Ensure that all form variables are initialized
|
||||
if (!isset($form->name)) {
|
||||
$form->name = "";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// A quick way to add lots of questions to a category (and a quiz)
|
||||
|
||||
require_once('../../config.php');
|
||||
require_once('lib.php');
|
||||
require_once('locallib.php');
|
||||
|
||||
require_variable($category);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php // $Id$
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("locallib.php");
|
||||
|
||||
require_variable($id); // question id
|
||||
optional_variable($quizid, 0);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/// For creating and editing quiz questions.
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("locallib.php");
|
||||
require_once("../../files/mimetypes.php");
|
||||
|
||||
optional_variable($id); // question id
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
require_once('../../config.php');
|
||||
require_once('../../files/mimetypes.php');
|
||||
require_once('lib.php');
|
||||
require_once('locallib.php');
|
||||
|
||||
if (empty($CFG->filelifetime)) {
|
||||
$lifetime = 86400; // Seconds for files to remain in caches
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
// This script uses installed report plugins to print quiz reports
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("locallib.php");
|
||||
|
||||
optional_variable($id); // Course Module ID, or
|
||||
optional_variable($q); // quiz ID
|
||||
|
||||
+6
-1
@@ -3,7 +3,7 @@
|
||||
// This page prints a review of a particular quiz attempt
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("locallib.php");
|
||||
|
||||
optional_variable($id); // Course Module ID, or
|
||||
optional_variable($q); // quiz ID
|
||||
@@ -113,6 +113,11 @@
|
||||
}
|
||||
|
||||
$table->align = array("right", "left");
|
||||
if ($attempt->userid <> $USER->id) {
|
||||
$student = get_record('user', 'id', $attempt->userid);
|
||||
$picture = print_user_picture($student->id, $course->id, $student->picture, false, true);
|
||||
$table->data[] = array($picture, fullname($student, true));
|
||||
}
|
||||
$table->data[] = array("$strtimetaken:", $timetaken);
|
||||
$table->data[] = array("$strtimecompleted:", userdate($attempt->timefinish));
|
||||
if (!empty($overtime)) {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
// This page prints a particular instance of quiz
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("locallib.php");
|
||||
|
||||
optional_variable($id); // Course Module ID, or
|
||||
optional_variable($q); // quiz ID
|
||||
|
||||
Reference in New Issue
Block a user