2007/12/18

Email digest type

If you are subscribed to many forums on moodle.org as i do, you might have encountered problem of your email address been spammed with a lot of new posts. How to solve it without tossing your email address out?

Maybe you overlooked one tiny setting in your profile, with label Email digest type.
As you can see, there are 3 possible options:

  1. No digest - you will become all new posts from your subscribed forum, that means a lot of emails sometimes ;)
  2. Complete - you will become one email, with all content of new posts, this can be very long
  3. Subjects - you will become one mail only with topics and authors of new posts

I prefer third options, it seems most informational and still comprehensive for me.

You might find, you cannot see Email digest type label with select menu at all in your profile. Please notice, that this setting is set up as Advanced. So press Show advanced button to see it.

With this post you will be never again spammed by ;)

2007/12/09

Change language strings in Moodle

Moodle is widely known and used in many countries around the globe. You can run moodle in over a 70 languages (English - of course ;-), German, French, but also Japanese or Hindi.). You can find full list of languages here

We call these language packages language packs (or langpacks in short). They are consisting of php files with lines:
define['somedefinition'] = "What the definition means, in selected language"
You can change the right sides of these lines to change literal meanings of definitions on the left sides.

Language variables are separated into different files for better navigation, mostly with names of modules/blocks they belong to. General strings are found in moodle.php file

Let say, we want to change label Course categories that is on the Front page to something different. Like Lesson categories for example.

Here is step by step approach.

  1. Login as administrator
  2. Go to Site Administration block
  3. Choose Language link
  4. Choose Language editing
  5. Select language pack you want to edit (if you have more than one installed)
  6. Choose Edit words or phrases
  7. Select file to edit (moodle.php in our case)
  8. Find there a "Course categories" string (with CTRL+F)
  9. Change the meaning of the definition to "Lesson categories"
  10. You will find Save changes button at the bottom on the page

Problems you may run into:
Definition meanings are not writable
Solution: Your server (apache user) don't have needed rights for write in language directory. Change permissions (chmod or set it in gui).

Better Solution: Let Moodle create your "local" directory with yours changed strings. In this case you will not loose your edits next time you will be updating. (In Moodle 1.9 it is not possible to change original language packs with administration gui, only create local directory)

You can find button needed for creating local directory on Edit words or phrases page.

I don't know what file to edit
Solution: Use some IDE that can search through directories and files in. I am using free PSPad It's very helpful for programming and creating Moodle customs and it's is really user friendly.

And as usually you can find small video (1:07, 1.4MB) with higher mentioned process HERE

2007/12/05

Front page settings

Moodle has various setting when, where and what to display on its Front page, this article will describe basic settings. After this article you will be able to create same great pages full of informations as moodle.org is using ;-).

You have various setting for content part (middle) of front page. You can access them all on page
(Site) Administration >> Front page >> Front page settings

You can fill there full name and shortname of your site. If you are using standart themes included in moodle, full name would be seen as heading in left top corner. Shortname is used in breadcrumb navigation.




Site description can be displayed on Front page when you add block Site description.

Next you have the ability to choose what you will show based on log in status of your users. You can choose between not logged users (guests) and logged users.


For both kind of users you have 4 types of what to show.

  1. News item
  2. List of courses
  3. List of categories
  4. Combo list
Or show nothing, of course ;-).

News item
This will show content of Site News forum. You can also set how many news you want to show with setting News items to show lower on the Front Page settings page.

List of courses
Displays list of courses in that user is enrolled into OR if user is not enrolled into any course (or user is not logged in) it shows all available courses.

List of categories
This displays categories your moodle consists of. Hidden categories aren't displaying for users who don't have needed rights of course.

Combo list
This will display categories with courses included AND search form for course search.

Hang on, there are only a few settings left.

Very important and setting this post was about before it had grown to current proportions ;-) is Include a topic section

This setting will add you place on the top of your front page you can create labels in add Resources, or Activities that everybody can see or participate.
You can create a fairly complicated content with built-in html editor so here is sky the limit ;-).


Just in this section is created main content of moodle.org front page, these Welcome to Moodle and Moodle community parts are written in html editor and you can do just the same! :-D

Last two settings are Courses per page and Allow visible courses in hidden categories.

On number set in Courses per page depends how many courses will moodle display on one page, larger count will be paginated.

And Allow visible courses in hidden categories does just right that what is saying, because on default, when you will hide category, you will hide courses and even if you will show the courses manually as a side effect this courses won't be accessible for students.

This blogpost should give you a basic overview of the settings for the Front page, just try play with these to gain behavior you need. If you will have questions about Front page layout, use comments please.

2007/11/29

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:
http://docs.moodle.org/en/Tracker
http://tracker.moodle.org/secure/Dashboard.jspa

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

2007/11/25

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.

2007/11/22

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

2007/11/12

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

<?php

require 'config.php';

$systemcontext = get_context_instance(CONTEXT_SYSTEM);
$adminroleid = create_role('new admin6', 'admin6', 'delete me later', ' moodle/legacy:admin');
reset_role_capabilities($adminroleid);
$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.

2007/11/07

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.


2007/11/05

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.

2007/11/01

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

2007/10/29

How to on Maximum upload size

One of the most frequent problems in Moodle is setting limit for upload files. Sometimes it depends on settings on your webserver and we should cover these settings here.

Many teachers and students faced to bothersome warning when they tried to upload some material to Moodle course. Teachers can try to zip their materials before they try to upload them to course and there Moodle can unzip them for teachers. Teacher also should look for upload size limit in Course settings, because Moodle allow different limit for every course.



But if there is only some small value and teacher want upload bigger files, he have to ask administrator to set the limit higher.

First thing Moodle administrator should check is main upload limit settings for whole site in Site Administration > Site policies.



As you may see on the picture, there is set 0 for maxbytes value. This means no limit. But only no limit meant from moodle administrator. Administrator might want to limit users to disallow them upload too large files (due some bandwidth problems, not enough harddisk place etc.) So administrator should check this place, if it doesn't contain some unwanted limit.

But you may see i highlighted two anothers words. post_max_size and upload_max_filesize. These settings are true limit holders, beyond them even administrator cannot set Moodle upload limit higher, even if he set no limit.

These settings are given by your server php.ini file. If you are admin of your webserver where you run Moodle you might change them by yourself. Or just ask person with root rights for your server to change them for you.

You might be asking, what are these two variables about. So upload_max_filesize is a max limit of uploaded files. You might upload more than one file with single form on another websites, but this is not Moodle case, i think there is only one input of file type everywhere. (You can upload how many files you want, i meant you may upload only one file by one submitting of the form.)

post_max_size is limiting how much posted data can your script digest. So some additional data might be added to file size of uploaded file. You should therefore set slightly higher value in post_max_size than upload_max_filesize.


Don't forget to restart your webserver, after you alter higher mentioned variables!!

There is another way if you don't have root access to your webserver and php.ini file (on some servers there are more than one php.ini file, you will find which one to modify when you will run yourmoodle/admin/phpinfo.php in browser - here you can find very useful information about settings on your server. post_max_size and upload_max_filesize are mentioned here too!



You may try to create special file .htaccess (there is really no extension, trust me ;-) ) with lines

php_value post_max_size 22M
php_value upload_max_filesize 20M

And place it to root directory of your moodle. (Right there where is config.php of your moodle located). If you encounter some error, delete this file. This error means your server is not allowing you to alter settings with .htaccess files (it's for security reason and you will have to ask server administrator to help you solve upload file size problem).

I know today's post seamed little too difficult. If you are lucky and you have some person who is taking care of your webserver, just ask him politely to set these variables for you, he might know better what he should do ;-). If you are in this on your own, Good luck to you and feel free to contact me if you encounter a problem.

2007/10/18

Displaying course summaries

Did you notice different displaying of courses summaries when you are viewing content of Categories in Moodle?

You may notice that in small categories, which consists of small number of courses it looks like this:



But with large count of courses it looks like this:


It depends on value of defined variable 'COURSE_MAX_SUMMARIES_PER_PAGE' in file moodle/course/lib.php.

But beware! This is site wide setting and displaying very large counts of courses with summaries can increase loading times of category pages.

Change confirmation email

Do you want to create cutting edge confirmation email which will catch your users and will show that your Moodle site is something different?

Maybe you are tired of formal sounding of Moodle confirmation emails. For changing its content you need to look for file /moodle/lang/en_utf8/moodle.php and there for line with $string['emailconfirmation'] =... and modify content there.
(For other languages you should look for same file, but in different directory. Lang packs are located in moodledata/lang/ directory usually.)

Just take care and don't delete some useful info, like variables starting with $a-> (for example $a->sitename for displaying name of your Moodle, $a->link link to your Moodle for users can find you etc.)

2007/10/08

Wrong month names in Calendar

I encountered problem when you are running multi-lang site with month names in moodle Calendar.

I had courses which were forcing another language than my main language. Blocks and everything have been showing correctly, only dates were showing in my main language.

After some test i found, it's problem with locales setting on the server.

Locales are set of parameters that defines user's language, user's currency, user's date formatting. Not all countries have same style of displaying dates, not mentioning that every language represent different months names.

Every moodle lang pack has set these localales setting, you can find it in two files:
moodle/lang/yourlangpack/langconfig.php
line $string['locale'] = 'somelocalesetting';

and
moodle/lang/yourlangpack/moodle.php
line $string['locale'] = 'somelocalesetting';


In my case it was set up to en_AU.iso88591.

I don't know, why it is on two places, same setting, maybe langconfig.php file holds more settings and you may alter them by your wish. Either way, you may want to change these settings to locales you have set up on your server.

In my case, my server didn't have en_AU.iso88591 locale installed. On unix server you can find all installed locales with command locale -a.

You have two ways how to solve this problem.


  • One: Install this locale to your server (or ask your administrator, if you have one, to install it for you)

  • Second: Pick up another locale setting you have installed and its shown by locale -a command.



I changed 'somelocalesetting' to one of my installed locales settings for english language and now it's working correctly.

2007/10/03

Zen sarcasm

I intended not to write here others post than about administrating Moodle at first, but i HAD TO link this: Zen sarcasm

2007/09/26

Turn Editing On shows blank page

There is a question that shows repeatedly after upgrading to Moodle 1.8.2 . Are one of those : "I upgraded to 1.8, working perfectly, but when i Turn Editing On, it shows only header and page stays blank"

And you know what? It happened to me to ;-). So don't panic, there is a simple solution usually.

Turn on debugging, (Administration > Server > Debugging and set Debug messages to ALL : Show all reasonable PHP debug messages.
Don't forget to check Display debug messages



Then try Turn editing on again and it will show some errors. I dare to say you will see, that some files from third party block/module you used are missing, because you just forgot, you were using something like that ;-).
So check Modules and plugins database for new version of this missing block/module, download it and install it in your new Moodle 1.8

If you wouldn't be able to locate corresponding version of block for Moodle 1.8 copy this block/module from old version, you might be lucky and it can work. If not, you need to ask block/module maintainer for new version. In worst case you will have to delete missing block/module from settings to get your new Moodle working.

2007/09/25

Where has my Help gone?

In Moodle 1.8 is missing Help line in Administration block in the course. Solution?

Some of my teachers noticed, the Help line is missing. So i need to come for a rescue and i have found it again! (I have to add it)

If you are not interested in tech stuff and just want modified file, download it here, its for 1.8.2+

Not much stuff for techies. I just pasted there this section (see crippled a href for displaying reason):



/// show Help for teachers -dfa- START
if (has_capability('moodle/course:update', $context) && ($course->id!==SITEID))
$lang = str_replace('_utf8', '', current_language());
$this->content->items[]='< a href="http://docs.moodle.org/'.$lang.'/Teacher_documentation">'.get_string('help').'</a>';
$this->content->icons[] = '<img src="'.$CFG->wwwroot.'/mod/resource/icon.gif" class="icon" alt="'.get_string('help').'" />';
}
/// -dfa- END

I pasted this section right after section displaying Grades to achieve old look.
Hope this helps some confused teachers.

2007/09/23

Teacher assign Teachers

Teachers cannot add another Teachers to their courses in new version (1.8), as they have been used. This post will provide a solution.

I have written about changes in roles system and most noticeable change ordinary users will see is in my another post. But there is a another change!

Teachers can add new teachers to their's courses whenever they wanted, without asking administrator in older versions. But this has been changed in new version by default.

So if you want to turn back to "old times, good times" way, you have to ask your administrator to change some setting.

At first, role setting for Teacher has to be changed. You (admin) can find it on Administration > Users > Permissions > Define Roles then edit Teacher role and change line moodle/role:assign to ALLOW.



But this is not enough. Administrator mustn't forget to change settings on Allow role overrides on same page. There you can check roles you want your users can assign.

We are targeting teacher role in our case and we want, that teachers can assign some roles to users in their course.(Eg. we want, teachers can give users in their course roles of Guest(by default yes), Student(by default yes), Non-editing teacher(by default yes), Teacher (we want this!!!). See next image how to achieve this.



Administrator can play with various ways of allowing roles to assign on this page. But take care not to overdo it! We do not want (usually) to teachers can add Administrator role to everybody ;-).

2007/09/19

Eaccelerator was a bad idea...for now

I experimented with caching in 1.8.2+ Moodle, to tune my site. I selected eaccelerator in Administration > Server > Performance



But as a result i got a
Fatal error: Call to undefined function _get() in D:\xampp\htdocs\moodle\lib\eaccelerator.class.php on line 56
and been cut from my site.

So i searched my database with phpmyadmin, looked for table mdl_config, because i know that various settings are stored there.
Found row which were doing this mess, with names cachetype and rcache



I deleted value for cachetype and set rcache value to 0 and we are working correctly again!!

So it's time for another crazy idea how to mess with my installation.

If you are not sure about manipulating your database manually, you can use solution mentioned here:
http://moodle.org/mod/forum/discuss.php?d=75689&parent=355922
Eg. insert to config.php line with $CFG->rcache = false; This should be working too.

PK

2007/09/17

No more Students, no more Teachers

I think the biggest difference for ordinary users, eg. teachers, when you upgrade to Moodle 1.8 (or 1.7 and higher) are new roles system. I may write more about this next time.

Right now i want to point to the most usual problem some teachers will face: "Where do I add students to my course? I can not see Students link in Administration section any more!"

In the times before 1.7 the Administration section for teachers looked something like that:


But in newer version it looks like this:


You can notice, there are missing lines Students and Teachers to enroll users to your course. These two lines are combined to line Assign roles which will lead you to this screen:


When you click on highlighted role, you will be shown a usual screen with two windows to enroll users as you were used.

I tried create small video to show you all this
in motion.

Hope this helps somebody.
PK

2007/09/11

I can't see, i can't see...discussions

My friend currently asked me for help. He found strange bug, that new discussions in forums aren't showing for him on 1.5.3. He didn't change anything, but suddenly it was not working anymore. I suggested him some way to track the problem, then i dugg to my test installation on localhost and suddenly found, it's not working for me too!!

It costs me some hairs pulled from my head, when i pinpointed a bug to be in function forum_get_discussions in moodle/forum/lib.php.
System told me that column usermodified doesn't exist in my database. I checked DB, it was there...So another hairs later i searched a solution here:
http://moodle.org/mod/forum/discuss.php?d=34487#p347650

It showed up, it has been made by updating mysql server. I recently updated it on my localhost to 5.0.41 with installing new XAMPP and this mysql version has some issues with order of the tables.

I reordered lines in FROM section of the query and its working again.

Another lesson learned: If you have problem, search moodle.org before doing anything on your on. Maybe someone had the same problem to and found solution already.

PK

2007/09/10

Don't show users naked!


I just upgraded one of my moodle installations this weekend to latest 1.8.2+, lot of fun till the morning hours :(, but right now its working again correctly. I hope :).

One of the things i noticed, that the Guest can view users profiles. And i don't like it. It is like showing my users naked, therefore the title ;-). I think this was not possible with older version by default.

So after some searching, i found solution. It's forceloginforprofiles

and you can find it in
Administration -> Security -> Site policies


In this way you force Guests to login as a normal user to see the profiles with emails and others informations of user of your site.

I think i protect my users privacy little more with this settings set to on.

PK

Welcome, taming of the beast begins

Welcome readers

I am Moodle administrator (for 2+ year) or programming freelancer sometimes and this blog it to share my thoughts, my experiences with administrating this great e-learning system Moodle.

I try to participate on forums on moodle.org and i want to write here some general advices, some helpful hints i encounter to help others who are battling or trying to "Tame the Moodle" ;-). Keep trying, its worth it.
PK

P.S. Pardon my english, it is not my native language and still struggling with expressing my thoughts correctly.