From fff79722e59f79a37d5ecbbd6151eabb7a11b2bd Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 20 Aug 2003 07:32:24 +0000 Subject: [PATCH] A new course field called "showgrades" which allows the teacher to turn the display of the grade book on and off. --- backup/backuplib.php | 1 + backup/restorelib.php | 4 ++++ course/edit.html | 12 +++++++++++- course/lib.php | 8 +++++--- lang/en/help/coursegrades.html | 14 ++++++++++++++ lang/en/help/index.html | 1 + lang/en/moodle.php | 2 ++ lib/db/mysql.php | 4 ++++ lib/db/mysql.sql | 1 + lib/db/postgres7.php | 4 ++++ lib/db/postgres7.sql | 1 + version.php | 2 +- 12 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 lang/en/help/coursegrades.html diff --git a/backup/backuplib.php b/backup/backuplib.php index f0cac69d42..252a501b54 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 06227f1572..4eb191c92b 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 53fc0e4c50..512501b4b2 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")); ?> + + + +

: + showgrades, ""); + helpbutton("coursegrades", get_string("grades")); ?> diff --git a/course/lib.php b/course/lib.php index 7bb3fe37ca..f2b820928d 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 0000000000..1e4a70ba9c --- /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 ccc864c48f..a32ff5b4eb 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 11e4c2eed4..64cb6f6f51 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 97e5ddc330..e04e423ff6 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 f5fc2be7d5..b634f7f7cb 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 c06456b3d9..4f4f19c6a7 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 ec58e3d648..1d45f291b3 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 c33877876d..e7d1297e2f 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 -- 2.39.5