]> git.mjollnir.org Git - moodle.git/commitdiff
A new course field called "showgrades" which allows the teacher to
authormoodler <moodler>
Wed, 20 Aug 2003 07:32:24 +0000 (07:32 +0000)
committermoodler <moodler>
Wed, 20 Aug 2003 07:32:24 +0000 (07:32 +0000)
turn the display of the grade book on and off.

12 files changed:
backup/backuplib.php
backup/restorelib.php
course/edit.html
course/lib.php
lang/en/help/coursegrades.html [new file with mode: 0644]
lang/en/help/index.html
lang/en/moodle.php
lib/db/mysql.php
lib/db/mysql.sql
lib/db/postgres7.php
lib/db/postgres7.sql
version.php

index f0cac69d42af688ae6a71bce5db29ac26281361f..252a501b54756c0e19907ae739607c1fb47c08a2 100644 (file)
             fwrite ($bf,full_tag("SHORTNAME",3,false,$course->shortname));
             fwrite ($bf,full_tag("SUMMARY",3,false,$course->summary));
             fwrite ($bf,full_tag("FORMAT",3,false,$course->format));
+            fwrite ($bf,full_tag("SHOWGRADES",3,false,$course->showgrades));
             fwrite ($bf,full_tag("NEWSITEMS",3,false,$course->newsitems));
             fwrite ($bf,full_tag("TEACHER",3,false,$course->teacher));
             fwrite ($bf,full_tag("TEACHERS",3,false,$course->teachers));
index 06227f1572e72dda95c8d909492c03d24029a1f2..4eb191c92b3a5982764c1623b7370dee834b70a8 100644 (file)
             $course->shortname = addslashes($course_header->course_shortname);
             $course->summary = addslashes($course_header->course_summary);
             $course->format = addslashes($course_header->course_format);
+            $course->showgrades = addslashes($course_header->course_showgrades);
             $course->newsitems = addslashes($course_header->course_newsitems);
             $course->teacher = addslashes($course_header->course_teacher);
             $course->teachers = addslashes($course_header->course_teachers);
                         case "FORMAT":
                             $this->info->course_format = $this->getContents();
                             break;
+                        case "SHOWGRADES":
+                            $this->info->course_showgrades = $this->getContents();
+                            break;
                         case "NEWSITEMS":
                             $this->info->course_newsitems = $this->getContents();
                             break;
index 53fc0e4c50d6ba85520b0ad65048744de72024c7..512501b4b2155559fb89e27941a354ee13e2dc1b 100644 (file)
     $choices["0"] = get_string("no");
     $choices["1"] = get_string("yes");
     choose_from_menu ($choices, "showrecent", $form->showrecent, "");
-    helpbutton("courserecent", get_string("showrecent")); ?>
+    helpbutton("courserecent", get_string("recentactivity")); ?>
+       </td>
+</tr>
+<tr valign=top>
+       <td><P><? print_string("showgrades") ?>:</td>
+       <td><?
+    unset($choices);
+    $choices["0"] = get_string("no");
+    $choices["1"] = get_string("yes");
+    choose_from_menu ($choices, "showgrades", $form->showgrades, "");
+    helpbutton("coursegrades", get_string("grades")); ?>
        </td>
 </tr>
 <tr valign=top>
index 7bb3fe37ca36cad777642e4d2711cd6d9face5cc..f2b820928da366929449ed516dc591ff54b18e88 100644 (file)
@@ -791,9 +791,11 @@ function print_course_admin_links($course, $width=180) {
             $adminicon[]="<img src=\"$modpixpath/forum/icon.gif\" height=16 width=16 alt=\"\">";
         }
 
