All-or-Nothing Multiple Choice
Maintained by
Eoin Campbell, Jean-Michel Védrine
The all-or-nothing multiple choice question is a version of the core multi-answer multiple choice question with modified grading. In an all-or-nothing multiple choice question, a respondent can choose one or more answers. If the chosen answers correspond exactly to the correct choices defined in the question, the respondent gets 100%. If he/she chooses any incorrect choices or does not select all of the correct choices, the grade is 0%.
Comments
Comments are no longer open for new posts. Existing comments remain available to read.
I'm very interested in this plugin for digital exams via Moodle. Are there any plans to update the plugin to the current Moodle version 4.3 and onwards?
Thanks for your work and greetings from Germany!
I have been recently trying to import all or nothing questions via ohie plugin (https://moodle.org/plugins/qformat_ohie) that references your plugin.
I know there have been changes to the all or nothing question type, and the coding must've made the import via ohie format incompatible to import the boolean properties of the answers anymore.
Unfortunately they do not develop the plugin anymore, and I wanted to modify the code myself (perhaps with your guidance and assistance).
It seems that it imports most of the settings thus far except for the correct corresponding answers. Here is the php snippet :
$userfractionrightanswer = 1/count($userrightanswers);
$userfranctionbadanswer = -1/(count($useranswers)-count($userrightanswers));
$acount = 0;
foreach($useranswers as $key => $useranswer){
$question->answer[$acount] = array('text' => $useranswer, 'format' => FORMAT_HTML, 'files' => array());
$question->feedback[$acount] = array('text' => '', 'format' => FORMAT_HTML, 'files' => array());
if(in_array($key,$userrightanswers)){
$question->fraction[$acount] = $userfractionrightanswer;
} else{
$question->fraction[$acount] = $userfranctionbadanswer;
}
$acount++;
}
return $question;
}
private function import_multichoice_all_or_nothing($rowdata){
question_bank::load_question_definition_classes('multichoiceset');
$question = $this->defaultquestion();
$question->qtype = 'multichoiceset';
$question->shuffleanswers = 1;
$userrightanswers = explode(',',$rowdata[8]);
$useranswers = $this->getanswers($rowdata);
if(count($useranswers) < count($userrightanswers)){
imap_alerts();
}elseif (count($userrightanswers)<2){
echo get_string('alert_multichoice', 'qformat_ohie', $rowdata[0]);
return $this->import_multichoice_one_right_answer($rowdata);
}
$acount = 0;
foreach ($useranswers as $key => $useranswer){
$question->answer[$acount] = array('text' => $useranswer, 'format' => FORMAT_HTML);
$question->feedback[$acount] = array('text' => '', 'format' => FORMAT_HTML);
if(in_array($key,$userrightanswers)){
$question->fraction[$acount] = 1.0;
}
else{
$question->fraction[$acount] = 1.0;
}
$acount++;
}
return($question);
}
private function getanswers($rowdata){
$key = 'A';
$answers = array();
for($i = 9; $i < 15; $i++){
$curentanswers = $rowdata[$i];
if(!empty($curentanswers))
$answers[$key] = $curentanswers;
$key++;
}
return($answers);
}
I have a feeling that it is not importing boolean properties for the corresponding answers from text. The functions above references the get answers function and the import for the all or nothing plugin.
I think the problem could be in this line. (I could be wrong.)
$question->answer[$acount] = array('text' => $useranswer, 'format' => FORMAT_HTML);
or in
if(in_array($key,$userrightanswers)){
$question->fraction[$acount] = 1.0;
}
else{
$question->fraction[$acount] = 1.0;
perhaps you could give some guidance for the correct function in order for the imported csv to enable the correct answers from the answer key?
my installations of this plugin crash repeatly.
I have Moodle 3.11.4+ and when I try to install 1.9.1 version of this plugin, after correct previous check, the website displays "error/moodle/generalexceptionmessage" and all Moodle sites crash and are displaying the following error:
Exception - Call to undefined function is_executable()
Solution for work other sites is delete multichoiceset directory on my FTP, but I would like to use this plugin.
Do you have any ideas, please? Thank you for your help.
Our tech support thinks this is due to the “all-or-nothing” plugin update (qtype_multichoiceset). Now we have version 1.10.1 (Build 2021070900)
Ask for your help solving this problem. Did anyone have similar errors?
I agree with Matej Topolovec's remark. The checkboxes should be aligned. Plus if numbering option is selected, the numbers (or letters) overlap with the beginning of the answer text.