Want to have next character and next word hints in Moodle shortanswer questions - use Preg question type with "Moodle Shortanswer" notation.

Want to have next character and next word hints in Moodle shortanswer questions - use Preg question type with "Moodle Shortanswer" notation.

by Oleg Sychev -
Number of replies: 0
Picture of Core developers Picture of Plugin developers

For several years regular expressions question types REGEX and PREG supported hinting next correct character and next correct word in adaptive behaviour. However, many peoples are not really know what regular expressions are. And moodle shortanswer question doesn't support such hints for whatever strange reasons.

But you could use PREG question type without knowing anything about regular expressions! Just choose NFA ("non-deterministic finite automata") as engine and  "Moodle shortanswer" as notation, and you could just copy you answers from shortanswer questions (* as wildcard supported).

Preg 2.3.1 - bug fix and small improvments release is now done. Main changes are:

  • standard Moodle text hints now supported in adapative behaviour along with special Preg hints;
  • default language setting should finally work;
  • fixed syntax error in lib.php, which could interfere with cron script execution;
  • several fixes in NFA engine, improving already good whole match possibilities for several corner cases.

It is strongly recommended to upgrade to 2.3.1 if you use Preg 2.3 version. It basically works on Moodle 2.4 too, but we hope to add more useful upgrades to Preg 2.4.

Average of ratings: -