Fall 2010 Setup

Apache

  1. Careful with selinux permission. If modules don't install, it could be the reason
 sudo chcon -R system_u:object_r:httpd_sys_content_t:s0 files_and_modules

PHP Change

php.ini

 expose_php = Off
 memory_limit = 1024M (from 32M)
 error_reporting = E_ALL & ~(E_NOTICE|E_DEPRECATED|E_STRICT)
 register_long_arrays = On   (This is deprecated, but one of the modules need it.)
 post_max_size = 100M  (from 8M)
 upload_max_filesize = 100M

Deprecated

is_a

is_a is deprecated and causes notices in the log. Use instanceof.

 if ( is_a($extpage, 'admin_externalpage'))
 if ( $extpage instanceof admin_externalpage)

eregi

mktime

ereg

split

CAS

Files:

 auth/cas/CAS/client.php
 auth/cas/CAS/CAS.php
 auth/cas/auth.php
 auth/cas/config.html
 auth/cas/cas_form.html

Arlen's Debug code

  // mode client CAS
  // RAS uncomment this line to generate a debug trace of the CAS authentication method.
  //          phpCAS::setDebug("/tmp/moodle.debug");
  //$myFile = "/tmp/moodle_log.txt";
  //$arlen = fopen($myFile, 'a');
  //fwrite($arlen, "hostname = " . $this->config->hostname . "\n" );
  //fwrite($arlen, "baseuri = " . $this->config->baseuri . "\n" );
  //fclose($arlen);

Blocks

