MCQ with 80 possible responses

MCQ with 80 possible responses

by Tina Barclay -
Number of replies: 3
A tough MCQ quiz question, which I need to put into a Moodle quiz, has 80 possible responses. I am stuck because I can not save a MCQ question with more than 36 responses to the question (I can keeping clicking 'Blanks for 3 more Choices' but they will not save). Further, I can not import the question as gift or WebCT format either.

How can we extend the number of MCQ responses? Can someone point me the the code we need to look at?

Thank you in advance
Tina
Average of ratings: -
In reply to Tina Barclay

Re: MCQ with 80 possible responses

by Pierre Pichet -
The answers (responses) list is stored in the database actually in a char field with a length of 255 .
If your database contains between 10000 and 100000 answers the aswers id will contain 5 figures and the , add to 6 so the maximum is 255/6 = 42 answers.
 <TABLES>
 7 <TABLE NAME="question_multichoice" COMMENT="Options for multiple choice questions">
 8 <FIELDS>
 9 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="question"/>
 10 <FIELD NAME="question" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="layout"/>
 11 <FIELD NAME="layout" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="question" NEXT="answers"/>
 12 <FIELD NAME="answers" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="layout" NEXT="single"/>
 13 <FIELD NAME="single" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="answers" NEXT="shuffleanswers"/>
 14 <FIELD NAME="shuffleanswers" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="single" NEXT="correctfeedback"/>
 15 <FIELD NAME="correctfeedback" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="shuffleanswers" NEXT="partiallycorrectfeedback"/>
 16 <FIELD NAME="partiallycorrectfeedback" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="correctfeedback" NEXT="incorrectfeedback"/>
 17 <FIELD NAME="incorrectfeedback" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="partiallycorrectfeedback" NEXT="answernumbering"/>
 18 <FIELD NAME="answernumbering" TYPE="char" LENGTH="10" NOTNULL="true" DEFAULT="abc" SEQUENCE="false" ENUM="false" COMMENT="Indicates how and whether the choices should be numbered." PREVIOUS="incorrectfeedback"/>
 19 </FIELDS>
 20 <KEYS>
 21
This problem has also been reported elsewhere in this forum.
I did not see this in a simple search in the tracker.
Look more closely before adding a new feature in the tracker.

Pierre
P.S. You could change the "answers" type in your database if you are a database expert...
In reply to Pierre Pichet

Re: MCQ with 80 possible responses

by Tina Barclay -
Thank you. Our server guru took your advice and changed the mdl_question_multichoice.answers field from varchar(255) to 'longtext' and it works perfectly. Thank you again.
In reply to Pierre Pichet

Re: MCQ with 80 possible responses

by Rachel Cooper -
Hello,
This is exactly what we needed smile
I changed my database table as follows:
ALTER TABLE `mdl_question_multichoice` CHANGE `answers` `answers` LONGTEXT;
And this has fixed the problem.
Thanks very much!
Rachel.