more globals fixed

This commit is contained in:
Petr Skoda 2010-09-18 13:07:45 +00:00
parent 4f96fe55af
commit df0442c67e
4 changed files with 5 additions and 4 deletions

View file

@ -155,12 +155,12 @@ function lesson_delete_course($course, $feedback=true) {
* @return object * @return object
*/ */
function lesson_user_outline($course, $user, $mod, $lesson) { function lesson_user_outline($course, $user, $mod, $lesson) {
global $DB;
global $CFG; global $CFG;
require_once("$CFG->libdir/gradelib.php"); require_once("$CFG->libdir/gradelib.php");
$grades = grade_get_grades($course->id, 'mod', 'lesson', $lesson->id, $user->id); $grades = grade_get_grades($course->id, 'mod', 'lesson', $lesson->id, $user->id);
$return = new object();
if (empty($grades->items[0]->grades)) { if (empty($grades->items[0]->grades)) {
$return->info = get_string("no")." ".get_string("attempts", "lesson"); $return->info = get_string("no")." ".get_string("attempts", "lesson");
} else { } else {

View file

@ -106,6 +106,7 @@ class lesson_page_type_endofcluster extends lesson_page {
return true; return true;
} }
public function override_next_page() { public function override_next_page() {
global $DB;
$jump = $DB->get_field("lesson_answers", "jumpto", array("pageid" => $this->properties->id, "lessonid" => $this->lesson->id)); $jump = $DB->get_field("lesson_answers", "jumpto", array("pageid" => $this->properties->id, "lessonid" => $this->lesson->id));
if ($jump == LESSON_NEXTPAGE) { if ($jump == LESSON_NEXTPAGE) {
if ($this->properties->nextpageid == 0) { if ($this->properties->nextpageid == 0) {

View file

@ -132,7 +132,7 @@ class lesson_page_type_matching extends lesson_page {
} }
public function check_answer() { public function check_answer() {
global $CFG; global $CFG, $PAGE;
$formattextdefoptions = new object(); $formattextdefoptions = new object();
$formattextdefoptions->noclean = true; $formattextdefoptions->noclean = true;

View file

@ -99,7 +99,7 @@ class lesson_page_type_multichoice extends lesson_page {
} }
public function check_answer() { public function check_answer() {
global $DB, $CFG; global $DB, $CFG, $PAGE;
$result = parent::check_answer(); $result = parent::check_answer();
$formattextdefoptions = new object(); $formattextdefoptions = new object();