Bugathon - solve most bugs!

Maybe regular visitors of moodle.org noticed of recently started contest Bugathon. What it is about?

I think everybody knows what a bug in nature is. Bug in IT world means a glitch, mistake in program. No program can be created without ones. Moodle has some of this filthy and persistent creatures too :-(.

And to eradicate them, to create better system with as few bug as possible, Moodle Bugathon is taking place.

It started on Novemer 12th 2007 and will end on February 12th 2008.

You can win money or material prizes in these 4 categories:

  1. Most bug resolved
  2. Most fixes verified
  3. Most duplicates identified
  4. Most new bugs filled
I plan to attend only first category actively, already fixed some small bugs. If you have some favorite one (accent is put on 1.9 version bugs) , write it in comments, maybe i can take a look on it and try to resolve them. You may also log in to the tracker and vote for these bugs, i will get +1 point per vote in case i will solve your bug ;-).

You may find these links useful:

Join us in Great Bug Squashing Contest!!! :-D


Video: RSS in Plain English

I was thinking about some post that will explain RSS concept to people which don't know it and don't use it for some time (and mainly to increase my rss subscribers count ;-)).
I just found this video and i think there is everything you will need to grasp RSS idea and it is said in better words i will be ever able to think off.
So enjoy, please, put attention to last sentences. RSS reader is highly addictive :-D.


Users pictures are not showing

Fairly recent issue for moodle administrators beginners is problem about users pictures not showing. I call it "Yellow smileys hell". How to beat this devils and get pictures of our beautiful user to show and not to feel ashamed?

In most cases is problem in slasharguments settings.
in Site administration > Server > HTTP

You can identify this fairly easy. User photos aren't showing and when you try to access uploaded files you will be rewarded only by No input file error.

Try fiddle with this settings. And remember, sometimes (IE mainly) helps clearing the browser cache or forced refresh (CTRL + F5).


How to get administrator rights back

I have seen, that some people had similar problem with roles system in Moodle 1.8. They were making some changes in roles settings and suddenly they lost their's administrators rights when they log in next time.

It did not happened to me, yet ;), but it is better to be prepared! I found really helpful little script made by one of the core moodle developers Petr Skoda (skodak) here
This script add administrators right back to user with login name 'admin'

Step by step approach:
1. Open your favourite text editor
2. Copy there this script


require 'config.php';

$systemcontext = get_context_instance(CONTEXT_SYSTEM);
$adminroleid = create_role('new admin6', 'admin6', 'delete me later', ' moodle/legacy:admin');
$user = get_record('user', 'username', 'admin');
role_assign($adminroleid, $user->id, 0, $systemcontext->id);
echo 'done';

3. Save it as createadmin.php
4.Upload this file to your moodle server to moodle directory, where the config.php is located
5.Set proper rights for this file to be accessible
6.Access this file with your browser with calling url http://yourmoodle.com/createadmin.php

What does this script do? In the first place, it loads all needed settings from config.php and includes files with core functions.

Then you set you want to modify whole Site context.

Thsn you are creating new temporary role ( with line beginning with $adminroleid = create_rol ), that you can delete after you regain your administrator's rights.

You can add administrators rights to every user on your moodle you want. Just paste in line
$user = get_record('user', 'username', 'admin'); wanted username instead of 'admin'.

Last line will add admin role to your 'admin' user.

This script is working in Moodle 1.8 and higher.

Do you not forget!
Any changes made in roles system, like allowing new capabilities for specified role etc. take effect after affected user (with modified role) logout/login again!

To delete higher mentioned file from your server when you don't need it.


Yay, i am Particularly helpful Moodler !!!

Just short personal stuff today.

Some time ago i decided i should repay Moodle and its community what i have earned, personally and professionally, from it. So i started to participate in forums on moodle.org more. As my goal i set to myself i should write at least one helpful post a day. I think i am doing this for some time on average.

And yesterday i have been rewarded and i am in group Particularly helful Moodlers
It really mean a lot to me, so forgive me this shameful bragging post ;-).

So, i think this is enough and back to work :-D.


New feature - Set dates block

I fought a problem with setting accessing dates and times for multiple instances of one activity type. Here is what i have done about it!

Let me explain. Try to imagine you created a nice course, students enrolled, time is moving, students accessing assignments, quizzes etc at times you wanted them but now a problem arises! For some reason, not matters how you want to postpone accessing times of all your assignment by 7 days.

You can say, it is small problem, you just have to access all assignments, one by one, edit them and change starting times for them.

But what you will do, if you have 20 assignments in your course? And 20 quizzes you want to postpone too! Isn't it boring to edit activities one by one?

So i created just for myself little block i want to share with you. Maybe you will find it useful.

You can add this block to your course and it will display list of activities that are possible to limit access to them in their's setting. This list looks like a well known Activities block.

For a sake of example, let me suppose you want to change assignments dates. The page you will see after you click on Assignments line looks like this..

I think this is self-explained. You can set Available from and Due dates of all assignment in your course on one page.

Or if you want to spare some clicking and you want to set same date for all assignments, you can do that to!
And last possibility is to delay available times by specified count of days.

This block is meant and is working on Moodle 1.8 (precisely 1.8.2+). So if you are interested, try it and let me know how it went.


Add random question to Moodle quiz

With modern techniques is really easy for students to try cheat when attempting quiz. They can use another opened browser window to google the answers, printscreen the question content and delivery them to another students etc.
One of the ways to make cheating more complicated is to create large questions banks and compiling quizzes with random question. Unique to every attempt.

Moodle quiz allow you to add random questions to your quiz. Even from various question banks.

Just go to the page, where you are creating questions and inserting them to the quiz. Choose one of your categories and look at the bottom on the right side. You should see dropdown input with label Add X random questions.

There you add specified count of question that are supposed to exist in the quiz. Max is count of question in selected category.

You can even change ordering of the questions, but please be advised that if you set quiz to shuffle the questions, this ordering will perish.

So qood luck with testing and lot of good ideas for difficult questions ;-).