Monday, June 4, 2012

Moodle 2 restore questionnaire

Backup from moodle 1.9 to moodle 2 will not include the questionnaire. However, now there is a fix already. Here is the information http://tracker.moodle.org/browse/CONTRIB-3044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel Simply download lib.php and place it to mod/questionnaire/backup/moodle1/lib.php

Wednesday, May 2, 2012

Moodle lang set default value in database

To set default value for user language in the table mdl_user, simply run this alter table mdl_user alter lang set default 'en_us';

Thursday, April 5, 2012

Upgrade to moodle 2 issue and fix

If upgrading from 1.9 to moodle 2 and you're running into issue like

!! Data too long for column 'questiontext' at row 1

Fix is

Running ALTER TABLE mdl_question MODIFY questiontext MEDIUMTEXT;

Sunday, April 1, 2012

Moodle 2 moodledata directory

Here is the info for moodledata directory in moodle 2

For example
moodledata/filedir/d2/90/d2901f1f5f46134bd8cd767448c1da7daf9a41a2

Then connect to the Moodle 2 database and run a query

SELECT * FROM mdl_files WHERE contenthash = 'd2901f1f5f46134bd8cd767448c1da7daf9a41a2';

Thursday, March 29, 2012

Moodle Timezone add UTC+14

Edit the moodle/lib/moodlelib.php and do a search for get_list_of_timezones() and change 13 to 14

USB Mouse not working in XP SP3

If you plug in USB Mouse and getting hid class error complaining about some windows 95 incompatible INF, here is the fix

1. Open %windir%\inf folder (Must show hidden files)
2. Backup and delete these files:

- INFCache.1
- msmouse.pnf
- input.pnf

3. Open a command line and run
Net stop Cryptsvc
4. Backup and delete this folder “%windir%\system32\catroot2”
5. Reboot the computer to make sure the information was clean up.
6. Insert USB mouse to another port which hasn’t been used before.

Thursday, February 9, 2012

How to find orphaned modules in moodle

SELECT cm.id, m.name AS modname FROM mdl_course_modules cm JOIN mdl_modules m ON m.id = cm.module WHERE cm.course = 1398 AND cm.section = 1513;

then list will show up.
delete from mdl_course_modules where id = 1523; (replace the id that associate with book and chat)