COURSES12

Download moodle 1.9.12

$version = 2007101591.03;
$release = '1.9.12 (Build: 20110510)';

Version control

After adding any module, block or local modification, commit with that change only, so that we can back out the specific change only if needed.

For example, to revert some_folder to svn version 826, do:

svn merge -rHEAD:826 some_folder

After each database change, do

mysqldump -d > /admin/schema.courses2012

Commit this file. But we don't want to expose it to the world.

chmod 000 /admin/schema.courses2012

If a change involves change of core files, make a backup of the files to be changed. Include the backup file name/location in svn commit comments.

servers

  • frontend server: courses.cehd.tamu.edu (165.91.232.9)
    • It runs on a load balancer of courses-fe1.cehd.tamu.edu and courses-fe2.cehd.tamu.edu. (165.91.232.61 and 165.91.232.63)
  • webserver 1: enterprise.cehd.tamu.edu (165.91.232.46)
  • webserver 2: constellation.cehd.tamu.edu (165.91.232.58)
    • Enterprise's /disks/www/courses12data is nfs-mounted by constellation. The mount option "sync" should not be used since it drastically degrades file write performance.
  • database server: ticonderoga.cehd.tamu.edu (165.91.232.53)
  • backup server: maslow-heaton.cehd.tamu.edu (128.194.246.150)
    • courses-heaton.cehd.tamu.edu (has the web and database)

Apache

security

In httpd.conf and ssl.conf

TraceEnable Off

<LocationMatch "/.svn/">
order allow,deny
deny from all
</LocationMatch>

<FilesMatch "^\.ht|\.1$|\.2$|\.3$\|\.4$|\.5$|\.6$|\.bak|\.old$">
Order allow,deny
Deny from all
</FilesMatch>

In httpd.conf

<Directory "/disks/www/courses12">
Options -Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Directory>

In ssl.conf

SSLProtocol -all +SSLv3 +TLSv1
SSLCipherSuite HIGH:!ADH:!EXPORT:!SSLv2:!aNULL:!eNULL:!NULL
(Make sure MEDIUM or LOW is not here.)

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

apc

Install php-pecl-apc.

Mysql

##
max_connections=2400
## query_cache_limit is the maximum size of individual query results that can be cached.
query_cache_limit=512M
## size of the query cache. The amount of memory allocated for caching query results.
query_cache_size=1536M

Moodle

  • Check Use database for session information (dbsessions)
  • Check https for logins and secure cookies only (from Reports > Security overview)


http security

CAS

  1. 1.9,2.0
  2. Files:

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

Changes in code

  • lang/en_utf8/auth.php

$string['accesCAS'] = "Login for Texas A&M faculty, staff and students";
$string['accesNOCAS'] = "Login for others";

  • lib/moodlelib.php

===================================================================
--- lib/moodlelib.php (revision 37)
+++ lib/moodlelib.php (working copy)
@@ -3228,7 +3228,8 @@
}
} else {
// if user not found, create him
- $user = create_user_record($username, $password, $auth);
+ //BK This allows any random CAS user, once authenticated through NEO, to create an account, and is not desirable. Commented out one line.
+ //BK $user = create_user_record($username, $password, $auth);
}
$authplugin->sync_roles($user);

  • moodle 2.0.3

function authenticate_user_login($username, $password) {
...
foreach ($auths as $auth) {
...
if ($user->id) { // User already exists in database
... //line 3557
} else {
// if user not found, create him
// $user = create_user_record($username, $password, $auth);
}

Changes to enable back-end NON-SSL connections

ref

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

lib/javascript.php

Change all $CFG->httpswwwroot to $CFG->wwwroot. (no longer needed - RAS) Leave Moodle 1.9.12 stock code as is.

lib/weblib.php -- qualified_me()

@@ -291,6 +291,8 @@
+ # RAS. Forcing all links to appear with https rather than http
+ $url_prefix = $CFG->wwwroot;

Also comment out 38 lines in function qualified_me() from

if (!empty($CFG->wwwroot)) {

to

$url_prefix = $protocol.$hostname;

auth/cas/CAS/CAS/client.php

to ensure that CAS calls will always resolve to https

  • there are three sections that we commented out
  • isHttps() -- now always returns true
  • getCallbackURL() -- no longer adds ":80" to CAS service url
  • getURL() -- no longer adds ":80" to CAS service url

Confusion due to CAS login

Change in login/index.php

from if($user) to if($user && $user->id != 0)

to avoid going into mustconfirm block.

svn rev 36

Course Menu

  1. 1.9, 2.0
  2. $this->version = 2010100101;
  3. Get course menu source http://moodle.org/mod/data/view.php?d=13&rid=926
  4. Unzip, and move course_menu to /blocks
  5. Log in as admin, and go to notification area. This will make the database change.
  6. You should see this screen.

CREATE TABLE `mdl_block_course_menu` ( `id` bigint(10) unsigned NOT NULL auto_increment, `name` varchar(40) collate utf8_unicode_ci NOT NULL default '', `version` bigint(10) unsigned NOT NULL default '0', `cron` bigint(10) unsigned NOT NULL default '0', `lastcron` bigint(10) unsigned NOT NULL default '0', `visible` tinyint(1) NOT NULL default '1', `multiple` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='to store installed blocks'

There are local modifications:

  1. In the tree, chapter title should not be truncated( ending 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 .

HTML block

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

html block text.

Questionnaire

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

CREATE TABLE mdl_questionnaire ( id BIGINT(10) unsigned NOT NULL auto_increment, course BIGINT(11) unsigned NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL DEFAULT '', summary TEXT NOT NULL, qtype BIGINT(10) NOT NULL DEFAULT 0, respondenttype enum('fullname', 'anonymous') NOT NULL DEFAULT 'fullname', resp_eligible enum('all', 'students', 'teachers') NOT NULL DEFAULT 'all', resp_view TINYINT(2) unsigned NOT NULL DEFAULT 0, opendate BIGINT(10) unsigned NOT NULL DEFAULT 0, closedate BIGINT(10) unsigned NOT NULL DEFAULT 0, resume TINYINT(2) unsigned NOT NULL DEFAULT 0, navigate TINYINT(2) unsigned NOT NULL DEFAULT 0, grade BIGINT(10) NOT NULL DEFAULT 0, sid BIGINT(11) unsigned NOT NULL DEFAULT 0, timemodified BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire COMMENT='Main questionnaire table.'
CREATE INDEX mdl_ques_sid_ix ON mdl_questionnaire (sid)
CREATE TABLE mdl_questionnaire_survey ( id BIGINT(10) unsigned NOT NULL auto_increment, name VARCHAR(64) NOT NULL DEFAULT '', owner VARCHAR(16) NOT NULL DEFAULT '', realm VARCHAR(64) NOT NULL DEFAULT '', status BIGINT(10) unsigned NOT NULL DEFAULT 0, title VARCHAR(255) NOT NULL DEFAULT '', email VARCHAR(255) DEFAULT NULL, subtitle TEXT, info TEXT, theme VARCHAR(64) DEFAULT NULL, thanks_page VARCHAR(255) DEFAULT NULL, thank_head VARCHAR(255) DEFAULT NULL, thank_body TEXT, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_survey COMMENT='questionnaire_survey table retrofitted from MySQL'
CREATE INDEX mdl_quessurv_nam_ix ON mdl_questionnaire_survey (name)
CREATE INDEX mdl_quessurv_own_ix ON mdl_questionnaire_survey (owner)
CREATE TABLE mdl_questionnaire_attempts ( id BIGINT(11) unsigned NOT NULL auto_increment, qid BIGINT(11) unsigned NOT NULL DEFAULT 0, userid BIGINT(11) unsigned NOT NULL DEFAULT 0, rid BIGINT(10) unsigned NOT NULL DEFAULT 0, timemodified BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_attempts COMMENT='questionnaire_attempts table retrofitted from MySQL'
CREATE TABLE mdl_questionnaire_question ( id BIGINT(10) unsigned NOT NULL auto_increment, survey_id BIGINT(10) unsigned NOT NULL DEFAULT 0, name VARCHAR(30) DEFAULT NULL, type_id BIGINT(10) unsigned NOT NULL DEFAULT 0, result_id BIGINT(10) unsigned DEFAULT NULL, length BIGINT(11) unsigned NOT NULL DEFAULT 0, precise BIGINT(11) unsigned NOT NULL DEFAULT 0, position BIGINT(10) unsigned NOT NULL DEFAULT 0, content TEXT NOT NULL, required enum('y', 'n') NOT NULL DEFAULT 'n', deleted enum('y', 'n') NOT NULL DEFAULT 'n', CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_question COMMENT='questionnaire_question table retrofitted from MySQL'
CREATE TABLE mdl_questionnaire_quest_choice ( id BIGINT(10) unsigned NOT NULL auto_increment, question_id BIGINT(10) unsigned NOT NULL DEFAULT 0, content TEXT NOT NULL, value TEXT, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_quest_choice COMMENT='questionnaire_quest_choice table retrofitted from MySQL'
CREATE TABLE mdl_questionnaire_question_type ( id BIGINT(10) unsigned NOT NULL auto_increment, typeid BIGINT(10) unsigned NOT NULL DEFAULT 0, type VARCHAR(32) NOT NULL DEFAULT '', has_choices enum('y', 'n') NOT NULL DEFAULT 'y', response_table VARCHAR(32) DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_question_type COMMENT='questionnaire_question_type table retrofitted from MySQL'
CREATE UNIQUE INDEX mdl_quesquestype_typ_uix ON mdl_questionnaire_question_type (typeid)
CREATE TABLE mdl_questionnaire_response ( id BIGINT(10) unsigned NOT NULL auto_increment, survey_id BIGINT(10) unsigned NOT NULL DEFAULT 0, submitted BIGINT(10) unsigned NOT NULL DEFAULT 0, complete enum('y', 'n') NOT NULL DEFAULT 'n', grade BIGINT(10) NOT NULL DEFAULT 0, username VARCHAR(64) DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_response COMMENT='questionnaire_response table retrofitted from MySQL'
CREATE TABLE mdl_questionnaire_response_bool ( id BIGINT(11) unsigned NOT NULL auto_increment, response_id BIGINT(10) unsigned NOT NULL DEFAULT 0, question_id BIGINT(10) unsigned NOT NULL DEFAULT 0, choice_id enum('y', 'n') NOT NULL DEFAULT 'y', CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_response_bool COMMENT='questionnaire_response_bool table retrofitted from MySQL'
CREATE INDEX mdl_quesrespbool_resque_ix ON mdl_questionnaire_response_bool (response_id, question_id)
CREATE TABLE mdl_questionnaire_response_date ( id BIGINT(11) unsigned NOT NULL auto_increment, response_id BIGINT(10) unsigned NOT NULL DEFAULT 0, question_id BIGINT(10) unsigned NOT NULL DEFAULT 0, response TEXT, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_response_date COMMENT='questionnaire_response_date table retrofitted from MySQL'
CREATE INDEX mdl_quesrespdate_resque_ix ON mdl_questionnaire_response_date (response_id, question_id)
CREATE TABLE mdl_questionnaire_resp_multiple ( id BIGINT(10) unsigned NOT NULL auto_increment, response_id BIGINT(10) unsigned NOT NULL DEFAULT 0, question_id BIGINT(10) unsigned NOT NULL DEFAULT 0, choice_id BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_resp_multiple COMMENT='questionnaire_resp_multiple table retrofitted from MySQL'
CREATE INDEX mdl_quesrespmult_resquecho_ix ON mdl_questionnaire_resp_multiple (response_id, question_id, choice_id)
CREATE TABLE mdl_questionnaire_response_other ( id BIGINT(11) unsigned NOT NULL auto_increment, response_id BIGINT(10) unsigned NOT NULL DEFAULT 0, question_id BIGINT(10) unsigned NOT NULL DEFAULT 0, choice_id BIGINT(10) unsigned NOT NULL DEFAULT 0, response TEXT, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_response_other COMMENT='questionnaire_response_other table retrofitted from MySQL'
CREATE INDEX mdl_quesrespothe_resquecho_ix ON mdl_questionnaire_response_other (response_id, question_id, choice_id)
CREATE TABLE mdl_questionnaire_response_rank ( id BIGINT(11) unsigned NOT NULL auto_increment, response_id BIGINT(10) unsigned NOT NULL DEFAULT 0, question_id BIGINT(10) unsigned NOT NULL DEFAULT 0, choice_id BIGINT(10) unsigned NOT NULL DEFAULT 0, rank BIGINT(11) NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_response_rank COMMENT='questionnaire_response_rank table retrofitted from MySQL'
CREATE INDEX mdl_quesresprank_resquecho_ix ON mdl_questionnaire_response_rank (response_id, question_id, choice_id)
CREATE TABLE mdl_questionnaire_resp_single ( id BIGINT(11) unsigned NOT NULL auto_increment, response_id BIGINT(10) unsigned NOT NULL DEFAULT 0, question_id BIGINT(10) unsigned NOT NULL DEFAULT 0, choice_id BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_resp_single COMMENT='questionnaire_resp_single table retrofitted from MySQL'
CREATE INDEX mdl_quesrespsing_resque_ix ON mdl_questionnaire_resp_single (response_id, question_id)
CREATE TABLE mdl_questionnaire_response_text ( id BIGINT(11) unsigned NOT NULL auto_increment, response_id BIGINT(10) unsigned NOT NULL DEFAULT 0, question_id BIGINT(10) unsigned NOT NULL DEFAULT 0, response TEXT, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_questionnaire_response_text COMMENT='questionnaire_response_text table retrofitted from MySQL'
CREATE INDEX mdl_quesresptext_resque_ix ON mdl_questionnaire_response_text (response_id, question_id)
INSERT INTO mdl_questionnaire_question_type(typeid, type, has_choices, response_table) VALUES ('1', 'Yes/No', 'n', 'response_bool')
INSERT INTO mdl_questionnaire_question_type(typeid, type, has_choices, response_table) VALUES ('2', 'Text Box', 'n', 'response_text')
INSERT INTO mdl_questionnaire_question_type(typeid, type, has_choices, response_table) VALUES ('3', 'Essay Box', 'n', 'response_text')
INSERT INTO mdl_questionnaire_question_type(typeid, type, has_choices, response_table) VALUES ('4', 'Radio Buttons', 'y', 'resp_single')
INSERT INTO mdl_questionnaire_question_type(typeid, type, has_choices, response_table) VALUES ('5', 'Check Boxes', 'y', 'resp_multiple')
INSERT INTO mdl_questionnaire_question_type(typeid, type, has_choices, response_table) VALUES ('6', 'Dropdown Box', 'y', 'resp_single')
INSERT INTO mdl_questionnaire_question_type(typeid, type, has_choices, response_table) VALUES ('8', 'Rate (scale 1..5)', 'y', 'response_rank')
INSERT INTO mdl_questionnaire_question_type(typeid, type, has_choices, response_table) VALUES ('9', 'Date', 'n', 'response_date')
INSERT INTO mdl_questionnaire_question_type(typeid, type, has_choices, response_table) VALUES ('10', 'Numeric', 'n', 'response_text')
INSERT INTO mdl_questionnaire_question_type(typeid, type, has_choices, response_table) VALUES ('99', 'Page Break', 'n', '')
INSERT INTO mdl_questionnaire_question_type(typeid, type, has_choices, response_table) VALUES ('100', 'Section Text', 'n', '')

select distinct shortname, course from mdl_questionnaire tp join mdl_course c on tp.course = c.id;
+-----------------------------+--------+
| shortname | course |
+-----------------------------+--------+
| EHRD 473-521 (2011A) | 20 |
| VICP (Formative Evaluation) | 109 |
| VICP (2011) | 110 |
| PACT | 113 |
| EDAD 605-700 (2011C)_1 | 233 |
| EHRD 473-501 (2011C) | 226 |
| EHRD 477-500 (2011C) | 169 |
| TDPC1 | 239 |
| TDPC6 | 244 |
| EPSY 622-699/700 (2012A) | 269 |
| DCED 302-599 (2012A) | 352 |
+-----------------------------+--------+

Side_bar

  1. Version independent
  2. This requires Questionnaire module installed.
  3. download url: http://moodle.org/mod/data/view.php?d=13&rid=270
  4. Unzip under /blocks
  5. go to admin url, have it installed.
  6. Although it says "tables were added", it doesn't show any detail. Comparison of schemas before and after shows that there was no schema change.

Activities

In admin > modules > activities > manage activities, turn on journal, questionnaire and workshop.

Forum Post Approval

  1. Only for 1.9
  2. http://moodle.org/mod/data/view.php?d=13&rid=2296
  3. The patch comes in one text file, forum_post_approval.patch.
  4. 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 administration -> miscellaneous -> experimental -> enable groupings

should be checked.

mod/forum/patch_forum_approveposts.txt

Files modified by forum_post_approval_patch. (grep '\-\-\-' )

mod/forum/post.php
mod/forum/rate_ajax.js
mod/forum/rate.php
mod/forum/lib.php
mod/forum/rate_ajax.php
mod/forum/mod_form.php
lang/en_utf8/forum.php
lang/en_utf8/error.php
mod/forum/db/access.php

In moodle 1.9.12, the patch fails partially with the lang/en_utf8/forum.php, since the wording has changed from what the patch is expecting. We have to manually add/replace these lines.

$string['forum:approvepost'] = 'Approve posts';
$string['forumbodyhidden'] = 'This post cannot be viewed by you, probably because it has not yet been approved or you have not posted in the discussion.';

Local Modification

https://courses.cehd.tamu.edu/mod/forum/view.php?f=402

if ($forum->type == 'qanda') {
$firstpost = forum_get_firstpost_from_discussion($discussion->id);
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
$userfirstpost = forum_get_user_posted_time($discussion->id, $user->id);

return (($userfirstpost !== false && (time() - $userfirstpost >= $CFG->maxeditingtime)) ||
$firstpost->id == $post->id || $post->userid == $user->id || $firstpost->userid == $user->id ||
has_capability('mod/forum:viewqandawithoutposting', $modcontext, $user->id, false));
}

// BK This if block is added by the forum approval patch. It should kick in only when the
// forum requires approval, but the original patch didn't check the condition.
// Added $forum->approve == 1 && .
if ($forum->approve == 1 && $post->userid<>$user->id) {
if (isset($cm->cache->caps['mod/forum:approvepost'])) {
if (!$cm->cache->caps['mod/forum:approvepost']) {
if ($post->approved==0) {
return false;
}
}
} else {
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
if (!has_capability('mod/forum:approvepost', $modcontext, $user->id)) {
if ($post->approved==0) {
return false;
}
}
}
}

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

CREATE TABLE mdl_respondusws ( id BIGINT(10) unsigned NOT NULL auto_increment, course BIGINT(10) unsigned NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL DEFAULT '', intro MEDIUMTEXT, introformat SMALLINT(4) unsigned NOT NULL DEFAULT 0, timecreated BIGINT(10) unsigned NOT NULL DEFAULT 0, timemodified BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
Success
ALTER TABLE mdl_respondusws COMMENT='respondusws module instance data'
Success
CREATE INDEX mdl_resp_cou_ix ON mdl_respondusws (course)
Success
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('respondusws', 'add', 'respondusws', 'name')
Success
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('respondusws', 'update', 'respondusws', 'name')
Success
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('respondusws', 'view', 'respondusws', 'name')
Success
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('respondusws', 'view all', 'respondusws', 'name')
Success
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('respondusws', 'publish', 'respondusws', 'name')
Success
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('respondusws', 'retrieve', 'respondusws', 'name')
Success

Quiz Overview With IP

Files:

mod/quiz/report/overviewwithip
lang/en_utf8/quiz_overviewwithip.php

This is a local modification by Arlen, of mod/quiz/report/overview. The mod was made on 1.9.8, and there is some difference between 1.9.8's report.php and 1.9.12's report.php.

problem: Nothing to display

ticket 28361 Amber reported this problem

ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(`courses12`.`qa`.`timefinish` - `courses12`.`qa`.`timestart`)'

Changed duration from

qa.timefinish - qa.timestart AS duration

to

CASE WHEN qa.timefinish = 0 THEN null
WHEN qa.timefinish > qa.timestart THEN qa.timefinish - qa.timestart
ELSE 0 END AS duration,

Realtime Quiz

http://moodle.org/mod/forum/discuss.php?d=84093
by Davo Smith - Tuesday, September 6, 2011, 04:12 AM
There is a Moodle 2.0 version here: https://github.com/davosmith/moodle-realtimequiz
Unfortunately it is not quite complete - it does not allow images to be added, nor does it include backup/restore
code (but everything else *should* work fine).

  • Files are only under mod/realtimequiz/.

CREATE TABLE mdl_realtimequiz ( id BIGINT(10) unsigned NOT NULL auto_increment, course BIGINT(10) unsigned NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL DEFAULT '', status SMALLINT(3) unsigned NOT NULL DEFAULT 0, currentquestion BIGINT(10) unsigned NOT NULL DEFAULT 0, nextendtime BIGINT(10) unsigned NOT NULL DEFAULT 0, currentsessionid BIGINT(10) unsigned NOT NULL DEFAULT 0, questiontime SMALLINT(3) unsigned NOT NULL DEFAULT 30, classresult SMALLINT(3) unsigned NOT NULL DEFAULT 0, questionresult SMALLINT(3) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_realtimequiz COMMENT='Defines realtime quizzes'
CREATE TABLE mdl_realtimequiz_question ( id BIGINT(10) NOT NULL auto_increment, quizid BIGINT(10) unsigned NOT NULL DEFAULT 0, questionnum SMALLINT(3) unsigned NOT NULL DEFAULT 0, questiontext MEDIUMTEXT NOT NULL, questiontime MEDIUMINT(5) unsigned NOT NULL, image TEXT DEFAULT '', CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_realtimequiz_question COMMENT='Defines questions for the realtime quizzes'
CREATE INDEX mdl_realques_quique_ix ON mdl_realtimequiz_question (quizid, questionnum)
CREATE TABLE mdl_realtimequiz_answer ( id BIGINT(10) NOT NULL auto_increment, questionid BIGINT(10) unsigned NOT NULL DEFAULT 0, answertext MEDIUMTEXT NOT NULL, correct TINYINT(2) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_realtimequiz_answer COMMENT='The available answers for each question in the realtime quiz'
CREATE INDEX mdl_realansw_que_ix ON mdl_realtimequiz_answer (questionid)
CREATE TABLE mdl_realtimequiz_submitted ( id BIGINT(10) NOT NULL auto_increment, questionid BIGINT(10) unsigned NOT NULL DEFAULT 0, sessionid BIGINT(10) unsigned DEFAULT 0, userid BIGINT(10) unsigned NOT NULL DEFAULT 0, answerid BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_realtimequiz_submitted COMMENT='The answers that have been submitted by students'
CREATE INDEX mdl_realsubm_anssesque_ix ON mdl_realtimequiz_submitted (answerid, sessionid, questionid)
CREATE INDEX mdl_realsubm_use_ix ON mdl_realtimequiz_submitted (userid)
CREATE TABLE mdl_realtimequiz_session ( id BIGINT(10) NOT NULL auto_increment, name VARCHAR(255) NOT NULL DEFAULT '', quizid BIGINT(10) unsigned NOT NULL DEFAULT 0, timestamp BIGINT(10) unsigned DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_realtimequiz_session COMMENT='Details about each quiz session'
CREATE INDEX mdl_realsess_qui_ix ON mdl_realtimequiz_session (quizid)

Attendance

CREATE TABLE mdl_attforblock ( id BIGINT(10) unsigned NOT NULL auto_increment, course BIGINT(10) unsigned NOT NULL DEFAULT 0, name VARCHAR(255) DEFAULT NULL, grade BIGINT(10) NOT NULL DEFAULT 100, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_attforblock COMMENT='Module for support Attendances'
CREATE INDEX mdl_attf_cou_ix ON mdl_attforblock (course)
CREATE TABLE mdl_attendance_sessions ( id BIGINT(10) unsigned NOT NULL auto_increment, courseid BIGINT(10) unsigned NOT NULL DEFAULT 0, sessdate BIGINT(10) unsigned NOT NULL DEFAULT 0, duration BIGINT(10) unsigned NOT NULL DEFAULT 0, lasttaken BIGINT(10) unsigned DEFAULT NULL, lasttakenby BIGINT(10) unsigned NOT NULL DEFAULT 0, timemodified BIGINT(10) unsigned DEFAULT NULL, description VARCHAR(100) NOT NULL DEFAULT '', CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_attendance_sessions COMMENT='attendance_sessions table retrofitted from MySQL'
CREATE INDEX mdl_attesess_cou_ix ON mdl_attendance_sessions (courseid)
CREATE INDEX mdl_attesess_ses_ix ON mdl_attendance_sessions (sessdate)
CREATE TABLE mdl_attendance_log ( id BIGINT(10) unsigned NOT NULL auto_increment, sessionid BIGINT(10) unsigned NOT NULL DEFAULT 0, studentid BIGINT(10) unsigned NOT NULL DEFAULT 0, statusid BIGINT(10) unsigned NOT NULL DEFAULT 0, statusset VARCHAR(100) DEFAULT NULL, timetaken BIGINT(10) unsigned NOT NULL DEFAULT 0, takenby BIGINT(10) unsigned NOT NULL DEFAULT 0, remarks VARCHAR(255) DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_attendance_log COMMENT='attendance_log table retrofitted from MySQL'
CREATE INDEX mdl_attelog_ses_ix ON mdl_attendance_log (sessionid)
CREATE INDEX mdl_attelog_stu_ix ON mdl_attendance_log (studentid)
CREATE INDEX mdl_attelog_sta_ix ON mdl_attendance_log (statusid)
CREATE TABLE mdl_attendance_statuses ( id BIGINT(10) unsigned NOT NULL auto_increment, courseid BIGINT(10) unsigned NOT NULL DEFAULT 0, acronym VARCHAR(2) NOT NULL DEFAULT '', description VARCHAR(30) NOT NULL DEFAULT '', grade SMALLINT(3) NOT NULL DEFAULT 0, visible TINYINT(1) unsigned NOT NULL DEFAULT 1, deleted TINYINT(1) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_attendance_statuses COMMENT='attendance_statuses table retrofitted from MySQL'
CREATE INDEX mdl_attestat_cou_ix ON mdl_attendance_statuses (courseid)
CREATE INDEX mdl_attestat_vis_ix ON mdl_attendance_statuses (visible)
CREATE INDEX mdl_attestat_del_ix ON mdl_attendance_statuses (deleted)

Realtime Attendance

CREATE TABLE mdl_realtimeattendance ( id BIGINT(10) unsigned NOT NULL auto_increment, course BIGINT(10) unsigned NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL DEFAULT '', status SMALLINT(3) unsigned NOT NULL DEFAULT 0, currentquestion BIGINT(10) unsigned NOT NULL DEFAULT 0, nextendtime BIGINT(10) unsigned NOT NULL DEFAULT 0, currentsessionid BIGINT(10) unsigned NOT NULL DEFAULT 0, questiontime SMALLINT(3) unsigned NOT NULL DEFAULT 30, classresult SMALLINT(3) unsigned NOT NULL DEFAULT 0, questionresult SMALLINT(3) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_realtimeattendance COMMENT='Defines realtime quizzes'
CREATE TABLE mdl_realtimeattendance_question ( id BIGINT(10) NOT NULL auto_increment, quizid BIGINT(10) unsigned NOT NULL DEFAULT 0, questionnum SMALLINT(3) unsigned NOT NULL DEFAULT 0, questiontext VARCHAR(255) NOT NULL DEFAULT '', questiontime MEDIUMINT(5) unsigned NOT NULL, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_realtimeattendance_question COMMENT='Defines questions for the realtime quizzes'
CREATE INDEX mdl_realques_quique_ix ON mdl_realtimeattendance_question (quizid, questionnum)
CREATE TABLE mdl_realtimeattendance_answer ( id BIGINT(10) NOT NULL auto_increment, questionid BIGINT(10) unsigned NOT NULL DEFAULT 0, answertext VARCHAR(255) NOT NULL DEFAULT '', correct TINYINT(2) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_realtimeattendance_answer COMMENT='The available answers for each question in the realtime quiz'
CREATE INDEX mdl_realansw_que_ix ON mdl_realtimeattendance_answer (questionid)
CREATE TABLE mdl_realtimeattendance_submitted ( id BIGINT(10) NOT NULL auto_increment, questionid BIGINT(10) unsigned NOT NULL DEFAULT 0, sessionid BIGINT(10) unsigned DEFAULT 0, userid BIGINT(10) unsigned NOT NULL DEFAULT 0, answerid BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_realtimeattendance_submitted COMMENT='The answers that have been submitted by students'
CREATE INDEX mdl_realsubm_anssesque_ix ON mdl_realtimeattendance_submitted (answerid, sessionid, questionid)
CREATE INDEX mdl_realsubm_use_ix ON mdl_realtimeattendance_submitted (userid)
CREATE TABLE mdl_realtimeattendance_session ( id BIGINT(10) NOT NULL auto_increment, name VARCHAR(255) NOT NULL DEFAULT '', quizid BIGINT(10) unsigned NOT NULL DEFAULT 0, timestamp BIGINT(10) unsigned DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_realtimeattendance_session COMMENT='Details about each quiz session'
CREATE INDEX mdl_realsess_qui_ix ON mdl_realtimeattendance_session (quizid)

select distinct shortname, course from mdl_realtimeattendance tp join mdl_course c on tp.course = c.id;
+----------------------+--------+
| shortname | course |
+----------------------+--------+
| EHRD 473-501 (2011C) | 226 |
| EHRD 477-500 (2011C) | 169 |
+----------------------+--------+

Trackpad

  1. http://moodle.org/mod/data/view.php?d=13&rid=2867
  2. version 1.9 only (2.0 is not mentioned.)
  3. Download link on the module page does not work. This is the new one. http://mintranet.com.au/creativity-software
  4. So this module might actually work with moodle 2.0.
  5. Download link: http://mintranet.com.au/images/stories/files/trackpad_beta.zip
  6. Unzip under /mod
  7. Go to notification, and have database installed.
  8. Trackpad does not add an icon to themes automatically. Copy /mod/trackpad/icon.gif to /themes/cehd/pix/mod/trackpad/icon.gif. (/themes/cehd/pix/mod/trackpad does not exist, and should be created.)

CREATE TABLE mdl_trackpad ( id BIGINT(10) unsigned NOT NULL auto_increment, course BIGINT(10) unsigned NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL DEFAULT '', type VARCHAR(10) NOT NULL DEFAULT '', target LONGTEXT, targettype VARCHAR(10) NOT NULL DEFAULT '', duedate BIGINT(10) unsigned DEFAULT NULL, notes LONGTEXT, public VARCHAR(10) NOT NULL DEFAULT '', showblocks TINYINT(1) unsigned NOT NULL DEFAULT 0, permissions VARCHAR(10) DEFAULT NULL, presets LONGTEXT, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_trackpad COMMENT='trackpad table retrofitted from MySQL'
CREATE INDEX mdl_trac_cou_ix ON mdl_trackpad (course)
CREATE TABLE mdl_trackpad_page ( id BIGINT(10) unsigned NOT NULL auto_increment, trackpadid BIGINT(10) unsigned NOT NULL, ownerid BIGINT(10) unsigned NOT NULL, name VARCHAR(255) DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, duedate BIGINT(10) unsigned DEFAULT NULL, public TINYINT(1) unsigned NOT NULL, type VARCHAR(10) NOT NULL DEFAULT '', exploreid BIGINT(10) unsigned DEFAULT NULL, parent BIGINT(10) unsigned DEFAULT NULL, groupid BIGINT(10) unsigned DEFAULT 0, created BIGINT(10) unsigned DEFAULT 0, titlecolor VARCHAR(6) DEFAULT '999999', CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_trackpad_page COMMENT='trackpad_page table retrofitted from MySQL'
CREATE TABLE mdl_trackpad_page_history ( id BIGINT(10) unsigned NOT NULL auto_increment, pageid BIGINT(10) unsigned NOT NULL, timestamp BIGINT(10) unsigned NOT NULL, userid BIGINT(10) unsigned NOT NULL, target LONGTEXT, duedate BIGINT(10) unsigned DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_trackpad_page_history COMMENT='trackpad_page_history table retrofitted from MySQL'
CREATE TABLE mdl_trackpad_pagemember ( id BIGINT(10) unsigned NOT NULL auto_increment, userid BIGINT(10) unsigned NOT NULL, pageid BIGINT(10) unsigned NOT NULL, captain TINYINT(1) unsigned NOT NULL DEFAULT 0, primarypage BIGINT(10) unsigned DEFAULT NULL, invite TINYINT(1) unsigned DEFAULT 0, invitedby BIGINT(10) unsigned DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_trackpad_pagemember COMMENT='trackpad_pagemember table retrofitted from MySQL'
CREATE TABLE mdl_trackpad_todo ( id BIGINT(10) unsigned NOT NULL auto_increment, pageid BIGINT(10) unsigned NOT NULL, createdby BIGINT(10) unsigned NOT NULL, assignedto BIGINT(10) unsigned NOT NULL, dateentered BIGINT(10) unsigned NOT NULL, datefinished BIGINT(10) unsigned NOT NULL, finishedby BIGINT(10) unsigned NOT NULL, task VARCHAR(160) NOT NULL DEFAULT '', priority TINYINT(1) unsigned NOT NULL, todoorder BIGINT(10) unsigned DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_trackpad_todo COMMENT='trackpad_todo table retrofitted from MySQL'
CREATE TABLE mdl_trackpad_pageprimary ( id BIGINT(10) unsigned NOT NULL auto_increment, cmid BIGINT(10) unsigned DEFAULT NULL, userid BIGINT(10) unsigned DEFAULT NULL, pageid BIGINT(10) unsigned DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_trackpad_pageprimary COMMENT='trackpad_pageprimary table retrofitted from MySQL'
CREATE TABLE mdl_trackpad_follow ( id BIGINT(10) unsigned NOT NULL auto_increment, pageid BIGINT(10) unsigned NOT NULL, userid BIGINT(10) unsigned NOT NULL, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_trackpad_follow COMMENT='trackpad_follow table retrofitted from MySQL'
CREATE TABLE mdl_trackpad_explore ( id BIGINT(10) unsigned NOT NULL auto_increment, parentid BIGINT(10) unsigned NOT NULL, parenttype VARCHAR(20) NOT NULL DEFAULT '', typeid BIGINT(10) unsigned NOT NULL, type VARCHAR(20) NOT NULL DEFAULT '', pageid BIGINT(10) unsigned DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_trackpad_explore COMMENT='trackpad_explore table retrofitted from MySQL'
CREATE TABLE mdl_trackpad_cron ( date BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (date) )
ALTER TABLE mdl_trackpad_cron COMMENT='trackpad_cron table retrofitted from MySQL'
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('trackpad', 'view', 'trackpad', 'name')
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('trackpad', 'updatepage', 'trackpad', 'name')
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('trackpad', 'addpage', 'trackpad', 'name')
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('trackpad', 'addtask', 'trackpad', 'name')
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('trackpad', 'updatetask', 'trackpad', 'name')
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('trackpad', 'deletetask', 'trackpad', 'name')
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('trackpad', 'deletepage', 'trackpad', 'name')

Add Icon

  • Create /theme/cehd_custom/pix/mod/trackpad folder.
  • Copy /mod/trackpad/icon.gif to /theme/cehd_custom/pix/mod/trackpad/icon.gif

Bug fix - drag and drop

Drag and drop didn't work. It didn't work on courses11 either.

In mod/trackpad/lib.php, we should add effects.js and controls.js before scriptaculous.js, and add dragdrop.js later. The order matters, and this order works. There may be other order that works. There are 3 places this should be changed.

require_js(array('yui_yahoo', 'yui_dom', 'yui_event', 'yui_calendar',
$CFG->wwwroot.'/mod/trackpad/javascript/prototype.js',
$CFG->wwwroot.'/mod/trackpad/javascript/effects.js',
$CFG->wwwroot.'/mod/trackpad/javascript/controls.js',
$CFG->wwwroot.'/mod/trackpad/javascript/scriptaculous.js',
$CFG->wwwroot.'/mod/trackpad/javascript/dragdrop.js',
$CFG->wwwroot.'/mod/trackpad/javascript/trackpad.js'));

Trackpad download is now moved to http://mintranet.com.au/creativity-software. The link on moodle is broken. The new file is a beta, but it doesn't have the modification.

select distinct shortname, course from mdl_trackpad tp join mdl_course c on tp.course = c.id;
+-----------------------------+--------+
| shortname | course |
+-----------------------------+--------+
| CF101 | 2 |
| EHRD 621 (Ben Kim Test) | 3 |
| BldACourse 101_1 | 40 |
| VICP (Formative Evaluation) | 109 |
| VICP (2011) | 110 |
| VICP (2012) | 251 |
+-----------------------------+--------+

nanogong

For 1.9 only. (No 2.0)

http://gong.ust.hk/nanogong/moodle.html has download/installation instructions.

Install nanogong module

Unzip nanogong-4.1.zip under /mod to get /mod/nanogong. Go to notification to update database.

CREATE TABLE mdl_nanogong ( id BIGINT(10) unsigned NOT NULL auto_increment, name VARCHAR(255) NOT NULL DEFAULT '', course BIGINT(10) unsigned NOT NULL DEFAULT 0, message TEXT NOT NULL, color VARCHAR(7) DEFAULT NULL, maxduration SMALLINT(4) unsigned NOT NULL DEFAULT 300, maxmessages SMALLINT(4) unsigned NOT NULL DEFAULT 0, maxscore SMALLINT(4) unsigned NOT NULL DEFAULT 100, allowguestaccess TINYINT(1) unsigned NOT NULL DEFAULT 0, timecreated BIGINT(10) unsigned NOT NULL DEFAULT 0, timemodified BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_nanogong COMMENT='NanoGong table for an NanoGong activity'
CREATE UNIQUE INDEX mdl_nano_id_uix ON mdl_nanogong (id)
CREATE TABLE mdl_nanogong_message ( id BIGINT(10) unsigned NOT NULL auto_increment, nanogongid BIGINT(10) unsigned NOT NULL DEFAULT 0, userid BIGINT(10) unsigned NOT NULL DEFAULT 0, groupid BIGINT(10) unsigned NOT NULL DEFAULT 0, title VARCHAR(255) NOT NULL DEFAULT '', message TEXT NOT NULL, path TEXT NOT NULL, comments TEXT NOT NULL, commentedby BIGINT(10) unsigned DEFAULT NULL, score SMALLINT(4) unsigned NOT NULL DEFAULT 0, timestamp BIGINT(10) unsigned NOT NULL DEFAULT 0, timeedited BIGINT(10) unsigned DEFAULT NULL, locked TINYINT(1) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_nanogong_message COMMENT='NanoGong messages in each NanoGong activity'
CREATE INDEX mdl_nanomess_nan_ix ON mdl_nanogong_message (nanogongid)
CREATE INDEX mdl_nanomess_use_ix ON mdl_nanogong_message (userid)
CREATE INDEX mdl_nanomess_gro_ix ON mdl_nanogong_message (groupid)
CREATE UNIQUE INDEX mdl_nanomess_id_uix ON mdl_nanogong_message (id)

Install nanogong filter

Unzip nanogong-filter-4.1.zip under /filter, to get /filter/nanogong.

Install nanogong htmlarea

Unzip nanogong-htmlarea-4.1-moodle-1.9.11plus.zip under /.

This will replace several core files.

lang/en_utf8/editor.php
lib/editor/htmlarea/dialog.js
lib/editor/htmlarea/htmlarea.php
lib/weblib.php

So make a backup first.

zip ~/moodleroot-before-nanogong.zip `cat ~/nanogong-htmlarea-11plus-file-list.txt`

Add Icon

  • Create /theme/cehd_custom/pix/mod/nanogong folder.
  • Copy /mod/nanogong/icon.gif to /theme/cehd_custom/pix/mod/nanogong/icon.gif

This pages may be helpful.

  • Used in

select distinct shortname, course from mdl_nanogong tp join mdl_course c on tp.course = c.id;
+--------------------------+--------+
| shortname | course |
+--------------------------+--------+
| MEFB 460-501/503 (2011C) | 118 |
| Mañihuales project | 236 |
| EDCI 617-600 (2011C) | 140 |
+--------------------------+--------+

Certificate

CREATE TABLE mdl_certificate ( id BIGINT(10) unsigned NOT NULL auto_increment, course BIGINT(10) unsigned NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL DEFAULT '', intro TEXT, emailteachers TINYINT(2) unsigned NOT NULL DEFAULT 0, emailothers TEXT, savecert TINYINT(2) unsigned NOT NULL DEFAULT 0, reportcert TINYINT(2) unsigned NOT NULL DEFAULT 0, delivery SMALLINT(3) unsigned NOT NULL DEFAULT 0, certificatetype VARCHAR(50) NOT NULL DEFAULT '', borderstyle VARCHAR(30) NOT NULL DEFAULT '0', bordercolor VARCHAR(30) NOT NULL DEFAULT '0', printwmark VARCHAR(30) NOT NULL DEFAULT '0', printdate BIGINT(10) unsigned NOT NULL DEFAULT 0, datefmt BIGINT(10) unsigned NOT NULL DEFAULT 0, printnumber BIGINT(10) unsigned NOT NULL DEFAULT 0, printgrade BIGINT(10) unsigned NOT NULL DEFAULT 0, gradefmt BIGINT(10) unsigned NOT NULL DEFAULT 0, printoutcome BIGINT(10) unsigned NOT NULL DEFAULT 0, printhours TEXT, lockgrade BIGINT(10) unsigned NOT NULL DEFAULT 0, requiredgrade SMALLINT(4) unsigned NOT NULL DEFAULT 0, printteacher BIGINT(10) unsigned NOT NULL DEFAULT 0, customtext TEXT, printsignature VARCHAR(30) NOT NULL DEFAULT '0', printseal VARCHAR(30) NOT NULL DEFAULT '0', timemodified BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_certificate COMMENT='Defines certificates'
CREATE TABLE mdl_certificate_issues ( id BIGINT(10) unsigned NOT NULL auto_increment, certificateid BIGINT(10) unsigned NOT NULL DEFAULT 0, userid BIGINT(10) unsigned NOT NULL DEFAULT 0, timecreated BIGINT(10) unsigned NOT NULL DEFAULT 0, studentname VARCHAR(40) NOT NULL DEFAULT '', code VARCHAR(40) DEFAULT NULL, classname VARCHAR(254) NOT NULL DEFAULT '', certdate BIGINT(10) unsigned DEFAULT 0, reportgrade VARCHAR(10) DEFAULT NULL, mailed TINYINT(1) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_certificate_issues COMMENT='Info about issued certificates'
CREATE TABLE mdl_certificate_linked_modules ( id BIGINT(10) unsigned NOT NULL auto_increment, certificate_id BIGINT(10) unsigned NOT NULL DEFAULT 0, linkid BIGINT(10) NOT NULL DEFAULT 0, linkgrade BIGINT(10) NOT NULL DEFAULT 0, timemodified BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_certificate_linked_modules COMMENT='Defines certificate dependencies'
CREATE INDEX mdl_certlinkmodu_lin_ix ON mdl_certificate_linked_modules (linkid)
CREATE INDEX mdl_certlinkmodu_cer_ix ON mdl_certificate_linked_modules (certificate_id)
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('certificate', 'view', 'certificate', 'name')
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('certificate', 'add', 'certificate', 'name')
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('certificate', 'update', 'certificate', 'name')
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('certificate', 'report', 'certificate', 'name')
INSERT INTO mdl_log_display(module, action, mtable, field) VALUES ('certificate', 'received', 'certificate', 'name')

select distinct shortname, course from mdl_certificate tp join mdl_course c on tp.course = c.id;
+---------------------+--------+
| shortname | course |
+---------------------+--------+
| A0101_5 | 64 |
| A0101_4 | 68 |
| HLKN Advising | 98 |
| AO101 | 103 |
| AO102 | 104 |
| AO106 | 106 |
| HLKN_ELL | 111 |
| OMT101 | 114 |
| TDPC6 | 244 |
| TDPC1 | 239 |
| TDPC3 | 241 |
| AO104 | 81 |
| AO105 | 82 |
| AO103 | 105 |
+---------------------+--------+

OnlineTesting

This is an assignment type added by Arlen. http://onlinetesting.cehd.tamu.edu.

Files:

mod/assignment/type/onlinetesting/assignment.class.php
lang/en_utf8/help/assignment/onlinetesting_classid.html
lang/en_utf8/help/assignment/onlinetesting_examid.html

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

Changes to Assignment

patch for mod/assignment/lib.php

20110712

Due to changes in mysql 5.5.10, SIGN(s.timemarked - s.timemodified) causes this error: (both timemarked and timemodified are unsigned BigInt.)

SELECT COALESCE(SIGN(SIGN(s.timemarked) + SIGN(s.timemarked - s.timemodified)), 0) AS status FROM mdl_user u LEFT JOIN mdl_assignment_submissions s ON u.id = s.userid AND s.assignment = 18 WHERE u.id =4 ORDER BY lastname ASC;

ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(`courses12`.`s`.`timemarked` - `courses12`.`s`.`timemodified`)'

The fix is in this patch. See http://moodle.org/mod/forum/discuss.php?d=167923.

===================================================================
--- mod/assignment/lib.php (revision 37)
+++ mod/assignment/lib.php (working copy)
@@ -1205,7 +1205,7 @@
$select = 'SELECT u.id, u.firstname, u.lastname, u.picture, u.imagealt,
s.id AS submissionid, s.grade, s.submissioncomment,
s.timemodified, s.timemarked,
- COALESCE(SIGN(SIGN(s.timemarked) + SIGN(s.timemarked - s.timemodified)), 0) AS status ';
+ COALESCE(SIGN(SIGN(s.timemarked) + SIGN(cast((s.timemarked - s.timemodified) as signed))), 0) AS status ';
$sql = 'FROM '.$CFG->prefix.'user u '.
'LEFT JOIN '.$CFG->prefix.'assignment_submissions s ON u.id = s.userid
AND s.assignment = '.$this->assignment->id.' '.

Can't view submitted assignments. (20110712)

  • Changes to lib/tablelib.php

When a grader views "View submitted assignments", the page returns "nothing to display" even if there are submissions. The problem is that for some reason, the page defaults to show people with firstname and lastname beginning with A. There seems to be some logic issue.

So we add another initialization.

$this->sess->i_first = ;
$this->sess->i_last = ;

before

if(isset($_GET[$this->request[TABLE_VAR_ILAST]])) {

The initialization to "A" happens in mod/assignment/lib.php's $table->setup();

My Moodle page

Problem = • My Moodle Index page is different on courses12 from courses.

The my moodle page (https://courses12.cehd.tamu.edu/my) listed assignments, but not courses.

In my/index.php

print_overview($courses);

In course/lib.php

function print_overview($courses) {

Make the following change.

 

Index: course/lib.php
===================================================================
--- course/lib.php (revision 37)
+++ course/lib.php (working copy)
@@ -820,11 +820,13 @@
$linkcss = 'class="dimmed"';
}
print_heading('<a title="'. format_string($course->fullname).'" '.$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'. format_string($course->fullname).'</a>');
+ /* //BK: disable course-module-level dashboard
if (array_key_exists($course->id,$htmlarray)) {
foreach ($htmlarray[$course->id] as $modname => $html) {
echo $html;
}
}
+ */ //BK: end
print_simple_box_end();
}
}

Question and Answer forums display different in courses12 than courses

Moodle 1.9.8

1.9.8

Moodle 1.9.12

1.9.12

This is a Question and Answer forum. In order to see other responses to these Questions, you must first post your Answer (string qandanotify)

 

function forum_user_can_see_post($forum, $discussion, $post, $user=NULL, $cm=NULL) {
if ($post->userid<>$user->id) {
if (isset($cm->cache->caps['mod/forum:approvepost'])) {
} else {
if (!has_capability('mod/forum:approvepost', $modcontext, $user->id)) {
if ($post->approved==0) {
return false;

In lib.php

function forum_print_discussion_header
if ($post->approved || $usercansee) {
$post->subject = format_string($post->subject,true);
} else {
$post->subject = get_string('forumsubjecthidden','forum');
}

diagnosis

This problem is caused by the forum approval patch. The patch adds forum_user_can_see_post OR is_approved as a condition to seeing the posts - and it is somehow preventing a student from viewing the teacher's post. Didn't find a good solution yet.

fix

Move this block (from forum approval patch) to below if ($forum->type == 'qanda') { in lib.php line 4812.

 

if ($post->userid<>$user->id) {
if (isset($cm->cache->caps['mod/forum:approvepost'])) {
if (!$cm->cache->caps['mod/forum:approvepost']) {
if ($post->approved==0) {
return false;
}
}
} else {
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
if (!has_capability('mod/forum:approvepost', $modcontext, $user->id)) {
if ($post->approved==0) {
return false;
}
}
}
}

30 minutes delay time

When Teacher posts a question, student can view the question, but not the answers of others. It is to prevent students copying others' ideas.

The student can post her/his answer, and is given a 30 minutes edit window to edit her/his answer. During this delay time, the student still cannot view the answers of others, for the same reason.

Once the edit time (30 minutes) is over, the student can view the answers of others. At this time s/he cannot edit her/his own answer any more.

Problem: Backup of courses with user data

There is a problem with xmlize function used in backup. This causes errors during large backups with user data. No solution is found yet. Large backups with user data might be needed for Continuing Ed or Accelerate Online students.

Creating course modules

INSERT INTO mdl_backup_ids ( BACKUP_CODE, TABLE_NAME, OLD_ID, NEW_ID, INFO ) VALUES ( 1310672718, 'assignment', 798, 0, 'infile' )
INSERT INTO mdl_backup_ids ( BACKUP_CODE, TABLE_NAME, OLD_ID, NEW_ID, INFO ) VALUES ( 1310672718, 'forum', 786, 0, 'infile' )

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 77 bytes) in /disks/www/courses12/lib/xmlize.php on line 53

Warning: Invalid callback ADODB_Session::close, class 'ADODB_Session' not found in Unknown on line 0

 

Modification: Change Backup Page to show "User Data" unchecked by default

Change 3rd arg of print_checkbox from $$var to $cehd_want_user_data in backup_form.html

$backupuserinfo = false;
$cehd_want_user_data = false;
...
foreach ($allmods as $mod) {
print_checkbox($var, $$var, $cehd_want_user_data, get_string('userdata')...
...
foreach ($instances as $instance) {
print_checkbox($var,$$var,$cehd_want_user_data,get_string('userdata'),...

Backup

In config.php add $CFG->extramemorylimit='1024M'; This setting is used in backup/lib.php, backup/backup.php and backup/restore.php

jclic

CREATE TABLE mdl_jclic ( id BIGINT(10) unsigned NOT NULL auto_increment, course BIGINT(10) unsigned NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL DEFAULT '', description TEXT, url VARCHAR(255) NOT NULL DEFAULT '', skin VARCHAR(20) NOT NULL DEFAULT '', maxattempts SMALLINT(3) DEFAULT 0, width MEDIUMINT(5) unsigned DEFAULT 600, height MEDIUMINT(5) unsigned DEFAULT 400, avaluation VARCHAR(10) DEFAULT NULL, maxgrade VARCHAR(15) DEFAULT NULL, lang VARCHAR(10) DEFAULT NULL, exiturl VARCHAR(255) DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
Success
ALTER TABLE mdl_jclic COMMENT='Main information about each jclic activity'
Success
(mysql): CREATE INDEX mdl_jcli_cou_ix ON mdl_jclic (course)
Success
(mysql): CREATE TABLE mdl_jclic_sessions ( id BIGINT(10) unsigned NOT NULL auto_increment, jclicid BIGINT(10) unsigned NOT NULL DEFAULT 0, session_id VARCHAR(50) NOT NULL DEFAULT '', user_id VARCHAR(50) NOT NULL DEFAULT '0', session_datetime DATETIME NOT NULL, project_name VARCHAR(100) NOT NULL DEFAULT '', session_key VARCHAR(50) DEFAULT NULL, session_code VARCHAR(50) DEFAULT NULL, session_context VARCHAR(50) DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
Success
(mysql): ALTER TABLE mdl_jclic_sessions COMMENT='Main information about each jclic session'
Success
(mysql): CREATE UNIQUE INDEX mdl_jclisess_ses_uix ON mdl_jclic_sessions (session_id)
Success
(mysql): CREATE INDEX mdl_jclisess_use_ix ON mdl_jclic_sessions (user_id)
Success
(mysql): CREATE INDEX mdl_jclisess_jcl_ix ON mdl_jclic_sessions (jclicid)
Success
(mysql): CREATE TABLE mdl_jclic_activities ( id BIGINT(10) unsigned NOT NULL auto_increment, session_id VARCHAR(50) NOT NULL DEFAULT '', activity_id MEDIUMINT(5) unsigned NOT NULL DEFAULT 0, activity_name VARCHAR(50) NOT NULL DEFAULT '', num_actions SMALLINT(4) unsigned DEFAULT NULL, score SMALLINT(4) unsigned DEFAULT NULL, activity_solved TINYINT(1) unsigned DEFAULT NULL, qualification SMALLINT(3) unsigned DEFAULT NULL, total_time MEDIUMINT(5) unsigned DEFAULT NULL, activity_code VARCHAR(50) DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
Success
(mysql): ALTER TABLE mdl_jclic_activities COMMENT='Stores user information for each jclic activity'
Success
(mysql): CREATE INDEX mdl_jcliacti_ses_ix ON mdl_jclic_activities (session_id)
Success
(mysql): CREATE TABLE mdl_jclic_settings ( setting_key VARCHAR(255) NOT NULL DEFAULT '', setting_value VARCHAR(255) NOT NULL DEFAULT '', CONSTRAINT PRIMARY KEY (setting_key) )
Success
(mysql): ALTER TABLE mdl_jclic_settings COMMENT='Stores settings information'
Success
(mysql): CREATE TABLE mdl_jclic_groups ( id BIGINT(10) unsigned NOT NULL auto_increment, group_id VARCHAR(50) NOT NULL DEFAULT '', group_name VARCHAR(80) NOT NULL DEFAULT '', group_description VARCHAR(255) DEFAULT NULL, group_icon VARCHAR(255) DEFAULT NULL, group_code VARCHAR(50) DEFAULT NULL, group_keywords VARCHAR(255) DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
Success
(mysql): ALTER TABLE mdl_jclic_groups COMMENT='Compatibility with JClic Reports'
Success
(mysql): CREATE TABLE mdl_jclic_users ( id BIGINT(10) unsigned NOT NULL auto_increment, user_id VARCHAR(50) NOT NULL DEFAULT '', group_id VARCHAR(50) NOT NULL DEFAULT '', user_name VARCHAR(80) NOT NULL DEFAULT '', user_pwd VARCHAR(255) DEFAULT NULL, user_icon VARCHAR(255) DEFAULT NULL, user_code VARCHAR(50) DEFAULT NULL, user_keywords VARCHAR(255) DEFAULT NULL, CONSTRAINT PRIMARY KEY (id) )
Success
(mysql): ALTER TABLE mdl_jclic_users COMMENT='Compatibility with JClic Reports'
Success
(mysql): INSERT INTO mdl_jclic_settings(setting_key, setting_value) VALUES ('ALLOW_CREATE_GROUPS', 'false')
Success
(mysql): INSERT INTO mdl_jclic_settings(setting_key, setting_value) VALUES ('ALLOW_CREATE_USERS', 'false')
Success
(mysql): INSERT INTO mdl_jclic_settings(setting_key, setting_value) VALUES ('SHOW_GROUP_LIST', 'false')
Success
(mysql): INSERT INTO mdl_jclic_settings(setting_key, setting_value) VALUES ('SHOW_USER_LIST', 'false')
Success
(mysql): INSERT INTO mdl_jclic_settings(setting_key, setting_value) VALUES ('USER_TABLES', 'true')
Success
(mysql): INSERT INTO mdl_jclic_settings(setting_key, setting_value) VALUES ('TIME_LAP', '10')

drag and drop

Drag and drop question type. Goes under question/type/dragdrop. It does not show up in module or block list page.

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

Page says it's good for moodle 1.6 and later. It works with 1.9.12.

CREATE TABLE mdl_question_dragdrop ( id BIGINT(10) unsigned NOT NULL auto_increment, questionid BIGINT(10) unsigned NOT NULL DEFAULT 0, backgroundmedia BIGINT(10) NOT NULL DEFAULT 0, dragdropmedia VARCHAR(255) NOT NULL DEFAULT '', freestyle SMALLINT(4) unsigned NOT NULL DEFAULT 0, feedbackfraction VARCHAR(10) NOT NULL DEFAULT '0.0', feedbackok LONGTEXT NOT NULL, feedbackmissed LONGTEXT NOT NULL, arrangemedia SMALLINT(4) NOT NULL DEFAULT 0, placemedia SMALLINT(4) NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_question_dragdrop COMMENT='Options for dragdrop questions'
CREATE INDEX mdl_quesdrag_que_ix ON mdl_question_dragdrop (questionid)
CREATE TABLE mdl_question_dragdrop_hotspot ( id BIGINT(10) unsigned NOT NULL auto_increment, questionid BIGINT(10) unsigned NOT NULL DEFAULT 0, x BIGINT(10) NOT NULL DEFAULT 0, y BIGINT(10) NOT NULL DEFAULT 0, width BIGINT(10) unsigned NOT NULL DEFAULT 0, height BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_question_dragdrop_hotspot COMMENT='Defines the hotspot areas for drag-and-drop questions'
CREATE INDEX mdl_quesdraghots_que_ix ON mdl_question_dragdrop_hotspot (questionid)
CREATE TABLE mdl_question_dragdrop_media ( id BIGINT(10) unsigned NOT NULL auto_increment, questionid BIGINT(10) unsigned NOT NULL DEFAULT 0, questiontext LONGTEXT NOT NULL, media VARCHAR(255) NOT NULL DEFAULT '', alt LONGTEXT NOT NULL, width BIGINT(10) unsigned NOT NULL DEFAULT 0, height BIGINT(10) unsigned NOT NULL DEFAULT 0, mimetype VARCHAR(100) NOT NULL DEFAULT '', targetx BIGINT(10) NOT NULL DEFAULT 0, targety BIGINT(10) NOT NULL DEFAULT 0, displaywidth BIGINT(10) unsigned NOT NULL DEFAULT 0, displayheight BIGINT(10) unsigned NOT NULL DEFAULT 0, positioned SMALLINT(4) unsigned NOT NULL DEFAULT 0, hotspots VARCHAR(200) NOT NULL DEFAULT '', primary_hotspot BIGINT(12) NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
ALTER TABLE mdl_question_dragdrop_media COMMENT='Media objects for drag-and-drop questions'
CREATE INDEX mdl_quesdragmedi_que_ix ON mdl_question_dragdrop_media (questionid)

session error

A server error that affects your login session was detected. Please login again or restart your browser.

In lib/moodlelib.php

function report_session_error() {

redirect($FULLME, get_string('sessionerroruser2', 'error'), 5);

Modification to lib/tablelib.php

When grading, the firstname and lastname filters for student list is set to the wrong initial values. Add

$this->sess->i_first = ;
$this->sess->i_last = ;

before

if(isset($_GET[$this->request[TABLE_VAR_ILAST]])) {

(line 362)

Email based registration

flow

Process Flow

authentication

  1. Enable email-based registration.
    1. Enable Recaptcha.

common settings for authentication

  1. Enable "self registration" selecting "Email-based self-registration".
  2. Set up Recaptcha
    1. Visit http://www.google.com/recaptcha
    2. Generate Recaptcha keys () - Copy public key and private key to moodle's setting screen, and save changes.
    3. Update "RECAPTCHA_API_SECURE_SERVER" in lib/recaptchalib.php

define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api");

Courses > Enrollment setting

  1. Enable External Database

enrol_dbtype = mysql
enrol_dbhost = 192.168.128.182
enrol_dbuser = cehdmoodle
enrol_dbpass = ******
enrol_dbname = courses12
enrol_dbtable = cehd_enrollment
enrol_localcoursefield = shortname
enrol_localuserfield = username

  1. Add cehd_enrollment table

\u courses12
create table cehd_enrollment (
id int auto_increment primary key,
course varchar(100),
user varchar(100),
role varchar(100),
email varchar(100)
);
grant all privileges on cehd_enrollment to 'cehdmoodle'@'%';
flush privileges;

/login/signup.php

  1. Copy to mentor.php
  2. Remove contents and replace with

<?php
require_once('../config.php');
echo "Access to this page is not allowed.";
redirect($CFG->wwwroot);
?>

/login/signup_form.php

// BK Added following 1 line.
// Temporary solution for OMT users (email based registration)
// TODO: Eliminate this from the form. Use email as username.
$mform->addElement('static', 'passwordpolicyinfo', , 'Please use your email address as u sername. It should be the same as the email address in the "More details" box.');

config.php

// BK Added 2 lines below for OMT courses.
$CFG->omt_admin_name = 'Ben Smith';
$CFG->omt_admin_email = 'bsmith@cehd.tamu.edu';
// End BK

 

/login/mentor.php

  1. This is a copy of the original moodle's "signup.php".
  2. No change in contents from signup.php.

/login/confirm.php

  1. Copy original to "approve.php"
  2. Modify confirm.php as follows.

See diff diff confirm.php or do

svn diff -r 87 confirm.php

since this revision is 88.

Changed this page function. When user confirms email, this page now will send an email to OMT admin. The original confirm.php function is transferred to approve.php.

function add_survey_enrollment($user) {
function send_confirmation_email_toadmin($user) {

When OMT admin (Ben Smith) confirms the link, the account is approved,

and the user is enrolled in OMT101 course.

(Currently, the self registration is directed only toward OMT101.)

/auth/email/auth.php

  1. Customize first email message to user.

// BK Changed following 1 line.
// Purpose: Customize message for OMT course.
// This sends the first email to user.
if (! omt_send_confirmation_email($user, 'email_confirmation_needed_notice')) {

  1. Customize first screen message to user.

// BK Changed following 1 line.
// Purpose: Customize message for OMT course.
// This is the first screen message after self registration.
notice(get_string('emailconfirmsent_omt', , $user->email), "$CFG->wwwroot/index.php");

/lib/moodlelib.php

  1. Added 2 functions, to customize messages to users.

function generate_email_signoff_omt()
function omt_send_confirmation_email($user, $purpose)

TODO: if possible, create an "OMT" auth plugin based on EMAIL based registration plugin. Move functions into that custom plugin, out of moodlelib.php.

/lang/en_utf8/moodle.php

  1. Added strings

$string['approved'] = 'You have approved the registration';

 

$string['emailconfirmation_omt'] = 'Hi $a->firstname,

A new account has been requested at \'$a->sitename\'
using your email address.

To confirm your new account, please go to this web address:

$a->link

In most mail programs, this should appear as a blue link
which you can just click on. If that doesn\'t work,
then cut and paste the address into the address
line at the top of your web browser window.

Once you successfully confirm your email, your request will
be reviewed by the administrator.
Once it is approved, you will receive another email
confirming your account within the next business day.

If you need help, please contact the course administrator,
$a->admin';

 

$string['emailconfirmation_omt_admin'] = 'User: $a->firstname.
Course: Online Mentor Training

To approve this new account, please click the following link:

$a->link

In most mail programs, this should appear as a blue link
which you can just click on. If that doesn\'t work,
then cut and paste the address into the address
line at the top of your web browser window.

If you need help, please contact the site administrator,
$a->admin';

 

$string['emailconfirmation_omt_approval'] = '$a->firstname,

Thank you for participating in the Texas A&M Online Mentor Training. The steps for accessing the module are listed below.

Go to - \'$a->link\'.
Click on the link that says “Login for others”.

Enter your username and password and click the “Login” button.
Click on Online Mentor Training.

You are now in the course and should proceed through the three steps listed.
When finished, print the Certificate of Completion for your records.
If you do have any problems or concerns, please email cehdmoodle@tamu.edu.
Thanks for your help with this TEA requirement.

Sincerely,

Ben Smith
Director, Instructional Technology Group
College of Education and Human Development
Texas A&M University
ben_smith@tamu.edu
';

 

$string['emailconfirmsent_omt'] = '<p>An email should have been sent to your address at <b>$a</b></p>
<p>It contains instructions to complete your registration.</p>
<p>If you have difficulty, contact the site administrator.</p>';

/login/approve.php

This is a copy of confirm.php modified as below.

[bkim@moodledev11 login]$ diff approve.php ~/courses12/login/confirm.php
51,56d50
< $omt = omt_send_confirmation_email($USER, 'account_approval_notice');
< error_log("omt\n".print_r($omt,true),3,"/disks/www/moodledevdata/2/omt.moo");
< if (! $omt) {
< error("Could not send the approval email");
< }
<
65c59
< print_header(get_string("approved"), get_string("approved"), array(), "");
---
> print_header(get_string("confirmed"), get_string("confirmed"), array(), "");
67,69c61,62
< echo "<h3>You have approved the account for ". fullname($USER) . ". An email was sent to the user.</h3>\n";
< // echo "<h3>".get_string("thanks").", ". fullname($USER) . "</h3>\n";
< // echo "<p>".get_string("confirmed")."</p>\n";
---
> echo "<h3>".get_string("thanks").", ". fullname($USER) . "</h3>\n";
> echo "<p>".get_string("confirmed")."</p>\n";

Dependency backup (SOLVED)

For Continuing Ed (Accelerated Online users). When courses are moved over, images need to be checked.

Problem description

Backup setting

  • No user data: no dependency, no groups
  • With user data: no dependency, no groups
  • With user data and roles: no dependency but groups OK

How to reproduce the problem

fix

IN mod/lesson/restorelib.php ADD THIS BLOCK:

// BK: Remap dependency links
if ($lessons = get_records_select('lesson', "dependency != 0 AND course = $restore->course_id", '
foreach ($lessons as $lesson) {
if ($newcmid = backup_getid($restore->backup_unique_code, 'lesson', $lesson->dependency))
$status = $status and set_field('lesson', 'dependency', $newcmid->new_id, 'id', $less
}
}
}
// end BK

BEFORE:

// Remap activity links

Journal Limits Entries to 64K

mdl_journal_entries.text is of "text" type, and it allows only 64K characters. This silently truncates longer submissions, as documented in http://tracker.moodle.org/browse/MDL-15678. In courses 12, the field was changed to "mediumtext" data type as of Mar 28, 2012. The problem stays the same in moodle 2.2 so it should also be changed.

alter table mdl_journal_entries change text text mediumtext;

Others

Module Icon issue

Some modules icons are not picked up by the theme. Not sure whether this should be done as part of theme design, but since modules can be added after theme setup is completed, icons should be copied into theme directory.

mkdir /disks/www/courses12/theme/cehd/pix/mod/nanogong
mkdir /disks/www/courses12/theme/cehd/pix/mod/attforblock
mkdir /disks/www/courses12/theme/cehd/pix/mod/realtimeattendance
cp /disks/www/courses12/mod/realtimeattendance/icon.gif /disks/www/courses12/theme/cehd/pix/mod/realtimeattendance
cp /disks/www/courses12/mod/attforblock/icon.gif /disks/www/courses12/theme/cehd/pix/mod/attforblock
cp /disks/www/courses12/mod/nanogong/icon.gif /disks/www/courses12/theme/cehd/pix/mod/nanogong

File does not exist

touch /disks/www/courses12/_vti_bin
touch /disks/www/courses12/_vti_inf.html
touch /disks/www/courses12/apple-touch-icon-114x114-precomposed.png
touch /disks/www/courses12/apple-touch-icon-72x72-precomposed.png
touch /disks/www/courses12/apple-touch-icon-72x72.png
touch /disks/www/courses12/apple-touch-icon-precomposed.png
touch /disks/www/courses12/apple-touch-icon.png
touch /disks/www/courses12/assets
cp /disks/www/courses12/pix/f/docm.gif /disks/www/courses12/theme/cehd/pix/f/docm.gif
cp /disks/www/courses12/pix/f/dotx.gif /disks/www/courses12/theme/cehd/pix/f/dotx.gif
cp /disks/www/courses12test/theme/chameleon/pix/t/switch_whole.gif /disks/www/courses12/theme/cehd/pix/t/switch_whole.gif

Taxonomy: