]> git.mjollnir.org Git - moodle.git/commitdiff
Adding a stub to start copying the report GUI into
authormoodler <moodler>
Tue, 12 Jun 2007 09:31:19 +0000 (09:31 +0000)
committermoodler <moodler>
Tue, 12 Jun 2007 09:31:19 +0000 (09:31 +0000)
grade/index.php
grade/report.php [new file with mode: 0644]

index a93069997a05d1dbe9e7db2dad900a0f7e589f20..aa585fb18c8bb9df95a364afcb187da376789a8d 100644 (file)
@@ -5,7 +5,6 @@
     $id       = required_param('id');              // course id
     $download = optional_param('download');
     $user     = optional_param('user', -1);
-    $group    = optional_param('group', -1);
     $action   = optional_param('action', 'grades');
     $cview    = optional_param('cview', -1);
 
     }
 
     require_login($course->id);
-    
-    /* 
-    if (has_capability('moodle/site:accessallgroups', get_context_instance(CONTEXT_COURSE, $course->id))) {
-        $group = get_and_set_current_group($course, $course->groupmode, $group);
-    } else {
-        $group = get_current_group($course->id);
-    }
-    */
-   
+
     // if the user set new prefs make sure they happen now
     if ($action == 'set_grade_preferences' && $prefs = data_submitted()) {
         if (!confirm_sesskey()) {
     }
 
     print_header($course->shortname.': '.get_string('grades'), $course->fullname, grade_nav($course, $action));
-    
-    grade_preferences_menu($action, $course, $group);
-
-    /// copied code from assignment module, if this is not the way to do this please change it
-    /// the above code does not work
-    /// set_and_print_groups() is not fully implemented as function groups_instance_print_grouping_selector()
-    /// and function groups_instance_print_group_selector() are missing. 
-    $context = get_context_instance(CONTEXT_COURSE, $course->id);
-    $changegroup = optional_param('group', -1, PARAM_INT);   // choose the current group
+
+    print_heading('This old gradebook may not work properly.  See the <a href="report.php?id='.$course->id.'">new 1.9 gradebook</a>');
+
+    /// find out current groups mode
     $groupmode = groupmode($course);
-    $currentgroup = get_and_set_current_group($course, $groupmode, $changegroup);   
-    
-    /// Now we need a menu for separategroups as well!
-    if ($groupmode == VISIBLEGROUPS || ($groupmode
-        && has_capability('moodle/site:accessallgroups', $context))) {
-        
-        //the following query really needs to change
-        if ($groups = groups_get_groups_names($course->id)) { //TODO:
-            print_box_start('groupmenu');
-            print_group_menu($groups, $groupmode, $currentgroup, 'index.php?id='.$course->id);
-            print_box_end(); // groupmenu
-        }
-    }
+    $currentgroup = setup_and_print_groups($course, $groupmode, 'index.php?id=' . $course->id);
+    echo '<div class="clearer"></div>';
+
+    grade_preferences_menu($action, $course);
 
     grade_set_uncategorized();
 
diff --git a/grade/report.php b/grade/report.php
new file mode 100644 (file)
index 0000000..34a97db
--- /dev/null
@@ -0,0 +1,53 @@
+<?php // $Id$
+
+///////////////////////////////////////////////////////////////////////////
+// NOTICE OF COPYRIGHT                                                   //
+//                                                                       //
+// Moodle - Modular Object-Oriented Dynamic Learning Environment         //
+//          http://moodle.org                                            //
+//                                                                       //
+// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //
+//                                                                       //
+// This program 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 2 of the License, or     //
+// (at your option) any later version.                                   //
+//                                                                       //
+// This program 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:                          //
+//                                                                       //
+//          http://www.gnu.org/copyleft/gpl.html                         //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+
+    require_once("../config.php");
+    require_once("../lib/gradelib.php");
+
+    $id       = required_param('id');              // course id
+    $report   = optional_param('report', '', PARAM_FILE);              // course id
+
+    if (!$course = get_record('course', 'id', $id)) {
+        errorcode('nocourseid');
+    }
+
+    require_login($course->id);
+
+    $strgrades = get_string('grades');
+
+    $crumbs[] = array('name' => $strgrades, 'link' => "view.php?f=$forum->id", 'type' => 'misc');
+    
+    $navigation = build_navigation($crumbs);
+    
+    print_header_simple($strgrades, "", $navigation, "", "", true, '', navmenu($course));
+
+
+    print_heading('New interface under construction');
+
+    
+    print_footer($course);
+
+
+?>