]> git.mjollnir.org Git - moodle.git/commitdiff
cleanup: MDL-17083 Remove the old teacher, teachers, student and students columns...
authortjhunt <tjhunt>
Thu, 13 Nov 2008 08:40:57 +0000 (08:40 +0000)
committertjhunt <tjhunt>
Thu, 13 Nov 2008 08:40:57 +0000 (08:40 +0000)
For something that has been deprecated for over two years, they were still used in a lot of places!

51 files changed:
admin/cliupgrade.php
backup/backup_form.html
backup/backup_scheduled.php
backup/backuplib.php
backup/restore_form.html
backup/restorelib.php
blocks/quiz_results/block_quiz_results.php
course/category.php
course/edit_form.php
course/format/topics/format.php
course/format/weeks/format.php
course/pending.php
enrol/database/enrol.php
enrol/database/enrol_database_sync.php
enrol/imsenterprise/enrol.php
enrol/ldap/config.html
enrol/ldap/enrol.php
enrol/ldap/enrol_ldap_sync.php
enrol/manual/enrol.php
enrol/paypal/return.php
lang/en_utf8/glossary.php
lang/en_utf8/lesson.php
lang/en_utf8/moodle.php
lang/en_utf8/resource.php
lib/adminlib.php
lib/datalib.php
lib/db/install.xml
lib/db/upgrade.php
lib/weblib.php
mod/assignment/lib.php
mod/assignment/type/upload/assignment.class.php
mod/glossary/mod_form.php
mod/lesson/essay.php
mod/lesson/highscores.php
mod/lesson/locallib.php
mod/lesson/mod_form.php
mod/lesson/report.php
mod/lesson/tabs.php
mod/lesson/view.php
mod/quiz/report/overview/overviewgraph.php
mod/quiz/report/overview/overviewsettings_form.php
mod/quiz/report/overview/report.php
mod/quiz/report/responses/responsessettings_form.php
mod/resource/type/file/resource.class.php
mod/resource/type/repository/resource.class.php
mod/survey/graph.php
mod/survey/report.php
mod/wiki/index.php
user/message.html
user/messageselect.php
version.php

index 2a819321c87998b4766ff401f11f890e3c466092..67cabe740a302d0439a61c0d5a22719716542514 100644 (file)
@@ -1132,10 +1132,6 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) {
         $newsite->numsections = 0;
         $newsite->category = 0;
         $newsite->format = 'site';  // Only for this course
-        $newsite->teacher = get_string("defaultcourseteacher");
-        $newsite->teachers = get_string("defaultcourseteachers");
-        $newsite->student = get_string("defaultcoursestudent");
-        $newsite->students = get_string("defaultcoursestudents");
         $newsite->timemodified = time();
 
         if ($newid = $DB->insert_record('course', $newsite)) {
index 17bc085567e7844b2ce3f95375c19aa2bd7f5bb6..b94e15f1505951aec4936446c2bfafa0ba1eda40 100644 (file)
@@ -332,7 +332,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
         echo "<td align=\"right\" valign=\"top\" colspan=\"2\"><b>";
         echo get_string("backuproleassignments");
         echo "</b></td><td colspan=\"2\">";
-        $roles = $DB->get_records('role', null, 'sortorder');
+        $roles = get_all_roles();
         foreach ($roles as $role) {
             print_checkbox('backupassignments_' . $role->shortname, 1, true, strip_tags(format_string($role->name, true)));
             echo "<br />";
index f339b2cccec046744d788aaca428fcda04c864da..00c5ba5013355584182c453bef19d9b3e7fe2e6c 100644 (file)
@@ -471,7 +471,7 @@ function schedule_backup_course_configure($course,$starttime = 0) {
         $preferences->keep_name = $keep_name;
 
         //Roleasignments
-        $roles = $DB->get_records('role', null, 'sortorder');
+        $roles = get_all_roles();
         foreach ($roles as $role) {
             $preferences->backuproleassignments[$role->id] = $role;
         }
index d82e8f5e706a9f527ef23af77b7f166c642e28bb..4d97673565b2f7a0923ed8b8b472f568d102e157 100644 (file)
             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));
-            fwrite ($bf,full_tag("STUDENT",3,false,$course->student));
-            fwrite ($bf,full_tag("STUDENTS",3,false,$course->students));
             fwrite ($bf,full_tag("GUEST",3,false,$course->guest));
             fwrite ($bf,full_tag("STARTDATE",3,false,$course->startdate));
             fwrite ($bf,full_tag("NUMSECTIONS",3,false,$course->numsections));
         $preferences->backup_name = required_param('backup_name',PARAM_FILE);
         $preferences->backup_unique_code =  required_param('backup_unique_code');
 
-        $roles = $DB->get_records('role', null, 'sortorder');
+        $roles = get_all_roles();
         $preferences->backuproleassignments = array();
         foreach ($roles as $role) {
             if (optional_param('backupassignments_' . $role->shortname, 0, PARAM_INT)) {
index 11b998123d2525d84f40f2dfbb738781a86ee2db..7bedead23213fd6ccee70faa433b431af45ce5ac 100644 (file)
@@ -602,7 +602,7 @@ $info = restore_read_xml_info($xml_file);
 
 // fix for MDL-9068, front page course is just a normal course
 $siterolesarray = get_assignable_roles(get_context_instance(CONTEXT_COURSE, $course->id), ROLENAME_ORIGINALANDSHORT);
-$allroles = $DB->get_records('role');
+$allroles = get_all_roles();
 
 echo ('<table width="100%" class="restore-form-instances">');
 echo ('<tr><td align="right" style="width:50%"><b>'.get_string('sourcerole').'</b></td><td align="left" style="width:50%"><b>'.get_string('targetrole').'</b></td></tr>');
index f254d56487f054e569ec2122b074bf9b3988e157..bba9419cfbd0f68313cc61f5846b45c34285a93e 100644 (file)
@@ -708,10 +708,6 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
             $course->format = $course_header->course_format;
             $course->showgrades = $course_header->course_showgrades;
             $course->newsitems = $course_header->course_newsitems;
-            $course->teacher = $course_header->course_teacher;
-            $course->teachers = $course_header->course_teachers;
-            $course->student = $course_header->course_student;
-            $course->students = $course_header->course_students;
             $course->guest = $course_header->course_guest;
             $course->startdate = $course_header->course_startdate;
             $course->startdate += $restore->course_startdateoffset;
@@ -5156,18 +5152,6 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
                         case "NEWSITEMS":
                             $this->info->course_newsitems = $this->getContents();
                             break;
-                        case "TEACHER":
-                            $this->info->course_teacher = $this->getContents();
-                            break;
-                        case "TEACHERS":
-                            $this->info->course_teachers = $this->getContents();
-                            break;
-                        case "STUDENT":
-                            $this->info->course_student = $this->getContents();
-                            break;
-                        case "STUDENTS":
-                            $this->info->course_students = $this->getContents();
-                            break;
                         case "GUEST":
                             $this->info->course_guest = $this->getContents();
                             break;
index 9a44636cc93fb23f92c04518e537f290e3855341..ae1d403b46317c5ce491ff6cb92a71754768ee1c 100644 (file)
@@ -330,10 +330,10 @@ class block_quiz_results extends block_base {
                 foreach($best as $userid => $gradeid) {
                     switch($nameformat) {
                         case B_QUIZRESULTS_NAME_FORMAT_ID:
-                            $thisname = $course->student.' '.intval($users[$userid]->idnumber);
+                            $thisname = get_string('user').' '.intval($users[$userid]->idnumber);
                         break;
                         case B_QUIZRESULTS_NAME_FORMAT_ANON:
-                            $thisname = $course->student;
+                            $thisname = get_string('user');
                         break;
                         default:
                         case B_QUIZRESULTS_NAME_FORMAT_FULL:
@@ -371,10 +371,10 @@ class block_quiz_results extends block_base {
                 foreach($worst as $userid => $gradeid) {
                     switch($nameformat) {
                         case B_QUIZRESULTS_NAME_FORMAT_ID:
-                            $thisname = $course->student.' '.intval($users[$userid]->idnumber);
+                            $thisname = get_string('user').' '.intval($users[$userid]->idnumber);
                         break;
                         case B_QUIZRESULTS_NAME_FORMAT_ANON:
-                            $thisname = $course->student;
+                            $thisname = get_string('user');
                         break;
                         default:
                         case B_QUIZRESULTS_NAME_FORMAT_FULL:
index 9102eb2130051aeb294e124f3d008842d44b1274..b30cb9fb73f2fef4dd0e8222587187bb875e18ad 100644 (file)
     unset($course);    // To avoid unwanted language effects later
 
     $courses = get_courses_page($category->id, 'c.sortorder ASC',
-                                'c.id,c.sortorder,c.shortname,c.fullname,c.summary,c.visible,c.teacher,c.guest,c.password',
+                                'c.id,c.sortorder,c.shortname,c.fullname,c.summary,c.visible,c.guest,c.password',
                                 $totalcount, $page*$perpage, $perpage);
     $numcourses = count($courses);
 
index 13a3bb9aea20ff42691e49c387085d45fac557c5..93d412ba940dbc72f05a63b9b055990e038c641b 100644 (file)
@@ -403,7 +403,7 @@ class course_edit_form extends moodleform {
 
         if ($roles = get_all_roles()) {
             if ($coursecontext) {
-                $roles = role_fix_names($roles, $coursecontext,ROLENAME_ALIAS_RAW);
+                $roles = role_fix_names($roles, $coursecontext, ROLENAME_ALIAS_RAW);
             }
             $assignableroles = get_roles_for_contextlevels(CONTEXT_COURSE);
             foreach ($roles as $role) {
index 6b43723dbd24b5ec936d81c2181da2d3420d5cb4..9d91e5e1ea88c5fdd6ec8473a6495f8aecaf9c4e 100644 (file)
     $editing         = $PAGE->user_is_editing();
 
     if ($editing) {
-        $strstudents = moodle_strtolower($course->students);
-        $strtopichide = get_string('topichide', '', $strstudents);
-        $strtopicshow = get_string('topicshow', '', $strstudents);
-       $strmarkthistopic = get_string('markthistopic');
-       $strmarkedthistopic = get_string('markedthistopic');
+        $strtopichide = get_string('hidetopicfromothers');
+        $strtopicshow = get_string('showtopicfromothers');
+        $strmarkthistopic = get_string('markthistopic');
+        $strmarkedthistopic = get_string('markedthistopic');
         $strmoveup   = get_string('moveup');
         $strmovedown = get_string('movedown');
     }
index 9bf6148e396d770f5b18d6e10082a27ab97a34c6..674ff48fbd54de99ab22aa1e1816a4637fd3d725 100644 (file)
@@ -49,9 +49,8 @@
     $editing         = $PAGE->user_is_editing();
 
     if ($editing) {
-        $strstudents = moodle_strtolower($course->students);
-        $strweekhide = get_string('weekhide', '', $strstudents);
-        $strweekshow = get_string('weekshow', '', $strstudents);
+        $strweekhide = get_string('hideweekfromothers');
+        $strweekshow = get_string('showweekfromothers');
         $strmoveup   = get_string('moveup');
         $strmovedown = get_string('movedown');
     }
index fe28ed5f126b12e37284b04b94aec2ef5717cf95..15f010fa7d51f4c65838fba438e4cfc95f824588 100644 (file)
             unset($course->id);
             $teacherid = $course->requester;
             unset($course->requester);
-            $course->teacher = get_string("defaultcourseteacher");
-            $course->teachers = get_string("defaultcourseteachers");
-            $course->student = get_string("defaultcoursestudent");
-            $course->students = get_string("defaultcoursestudents");
             if (!empty($CFG->restrictmodulesfor) && $CFG->restrictmodulesfor != 'none' && !empty($CFG->restrictbydefault)) {
                 $course->restrictmodules = 1;
             }
@@ -52,8 +48,7 @@
                 $user = $DB->get_record('user', array('id'=>$teacherid));
                 $a->name = $course->fullname;
                 $a->url = $CFG->wwwroot.'/course/view.php?id='.$courseid;
-                $a->teacher = $course->teacher;
-                
+
                 $eventdata = new object();
                 $eventdata->modulename        = 'moodle';
                 $eventdata->userfrom          = $USER;
index 8af7b99697915584884d172618c7e8ce4dd49f30..5812b4a88d7bcf1b0bc0af167d2650111d4014a0 100644 (file)
@@ -26,7 +26,7 @@ function setup_enrolments(&$user) {
     // we execute the below code for every role type.  Otherwise we just
     // execute it once with null (hence the dummy array).
     $roles = !empty($CFG->enrol_db_remoterolefield) && !empty($CFG->enrol_db_localrolefield)
-        ? $DB->get_records('role')
+        ? get_all_roles()
         : array(null);
 
     //error_log('[ENROL_DB] found ' . count($roles) . ' roles:');
@@ -575,10 +575,6 @@ function create_course ($course,$skip_fix_course_sortorder=0){
                           'showgrades'     => 1,
                           'groupmode'      => 0,
                           'groupmodeforce' => 0,
-                          'student'  => $site->student,
-                          'students' => $site->students,
-                          'teacher'  => $site->teacher,
-                          'teachers' => $site->teachers,
                           );
     }
     // overlay template
index d9b5d0ade24846e681a53307fc66504b5920722e..f8efcf03147c4eb9719f946972a9a6297fdbdc83 100644 (file)
@@ -27,7 +27,7 @@
     // role and update it.  Otherwise, just got through once (with no role
     // specified).
     $roles = !empty($CFG->enrol_db_remoterolefield) && !empty($CFG->enrol_db_localrolefield)
-        ? $DB->get_records('role')
+        ? get_all_roles()
         : array(null);
         
     foreach ($roles as $role) {
index 7f3c3cb805edc18dcc07d8b61be04da827fe57b4..325814fa878a5725920f5eb712f5a87eb844e8cf 100644 (file)
@@ -508,17 +508,6 @@ function process_group_tag($tagcontents){
                 $course->visible = 0;
                 // Insert default names for teachers/students, from the current language
                 $site = get_site();
-                if (current_language() == $CFG->lang) {
-                    $course->teacher  = $site->teacher;
-                    $course->teachers = $site->teachers;
-                    $course->student  = $site->student;
-                    $course->students = $site->students;
-                } else {
-                    $course->teacher = get_string("defaultcourseteacher");
-                    $course->teachers = get_string("defaultcourseteachers");
-                    $course->student = get_string("defaultcoursestudent");
-                    $course->students = get_string("defaultcoursestudents");
-                }
 
                 // Handle course categorisation (taken from the group.org.orgunit field if present)
                 if(strlen($group->category)>0){
index 832338f8a9a911dc9aa84b88481c6d87da984f84..e8444beb5ae59f2a4bbcb1b05839e7ed5338fefb 100755 (executable)
@@ -62,7 +62,7 @@ if (!isset ($frm->enrol_ldap_course_summary_editlock)) {
 }
 
 // Roles
-$roles = $DB->get_records('role');
+$roles = get_all_roles();
 foreach($roles as $role) {
     if (!isset($frm->{'enrol_ldap_contexts_role'.$role->id})) {
         $frm->{'enrol_ldap_contexts_role'.$role->id} = '';
index bdab28a08440e4932981ed66ddb6efae5abe57a0..c0adcb46f8afa7e8525929e1471cb8e5b7646aeb 100755 (executable)
@@ -27,7 +27,7 @@ function setup_enrolments(&$user) {
     // we are connected OK, continue...
 
     // Get all the possible roles
-    $roles = $DB->get_records('role');
+    $roles = get_all_roles();
 
     // Make sure the config settings have been upgraded.
     $this->check_legacy_config();
@@ -397,7 +397,7 @@ function process_config($config) {
     }
     set_config('enrol_ldap_autocreate', $config->enrol_ldap_autocreate);
 
-    $roles = $DB->get_records('role');
+    $roles = get_all_roles();
     foreach ($roles as $role) {
         if (!isset($config->{'enrol_ldap_contexts_role'.$role->id})) {
             $config->{'enrol_ldap_contexts_role'.$role->id} = '';
@@ -557,10 +557,6 @@ function create_course ($course_ext,$skip_fix_course_sortorder=0){
     } else {
         // set defaults
         $course = new object();
-        $course->student  = get_string('defaultcoursestudent');
-        $course->students = get_string('defaultcoursestudents');
-        $course->teacher  = get_string('defaultcourseteacher');
-        $course->teachers = get_string('defaultcourseteachers');
         $course->format = 'topics';
     }
 
index 7a42b0cd141ec787e0fe1d55c979b5fc2a051b79..4d516941c71d2d132db30345e7802ab5a8389261 100755 (executable)
@@ -22,7 +22,7 @@
 
     $enrol->check_legacy_config();
 
-    $roles = $DB->get_records('role');
+    $roles = get_all_roles();
     foreach ($roles as $role) {
         $enrol->sync_enrolments($role->shortname, true);
     }
index 7385cb06f7ba70bd3dda82221038534b2b7e80cf..33729f4cb1d5656bc4bb237fc933b165f547386d 100644 (file)
@@ -442,7 +442,7 @@ function print_enrolmentkeyfrom($course) {
         if (!empty($teacher)) {
             $teachername = "<a href=\"../user/view.php?id=$teacher->id&course=".SITEID."\">".fullname($teacher)."</a>.";
         } else {
-            $teachername = strtolower( get_string('defaultcourseteacher') ); //get_string('yourteacher', '', $course->teacher);
+            $teachername = strtolower( get_string('defaultcourseteacher') );
         }
 
         // guest user has a slightly different message
index 8d9ac6ff7ed69299ff333d9177ddc1c6c4844c38..7d6724aef56086d21063dc08cef39bdd48f169e0 100644 (file)
@@ -30,7 +30,7 @@
 
     } else {   /// Somehow they aren't enrolled yet!  :-(
         print_header();
-        notice(get_string('paymentsorry', '', $course), $destination);
+        notice(get_string('paymentsorry', '', get_string('defaultcourseteacher')), $destination);
     }
 
 ?>
index b86bd39d52c5033c4a6aaba84f3c4c7bd6959252..8d136af9a19ecf1b2fc663eea888866fa948d5d5 100644 (file)
@@ -181,6 +181,7 @@ $string['rating'] = 'Rating';
 $string['ratingeveryone'] = 'Everyone can rate entries';
 $string['ratingno'] = 'No ratings';
 $string['ratingonlyteachers'] = 'Only $a can rate entries';
+$string['ratingonlywithpermissions'] = 'Only people with permission to rate entries';
 $string['ratings'] = 'Ratings';
 $string['ratingssaved'] = 'Ratings saved';
 $string['ratingsuse'] = 'Use ratings';
index c5644fa44b85562003bc8799184e9847030ed9ad..0f7adf127a24bafacab1f67400cd35af4d888bbb 100644 (file)
@@ -130,6 +130,7 @@ $string['eolstudentoutoftime'] = 'Attention:  You ran out of time for this lesso
 $string['eolstudentoutoftimenoanswers'] = 'You did not answer any questions.  You have received a 0 for this lesson.';
 $string['essay'] = 'Essay';
 $string['essayemailmessage'] = '<p>Essay prompt:<blockquote>$a->question</blockquote></p><p>Your response:<blockquote><em>$a->response</em></blockquote></p><p>$a->teacher\'s comments:<blockquote><em>$a->comment</em></blockquote></p><p>You have received $a->earned out of $a->outof for this essay question.</p><p>Your grade for the lesson has been changed to $a->newgrade&#37;.</p>';
+$string['essayemailmessage2'] = '<p>Essay prompt:<blockquote>$a->question</blockquote></p><p>Your response:<blockquote><em>$a->response</em></blockquote></p><p>Grader\'s comments:<blockquote><em>$a->comment</em></blockquote></p><p>You have received $a->earned out of $a->outof for this essay question.</p><p>Your grade for the lesson has been changed to $a->newgrade&#37;.</p>';
 $string['essayemailsubject'] = 'Your grade for $a question';
 $string['essays'] = 'Essays';
 $string['essayscore'] = 'Essay score';
@@ -174,6 +175,7 @@ $string['lessondefault'] = 'Use this lesson\'s settings as defaults';
 $string['lessonformating'] = 'Lesson formatting';
 $string['lessonmenu'] = 'Lesson menu';
 $string['lessonnotready'] = 'This lesson is not ready to be taken.  Please contact your $a.';
+$string['lessonnotready2'] = 'This lesson is not ready to be taken.';
 $string['lessonopen'] = 'This lesson will be open on $a.';
 $string['lessonopens'] = 'Lesson opens';
 $string['lessonpagelinkingbroken'] = 'First page not found.  Lesson page linking must be broken.  Please contact an admin.';
@@ -265,6 +267,7 @@ $string['previewlesson'] = 'Preview $a';
 $string['previouspage'] = 'Previous page';
 $string['progressbar'] = 'Progress Bar';
 $string['progressbarteacherwarning'] = 'Progress Bar does not display for $a';
+$string['progressbarteacherwarning2'] = 'You will not see the progress bar because you can edit this lesson';
 $string['deleteallattempts'] = 'Delete all lesson attempts';
 $string['qtype'] = 'Page type';
 $string['question'] = 'Question';
@@ -279,6 +282,7 @@ $string['redisplaypage'] = 'Redisplay page';
 $string['report'] = 'Report';
 $string['reports'] = 'Reports';
 $string['response'] = 'Response';
+$string['retakesallowed'] = 'Re-takes allowed';
 $string['returnto'] = 'Return to $a';
 $string['returntocourse'] = 'Return to the course';
 $string['review'] = 'Review';
@@ -330,6 +334,7 @@ $string['usepassword'] = 'Password protected lesson';
 $string['viewgrades'] = 'View grades';
 $string['viewhighscores'] = 'View high scores list';
 $string['viewreports'] = 'View $a->attempts completed $a->student attempts';
+$string['viewreports2'] = 'View $a completed attempts';
 $string['welldone'] = 'Well done!';
 $string['whatdofirst'] = 'What would you like to do first?';
 $string['wronganswerjump'] = 'Wrong answer jump';
index c6a9dc42c479178b53e1250713b29a5bf702a5fd..f2c21cba96533faa04618d10d17b58dc7cc2632e 100644 (file)
@@ -265,6 +265,7 @@ $string['counteditems'] = '$a->count $a->items';
 $string['country'] = 'Country';
 $string['course'] = 'Course';
 $string['courseapprovedemail'] = 'Your requested course, $a->name, has been approved and you have been made a $a->teacher.  To access your new course, go to $a->url';
+$string['courseapprovedemail2'] = 'Your requested course, $a->name, has been approved.  To access your new course, go to $a->url';
 $string['courseapprovedfailed'] = 'Failed to save the course as approved!';
 $string['courseapprovedsubject'] = 'Your course has been approved!';
 $string['courseavailable'] = 'This course is available to students';
@@ -781,6 +782,8 @@ $string['hideadvancedsettings'] = 'Hide advanced settings';
 $string['hidepicture'] = 'Hide picture';
 $string['hidesection'] = 'Hide section $a';
 $string['hidesettings'] = 'Hide settings';
+$string['hidetopicfromothers'] = 'Hide topic from others';
+$string['hideweekfromothers'] = 'Hide week from others';
 $string['hits'] = 'Hits';
 $string['hitsoncourse'] = 'Hits on $a->coursename by $a->username';
 $string['hitsoncoursetoday'] = 'Today\'s hits on $a->coursename by $a->username';
@@ -1383,6 +1386,8 @@ $string['showrecent'] = 'Show recent activity';
 $string['showreports'] = 'Show activity reports';
 $string['showsettings'] = 'Show settings';
 $string['showtheselogs'] = 'Show these logs';
+$string['showtopicfromothers'] = 'Show topic from others';
+$string['showweekfromothers'] = 'Show week from others';
 $string['since'] = 'Since';
 $string['sincelast'] = 'since last login';
 $string['site'] = 'Site';
@@ -1687,6 +1692,7 @@ $string['youneedtoenrol'] = 'To perform that action you need to enrol in this co
 $string['yourlastlogin'] = 'Your last login was';
 $string['yourself'] = 'yourself';
 $string['yourteacher'] = 'your $a';
+$string['yourwordforx'] = 'Your word for \'$a\'';
 $string['zippingbackup'] = 'Zipping backup';
 
 $string['authenticationplugins'] = 'Authentication Plugins';
index 1120242fbf5e4dc19bf59e9a53dfc59c02741445..50cffef0de7274933175ce0e2bcbcfb28e80286f 100644 (file)
@@ -13,6 +13,7 @@ $string['cannotupdate'] = 'Cannot update resource.';
 $string['choose'] = 'Choose';
 $string['chooseafile'] = 'Choose or upload a file';
 $string['chooseparameter'] = 'Choose parameter';
+$string['chooseaparameter'] = 'Choose a parameter...';
 $string['clicktoopen'] = 'To open this document, click on this link: ';
 $string['configallowlocalfiles'] = 'When creating a new file resource, allow links to files on a local file system such as a CD drive or a hard drive. This may be useful in a classroom where all students have access to a common network drive or where files on a CD need to be accessed. Use of this feature may require changes to your browser\'s security settings.';
 $string['configautofilerenamesettings'] = 'Automatically update references to files and directories when renamed in file manager.';
index 9326535e9cb75269a0768f82ae78e55cacdaaf8c..95444c091488a7efa2cca783b75252331557eea5 100644 (file)
@@ -4141,7 +4141,7 @@ class admin_setting_pickroles extends admin_setting_configmulticheckbox {
         if (is_array($this->choices)) {
             return true;
         }
-        if ($roles = $DB->get_records('role')) {
+        if ($roles = get_all_roles()) {
             $this->choices = array();
             foreach($roles as $role) {
                 $this->choices[$role->id] = format_string($role->name);
index 0e1d0599ca312947cf76d2350e3b8a1437326eaa..7f722197fdfa718132d4528db9509e477c318aeb 100644 (file)
@@ -538,7 +538,6 @@ function get_courses_wmanagers($categoryid=0, $sort="c.sortorder ASC", $fields=a
 
     $basefields = array('id', 'category', 'sortorder',
                         'shortname', 'fullname', 'idnumber',
-                        'teacher', 'teachers', 'student', 'students',
                         'guest', 'startdate', 'visible',
                         'newsitems',  'cost', 'enrol',
                         'groupmode', 'groupmodeforce');
@@ -748,7 +747,6 @@ function get_my_courses($userid, $sort='visible DESC,sortorder ASC', $fields=NUL
 
     $basefields = array('id', 'category', 'sortorder',
                         'shortname', 'fullname', 'idnumber',
-                        'teacher', 'teachers', 'student', 'students',
                         'guest', 'startdate', 'visible',
                         'newsitems',  'cost', 'enrol',
                         'groupmode', 'groupmodeforce');
index ba48f95967e7db96ca81144dd20aa4db944c4a60..817c6be416787364d286751593ffa181b4d94fb9 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="lib/db" VERSION="20081022" COMMENT="XMLDB file for core Moodle tables"
+<XMLDB PATH="lib/db" VERSION="20081111" COMMENT="XMLDB file for core Moodle tables"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
 >
         <FIELD NAME="format" TYPE="char" LENGTH="10" NOTNULL="true" DEFAULT="topics" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="showgrades"/>
         <FIELD NAME="showgrades" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="modinfo"/>
         <FIELD NAME="modinfo" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="showgrades" NEXT="newsitems"/>
-        <FIELD NAME="newsitems" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="modinfo" NEXT="teacher"/>
-        <FIELD NAME="teacher" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Teacher" SEQUENCE="false" ENUM="false" PREVIOUS="newsitems" NEXT="teachers"/>
-        <FIELD NAME="teachers" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Teachers" SEQUENCE="false" ENUM="false" PREVIOUS="teacher" NEXT="student"/>
-        <FIELD NAME="student" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Student" SEQUENCE="false" ENUM="false" PREVIOUS="teachers" NEXT="students"/>
-        <FIELD NAME="students" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Students" SEQUENCE="false" ENUM="false" PREVIOUS="student" NEXT="guest"/>
-        <FIELD NAME="guest" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="students" NEXT="startdate"/>
+        <FIELD NAME="newsitems" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="modinfo" NEXT="guest"/>
+        <FIELD NAME="guest" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="newsitems" NEXT="startdate"/>
         <FIELD NAME="startdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="guest" NEXT="enrolperiod"/>
         <FIELD NAME="enrolperiod" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="startdate" NEXT="numsections"/>
         <FIELD NAME="numsections" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="enrolperiod" NEXT="marker"/>
index 720f784b5acb5c12548cb81068fb52b573429672..7821efb7cf003992b092604f20ea16e1bd5c63af 100644 (file)
@@ -992,6 +992,38 @@ function xmldb_main_upgrade($oldversion) {
         upgrade_main_savepoint($result, 2008110603);
     }
 
+    /// Drop the deprecated teacher, teachers, student and students columns from the course table.
+    if ($result && $oldversion < 2008111200) {
+        $table = new xmldb_table('course');
+
+    /// Conditionally launch drop field teacher
+        $field = new xmldb_field('teacher');
+        if ($dbman->field_exists($table, $field)) {
+            $dbman->drop_field($table, $field);
+        }
+
+    /// Conditionally launch drop field teacher
+        $field = new xmldb_field('teachers');
+        if ($dbman->field_exists($table, $field)) {
+            $dbman->drop_field($table, $field);
+        }
+
+    /// Conditionally launch drop field teacher
+        $field = new xmldb_field('student');
+        if ($dbman->field_exists($table, $field)) {
+            $dbman->drop_field($table, $field);
+        }
+
+    /// Conditionally launch drop field teacher
+        $field = new xmldb_field('students');
+        if ($dbman->field_exists($table, $field)) {
+            $dbman->drop_field($table, $field);
+        }
+
+    /// Main savepoint reached
+        upgrade_main_savepoint($result, 2008111200);
+    }
+
     return $result;
 }
 
index a29bdde3ba04d553ec46117ac659199e4b8eeae7..302acd0135b5e8438756268ba7810e9d56dd3137 100644 (file)
@@ -4662,7 +4662,7 @@ function print_user($user, $course, $messageselect=false, $return=false) {
     $output .= '<td class="content">';
     $output .= '<div class="username">'.fullname($user, has_capability('moodle/site:viewfullnames', $context)).'</div>';
     $output .= '<div class="info">';
-    if (!empty($user->role) and ($user->role <> $course->teacher)) {
+    if (!empty($user->role)) {
         $output .= $string->role .': '. $user->role .'<br />';
     }
     if ($user->maildisplay == 1 or ($user->maildisplay == 2 and ($course->id != SITEID) and !isguest()) or
index f1b1bd5cea6e54950ac8f0f0a206367af4c41d92..9c34a679b639b187148b15ab110353d9f829378d 100644 (file)
@@ -243,7 +243,7 @@ class assignment_base {
         }
 
     /// Print the feedback
-        print_heading(get_string('feedbackfromteacher', 'assignment', $this->course->teacher)); // TODO: fix teacher string
+        print_heading(get_string('feedbackfromteacher', 'assignment', fullname($teacher)));
 
         echo '<table cellspacing="0" class="feedback">';
 
@@ -1089,8 +1089,8 @@ class assignment_base {
                               get_string('fullname'),
                               get_string('grade'),
                               get_string('comment', 'assignment'),
-                              get_string('lastmodified').' ('.$course->student.')',
-                              get_string('lastmodified').' ('.$course->teacher.')',
+                              get_string('lastmodified').' ('.get_string('submission', 'assignment').')',
+                              get_string('lastmodified').' ('.get_string('grade').')',
                               get_string('status'),
                               get_string('finalgrade', 'grades'));
         if ($uses_outcomes) {
index f11bccadcae2f928c95b20ccc71454c7b510ff85..ea3d7ebeb9bb9774b31ae900ef000f83867c8d78 100644 (file)
@@ -82,7 +82,7 @@ class assignment_upload extends assignment_base {
 
         if (empty($submission->timemarked)) {   /// Nothing to show, so print nothing
             if ($this->count_responsefiles($USER->id)) {
-                print_heading(get_string('responsefiles', 'assignment', $this->course->teacher), '', 3);
+                print_heading(get_string('responsefiles', 'assignment'), '', 3);
                 $responsefiles = $this->print_responsefiles($USER->id, true);
                 print_simple_box($responsefiles, 'center');
             }
index 69a95502bad3bf50cb6951cd5d38c224f27918e8..5c6509264a4bbac2d11c111092a9d114fbfae184 100644 (file)
@@ -127,7 +127,7 @@ class mod_glossary_mod_form extends moodleform_mod {
         $mform->addElement('checkbox', 'userating', get_string('allowratings', 'glossary') , get_string('ratingsuse', 'glossary'));
 
         $options=array();
-        $options[2] = get_string('ratingonlyteachers', 'glossary', moodle_strtolower($COURSE->teachers));
+        $options[2] = get_string('ratingonlywithpermissions', 'glossary');
         $options[1] = get_string('ratingeveryone', 'glossary');
         $mform->addElement('select', 'assessed', get_string('users'), $options);
         $mform->disabledIf('assessed', 'userating');
index 19ac3acf9cbb66f556e3644d11dbd3bae492612c..12f6db8ba33709585299e5bc3c25f72d48db2985 100644 (file)
                         $a->earned = $essayinfo->score;
                         $a->outof  = 1;
                     }
-                    
+
                     // Set rest of the message values
                     $a->question = format_text($pages[$attempt->pageid]->contents, FORMAT_MOODLE, $options);
                     $a->response = s($essayinfo->answer);
-                    $a->teacher  = $course->teacher;
                     $a->comment  = s($essayinfo->response);
-                    
-                    
+
                     // Fetch message HTML and plain text formats
-                    $message  = get_string('essayemailmessage', 'lesson', $a);
+                    $message  = get_string('essayemailmessage2', 'lesson', $a);
                     $plaintxt = format_text_email($message, FORMAT_HTML);
 
                     // Subject
             
             // Setup table
             $table = new stdClass;
-            $table->head = array($course->students, get_string('essays', 'lesson'), get_string('email', 'lesson'));
+            $table->head = array(get_string('name'), get_string('essays', 'lesson'), get_string('email', 'lesson'));
             $table->align = array('left', 'left', 'left');
             $table->wrap = array('nowrap', 'nowrap', 'nowrap');
 
index 25ff04d32534a440a5a32485bca545dd452751e3..abce2e24048d304feebbce12c3204bb99db0979d 100644 (file)
                 $table->cellspacing = '10px';
                 $table->size = array('*', '*', '*');
             
-                $table->head = array(get_string("rank", "lesson"), $course->students, get_string("scores", "lesson"));
+                $table->head = array(get_string("rank", "lesson"), get_string('name'), get_string("scores", "lesson"));
             
                 $printed = 0;
                 while (true) {
index 6cb9da60de1856232accea58691ff4a7e33cf7d5..5dae74c0d257b858a0b0429e372c3dc845bcb41a 100644 (file)
@@ -1614,7 +1614,7 @@ function lesson_print_progress_bar($lesson, $course) {
     
     // catch teachers
     if (has_capability('mod/lesson:manage', $context)) {
-        notify(get_string('progressbarteacherwarning', 'lesson', $course->teachers));
+        notify(get_string('progressbarteacherwarning2', 'lesson'));
         return false;
     }
     if (!isset($USER->modattempts[$lesson->id])) {
index 632719b408b93e9511268dd8b02e9e4c8b4ade88..21318f1733750e81819becfb3be1b48547f4bf35 100644 (file)
@@ -74,8 +74,8 @@ class mod_lesson_mod_form extends moodleform_mod {
         $mform->setDefault('grade', 0);
         $mform->setHelpButton('grade', array('grade', get_string('maximumgrade'), 'lesson'));
 
-        $mform->addElement('selectyesno', 'retake', get_string('canretake', 'lesson', $COURSE->student));
-        $mform->setHelpButton('retake', array('retake', get_string('canretake', 'lesson', $COURSE->student), 'lesson'));
+        $mform->addElement('selectyesno', 'retake', get_string('retakesallowed', 'lesson'));
+        $mform->setHelpButton('retake', array('retake', get_string('retakesallowed', 'lesson'), 'lesson'));
         $mform->setDefault('retake', 0);
 
         $options = array();
index f7eae99f59bfed91def7a8ad90308f8b04398e5b..228767eb388f917d4c22fcef9a766328b1ce5bc9 100644 (file)
         $table         = new stdClass;
 
         // set up the table object
-        $table->head = array(get_string('studentname', 'lesson', $course->student), get_string('attempts', 'lesson'), get_string('highscore', 'lesson'));
+        $table->head = array(get_string('name'), get_string('attempts', 'lesson'), get_string('highscore', 'lesson'));
         $table->align = array("center", "left", "left");
         $table->wrap = array("nowrap", "nowrap", "nowrap");
         $table->width = "90%";
                 
                 $gradeinfo = lesson_grade($lesson, $try, $user->id);
                 
-                $table->data[] = array($course->student.':', print_user_picture($user->id, $course->id, $user->picture, 0, true).fullname($user, true));
+                $table->data[] = array(get_string('name').':', print_user_picture($user->id, $course->id, $user->picture, 0, true).fullname($user, true));
                 $table->data[] = array(get_string("timetaken", "lesson").":", format_time($timetotake));
                 $table->data[] = array(get_string("completed", "lesson").":", userdate($completed));
                 $table->data[] = array(get_string('rawgrade', 'lesson').':', $gradeinfo->earned.'/'.$gradeinfo->total);
index c8222310966ec8aaeb0f5250babb343997410b8d..81862474125a99cc34b6b1392b83e4ec8af0bbf4 100644 (file)
     $tabs = $row = $inactive = $activated = array();
 
 /// user attempt count for reports link hover (completed attempts - much faster)
-    $counts           = new stdClass;
-    $counts->attempts = $DB->count_records('lesson_grades', array('lessonid'=>$lesson->id));
-    $counts->student  = $course->student;
+    $attemptscount = $DB->count_records('lesson_grades', array('lessonid'=>$lesson->id));
     
     $row[] = new tabobject('view', "$CFG->wwwroot/mod/lesson/view.php?id=$cm->id", get_string('preview', 'lesson'), get_string('previewlesson', 'lesson', format_string($lesson->name)));
     $row[] = new tabobject('edit', "$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id", get_string('edit', 'lesson'), get_string('edit', 'moodle', format_string($lesson->name)));
-    $row[] = new tabobject('reports', "$CFG->wwwroot/mod/lesson/report.php?id=$cm->id", get_string('reports', 'lesson'), get_string('viewreports', 'lesson', $counts));
+    $row[] = new tabobject('reports', "$CFG->wwwroot/mod/lesson/report.php?id=$cm->id", get_string('reports', 'lesson'), get_string('viewreports2', 'lesson', $attemptscount));
     if (has_capability('mod/lesson:edit', $context)) {
         $row[] = new tabobject('essay', "$CFG->wwwroot/mod/lesson/essay.php?id=$cm->id", get_string('manualgrading', 'lesson'));
     }
index 1b7802871f9beadb5c81e6411516234fb658037e..e845a07f5c6a6c907fb848c23019e1735d049e0e 100644 (file)
         // make sure there are pages to view
         if (!$DB->get_field('lesson_pages', 'id', array('lessonid' => $lesson->id, 'prevpageid' => 0))) {
             if (!has_capability('mod/lesson:manage', $context)) {
-                lesson_set_message(get_string('lessonnotready', 'lesson', $course->teacher)); // a nice message to the student
+                lesson_set_message(get_string('lessonnotready2', 'lesson')); // a nice message to the student
             } else {
                 if (!$DB->count_records('lesson_pages', array('lessonid'=>$lesson->id))) {
                     redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id"); // no pages - redirect to add pages
index 58809e1a3c8771ef6c1ed724836b2e719066a32f..6989d35b90c1870d6c756c5d220bdd2a88d3a245 100644 (file)
@@ -31,7 +31,7 @@ require_capability('mod/quiz:viewreports', $modcontext);
 
 $line = new graph(800,600);
 $line->parameter['title']   = '';
-$line->parameter['y_label_left'] = $course->students;
+$line->parameter['y_label_left'] = get_string('participants');
 $line->parameter['x_label'] = get_string('grade');
 $line->parameter['y_label_angle'] = 90;
 $line->parameter['x_label_angle'] = 0;
index 77ab6c35beaf1ba37bc2aea2567583223042eb3c..ea778f4fb39c2b3ecb69f8fdfe0055aaabdbbc1e 100644 (file)
@@ -9,10 +9,10 @@ class mod_quiz_report_overview_settings extends moodleform {
         $mform->addElement('header', 'preferencespage', get_string('preferencespage', 'quiz_overview'));
 
         if (!$this->_customdata['currentgroup']){
-            $studentsstring = "'".$COURSE->students."'";
+            $studentsstring = get_string('participants');
         } else {
             $a = new object();
-            $a->coursestudent = $COURSE->students;
+            $a->coursestudent = get_string('participants');
             $a->groupname = groups_get_group_name($this->_customdata['currentgroup']);
             if (20 < strlen($a->groupname)){
               $studentsstring = get_string('studentingrouplong', 'quiz_overview', $a);
index 242c9868f0ccd8f06521dd474511c20769aa58f0..3f2ebe002c571afb4676625db66e9ab8f7fe7bf6 100644 (file)
@@ -283,7 +283,7 @@ class quiz_overview_report extends quiz_default_report {
                     if ($currentgroup){
                         $a= new object();
                         $a->groupname = groups_get_group_name($currentgroup);
-                        $a->coursestudents = $COURSE->students;
+                        $a->coursestudents = get_string('participants');
                         $a->countregradeneeded = $countregradeneeded;
                         $regradealldrydolabel = get_string('regradealldrydogroup', 'quiz_overview', $a);
                         $regradealldrylabel = get_string('regradealldrygroup', 'quiz_overview', $a);
index 48f0a144cf1b095ac470a3a4be4f3b7253b739fe..9f281854512a8371b5e609c53bb7367e1c58f32b 100644 (file)
@@ -9,10 +9,10 @@ class mod_quiz_report_responses_settings extends moodleform {
         $mform->addElement('header', 'preferencespage', get_string('preferencespage', 'quiz_overview'));
 
         if (!$this->_customdata['currentgroup']){
-            $studentsstring = "'".$COURSE->students."'";
+            $studentsstring = get_string('participants');
         } else {
             $a = new object();
-            $a->coursestudent = $COURSE->students;
+            $a->coursestudent = get_string('participants');
             $a->groupname = groups_get_group_name($this->_customdata['currentgroup']);
             if (20 < strlen($a->groupname)){
                 $studentsstring = get_string('studentingrouplong', 'quiz_overview', $a);
index 345dcb1ca6caf5fa182c71d1316db710d007e52a..34f71268a7008dd534cf0263cfb138acf161627b 100644 (file)
@@ -28,9 +28,7 @@ class resource_file extends resource_base {
         $littlecfg->wwwroot = $CFG->wwwroot;
 
 
-        $this->parameters = array(
-                'label2'          => array('langstr' => "",
-                                           'value'   =>'/optgroup'),
+        $courseparameters = array(
                 'label3'          => array('langstr' => get_string('course'),
                                            'value'   => 'optgroup'),
 
@@ -46,17 +44,19 @@ class resource_file extends resource_base {
                                            'value'   => $this->course->summary),
                 'courseformat'    => array('langstr' => get_string('format'),
                                            'value'   => $this->course->format),
-                'courseteacher'   => array('langstr' => get_string('wordforteacher'),
-                                           'value'   => $this->course->teacher),
-                'courseteachers'  => array('langstr' => get_string('wordforteachers'),
-                                           'value'   => $this->course->teachers),
-                'coursestudent'   => array('langstr' => get_string('wordforstudent'),
-                                           'value'   => $this->course->student),
-                'coursestudents'  => array('langstr' => get_string('wordforstudents'),
-                                           'value'   => $this->course->students),
-
-                'label4'          => array('langstr' => "",
-                                           'value'   =>'/optgroup'),
+        );
+
+        $roles = get_all_roles();
+        $coursecontext = get_context_instance(CONTEXT_COURSE, $this->course->id);
+        $roles = role_fix_names($roles, $coursecontext, ROLENAME_ALIAS);
+        foreach ($roles as $role) {
+            $courseparameters['course' . $role->shortname] = array(
+                    'langstr' => get_string('yourwordforx', '', $role->name),
+                    'value' => $role->localname);
+        }
+        $courseparameters['label4'] = array('langstr' => '', 'value'   =>'/optgroup');
+
+        $miscparameters = array(
                 'label5'          => array('langstr' => get_string('miscellaneous'),
                                            'value'   => 'optgroup'),
 
@@ -72,13 +72,12 @@ class resource_file extends resource_base {
                                            'value'   => $this->set_encrypted_parameter()),
 
                 'label6'          => array('langstr' => "",
-                                           'value'   =>'/optgroup')
+                                           'value'   =>'/optgroup'),
         );
 
+        $userparameters = array();
         if (!empty($USER->id)) {
-
             $userparameters = array(
-
                 'label1'          => array('langstr' => get_string('user'),
                                            'value'   => 'optgroup'),
 
@@ -113,11 +112,13 @@ class resource_file extends resource_base {
                 'usertimezone'    => array('langstr' => get_string('timezone'),
                                            'value'   => get_user_timezone_offset()),
                 'userurl'         => array('langstr' => get_string('webpage'),
-                                           'value'   => $USER->url)
-             );
+                                           'value'   => $USER->url),
 
-             $this->parameters = $userparameters + $this->parameters;
+                'label2'          => array('langstr' => "",
+                                           'value'   =>'/optgroup'),
+            );
         }
+        $this->parameters = array_merge($userparameters, $courseparameters, $miscparameters);
     }
 
     function add_instance($resource) {
@@ -268,6 +269,14 @@ class resource_file extends resource_base {
             $parray = explode(',', $resource->alltext);
             foreach ($parray as $fieldstring) {
                 $field = explode('=', $fieldstring);
+                // Backwards compatibility. This is not ideal, but we no longer
+                // store plural role names, so the best we can do is send the
+                // singular instead.
+                if ($field[0] == 'courseteachers') {
+                    $field[0] = 'courseeditingteacher';
+                } else if ($field[0] == 'coursestudents') {
+                    $field[0] = 'coursestudent';
+                }
                 $querys[] = urlencode($field[1]).'='.urlencode($this->parameters[$field[0]]['value']);
             }
             if ($isteamspeak) {
@@ -800,27 +809,27 @@ class resource_file extends resource_base {
 
         $mform->addElement('header', 'parameters', get_string('parameters', 'resource'));
 
-        $options = array();
-        $options['-'] = get_string('chooseparameter', 'resource').'...';
-        $optgroup = '';
+        $optiongroups = array();
+        $optiongroups[''] = array('-' => get_string('chooseaparameter', 'resource'));
+        $addto = &$optiongroups[''];
         foreach ($this->parameters as $pname=>$param) {
             if ($param['value']=='/optgroup') {
-                $optgroup = '';
                 continue;
             }
             if ($param['value']=='optgroup') {
-                $optgroup = $param['langstr'];
+                $optiongroups[$param['langstr']] = array();
+                $addto = &$optiongroups[$param['langstr']];
                 continue;
             }
-            $options[$pname] = $optgroup.' - '.$param['langstr'];
+            $addto[$pname] = $param['langstr'];
         }
 
         for ($i = 0; $i < $this->maxparameters; $i++) {
             $parametername = "parameter$i";
             $parsename = "parse$i";
             $group = array();
-            $group[] =& $mform->createElement('text', $parsename, '', array('size'=>'12'));//TODO: accessiblity
-            $group[] =& $mform->createElement('select', $parametername, '', $options);//TODO: accessiblity
+            $group[] =& $mform->createElement('text', $parsename, '', array('size'=>'12'));
+            $group[] =& $mform->createElement('selectgroups', $parametername, '', $optiongroups);
             $mform->addGroup($group, 'pargroup'.$i, get_string('variablename', 'resource').'='.get_string('parameter', 'resource'), ' ', false);
             $mform->setAdvanced('pargroup'.$i);
 
index 6528da85f59d98a6710e0b2befeb0864122c2151..04ef457540217bbaff2f6785a6136247ec465bc8 100644 (file)
@@ -35,8 +35,6 @@ function set_parameters() {
     $site = get_site();
 
     $this->parameters = array(
-            'label2'          => array('langstr' => "",
-                                       'value'   =>'/optgroup'),
             'label3'          => array('langstr' => get_string('course'),
                                        'value'   => 'optgroup'),
 
@@ -52,14 +50,6 @@ function set_parameters() {
                                        'value'   => $this->course->summary),
             'courseformat'    => array('langstr' => get_string('format'),
                                        'value'   => $this->course->format),
-            'courseteacher'   => array('langstr' => get_string('wordforteacher'),
-                                       'value'   => $this->course->teacher),
-            'courseteachers'  => array('langstr' => get_string('wordforteachers'),
-                                       'value'   => $this->course->teachers),
-            'coursestudent'   => array('langstr' => get_string('wordforstudent'),
-                                       'value'   => $this->course->student),
-            'coursestudents'  => array('langstr' => get_string('wordforstudents'),
-                                       'value'   => $this->course->students),
 
             'label4'          => array('langstr' => "",
                                        'value'   =>'/optgroup'),
@@ -78,7 +68,7 @@ function set_parameters() {
                                        'value'   => $this->set_encrypted_parameter()),
 
             'label6'          => array('langstr' => "",
-                                       'value'   =>'/optgroup')
+                                       'value'   =>'/optgroup'),
     );
 
     if (!empty($USER->id)) {
@@ -119,8 +109,10 @@ function set_parameters() {
             'usertimezone'    => array('langstr' => get_string('timezone'),
                                        'value'   => get_user_timezone_offset()),
             'userurl'         => array('langstr' => get_string('webpage'),
-                                       'value'   => $USER->url)
-         );
+                                       'value'   => $USER->url),
+            'label2'          => array('langstr' => "",
+                                       'value'   =>'/optgroup'),
+        );
 
          $this->parameters = $userparameters + $this->parameters;
     }
index fc159cf7a8e55edaebd9ddb13816e620f767b29a..698e47b4f27c182cd8a7679d38c4e7d6b7deed1b 100644 (file)
         print_error('coursemisconf');
     }
 
+    if ($sid) {
+        if (!$user = $DB->get_record("user", array("id"=>$sid))) {
+            print_error('invaliduserid');
+        }
+    }
+
     require_login($course->id, false, $cm);
 
     $groupmode = groups_get_activity_groupmode($cm);   // Groups are being used
 
     $stractual = get_string("actual", "survey");
     $stractualclass = get_string("actualclass", "survey");
-    $stractualstudent = get_string("actualstudent", "survey", $course->student);
+    $stractualstudent = get_string("actualstudent", "survey", fullname($user));
 
     $strpreferred = get_string("preferred", "survey");
     $strpreferredclass = get_string("preferredclass", "survey");
-    $strpreferredstudent = get_string("preferredstudent", "survey", $course->student);
+    $strpreferredstudent = get_string("preferredstudent", "survey", fullname($user));
 
     $virtualscales = false; //set default value for case clauses
 
index 7872abdb797e456a4f08e6ec8d169f3ad1eb32ea..2e914447e1ed1e9d84c791d0440a5e94ae02272f 100644 (file)
@@ -97,7 +97,7 @@
         echo "<a href=\"report.php?action=summary&amp;id=$id\">$strsummary</a>";
         echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=scales&amp;id=$id\">$strscales</a>";
         echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=questions&amp;id=$id\">$strquestions</a>";
-        echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=students&amp;id=$id\">$course->students</a>";
+        echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=students&amp;id=$id\">".get_string('participants')."</a>";
         if (has_capability('mod/survey:download', $context)) {
             echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=download&amp;id=$id\">$strdownload</a>";
         }
         }
     } else {
         echo "<a href=\"report.php?action=questions&amp;id=$id\">$strquestions</a>";
-        echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=students&amp;id=$id\">$course->students</a>";
+        echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=students&amp;id=$id\">".get_string('participants')."</a>";
         if (has_capability('mod/survey:download', $context)) {
             echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=download&amp;id=$id\">$strdownload</a>";
         }
 
       case "students":
 
-         print_heading(get_string("analysisof", "survey", "$course->students"));
+         print_heading(get_string("analysisof", "survey", get_string('participants')));
 
          if (! $results = survey_get_responses($survey->id, $currentgroup, $groupingid) ) {
              notify(get_string("nobodyyet","survey"));
index becd3449796b1347d91b5c642a8e899a0d34ae9a..c62a00ddb5d9ef7782bcbf850c7ad4ac6ccdea4e 100644 (file)
         switch ($wiki->wtype) {
 
         case 'teacher':
-            $wtype = $site->teacher;
+            $wtype = get_string('defaultcoursestudent');
             break;
 
         case 'student':
-            $wtype = $site->student;
+            $wtype = get_string('defaultcoursestudent');
             break;
 
         case 'group':
index 1343c81ae4e9827b6c906d79c9bd9c1b96a8d325..23331fd572eb8f899fbefc0b80653998edad6d3d 100644 (file)
 <table align="center"><tr><th colspan="4" scope="row"><?php print_string('currentlyselectedusers'); ?></th></tr>
 <?php
     if (count($SESSION->emailto[$id])) {
-        if (!$course->teacher) {
-            $course->teacher = get_string('defaultcourseteacher');
-        }
         foreach ($SESSION->emailto[$id] as $user) {
             echo '<tr><td>'.fullname($user,true).'</td><td>'.$user->email.'</td><td>';
-            if ($user->teacher) {
-                echo '<img src="'.$CFG->pixpath.'/t/user.gif" alt="'.$course->teacher.'" title="'.$course->teacher.'"/>';
-            }
             if ($user->emailstop) {
                 $error = get_string('emaildisable');
             } elseif (empty($user->email)) {
index d37a84e0a3bf6c4378521b62fdacc48c2759aa4d..0ab50d50a6f6ef21ff90fc0998402c58d2dee164 100644 (file)
@@ -5,9 +5,9 @@
 
     $id = required_param('id',PARAM_INT);
     $messagebody = optional_param('messagebody','',PARAM_CLEANHTML);
-    $send = optional_param('send','',PARAM_RAW);   // Content is actually treated as boolean
-    $preview = optional_param('preview','',PARAM_RAW);   // Content is actually treated as boolean
-    $edit = optional_param('edit','',PARAM_RAW);   // Content is actually treated as boolean
+    $send = optional_param('send','',PARAM_BOOL);
+    $preview = optional_param('preview','',PARAM_BOOL);
+    $edit = optional_param('edit','',PARAM_BOOL);
     $returnto = optional_param('returnto','',PARAM_LOCALURL);
     $format = optional_param('format',FORMAT_MOODLE,PARAM_INT);
     $deluser = optional_param('deluser',0,PARAM_INT);
@@ -48,7 +48,6 @@
             if (!array_key_exists($m[2],$SESSION->emailto[$id])) {
                 if ($user = $DB->get_record_select('user', "id = ?", array($m[2]), 'id,firstname,lastname,idnumber,email,emailstop,mailformat,lastaccess')) {
                     $SESSION->emailto[$id][$m[2]] = $user;
-                    $SESSION->emailto[$id][$m[2]]->teacher = ($m[1] == 'teacher');
                     $count++;
                 }
             }
                 echo "\n</form>";
             } else if (!empty($send)) {
                 $good = 1;
-                $teachers = array();
                 foreach ($SESSION->emailto[$id] as $user) {
                     $good = $good && message_post_message($USER,$user,$messagebody,$format,'direct');
-                    if ($user->teacher) {
-                        $teachers[] = $user->id;
-                    }
                 }
                 if (!empty($good)) {
                     print_heading(get_string('messagedselectedusers'));
index 50fd4e4cecfaec9ddc72262cfcd753a0e2131b58..ec6c2383149a2fa0355e32fa7da630bf63e08bf9 100644 (file)
@@ -6,7 +6,7 @@
 // This is compared against the values stored in the database to determine
 // whether upgrades should be performed (see lib/db/*.php)
 
-    $version = 2008111100;  // YYYYMMDD   = date of the last version bump
+    $version = 2008111200;  // YYYYMMDD   = date of the last version bump
                             //         XX = daily increments
 
     $release = '2.0 dev (Build: 20081113)';  // Human-friendly version name