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