Wednesday, August 31, 2011

Bulk Updates to User Authentication in #Moodle

Image Source: http://wamsoftinc.com/images/authenticate.jpg
Wondering what steps to take to change the way users "authenticate" in Moodle from LDAP to Manual or vice versa? Sometimes, it's necessary to do mass updates to your users that you don't want to do one by one and/or the bulk update tool isn't appropriate.


In the screenshot above, notice that "auth" column reflections how users are authenticating in Moodle. You can change that authentication in one fell swoop rather than going one by one...this is handy when you're dealing with more than 20 users.

To switch authentication in bulk, you can do that in a tool like PHPMyAdmin. I had to do that once or twice before we switched to LDAP authentication for students.


Some SQL commands to find and update user authentication....

To FIND users (the WHERE command is critical since what you find is what you can update):
  • SELECT * FROM `mdl_user` WHERE auth='manual'
    This will give you a list of everyone who has authentication set to manual. You could switch 'manual' to 'ldap' and get corresponding results.
To UPDATE users, you can use the command below. Notice that the WHERE command should be identical to the one you used to FIND users. This helps ensure you're not accidentally wiping out other users.
  • UPDATE 'mdl_user'
    SET auth='ldap'
    WHERE auth='manual'

    This update command will change everyone who is LDAP authenticated to manual. If you switch 'ldap' with 'manual' you will get the opposite result.
As always, while it's fun to play with MySQL commands, make sure to make a backup of the mdl_user table (SQL dump) before starting down this road.




Get Blog Updates via Email!
Enter your email address:
Delivered by FeedBurner
PingIt!

Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure

Recursively Deleting Files by Extension and Empty Directories

Image Source: http://systemcentercentral.com/Portals/0/VivoIndexItem/Index23742/WLW-RecursivelyDeleteReadOnlyDirectoriesSubd_F9F8-powershell2xa4_2.jpg

Cleaning out some files, I realized I had a lot of unneeded files that were all the same extension. Unfortunately, they were scattered inside of a million folders. What I needed was a command that would go through each folder and delete those files, saving me the effort of doing that. Then, after that, get rid of any empty directories that might have been left behind.

Two commands that can be given at the command line in UbuntuLinux (or Peppermint Linux which is what I was using) work...check further down in this post for how to on other platforms:

To recursively delete files with a particular filename extension:
find /home/mg/Desktop/books -iname "*.html" -exec rm '{}' ';'
In the command above, simply replace HTML with the filename extension you want to get rid of...could be XLS, ODF, PDF, MP3, MOV, whatever.

To delete empty directories, I used this command:
find -depth -type d -empty -exec rmdir {} \;
Both worked great and my hard drive is now free of unwanted files and directories. By the way, these commands run FAST. You blink and it's done. So, be careful.

Update: Interested in copying selected files from directories into one directory on GNU/Linux? Use this command:
find  /home/mg/Desktop/books -iname "*.html" -exec cp {} /home/mg/Desktop/html \;
If you want to move selected files, just use this command:
find  /home/mg/Desktop/books -iname "*.html" -exec mv {} /home/mg/Desktop/html \;

Get Blog Updates via Email!
Enter your email address:
Delivered by FeedBurner
PingIt!

Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure

Modifying Your PHP Ini Settings for Improved #Moodle 1.9 Performance


On the MoodleMayhem.org list, someone asked:
Need a little help. I am backing up courses in 1.9.6, I have two courses that are not backing up.  When it gets to the zipping backup in these courses it just quits. All of the other courses on this server backed up just fine. These happen to be the two biggest courses. Is there a php limitation or something that needs to be tweaked. I set the Max_upload to 500M just to see if it made a difference and it did not.

Some of the responses:
  • If the files are large, it could possibly be a problem with the max_execution_time and max_input_time which control the maximum amount of time that a PHP script is allowed to run.  Try increasing the timing on these.
  • Here are some recommended php.ini settings I use:

    Fixing this problem--with making backups timing out--will also address running large reports out of the Moodle Gradebook.

    To make the change, you have to edit the PHP.ini file, restart your Apache server, and it will be OK. What type of operating system are you running your server on?
