All-or-Nothing Multiple Choice

Question types ::: qtype_multichoiceset
Maintained by Jean-Michel Védrine, Eoin Campbell
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%.
Latest release:
3975 sites
1k downloads
75 fans
Current versions available: 7

This is a multiple-choice, multiple-response question type that was created by Adriane Boyd and later maintained by Jean-Michel Vedrine. It is now maintained by Eoin Campbell.

Description

The all or nothing question is adapted from the existing multichoice question. The main difference from the standard Moodle multiple choice question type is in the way that grading works. The teacher editing interface is slightly modified as when creating the question, the teacher just indicates which choices are correct.

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%. Before using this question type, teachers must really think if this grading is what they want.

Screenshots

Screenshot #0

Contributors

Jean-Michel Védrine (Lead maintainer)
Eoin Campbell: New maintainer
Adriane Boyd: Original Author
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Matej Topolovec
    Fri, 2 July 2021, 5:16 PM
    Greeting!
    I just installed this great plugin, but I have a problem. My checkbox is above the sentence, so it looks pretty weird. Can I somehow set the checkbox to be inline with the sentence?

    Thanks in advance for the reply!

    Have a nice day,
    Matej Topolovec
  • Joseph Rézeau
    Mon, 5 July 2021, 5:24 AM
    Using latest version 1.8.0 (Build: 2021042501) (2021042501) on Moodle 3.11 (Build: 20210517).
    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.
  • Anastasia Berlyuk
    Thu, 29 July 2021, 4:48 PM
    We recently updated moodle to version 3.11.1+ (Build 20210716). After that our students cannot open some tests (we usually use elements "quiz", less often ”assign”). When they try to open the test, they get «502 Bad Gateway» error (startattempt.php script execution error).

    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?
  • Jesper Martinez
    Thu, 5 Aug 2021, 9:08 AM
    Hi! can anybody help me on how to install this plugin in my moodle 3.10.5. Please I need your help. Thanks
  • Eoin Campbell
    Thu, 5 Aug 2021, 8:05 PM
    Hi Jesper, I have updated version 1.9.1 of the plugin so that it includes support for Moodle 3.10 and 3.11. You should now be able to install it on your site in the normal way. If not, you can download the plugin instead, and upload the Zip file to your site as an alternative way to install it.
  • Jakub Ransdorf
    Sun, 2 Jan 2022, 8:05 PM
    Hi,
    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.
  • Eoin Campbell
    Mon, 3 Jan 2022, 12:37 AM
    Hi Jakub, I installed the plugin on a clean Moodle 3.11.4 site and encountered no problem. The function is_executable() is not used in this plugin, so I suspect your installation problem lies elsewhere.
  • Samuel Derenboim
    Wed, 14 Dec 2022, 6:59 AM
    Hello dear developers. Thank you for providing a great question type, something I am using for my own preparation for exams (and in the future to help others)

    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?
  • Frank Madison
    Thu, 22 June 2023, 12:12 AM
    any planned support for the newer moodle versions, 4.2.x or 4.1.x?
  • Csaba Vágvölgyi
    Mon, 10 July 2023, 6:28 PM
    Does anyone have experience with this question type plugin in a Moodle 4.1 and PHP 8.1 environment?
  • Peter Diedrichs
    Mon, 10 July 2023, 9:21 PM
    I have tried it in 4.1.4 and it seems to work fine.
  • Csaba Vágvölgyi
    Mon, 10 July 2023, 10:48 PM
    Thank you Peter! Good news... Can you check your PHP version? (7.4/8.0/8.1)
  • Kiss Tamás
    Sun, 26 Nov 2023, 11:42 PM
    Does anyone know how I can run any of the existing versions on Moodle 4.2?
  • tmp 4152
    Mon, 18 Mar 2024, 6:47 PM
    I think it is a good plugin, if it is updated, it will definitely be much better...گوار گام
  • Kristine Trenkenschu
    Tue, 19 Mar 2024, 4:43 PM
    Hey @Eoin Campbell,

    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!
1 2 3 4 5
Please login to post comments