Regular expression short answer

Question types ::: qtype_regexp
Maintained by Joseph Rézeau, Nicolas Dunand
This question type (for the Moodle quiz module) aims at a more advanced system of student's response analysis, through the use of regular expresssions. This question type is an extension of the SHORTANSWER type. It can be used on its own and can also be incorporated into the existing Cloze (embedded) question type.
Latest release:
1056 sites
529 downloads
42 fans
Current versions available: 4

Like the Short Answer question, the RegExp Short Answer question expects the respondent to answer an "open" question with a word or a short phrase. However, the RegExp system system gives you access to a more powerful system for analyzing the student's answers with the aim of providing more relevant immediate feedback.

Screenshots

Screenshot #0
Screenshot #1

Contributors

Joseph Rézeau (Lead maintainer): Original author
CSE Université de Lausanne: Supporting institution
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Sebastian H.
    Tue, 17 June 2014, 11:23 PM
    Hello Joseph,

    will there be a Moodle 2.7 version?

    Best regards
    Sebastian
  • Joseph Rézeau
    Wed, 18 June 2014, 1:04 AM
    @Sebastian,
    Yes there will be a 2.7 version... when I have time.
  • Nicolas Dunand
    Fri, 18 July 2014, 3:11 PM
    What I can tell from my – albeit very basic – testing in Moodle 2.7, this question type seems to work flawlessly.
  • Tomáš Hudec
    Thu, 21 Jan 2016, 6:38 AM
    Would it be possible to extend the plug-in to multiple (short) answers (input fields) each compared to multiple regular expressions?
    I.e.:
    Question:
    The critical section access control algorithm must meet these three conditions:
    1. [ input-field ], 2. [ input-field ], 3. [ input-field ].

    Answers (regular expressions):
    1. for 50%: (mutual )?exclusion
    2, for 25%: progress( in allocation)?
    3. for 25%: bounded waiting
    (Or each worth 1/3 of points.)

    The answer from each input field would be checked to each RE and if a match is found that RE would be removed from checking remaining input fields.

    The purpose is to allow multiple answers in any order.

    Creating only one input field and requiring all the possibilities (separated by comma) would require complex RE mixing all possible orders and dealing with wrong parts. Multiple input field is much simpler.

    Thanks for implementing or pointing me to the solution if it already exists.
  • Ken Barker
    Thu, 9 June 2016, 9:42 AM
    Thanks for the permutation feature - I have found it very useful. I've also found that it seems to be limited to five options per set - I cannot get six to work. Perhaps this limitation could be documented?
  • Emmanuel Mayorga
    Fri, 28 Apr 2017, 12:36 PM
    I've read through all of the documentation several times and I am having a hard time understanding why meta characters are not allowed for accepted answers. I must be missing something, can someone please explain? Thank you.
  • Gilles Boyé
    Thu, 21 Sept 2017, 11:37 PM
    Does the CLOZE integration of Regex still work with Moodle 3.3 ?
  • Francis Feytout
    Fri, 22 Sept 2017, 5:36 PM
    Hi, I can confirm the regex integration to the multianswer (cloze) type is broken for Moodle 3.3, do you have with up-to-date renderer.php and questiontype.php files ? Or when will have them ? Thanks
  • Gilles Boyé
    Sat, 14 Oct 2017, 9:11 PM
    To be more precise, the existing renderer.php and questiontype.php files still work fine with the standard cloze question types but they block the new type, MULTIRESPONSE that was introduced in 3.2 (at least).
  • Gilles Boyé
    Sat, 14 Oct 2017, 9:13 PM
    The description of MULTIRESPONSE can be found at https://tracker.moodle.org/browse/MDL-3782
  • Sebastian H.
    Mon, 23 Apr 2018, 8:01 PM
    will there be a 3.4 Version of this plugin?

    Best regards
    Sebastian
  • Nicolas Dunand
    Tue, 24 Apr 2018, 12:29 PM
    Hi Sebastian,

    No 3.4 version planned, but please do report if not fully compatible with Moodle 3.4.
  • Alan Chadwick
    Tue, 31 July 2018, 5:27 PM
    Hi,

    I've been using this plugin for a while now and I'm really grateful to you for creating and maintaining it. It's probably the feature I use most in Moodle.

    I'm trying to add regex to cloze type questions but the links to the hacked files are dead - https://docs.moodle.org/24/en/Regular_Expression_Short-Answer_question_type#Inserting_RegExp_sub-questions_in_Cloze_type_questions

    Is there anywhere that I can find these files, please? It would be extremely helpful to have this functionality with Cloze. No problem if it's a problem.

    Thanks
    Alan
  • Nicolas Dunand
    Thu, 2 Aug 2018, 2:42 PM
    Hi Alan,

    I'm merely keeping these plugins originally made by Joseph Rézeau up to date. But the feature you are referring to comes from the Moodle 2.4 (obsolete) documentation of the plugin. If you check the current documentation – by clicking the link at the top of the article you mention – you will see that this feature is no longer mentioned.
  • Joseph Rézeau
    Sat, 6 Oct 2018, 5:50 AM
    As of today, the hacked files for using REGEXP questions to regular Moodle CLOZE questions have been restored (for Moodle 3.5). See the documentation at https://docs.moodle.org/35/en/Regular_Expression_Short-Answer_question_type#Inserting_RegExp_sub-questions_in_Cloze_type_questions
Please login to post comments