diff --git a/backup/backuplib.php b/backup/backuplib.php
index f0cac69d42a..252a501b547 100644
--- a/backup/backuplib.php
+++ b/backup/backuplib.php
@@ -423,6 +423,7 @@
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));
diff --git a/backup/restorelib.php b/backup/restorelib.php
index 06227f1572e..4eb191c92b3 100644
--- a/backup/restorelib.php
+++ b/backup/restorelib.php
@@ -290,6 +290,7 @@
$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);
@@ -1178,6 +1179,9 @@
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;
diff --git a/course/edit.html b/course/edit.html
index 53fc0e4c50d..512501b4b21 100644
--- a/course/edit.html
+++ b/course/edit.html
@@ -114,7 +114,17 @@
$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")); ?>
+
+
+
+ print_string("showgrades") ?>: |
+
+ unset($choices);
+ $choices["0"] = get_string("no");
+ $choices["1"] = get_string("yes");
+ choose_from_menu ($choices, "showgrades", $form->showgrades, "");
+ helpbutton("coursegrades", get_string("grades")); ?>
|
diff --git a/course/lib.php b/course/lib.php
index 7bb3fe37ca3..f2b820928da 100644
--- a/course/lib.php
+++ b/course/lib.php
@@ -791,9 +791,11 @@ function print_course_admin_links($course, $width=180) {
$adminicon[]="
";
}
- } else {
- $admindata[]="id\">".get_string("grades")."...";
- $adminicon[]="
";
+ } else { // Students menu
+ if ($course->usegrades) {
+ $admindata[]="id\">".get_string("grades")."...";
+ $adminicon[]="
";
+ }
}
if (!empty($admindata)) {
diff --git a/lang/en/help/coursegrades.html b/lang/en/help/coursegrades.html
new file mode 100644
index 00000000000..1e4a70ba9ca
--- /dev/null
+++ b/lang/en/help/coursegrades.html
@@ -0,0 +1,14 @@
+Grades
+
+Many of the activities allow grades to be set.
+
+By default, the results of all grades within the
+ course can be seen in the Grades page, available
+ from the main course page.
+
+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.
diff --git a/lang/en/help/index.html b/lang/en/help/index.html
index ccc864c48f9..a32ff5b4eb2 100755
--- a/lang/en/help/index.html
+++ b/lang/en/help/index.html
@@ -23,6 +23,7 @@
Course short name
Course start date
Enrollment keys
+ Grades
Guest access
Recent Activity
Scales
diff --git a/lang/en/moodle.php b/lang/en/moodle.php
index 11e4c2eed45..64cb6f6f511 100644
--- a/lang/en/moodle.php
+++ b/lang/en/moodle.php
@@ -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";
diff --git a/lib/db/mysql.php b/lib/db/mysql.php
index 97e5ddc3303..e04e423ff66 100644
--- a/lib/db/mysql.php
+++ b/lib/db/mysql.php
@@ -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;
}
diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql
index f5fc2be7d5a..b634f7f7cb2 100644
--- a/lib/db/mysql.sql
+++ b/lib/db/mysql.sql
@@ -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',
diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php
index c06456b3d97..4f4f19c6a71 100644
--- a/lib/db/postgres7.php
+++ b/lib/db/postgres7.php
@@ -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;
}
?>
diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql
index ec58e3d648e..1d45f291b37 100644
--- a/lib/db/postgres7.sql
+++ b/lib/db/postgres7.sql
@@ -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',
diff --git a/version.php b/version.php
index c33877876d5..e7d1297e2fd 100644
--- a/version.php
+++ b/version.php
@@ -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