A new random quote block

A new random quote block

by Scott Elliott -
Number of replies: 21
I've created a random quote block that allows users to submit quotes.

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!


Average of ratings: -
In reply to Scott Elliott

Re: A new random quote block

by Sean S -
Is it available for download? Also is it possible to restrict submission to only admins, creators, and teachers? I would rather not have my students adding quotes - but I'm all for other teachers being able to.
In reply to Sean S

Re: A new random quote block

by Scott Elliott -
I will make it available for download on my test site (http://cs1.jal.cc.il.us/~scott/moodle_15).

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! wink

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.
In reply to Scott Elliott

Re: A new random quote block

by Scott Elliott -

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.

Thanks!

In reply to Scott Elliott

Re: A new random quote block

by Jan Dierckx -
Scott,
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)

In reply to Jan Dierckx

Re: A new random quote block

by Jan Dierckx -
Er ... that's a lot of words to ask a simple question:

Hey Scott, what's wrong with my old one? big grin
In reply to Jan Dierckx

Re: A new random quote block

by Scott Elliott -

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.

In reply to Scott Elliott

Re: A new random quote block

by Jan Dierckx -
Ok, you can find the code here  (but works only in Moodle 1.4)
In reply to Jan Dierckx

Re: A new random quote block

by Sean S -
I just tried this but I'm getting the following error

Block RandomGlossary: /path/to/blocks/RandomGlossary/block_RandomGlossary.php was not readable
In reply to Sean S

Re: A new random quote block

by Jan Dierckx -
Sean,

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


In reply to Jan Dierckx

Re: A new random quote block

by Sean S -
Yeah that did the trick Thanks a bunch.
In reply to Scott Elliott

Re: A new random quote block

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Jan, is there a 1.5 version of the glossary_random block I can add to the distribution?
In reply to Martin Dougiamas

glossary_random block for 1.5

by Jan Dierckx -
Yes, I upgraded the block some time ago. Marc Dastous has been testing the new version and reported some problems. I was looking into them when I found out about the empty directory that seems to be in the development download of Moodle 1.5 and causes some install problems.
Not to cause anymore trouble... where should I commit it to?

In reply to Jan Dierckx

Re: glossary_random block for 1.5

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Thanks, yes, please put your latest code into CVS into that empty directory "glossary_random".
In reply to Martin Dougiamas

Re: glossary_random block for 1.5

by Jan Dierckx -
Done that.
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
In reply to Jan Dierckx

Re: glossary_random block for 1.5

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Jan,

You can attach here the french lang file, and I'll put it in the CVS, if it's OK for Martin big grin

Nicolas (french translation)
In reply to Nicolas Martignoni

Re: glossary_random block for 1.5

by Jan Dierckx -
In reply to Jan Dierckx

Re: glossary_random block for 1.5

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Thanks, the file is now in the CVS.

Cheers
Nicolas
In reply to Nicolas Martignoni

Re: glossary_random block for 1.5

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Check it closely, Nicolas, because I just put a modified English version into CVS with many changes.   I also worked on the block itself quite a bit to make it Postgres-compatible and cleaned up a few things. 

Thanks for the block, Jan!  It's really fun to use!