Customizations

Changes as of 3/26/2011.

  • M       lib/weblib.php
  • A       mod/realtimeattendance
  • A       mod/trackpad
  • A       mod/attforblock
  • A       mod/realtimequiz
  • A       mod/assignment/type/nanogong
  • M       mod/assignment/type/upload/assignment.class.php
  • A       mod/assignment/lang/es_utf8
  • A       mod/assignment/lang/en_utf8/assignment_nanogong.php
  • M       mod/assignment/lang/en_utf8/assignment.php
  • M       mod/assignment/lib.php
  • M       mod/assignment/submissions.php
  • M       config.php
  • M       course/view.php
  • M       course/format/social/format.php
  • M       theme/cehd_custom/footer.html
  • M       theme/cehd/footer.html
  • M       theme/cehd/styles.css
  • M       README.txt
  • A       blocks/attendance

Modules

nanogong

  • We use Nanogong module. We do not use the nanogong assignment type, which is a lighter version of the Nanogong module
  • http://moodle.org/mod/data/view.php?d=13&rid=1209%29?
  • http://gong.ust.hk/nanogong/moodle.html Developer page
  • Download requires  registration
  • Installation
    • http://gong.ust.hk/nanogong/moodle_inst.html installation instructions.
    • Unzip nanogong-module-4.1.zip to get nanogong-module-4.1/nanogong
    • Copy nanogong-module-4.1/nanogong to /mod/nanogong
    • Log in as admin
    • Go to notification
  • filter installation
    • Download nanogong-filter-4.1.zip
    • Extract it, and move nanogong-filter-4.1/nanogong  to  /filter/
    • Log on Moodle as admin
    • Go to the filter management page on the site administration menu
    • Enable the NanoGong filter by clicking on the eyelid on the page
  • htmlarea installation
    • Unzip nanogong-htmlarea-4.1-moodle-1.9.8.zip to get nanogong-htmlarea-4.1-moodle-1.9.8/
    • Copy lib and lang to /.  Files in /lib, /lang will be overwritten.
    • lang/en_utf8/editor.php
    • lib/weblib.php
    • lib/editor/htmlarea:
    • dialog.js  htmlarea.php  images/  nanogong.jar popups/  uploadsound.php
    • lib/editor/htmlarea/images/ed_sound.gif
    • lib/editor/htmlarea/popups/insert_sound.php

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);

forums and questions userid in backup

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;
                 }
Taxonomy: