I have not tested it fully and am still toying with some of the features, but feel free to check it out and give me some feed back.
Here's a link to a test site with the block activated on the main site: http://cs1.jal.cc.il.us/~scott/moodle_15
Feel free to create an account and try it out!
Right now it allows submissions from any user, but quotes must be approved by a teacher of the course before they will appear in the block. Don't discount a student's ability to contribute wisdom to a course. I was thinking about how advice from a student in regards to how to study/prepare may go a little further than from from me!
Having said that, I can see that a block setting to restrict submissions would be simple enough though. I'll try to work this in.
Ok, I now have a settings page created to allow restrictions on who can submit a quote.
All users -> Registered users, Teachers, and Admin can submit
Teacher -> Teachers and Admin can submit
Admins -> Only Admins can submit
I also have updated the block to work in version 1.5.
I would greatly appreciate any feedback and comments / suggestions.
It's great to have a 1.4 and a 1.5 version of the same block. I am looking at what things need changes to make a block compliant with moodle 1.5, and this is a great help.
I have one question.
The glossary module already has code for managing a collection of quotes. Students can submit quotes which can be approved and graded by teachers. Teachers can backup/export/import complete collections of quotes, sort them in categories, display lists of quotes by author, by student who contributed them, etc....
That's why I decided all that was needed for a random quote block was a configuration page (how is the block named, how often should it be refreshed, should it always display the next entry, or a completely random one) and a link at the bottom of the block: to a list with all the quotes if students are not allowed to submit / to the add a new glossary entry page if they are allowed to do so. The rest should then be handled inside the glossary module.
Why have you chosen this different approach? Has it got to do with speeding up the displaying of the block? (I have switched filters off for my site, so I don't know what happens when the content of the block passes through the filters)
Good question. To be honest, I never thought about using the glossary tool for student submission of quotes. I saw the need for me and just started writing the code.
I'll check out your suggested approach.
That path doesn't seem ok. It should look like path/to/blocks/glossary_random/block_glossary_random.php
When you unzip the file, you get two directories, one called glossary_random, the other called lang.
1. Place the directory 'glossary_random' inside the directory 'moodle/blocks/'
2. Copy the file lang/en/block_glossary_random.php to the directory 'moodle/lang/en/' (unless you want to use the dutch version)
3. Visit the admin page of your moodle site for the changes to take effect
now you can add the block to your course, but it will be really useful if you also do the following:
4. add a glossary to your course
5. add at least one entry to the glossary
Not to cause anymore trouble... where should I commit it to?
It seems I cannot commit to the lang directory. I have translations for en/nl/fr
As I don't have a Moodle 1.5 install on the web (only local copy) I cannot use the xhtml validation link provided at the bottom.
I did my best to take out all the old html
You can attach here the french lang file, and I'll put it in the CVS, if it's OK for Martin
Nicolas (french translation)
Thanks for the block, Jan! It's really fun to use!
I've just updated it!
Just attach them here, thanks!