From 59e5ceaab65eb4af5bae99b5678bad1ca62a4eff Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 11 Jan 2012 15:14:59 +0100 Subject: [PATCH] Minor cosmetic changes + avoid warning PHP message --- .../dashboard/block_session/block_session.class.php | 3 +-- .../dashboard/block_student/block_student.class.php | 11 ++++------- .../block_student_graph/block_student_graph.class.php | 3 +-- .../dashboard/block_teacher/block_teacher.class.php | 4 +--- .../block_teacher_graph/block_teacher_graph.class.php | 4 +--- 5 files changed, 8 insertions(+), 17 deletions(-) mode change 100755 => 100644 plugin/dashboard/block_session/block_session.class.php mode change 100755 => 100644 plugin/dashboard/block_student/block_student.class.php mode change 100755 => 100644 plugin/dashboard/block_student_graph/block_student_graph.class.php mode change 100755 => 100644 plugin/dashboard/block_teacher/block_teacher.class.php mode change 100755 => 100644 plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php diff --git a/plugin/dashboard/block_session/block_session.class.php b/plugin/dashboard/block_session/block_session.class.php old mode 100755 new mode 100644 index 4d2024127a..8d4caa0a63 --- a/plugin/dashboard/block_session/block_session.class.php +++ b/plugin/dashboard/block_session/block_session.class.php @@ -155,5 +155,4 @@ class BlockSession extends Block { return count($this->sessions); } -} -?> +} \ No newline at end of file diff --git a/plugin/dashboard/block_student/block_student.class.php b/plugin/dashboard/block_student/block_student.class.php old mode 100755 new mode 100644 index 606bc41b40..d84435bf28 --- a/plugin/dashboard/block_student/block_student.class.php +++ b/plugin/dashboard/block_student/block_student.class.php @@ -212,12 +212,12 @@ class BlockStudent extends Block { $course_code = $course['code']; $cats = Category::load(null, null, $course_code, null, null, null, false); $scoretotal = array(); - if (isset($cats)) { + if (isset($cats) && isset($cats[0])) { $scoretotal= $cats[0]->calc_score($student_id, $course_code); } if (!empty($scoretotal)) { - $score += $scoretotal[0]; + $score += $scoretotal[0]; $weight += $scoretotal[1]; } } @@ -256,8 +256,5 @@ class BlockStudent extends Block { */ function get_number_of_students() { return count($this->students); - } - -} - -?> \ No newline at end of file + } +} \ No newline at end of file diff --git a/plugin/dashboard/block_student_graph/block_student_graph.class.php b/plugin/dashboard/block_student_graph/block_student_graph.class.php old mode 100755 new mode 100644 index 21fca35497..0c56a5b3a0 --- a/plugin/dashboard/block_student_graph/block_student_graph.class.php +++ b/plugin/dashboard/block_student_graph/block_student_graph.class.php @@ -210,5 +210,4 @@ class BlockStudentGraph extends Block { function get_number_of_students() { return count($this->students); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/plugin/dashboard/block_teacher/block_teacher.class.php b/plugin/dashboard/block_teacher/block_teacher.class.php old mode 100755 new mode 100644 index 20ac690878..4f1b9ff8c5 --- a/plugin/dashboard/block_teacher/block_teacher.class.php +++ b/plugin/dashboard/block_teacher/block_teacher.class.php @@ -215,6 +215,4 @@ class BlockTeacher extends Block { return count($this->teachers); } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php b/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php old mode 100755 new mode 100644 index 4fa10f05b9..3ca707efd7 --- a/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php +++ b/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php @@ -197,6 +197,4 @@ class BlockTeacherGraph extends Block { return count($this->teachers); } -} - -?> +} \ No newline at end of file