-    } else {
-        $admindata[]="<a href=\"grade.php?id=$course->id\">".get_string("grades")."...</a>";
-        $adminicon[]="<img src=\"$pixpath/i/grades.gif\" height=16 width=16 alt=\"\">";
+    } else {  // Students menu
+        if ($course->usegrades) {
+            $admindata[]="<a href=\"grade.php?id=$course->id\">".get_string("grades")."...</a>";
+            $adminicon[]="<img src=\"$pixpath/i/grades.gif\" height=16 width=16 alt=\"\">";
+        }
     } 
 
     if (!empty($admindata)) {
diff --git a/lang/en/help/coursegrades.html b/lang/en/help/coursegrades.html
new file mode 100644 (file)
index 0000000..1e4a70b
--- /dev/null
@@ -0,0 +1,14 @@
+<p align="center"><b>Grades</b></p>
+
+<P>Many of the activities allow grades to be set.</p>
+
+<p>By default, the results of all grades within the 
+   course can be seen in the Grades page, available 
+   from the main course page.</p>
+
+<p>If a teacher is not interested in using grades in a 
+   course, or just wants to hide grades from students, 
+   then they can disable the display of grades in the 
+   Course Settings.  This does not prevent individual 
+   activities from using or setting grades, it just 
+   disables the results being displayed to students.</p>
index ccc864c48f9faed53f01105cdf6aa990d7e82a5d..a32ff5b4eb2bfa96c049356f70133b663fd622db 100755 (executable)
@@ -23,6 +23,7 @@
   <li><a href="help.php?file=courseshortname.html">Course short name</a> 
   <li><a href="help.php?file=coursestartdate.html">Course start date</a> 
   <li><a href="help.php?file=enrolmentkey.html">Enrollment keys</a> 
+  <li><a href="help.php?file=coursegrades.html">Grades</a> 
   <li><a href="help.php?file=guestaccess.html">Guest access</a> 
   <li><a href="help.php?file=courserecent.html">Recent Activity</a> 
   <li><a href="help.php?file=scales.html">Scales</a> 
index 11e4c2eed45a0ce7f69d37bf981f7c5806fd2c25..64cb6f6f51156d2b3129be2e163ef8436b1a8681 100644 (file)
@@ -154,6 +154,7 @@ $string['courseinfo'] = "Course info";
 $string['coursefiles'] = "Course files";
 $string['courseformats'] = "Course formats";
 $string['courserestore'] = "Course restore";
+$string['coursegrades'] = "Course grades";
 $string['courses'] = "Courses";
 $string['courseupdates'] = "Course updates";
 $string['create'] = "Create";
@@ -673,6 +674,7 @@ $string['showall'] = "Show all \$a";
 $string['showalltopics'] = "Show all topics";
 $string['showallusers'] = "Show all users";
 $string['showallweeks'] = "Show all weeks";
+$string['showgrades'] = "Show grades";
 $string['showlistofcourses'] = "Show list of courses";
 $string['showonlytopic'] = "Show only topic \$a";
 $string['showonlyweek'] = "Show only week \$a";
index 97e5ddc33035af8642530ee652f18d91aa7fd243..e04e423ff66d2ddbb39639d25242a018c449e1b4 100644 (file)
@@ -490,6 +490,10 @@ function main_upgrade($oldversion=0) {
         table_column("course_categories", "courseorder", "coursecount", "integer", "10", "unsigned", "0");
     }
 
+    if ($oldversion < 2003082001) {
+        table_column("course", "", "showgrades", "integer", "2", "unsigned", "1", "", "format");
+    }
+
     return $result;
 
 }
index f5fc2be7d5a220efc65c7df3497d0c762dcf1b87..b634f7f7cb2cf1f67deaab69bba53ad4cfc11638 100644 (file)
@@ -36,6 +36,7 @@ CREATE TABLE `prefix_course` (
   `shortname` varchar(15) NOT NULL default '',
   `summary` text NOT NULL,
   `format` varchar(10) NOT NULL default 'topics',
+  `showgrades` smallint(2) unsigned NOT NULL default '1',
   `modinfo` text NOT NULL,
   `newsitems` smallint(5) unsigned NOT NULL default '1',
   `teacher` varchar(100) NOT NULL default 'Teacher',
index c06456b3d976a0cc13381190a4f8654db6bdb8c8..4f4f19c6a71f2126df1fccf7fe7645e436439192 100644 (file)
@@ -234,6 +234,10 @@ function main_upgrade($oldversion=0) {
         table_column("course_categories", "courseorder", "coursecount", "integer", "10", "unsigned", "0");
     }
 
+    if ($oldversion < 2003082001) {
+        table_column("course", "", "showgrades", "integer", "2", "unsigned", "1", "", "format");
+    }
+
     return $result;
 }
 ?>    
index ec58e3d648e2699c785b6dc4c353f7686423dc8b..1d45f291b371525e17080e0c6ef09a95afef69b2 100644 (file)
@@ -14,6 +14,7 @@ CREATE TABLE prefix_course (
    shortname varchar(15) NOT NULL default '',
    summary text NOT NULL default '',
    format varchar(10) NOT NULL default 'topics',
+   showgrades integer NOT NULL default '1',
    modinfo text NOT NULL default '',
    newsitems integer NOT NULL default '1',
    teacher varchar(100) NOT NULL default 'Teacher',
index c33877876d5d5c255f32c95e8dca112661b0e1a3..e7d1297e2fdb1ffcfad407cf43ba275e7a7cfb12 100644 (file)
@@ -5,7 +5,7 @@
 // database to determine whether upgrades should
 // be performed (see lib/db/*.php)
 
-$version = 2003082000;   // The current version is a date (YYYYMMDDXX)
+$version = 2003082001;   // The current version is a date (YYYYMMDDXX)
 
 $release = "1.1 Beta";   // User-friendly version number