Skip to content
Browse files

Changes to allow much better control over what "teachers" are called

in a course.  Firstly, the course settings page now allows the teachers
to specify the word they want to use in place of "teachers" and "students"
as well as "teacher" and "student".  Secondly, a new teacher admin tool
allows any teacher to modify the order and displayed role of teachers
in that course.  This affects the display on the course listings, the
participants page and so on.
  • Loading branch information...
1 parent 774ab66 commit b4d7002e66802c309ae251cbbfb742005a4adb89 martin committed Sep 8, 2002
Showing with 65 additions and 21 deletions.
  1. +12 −0 course/edit.html
  2. +2 −0 course/edit.php
  3. +21 −11 course/lib.php
  4. +1 −1 course/social.php
  5. +1 −1 course/topics.php
  6. +1 −1 course/weeks.php
  7. +9 −2 lang/en/moodle.php
  8. +4 −1 lib/db/mysql.sql
  9. +1 −1 lib/moodlelib.php
  10. +2 −2 user/index.php
  11. +11 −1 version.php
View
12 course/edit.html
@@ -105,11 +105,23 @@
</td>
</tr>
<tr valign=top>
+ <td><P><? print_string("wordforteachers") ?>:</td>
+ <td><input type="text" name="teachers" size=25 value="<? p($form->teachers) ?>">
+ (<? print_string("wordforteacherseg") ?>) <? formerr($err["teachers"]) ?>
+ </td>
+</tr>
+<tr valign=top>
<td><P><? print_string("wordforstudent") ?>:</td>
<td><input type="text" name="student" size=25 value="<? p($form->student) ?>">
(<? print_string("wordforstudenteg") ?>) <? formerr($err["student"]) ?>
</td>
</tr>
+<tr valign=top>
+ <td><P><? print_string("wordforstudents") ?>:</td>
+ <td><input type="text" name="students" size=25 value="<? p($form->students) ?>">
+ (<? print_string("wordforstudentseg") ?>) <? formerr($err["students"]) ?>
+ </td>
+</tr>
<tr>
<td></td>
<td><input type="submit" value="<? print_string("savechanges") ?>"></td>
View
2 course/edit.php
@@ -84,7 +84,9 @@
$form->fullname = get_string("defaultcoursefullname");
$form->shortname = get_string("defaultcourseshortname");
$form->teacher = get_string("defaultcourseteacher");
+ $form->teachers = get_string("defaultcourseteachers");
$form->student = get_string("defaultcoursestudent");
+ $form->students = get_string("defaultcoursestudents");
$form->summary = get_string("defaultcoursesummary");
$form->format = "weeks";
$form->numsections = 10;
View
32 course/lib.php
@@ -221,7 +221,10 @@ function print_course($course) {
echo "<P><FONT SIZE=1>\n";
foreach ($teachers as $teacher) {
if ($teacher->authority > 0) {
- echo "$course->teacher: <A HREF=\"$CFG->wwwroot/user/view.php?id=$teacher->id&course=$site->id\">$teacher->firstname $teacher->lastname</A><BR>";
+ if (!$teacher->role) {
+ $teacher->role = $course->teacher;
+ }
+ echo "$teacher->role: <A HREF=\"$CFG->wwwroot/user/view.php?id=$teacher->id&course=$site->id\">$teacher->firstname $teacher->lastname</A><BR>";
}
}
echo "</FONT></P>";
@@ -531,28 +534,35 @@ function print_admin_links ($siteid, $width=180) {
echo "<IMG SRC=\"$CFG->wwwroot/pix/spacer.gif\" WIDTH=\"$width\" HEIGHT=1><BR>";
}
-function print_course_admin_links($courseid, $width=180) {
+function print_course_admin_links($course, $width=180) {
global $THEME, $CFG;
echo "<BR>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
- if (isediting($courseid)) {
- $admindata[]="<A HREF=\"view.php?id=$courseid&edit=off\">".get_string("turneditingoff")."</A>";
+ if (isediting($course->id)) {
+ $admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</A>";
} else {
- $admindata[]="<A HREF=\"view.php?id=$courseid&edit=on\">".get_string("turneditingon")."</A>";
+ $admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</A>";
+ }
+ $admindata[]="<A HREF=\"edit.php?id=$course->id\">".get_string("settings")."...</A>";
+ $adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
+ if (!$course->teachers) {
+ $course->teachers = get_string("defaultcourseteachers");
}
- $admindata[]="<A HREF=\"edit.php?id=$courseid\">".get_string("settings")."...</A>";
+ $admindata[]="<A HREF=\"teachers.php?id=$course->id\">$course->teachers...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
- $admindata[]="<A HREF=\"log.php?id=$courseid\">".get_string("logs")."...</A>";
+
+ $admindata[]="<A HREF=\"log.php?id=$course->id\">".get_string("logs")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
- $admindata[]="<A HREF=\"$CFG->wwwroot/files/index.php?id=$courseid\">".get_string("files")."...</A>";
+ $admindata[]="<A HREF=\"$CFG->wwwroot/files/index.php?id=$course->id\">".get_string("files")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
- $admindata[]="<A HREF=\"$CFG->wwwroot/doc/view.php?id=$courseid&file=teacher.html\">".get_string("help")."...</A>";
+ $admindata[]="<A HREF=\"$CFG->wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."...</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/reading/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
- if ($teacherforum = forum_get_course_forum($courseid, "teacher")) {
- $admindata[]="<A HREF=\"$CFG->wwwroot/mod/forum/view.php?f=$teacherforum->id\">".get_string("teacherforum")."</A>";
+
+ if ($teacherforum = forum_get_course_forum($course->id, "teacher")) {
+ $admindata[]="<A HREF=\"$CFG->wwwroot/mod/forum/view.php?f=$teacherforum->id\">".get_string("nameteacher", "forum")."</A>";
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
}
View
2 course/social.php
@@ -51,7 +51,7 @@
// Admin links and controls
if (isteacher($course->id)) {
- print_course_admin_links($course->id);
+ print_course_admin_links($course);
}
echo "</TD>";
View
2 course/topics.php
@@ -79,7 +79,7 @@
// Admin links and controls
if (isteacher($course->id)) {
- print_course_admin_links($course->id);
+ print_course_admin_links($course);
}
// Start main column
View
2 course/weeks.php
@@ -66,7 +66,7 @@
// Admin links and controls
if (isteacher($course->id)) {
- print_course_admin_links($course->id);
+ print_course_admin_links($course);
}
// Start main column
View
11 lang/en/moodle.php
@@ -63,8 +63,10 @@
$string[defaultcoursefullname] = "Course Fullname 101";
$string[defaultcourseshortname] = "CF101";
$string[defaultcoursestudent] = "Student";
+$string[defaultcoursestudents] = "Students";
$string[defaultcoursesummary] = "Write a concise and interesting paragraph here that explains what this course is about";
-$string[defaultcourseteacher] = "Facilitator";
+$string[defaultcourseteacher] = "Teacher";
+$string[defaultcourseteachers] = "Teachers";
$string[delete] = "Delete";
$string[deletecheck] = "Delete \$a ?";
$string[deletecheckfull] = "Are you absolutely sure you want to completely delete \$a ?";
@@ -300,6 +302,7 @@
$string[ok] = "OK";
$string[opentoguests] = "Guest access";
$string[optional] = "optional";
+$string[order] = "Order";
$string[outline] = "Outline";
$string[participants] = "Participants";
$string[password] = "Password";
@@ -326,6 +329,7 @@
$string[returningtosite] = "Returning to this web site?";
$string[requireskey] = "This course requires an enrolment key";
$string[revert] = "Revert";
+$string[role] = "Role";
$string[savechanges] = "Save changes";
$string[search] = "Search";
$string[searchagain] = "Search again";
@@ -360,7 +364,6 @@
$string[summary] = "Summary";
$string[summaryof] = "Summary of \$a";
$string[supplyinfo] = "Please supply some information about yourself";
-$string[teacherforum] = "Teacher forum";
$string[teacheronly] = "for the \$a only";
$string[textformat] = "Plain text format";
$string[timezone] = "Timezone";
@@ -408,8 +411,12 @@
$string[withchosenfiles] = "With chosen files";
$string[wordforteacher] = "Your word for Teacher";
$string[wordforteachereg] = "eg Teacher, Tutor, Facilitator etc";
+$string[wordforteachers] = "Your word for Teachers";
+$string[wordforteacherseg] = "eg Teachers, Tutors, Facilitators etc";
$string[wordforstudent] = "Your word for Student";
$string[wordforstudenteg] = "eg Student, Participant etc";
+$string[wordforstudents] = "Your word for Students";
+$string[wordforstudentseg] = "eg Students, Participants etc";
$string[wrongpassword] = "Incorrect password for this username";
$string[yes] = "Yes";
$string[yourlastlogin] = "Your last login was";
View
5 lib/db/mysql.sql
@@ -37,7 +37,9 @@ CREATE TABLE `course` (
`format` enum('weeks','social','topics') NOT NULL default 'weeks',
`newsitems` smallint(5) unsigned NOT NULL default '1',
`teacher` varchar(100) NOT NULL default 'Teacher',
+ `teachers` varchar(100) NOT NULL default 'Teachers',
`student` varchar(100) NOT NULL default 'Student',
+ `students` varchar(100) NOT NULL default 'Students',
`guest` tinyint(2) unsigned NOT NULL default '0',
`startdate` int(10) unsigned NOT NULL default '0',
`numsections` smallint(5) unsigned NOT NULL default '1',
@@ -214,7 +216,8 @@ CREATE TABLE `user_teachers` (
`id` int(10) unsigned NOT NULL auto_increment,
`user` int(10) unsigned NOT NULL default '0',
`course` int(10) unsigned NOT NULL default '0',
- `authority` tinyint(3) NOT NULL default '3',
+ `authority` int(10) NOT NULL default '3',
+ `role` varchar(40) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) TYPE=MyISAM COMMENT='One record per teacher per course';
View
2 lib/moodlelib.php
@@ -1164,7 +1164,7 @@ function get_course_students($courseid, $sort="u.lastaccess DESC") {
}
function get_course_teachers($courseid, $sort="t.authority ASC") {
- return get_records_sql("SELECT u.*,t.authority FROM user u, user_teachers t
+ return get_records_sql("SELECT u.*,t.authority,t.role FROM user u, user_teachers t
WHERE t.course = '$courseid' AND t.user = u.id
ORDER BY $sort");
}
View
4 user/index.php
@@ -34,7 +34,7 @@
$string->fullprofile = get_string("fullprofile");
if ( $teachers = get_course_teachers($course->id)) {
- echo "<H2 align=center>".$course->teacher."s</H2>";
+ echo "<H2 align=center>$course->teachers</H2>";
foreach ($teachers as $teacher) {
if ($teacher->authority > 0) { // Don't print teachers with no authority
print_user($teacher, $course, $string);
@@ -43,7 +43,7 @@
}
if ($students = get_course_students($course->id)) {
- echo "<H2 align=center>".$course->student."s</H2>";
+ echo "<H2 align=center>$course->students</H2>";
foreach ($students as $student) {
print_user($student, $course, $string);
}
View
12 version.php
@@ -18,7 +18,7 @@
// If there's something it cannot do itself, it
// will tell you what you need to do.
-$version = 2002090501; // The current version is a date (YYYYMMDDXX) where
+$version = 2002090800; // The current version is a date (YYYYMMDDXX) where
// XX is a number that increments during the day
$release = "1.0.4 beta"; // For humans only, not used for the upgrade process
@@ -62,6 +62,16 @@ function upgrade_moodle($oldversion=0) {
execute_sql(" ALTER TABLE `course_sections` CHANGE `summary` `summary` TEXT NOT NULL ");
}
+ if ($oldversion < 2002090701) {
+ execute_sql(" ALTER TABLE `user_teachers` CHANGE `authority` `authority` TINYINT( 10 ) DEFAULT '3' NOT NULL ");
+ execute_sql(" ALTER TABLE `user_teachers` ADD `role` VARCHAR(40) NOT NULL AFTER `authority` ");
+ }
+
+ if ($oldversion < 2002090800) {
+ execute_sql(" ALTER TABLE `course` ADD `teachers` VARCHAR( 100 ) DEFAULT 'Teachers' NOT NULL AFTER `teacher` ");
+ execute_sql(" ALTER TABLE `course` ADD `students` VARCHAR( 100 ) DEFAULT 'Students' NOT NULL AFTER `student` ");
+ }
+
return true;
}

0 comments on commit b4d7002

Please sign in to comment.
Something went wrong with that request. Please try again.