Question about question types - multianswer / multichoice

Question about question types - multianswer / multichoice

by Farhan Karmali -
Number of replies: 15
Picture of Core developers Picture of Plugin developers Picture of Testers
What is the difference between multianswer and multichoice ? I do not see multianswer in the moodle front end, nor can I find any documentation about multianswer?

I have to develop a question , where a single question would have 2 true and false sub questions , and a multichoice question.   Any ideas how can I go about this ?


Average of ratings: -
In reply to Farhan Karmali

Re: Question about question types - multianswer / multichoice

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Does the documentation on Multiple Choice question type help?

In reply to Mary Cooch

Re: Question about question types - multianswer / multichoice

by Farhan Karmali -
Picture of Core developers Picture of Plugin developers Picture of Testers
Thank you Mary 


I was asking from a developer perspective, I guess if we select multiple answers are allowed it uses the other table other than mdl_question_answer . I was wondering why do we have two separate folders in the question/type

In reply to Farhan Karmali

Re: Question about question types - multianswer / multichoice

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

question/type/multichoice is the multiple choice question type. (Where the right answer can either involve selecting one, or many, choice.

question/type/multianswer is called the Embedded answer (Cloze) question type in the user interface.

Average of ratings: Useful (2)
In reply to Tim Hunt

Re: Question about question types - multianswer / multichoice

by Farhan Karmali -
Picture of Core developers Picture of Plugin developers Picture of Testers

Thank you Tim,

Any suggestion on the first part, I see a similar plugin by OU https://docs.moodle.org/25/en/Combined_question_type but in my case I need to develop a question which will have fixed sub questions , even the text of these options is fixed, Basically the question text changes but all the options remain the same. How do you suggest will be the best way to go forward.

In reply to Farhan Karmali

Re: Question about question types - multianswer / multichoice

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The simplest option is to just create the questions in Moodle. That will work, but will get a bit boring.

Probably the simplest way to automate it a bit it to use Export and Import in the question bank.
  1. Create one question in Moodle with all the answers you want.
  2. Export it to a file (Moodle XML or GIFT).
  3. Edit that file in your text editor, and make many copies of the question. Change the question text in each copy, but leave the rest the same.
  4. Import the edited file.

An even more advanced option would be to create a custom question type plugin, but that is probably overkill.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Question about question types - multianswer / multichoice

by Farhan Karmali -
Picture of Core developers Picture of Plugin developers Picture of Testers

I need to go for the overkill sad thats what I was hired for sad. Made some progress thankfully , I just hope I am able to do it .

Thanks for your help

In reply to Farhan Karmali

Re: Question about question types - multianswer / multichoice

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

There are some examples of question type plugins that inherit from qtype_multichoice, e.g.

Try looking at the code for those.

Also, the docs for creating a question type plugin are at https://docs.moodle.org/dev/Question_types


Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Question about question types - multianswer / multichoice

by Farhan Karmali -
Picture of Core developers Picture of Plugin developers Picture of Testers
Hi Tim.


I need some help again, I tried looking a lot but couldn't find a question type that uses two different input elements . in my case I have to use 9 check boxes and 2 dropdowns . Your code for oucombined type question is good but I cannot use subquestions since I have to do it in one question itself . Any help would be appreciated on how do I modify the renderer.php

In reply to Farhan Karmali

Re: Question about question types - multianswer / multichoice

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I could understand if you were not able to install additional question types such as OU, but I don't understand the reference to subquestions. From my understanding the OU combined questions are created in the same editing interface and they have a rather nice syntax by contrast with the complexity of the Cloze question type. Having said that, if you are creating a large number of questions then it should not take too long to learn Cloze. 
In reply to Marcus Green

Re: Question about question types - multianswer / multichoice

by Farhan Karmali -
Picture of Core developers Picture of Plugin developers Picture of Testers
Thanks, The issue is I have been asked to develop this question type plugin. And I am figuring out how to do it in the codes. So cloze is ruled out, I cannot use it. Also the OU combined type, I checked the render.php in that it uses sub questions etc, Though transparent to the front end user. Its still there for the developers
In reply to Farhan Karmali

Re: Question about question types - multianswer / multichoice

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

So if it works transparently for the front end users what exactly is the problem?

Or is this more of a university assignment - you have to work under certain restrictions to develop the code, rather than looking at the actual needs of the user, which would imply that if the front end works the soultion provided by Tim would be fine?

Or is the goal to make work just to fill the hours quoted for, rather than finding the best solution when that already exists?

If its a paid contract - then if I was in the organisation contracting and someone came back to me and said  'actually I can do this for half what was quoted because there's already a way to do it in the existing code/plugins' I'd be saying thank you very much and putting that guy at the top of my go to list for the next piece of work that needs contracting out. Not because they have proved themselves the most wonderful coder, but becuase they have proved themselves to be the most efficient at finding an appropriate solution to my front end user requirements. It would also save my time and allow me to move onto the next project sooner.

Provide a well reasoned accurate explanation of why the existing code/plugins already do the task needed and how and move on would be my suggestion, surely much better for everyone than reinventing the wheel!

Maybe its just me - but shouldn't those front-end users be the most important thing?


In reply to Richard Oelmann

Re: Question about question types - multianswer / multichoice

by Farhan Karmali -
Picture of Core developers Picture of Plugin developers Picture of Testers

Dear Richard.

I appreciate your comments and totally agree with them. This is a paid contract for which I have been assigned , Since the options are always fixed so to save the teachers the time of having to type the same options (9 checkboxes with fixed labels, and two fixed true / false dropdowns) , Or even copy paste a template each time they make a question would not be very fruitful , The client has already considered all these before deciding to get a new question type built.


In reply to Farhan Karmali

Re: Question about question types - multianswer / multichoice

by Mauno Korpelainen -

Did you actually check the link at the bottom of Cloze

https://docs.moodle.org/28/en/Cloze_editor_module

It's a simple tinymce plugin that creates Cloze code - no Atto plugin available yet but users (teachers) can change editor from their user profile. Our site is using it in moodle 2.8 so even if https://moodle.org/plugins/pluginversions.php?plugin=tinymce_clozeeditor does not tell that it is suitable for moodle versions 2.7 and 2.8 it works fine with these versions too - default editor is just Atto.

In reply to Mauno Korpelainen

Re: Question about question types - multianswer / multichoice

by Farhan Karmali -
Picture of Core developers Picture of Plugin developers Picture of Testers

Thank you Mauno,


However as described above, I really cannot use the cloze question type , no matter how much I would have loved to do that