mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 16:13:28 +02:00
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.
This commit is contained in:
parent
774ab66002
commit
b4d7002e66
11 changed files with 65 additions and 21 deletions
|
@ -104,12 +104,24 @@
|
|||
(<? print_string("wordforteachereg") ?>) <? formerr($err["teacher"]) ?>
|
||||
</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>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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=$courseid\">".get_string("settings")."...</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=\"\">";
|
||||
$admindata[]="<A HREF=\"log.php?id=$courseid\">".get_string("logs")."...</A>";
|
||||
if (!$course->teachers) {
|
||||
$course->teachers = get_string("defaultcourseteachers");
|
||||
}
|
||||
$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=$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=\"\">";
|
||||
}
|
||||
|
||||
|
|
|
@ -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>";
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -63,8 +63,10 @@ $string[databaseupgrades] = "Upgrading database";
|
|||
$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[numviews] = "\$a views";
|
|||
$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[resources] = "Resources";
|
|||
$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[success] = "Success";
|
|||
$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 @@ within the course so that we can learn more about you:
|
|||
$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";
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
12
version.php
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue