Talk:Regular Expression Short-Answer question type: Difference between revisions
From MoodleDocs
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
: The only way to match words in any order is to actually write all the possible different combinations, e.g. | : The only way to match words in any order is to actually write all the possible different combinations, e.g. | ||
(blue white red|blue red white|white blue red|white red blue|red white blue|red blue white)--[[User:Joseph Rézeau|Joseph Rézeau]] 06:48, 17 February 2012 (WST) | (blue white red|blue red white|white blue red|white red blue|red white blue|red blue white)--[[User:Joseph Rézeau|Joseph Rézeau]] 06:48, 17 February 2012 (WST) | ||
: EDIT.- With regexp version 2012102900 for Moodle 2.3 you can now use a special syntax which simplifies the task of writing those combinations (or permutations). See [[https://docs.moodle.org/23/en/Regular_Expression_Short-Answer_question_type#Correct_answer_matching_a_regular_expression_pattern]] (Example 4).--[[User:Joseph Rézeau|Joseph Rézeau]] 01:35, 30 October 2012 (WST) | |||
:: But the Pmatch question type can handle this sort of thing: http://moodle.org/plugins/view.php?plugin=qtype_pmatch (It's only available for 2.1 and later, however)--[[User:Tim Hunt|Tim Hunt]] 17:31, 17 February 2012 (WST) | :: But the Pmatch question type can handle this sort of thing: http://moodle.org/plugins/view.php?plugin=qtype_pmatch (It's only available for 2.1 and later, however)--[[User:Tim Hunt|Tim Hunt]] 17:31, 17 February 2012 (WST) | ||
::: Unfortunately there is not much documentation in the Moodle wiki about pmatch and it's hard to find--[[User:Joseph Rézeau|Joseph Rézeau]] 00:56, 18 February 2012 (WST) | ::: Unfortunately there is not much documentation in the Moodle wiki about pmatch and it's hard to find--[[User:Joseph Rézeau|Joseph Rézeau]] 00:56, 18 February 2012 (WST) |
Revision as of 17:35, 29 October 2012
The example about the French flag always expects students to say the answer Blue, White and Red. What happens if a students answers Red, white and blue? Can regular expressions deal with any combination of answers?
Peter_Nickson
@Peter:
- The only way to match words in any order is to actually write all the possible different combinations, e.g.
(blue white red|blue red white|white blue red|white red blue|red white blue|red blue white)--Joseph Rézeau 06:48, 17 February 2012 (WST)
- EDIT.- With regexp version 2012102900 for Moodle 2.3 you can now use a special syntax which simplifies the task of writing those combinations (or permutations). See [[1]] (Example 4).--Joseph Rézeau 01:35, 30 October 2012 (WST)
- But the Pmatch question type can handle this sort of thing: http://moodle.org/plugins/view.php?plugin=qtype_pmatch (It's only available for 2.1 and later, however)--Tim Hunt 17:31, 17 February 2012 (WST)
- Unfortunately there is not much documentation in the Moodle wiki about pmatch and it's hard to find--Joseph Rézeau 00:56, 18 February 2012 (WST)