extending question types

extending question types

by Dov Kruger -
Number of replies: 5

I would like to write my own question types. I am not the most experienced php coder, but am a programmer.

Since the code base is huge, can some kind developer please tell me where to look to

1. Add a new kind of question?

question.php is tiny.  It looks like the main meat is in editlib.php.  Where is the code that generates the look of a given question?

2. Experimentally modify the code to display a given question type?
Specifically interested in CLOZE

3. Where is the page that allows me to edit the question?

In order to add a new experimental question type, is changing the php enough or do I have to manipulate mysql as well?

 

Thanks!

Dov

Average of ratings: -
In reply to Dov Kruger

Re: extending question types

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Dov,

"Specifically interested in CLOZE"

Please be aware that Cloze is the most complicated question type in Moodle. It is not a "real" question but a group of sub-questions. But maybe you are interested in developing a "simple" Cloze question type where each blank had to be filled in with one word (or group of words). What I think is missing from the Moodle question types at the moment is that kind of "simple" Cloze question type, with a user-friendly interface for creating the blanks, something like the HotPotatoes JCloze exercise.

Joseph

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: extending question types

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I agree with Joseph as I spent a great deal of time looking at the Cloze code before deciding to write my Gapfill question type with no reference to it.  My question type covers some similar functionality to the core Cloze question type but with a very simple syntax (and simpler code). You can find it here

https://moodle.org/plugins/view.php?plugin=qtype_gapfill

You should also look at the UK Open Universities Select Missing Words question type for ideas.

 

Average of ratings: Useful (1)
In reply to Marcus Green

Re: extending question types

by Jean-Michel Védrine -

In my opinion the combined question type done by Jamie Pratt for the Open University is a lot more friendly for teachers to create questions similar to CLOZE ones.

You can find it here

https://moodle.org/plugins/view.php?plugin=qtype_combined

But be warned that for it to be useful you need to install some of the Open University questions types (I have the files to use shortanswer questions in combined questions somewhere, if anybody is interested ...)

In reply to Jean-Michel Védrine

Re: extending question types

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I agree with Jean-Michel, but it is probably better to think of the combined question type as a container for other question types so they can be used together (like the Cloze type can contain sub questions but with completely separate self contained questions).

I have been looking at the contained question type over the last few days to see if I can adapt my Gapfill type to work as one of the combined types.