And this fascinating response from Ken Task:

Agree with suggestions so far.  Have run across a situation, however,where Moodle cannot complete the backup due to size of the courseregardless of php tweaks.  Happens on RH flavored Linux boxen ...there is a 4.+ gig limit to zip.  When courses reach that size backupsmight fail.  Interestingly enough, if one looks in /moodledata/temp/one will find a 'backup' folder with numbered ID folders (example:1314665333).  Inside that numbered folder - continuing with example,stuff like: 

[root@cms 1314665333]# lltotal 4042316drwxrwxrwx 2 apache apache       4096 Aug 29 20:06 course_files-rw-rw-rw- 1 apache apache 4134946384 Aug 29 20:16 Hysquierdo_backup-math-20110829-1848.zipdrwxrwxrwx 4 apache apache       4096 Aug 29 19:49 moddata-rw-rw-rw- 1 apache apache     318076 Aug 29 19:56 moodle.xmldrwxrwxrwx 2 apache apache       4096 Aug 29 20:06 site_filesdrwxrwxrwx 3 apache apache       4096 Aug 29 19:56 user_files 

These are all temporary and can be safely removed.
The backup process (in some cases) fails because the system cannotcopy the backup into the /moodledata/[courseid]/backupdata/ folder.But, if you notice above, one can manually create a backup using zipof the course ... as I've had to do with a TAKS Math Review course ...all videos - the example shown above. 

So, check out the backup area and see what did get created before theroutine failed.  All is NOT lost ... one could use at least thecourse_files contents to get uploaded files and user_files(assignments).  Depends upon where the backup process fails.  IF youwatch the backup process via the Moodle interface you will note thatquiz stuff is very intensive.  Where is fails/stops, could indicate itbacked up most.
Wow, great info!



Get Blog Updates via Email!
Enter your email address:
Delivered by FeedBurner
PingIt!

Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure

Cleaning Out Old #Moodle 1.9 Quiz Results

A colleague on the MoodleMayhem.org email list recently asked...
I have an industrial arts teacher that now uses Moodle 1.9 quizzes for all of his shop safety tests. He uses the same quizzes for 3 grade levels, thus the students are removed and re-enroll yearly. Now that we've rolled over to a new year, he reset the course, effectively removing all students. The issue that we're having is that when students enroll for a second time, their prior quiz scores reappear. Sure, the teacher can select all scores and delete them, but I am wondering if there isn't a method for achieving this in bulk, clearing all attempts for all quizzes with a single action.

Below is my response:
I'm sure there is a better solution than the one I'm going to offer but...

What about backing up the course and restoring it? Backup the previous course with user info and save it somewhere so you have it. 
You've probably already thought of that solution.

Some related discussions happening here for Moodle 2.0 but I found the following two excerpts informative:
Version 2.0 deletes all grades information for students unenrolled from a course.  This is opposite from previous behavior and IMO very undesireable.  A moderate number of times each term a student will get accidentally unenrolled from a course.  Retention of grades information permits them to be re-enrolled without issue.
*** 
Moodle courses are not designed to be reused for each new year while keeping all the old history in there. It may work in some cases but it is recommended to create a fresh copy of the course each year and at the end either hide the course are disable all enrolments.The keeping of all course info after full unenrolment is not a real solution because it causes problems in other scenarios. Source for remarks: http://moodle.org/mod/forum/discuss.php?d=164550

Another possibility might be to edit the MySQL dbase to remove quiz results. Hmm...just playing here:

You could find the quiz you want to modify in the course like this:

SELECT id, course,name
FROM `mdl_quiz` 
WHERE name = 'Module 1 Test'
AND course =27
LIMIT 0 , 30

RESULTS:
id=34
course=27
name=Module 1 Test


Note that ID in mdl_quiz is the quiz in mdl_quiz_grades...

SELECT *
FROM `mdl_quiz_grades`
WHERE quiz =34
LIMIT 0 , 30

To remove these results:
DELETE FROM mdl_quiz_gradesWHERE quiz=34
That would remove all the quiz grades.

Before trying anything suggested here, make backups. Even better, duplicate your moodle instance and then experiment on the duplicate rather than the original.


Get Blog Updates via Email!
Enter your email address:
Delivered by FeedBurner
PingIt!

Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure

Tuesday, August 30, 2011

Free Software Funnies


Oh, this is hilarious. I'm so sorry I'm late to this.

View this in full-size at...http://xkcd.com/806/


As funny as that is, even funnier is the story reported here, The Girl Who Didn't Want Ubuntu. It's a great reminder (for me) of how important it is to remember that some people just want to fit in...forget about changing the world, they just want to fit into the status quo, get their's and enjoy life or whatever. 

Of course, that particular attitude isn't an affliction bloggers suffer from...right?


Get Blog Updates via Email!
Enter your email address:
Delivered by FeedBurner
PingIt!

Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure

Dr. Rios and the Mimio Minute @drrios

http://goo.gl/34WC6


What fun to listen to Dr. Roland Rios,Instructional Technology Director from Ft. Sam Houston ISD, as he explores The Mimeo Minute:

Episodes
  1. Using Colors
  2. Creating a Faux Shadow
  3. Using Ordering
  4. Using the Reveals and Answer Areas from the Gallery
Although not a mimeo user myself, it's fun to watch these and get insights into how others are using technologies like Mimeo in Texas schools!

Get Blog Updates via Email!
Enter your email address:
Delivered by FeedBurner
PingIt!

Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure

Migrating from Moodle 1.9.x to Moodle 2.1


This blog entry isn't intended to add anything to the Moodle 2.x conversation except serve as my notes on a conversation taking place on a MN Moodle list. Feel free to jump in....

Melissa Benson asks the following via an email list message to MN Moodlers:
Has anyone moved to Moodle 2.x yet? We recently installed a fresh copy 2.1.1 on a fresh ubuntu virtual server. We will be using that site for mainly professional development courses, but a few advanced users will be using it as well. Right now, we are planning on having most of our staff still use the 1.9 version and next summer we will hop over to the 2.x server. No upgrade. I'm not sure how we will get our 1.9 courses over to the 2.x server but at the very worst I'd move them over. Would be a few days work but it'll give us (and the staff) to weed out courses not used and will be less of a headache (i think) than an upgrade.
By way of response, I wrote the following....

Howdy! I've been working with 1.9.x and 2.1 and noticed the following:
  • You can now import 1.9.x courses into Moodle 2.1 directly. Works great!
  • Upgrading a 1.9.x or 2.0 Moodle instance to 2.1 is straightforward, just the way you might have in the past*.
As to migrating an entire database from 1.9 to 2.1, here's how it can be done:
Migrating Database from 1.9 to 2.0 readiness - A quick overview of how to convert your existing Moodle 1.9 MyISAM type MySQL database to INNODB type required for Moodle 2.x.

In consideration of the following:

Also, I think you can un zip uploaded files, but if you want to use them later, I'm just not sure where to go yet. (Source: Excerpt from email by Jon Fila)

...I'm not completely sold on the new file manager but that's just because I haven't completely come to grips with it yet! I did have fun over the weekend and read a nice tutorial on the Moodle Docs site about how to use it but forgot to bookmark it. Here are two possible ways of dealing with that problem that appear in the Moodle Forums:

Upload the zip into your 'My private files' area, and unzip it there. You can access your private files from the Navigation block on your profile page, to upload the files.
Then, anywhere else in Moodle where you need to access a file using the file-picker, you should see 'My private files' as one of the repositories available in the column on the left, alongside Upload file and Server files. 
although the file is logically copied into each resource, there is only one copy of each file kept on disc, not matter now many different people upload the same thing.
 (Source: Tim Hunt)
And the second response or approach to this is from Mary Cooch, which is the link I mentioned earlier:
http://docs.moodle.org/20/en/File_system_repository_configuration 

I really like the Repository idea shown above but that like is theoretical at this point. I'll have to work on Moodle 2.1 some more before I feel utterly confident about it.
;->


At the top of my response cited above, there's an asterisk next to how you might have upgraded Moodle "in the past." Here's how I have done it countless times, and this process works with Moodle 1.9.x to Moodle 2 and/or Moodle 2.0 to Moodle 2.1

Upgrading a Moodle 1.9 Instance to a Moodle 2.0 Instance in A Few Steps
  1. Migrate Your MySQL Database from 1.9 to 2.0 readiness - A quick overview of how to convert your existing Moodle 1.9 MyISAM type MySQL database to INNODB type required for Moodle 2.x.
  2. Back up your existing Moodle's MySQL database, PHP pages, and Moodledata. That way, you can restore from scratch if need be.
  3. Check compatibility of your mods, blocks with Moodle 2.0, downloading the new versions if necessary.
  4. Get the latest copy of Moodle 2.1+ and then copy your mods, blocks into the unzipped folder.
  5. In your Moodle 1.9 folder, delete everything EXCEPT the config.php file. Then,
  6. Copy the contents of the latest copy of Moodle 2.1+ into the old folder. This keeps your folder permissions intact. Once the copy is complete,
  7. Go to http://moodledomainnameforyourserver.net/admin and begin the upgrade process. Be sure to choose unattended.

Upgrading a Moodle 2.0 Instance to 2.1 in One Step
  1. Back up your existing Moodle's MySQL database, PHP pages, and Moodledata. That way, you can restore from scratch if need be.
  2. Check compatibility of your mods, blocks with Moodle 2.x, downloading the new versions if necessary.
  3. Get the latest copy of Moodle 2.1+ and then copy your mods, blocks into the unzipped folder.
  4. In your Moodle 2.0 folder, delete everything EXCEPT the config.php file. Then,
  5. Copy the contents of the latest copy of Moodle 2.1+ into the old folder. This keeps your folder permissions intact. Once the copy is complete,
  6. Go to http://moodledomainnameforyourserver.net/admin and begin the upgrade process. Be sure to choose unattended.
That's all there is to it. Take your time, though.

Get Blog Updates via Email!
Enter your email address:
Delivered by FeedBurner
PingIt!

Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure

Monday, August 29, 2011

The Price of Freedom - GNU/Linux

Nice videos to reflect upon as we consider the technologies we use today....


Revolution OS


The Story of Linux....



Get Blog Updates via Email!
Enter your email address:
Delivered by FeedBurner
PingIt!

Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure

Simple Image Resizing/Editing


What program (FREE) do you recommend for teachers to use to just do minimal editing of photos for their websites?  Mainly I want them to reduce the file size of the photo.

Some solutions:

  1. Microsoft Picture Manger comes with MS office and its great and simple and has great compression… ( I am a Photoshop nut but this one my mom can use)
  2. If you still have licenses for Office XP or so, I do think Microsoft Photo Editor is very easy to use, and was distributed with the older versions of Office. Microsoft Office Picture Manager can "shrink" multiple photos at once, but is not quite as easy for novices. 
  3. Microsoft Photo Editor can be installed without the other older Office products, I believe, although it's been a while since I fiddled with it.
Here's my response:
Advanced.png


You might try this right-click image resizer (free open source):


Image Resizer for Windows is a utility that lets you resize one or more selected image files directly from Windows Explorer by right-clicking. You don't even have to open a program, just right-click.

Other editors, like these below, provide nice alternatives:
Suggestions From Folks in the Peanut Gallery (a.k.a. Comments section):
What would your recommendation be?


Get Blog Updates via Email!
Enter your email address:
Delivered by FeedBurner
PingIt!

Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure

Subscribe via email

Enter your email address:

Delivered by FeedBurner