course_menu

  1. Get course menu source (http://www.netsapiensis.com/Download/CourseMenu1.9.x.zip)
  2. unzip it under /moodle/blocks
  3. browse to https://classes.cehd.tamu.edu/admin -- this will add a table mdl_block_course_menu to the database.

There are local modifications:

  1. In the tree, chapter title should not truncated and end with ... (Show full title)
  2. In the tree, each section should open the page, with only the relevant section open and others folded.
  3. If a section is "hidden" by the instructor, it should not show in the tree.
  4. If a node is "hidden", the tree highlights the wrong (the next) node. See Yolanda's description here Course Menu: Wrong Node Highlighted .
    1. This is nice-if-fixed for now.

HTML block

An HTML block titled "Moodle Help Desk" should be added as a sticky block on MyMoodle pages. The text is here: html block text.

TODO

  1. cmsnavigation
  2. server_clock

Modules

Questionnaire

  1. download url: http://moodle.org/mod/data/view.php?d=13&rid=84
  2. unzip under mod
  3. go to admin, have installed.

Side_bar

  1. This requires Questionnaire module installed.
  2. download url: http://moodle.org/mod/data/view.php?d=13&rid=270
  3. go to admin url, have it installed.
  4. check list of activities
  5. In admin > modules > activities > manage activities, turn on journal, questionnaire and workshop.

Forum Post Approval

Forum requires a forum post approval patch.

The patch comes in one text file, forum_post_approval.patch.

All we need is apply the patch. After the patch, go to any page related with forum. Patch will be applied. (It modifies database.)

Advanced Setting problem

mod/forum/patch_forum_approveposts.txt

Respondusws

Requester: R Capraro / Yolanda

http://www.respondus.com/download/moodleserver.shtml

http://www.respondus.com/downloads/Moodle-respondusws-v104.zip

This file expands to respondusws, and goes under mod.

The whole directory is maintained by Respondus, so we'll not add our svn id.

Files:

 mod/respondusws

Certificate

Add Certificate module. http://docs.moodle.org/en/Certificate_module

Files:

 mod/certificate

Quiz Overview With IP

Files:

 mod/quiz/report/overviewwithip

Trackpad

May 2011

Nanogong

May 2011

Realtime Attendance

Attendance

Module page: http://moodle.org/mod/data/view.php?d=13&rid=1062

Download Link: http://download.moodle.org/download.php/packages19/attendance_package.zip

Local zip file: moodle11:/disks/www/moodle_modules11/attendance_package.zip

Unzip under moodle folder, into blocks and mod folders.

Gives attendance table.

Realtime Quiz

Module page: http://moodle.org/mod/data/view.php?d=13&rid=1036&filter=1

Download link: http://download.moodle.org/download.php/plugins/mod/realtimequiz.zip

Local zip file: moodle11:/disks/www/moodle_modules11/realtimequiz.zip

Unzip under moodle/mod folder.

Gives realtime quiz.

Realtime Attendance

Requires the two preceding modules (Attendance and Realtime Quiz)

Module page: http://moodle.org/mod/data/view.php?d=13&rid=2100&filter=1

Download link: http://orglearn.com/moodle/rtattendance/realtimeattendance.zip

Local zip file: moodle11:/disks/www/moodle_modules11/realtimeattendance.zip

Unzip under moodle/mod folder.

Gives realtime attendance.

sample

On moodle11

Admin test course 01 > Ben Kim Realtime Attendance Test

https://moodle.cehd.tamu.edu/mod/realtimeattendance/index.php?id=3

backup and restore

Image urls are hard coded by htmlarea (html editor), like

https://courses.cehd.tamu.edu/file.php/36/Educational_Philosophy/writing...

This cannot be a relative url. The reason is moodle uses file.php as the intermediary. It is explained here:

http://tracker.moodle.org/browse/MDL-24388

TODO

Code Chages

1. Arlen's onlinetesting module.

/user/view.php

   if (has_capability('moodle/user:viewhiddendetails', $coursecontext)) {
+      if ($user->idnumber) {
+          print_row(get_string("idnumber").":", "$user->idnumber");
+      }

Themes

  • Theme settings (administration > appearance > themes > theme settings)
  • Theme list is "cehd,cehd2"
  • These should have these checked:
    • Allow course themes
    • Allow users to hide blocks

Errors and Fixes

  • Notice: Undefined property: stdClass::$footer in /disks/www/moodle/blocks/moodleblock.class.php on line 355

Server Setup

sshd config

  • Comment this line out.
  1. Subsystem sftp /usr/libexec/openssh/sftp-server
  • Add these lines.

Subsystem sftp internal-sftp

Match group sftponly

 ChrootDirectory /home/%u
 X11Forwarding no
 AllowTcpForwarding no
 ForceCommand internal-sftp
  • This does not work with the default sshd.

postgresql

For onlinetesting integration, we need:

 yum install php-pgsql* --enablerepo=webtatic  --nogpgcheck
 yum install postgresql84*

repo

http://wiki.centos.org/AdditionalResources/Repositories/RPMForge

http://repo.webtatic.com/yum/webtatic.repo

forums and questions userid in backup

Discussion

This problem is described in http://tracker.moodle.org/browse/MDL-16614. Moodle questions' createdby and modifiedby fields, and forums' lastmodifiedby field, are included in the backup. When the backup is restored on another site, if the site already has a user having the same userid as those fields, then the question shows "Created by __SOME_WRONG_USER__" and so on.

The patch in http://tracker.moodle.org/browse/MDL-16614 is already included in 1.9.8. However, for some reason, it did not work.

CEHD usually does not backup or restore users. Workshop is an exception, which might include user data. However, when a course is first restored to a new site, there's no need to keep this created by or modified by values. So we simply cause it to become empty.

Patch for forum

--- question/restorelib.php 2011-07-06 16:13:55.000000000 -0500
+++ /home/bkim/c11-question-restorelib.php  2011-07-06 15:57:08.000000000 -0500
@@ -340,7 +340,12 @@
             if (!empty($createdby)) {
                 $user = backup_getid($restore->backup_unique_code, 'user', $createdby);
                 if ($user) {
-                    $question->createdby = $user->new_id;
+                    if(preg_match("/165.91.232.12[789]/",$_SERVER['REMOTE_ADDR'])){
+                        error_log("user in question restorelib createby:\n",3,"/tmp/bk.log"); 
+                        error_log(print_r($user,true),3,"/tmp/bk.log"); 
+                    } else {
+                    }
+                    //$question->createdby = $user->new_id;
                 } else if (backup_is_same_site($restore)) {
                     $question->createdby = $createdby;
                 }
@@ -348,10 +353,15 @@
 
             // Set the modifiedby field, if the user was in the backup, or if we are on the same site.
             $modifiedby = backup_todb_optional_field($que_info, 'MODIFIEDBY', null);
-            if (!empty($createdby)) {
+            if (!empty($modifiedby)) {
                 $user = backup_getid($restore->backup_unique_code, 'user', $modifiedby);
                 if ($user) {
-                    $question->modifiedby = $user->new_id;
+                    if(preg_match("/165.91.232.12[789]/",$_SERVER['REMOTE_ADDR'])){
+                        error_log("user in question restorelib modifiedby:\n",3,"/tmp/bk.log"); 
+                        error_log(print_r($user,true),3,"/tmp/bk.log"); 
+                    } else {
+                    }
+                    //$question->modifiedby = $user->new_id;
                 } else if (backup_is_same_site($restore)) {
                     $question->modifiedby = $modifiedby;
                 }

Patch for questions

--- restorelib.php 2011-07-06 16:39:04.000000000 -0500
+++ /home/bkim/restorelib.php 2011-07-06 16:38:59.000000000 -0500
@@ -299,11 +299,13 @@
                 $discussion->groupid = $group->new_id;
             }

+            /* BK Commented out following 5 lines. Purpose is to fix incorrect user mapping.
             //We have to recode the usermodified field
             $user = backup_getid($restore->backup_unique_code,"user",$discussion->usermodified);
             if ($user) {
                 $discussion->usermodified = $user->new_id;
             }
+            */

             //The structure is equal to the db, so insert the forum_discussions
             $newid = insert_record ("forum_discussions",$discussion);

login

login/forgot_password_form.php

The original form shows both email and username input boxes. If users enter both, and a few of them did, moodle shows an error message. This mod prevents users from entering both data.

         // Ben 20110921 A few users entered both username and email, and 
         // the system showed error messages to them.
         // Added the following 1 line.
         $mform->addElement('static', ,,'OR');
Taxonomy: