Moodle has a Multichoice question-type plugin. These questions are used in Quizes.
I have different types of multiple choice questions which I want to be displayed. They are all basically MCQ's, but are rendered in different ways.
Forexample some are *simple MCQ'*s, while others have a reading passage associated with them (which the student has to read and find the answer from it) which needs to be displayed. Then the reading passage can be displayed in different ways in further different types of MCQ's.
So I need to render around 4 to 5 different types of MCQ's, which only differ in how they are rendered on the web-page.
Now, the solution to displaying a question in a different way is overriding the renderer of the plugin. But the problem is that:
If I override the renderer of the Multichoice question type such that it displays the reading passage, the renderer for displaying the simple MCQ will be overridden. This means I can only display the MCQ with the passage and not the simple MCQ any more.
But I need to display all kinds of MCQ's.
So please suggest me some way to work around it.
The biggest fear is: may be it needs writing question type plugins for each type of MCQ, and then when adding them in the part of the quiz where the teacher (or the admin who makes the quiz) is asked to choose the question type; and then the teacher selects the particular type of a question, and then in our code we get that type and do something like:
If question type is simple MCQ, then use the MCQ plugin's renderer, otherwise if it is an MCQ with a passage, use this renderer (our custom renderer which overrides the multichoice plugin renderer)
How should I go about it?
EDIT:- This is a picture of the form which takes the input from the admin who is adding a question to the quiz, on what type of question do they want to add?
Perhaps I further need to divide the multichoice question into the types I am interested in by identifying and then overriding the code which displays this form, and then identifying and the code which receives the input from this form, and then use that input to make a decision on how to render the ouput.