Perl-Compatible Regular Expression
Maintained by
Oleg Sychev
A question that could check student's response against several regular expressions and could give next character and next word hints.
If you do not know what regular expression is, it could also work like Moodle Shortanswer question with hints, just choose "Moodle shortanswer" as notation and you could enter answers just like in shortanswer question type.
Comments
Product ratings and reviews are coming to Moodle Marketplace. Until then, existing comments remain available to read, but new posts have been disabled.
It breaks the complete upgrade process resulting 404 errors on
/admin/index.php?cache=1
/admin/search.php
and other pages.
What unit tests file gives failure to you? If you run cross_tests.php (more than 2500 tests) there are tests that are expected to break for several very obscure cases. There are also 1-2 obsolete unit-tests files probably too.
I think, to grade fully correct answers with regex is a trivial thing. The difficult job is to grade partially correct answers.
My idea was to search (with regex) in the student's answer for special expressions and have points for it.
e.g: in Java: for(int i=0;i<10;i++)
One regex checks for fully correctness; if not a serie of regexes looks for correct parts like
"int i=0" or "i<10|i<=9" or "i++|i+=1|i=i+1|i=1+i" or "for(.*;.*;)"
and have 30%+30%+30%+5% points for it. A student answer can have a combination of errors, but the correct parts give percents of points.
This is what I meant. Each regex needs two fields for successor regexes for matched / unmatched. (like in the math plugin STACK). So it is possible to build up a decision tree with matching or unmatching regexes. (Sure, I can use use the math plugin and take usage of maxima's regex capabilities, but this plugin is more performant)
Regular expressions are used to write all kind of nasty thing, they can be non-linear, use repetitions, backreferences, recursion etc. I can not imagine right now how what you want should behave for complex regular expression. If you still wish to discuss this to example - let's do it on the tracker (link above). But I think than CorrectWriting question will give you what you want without regular expressions.
"blue, white, red". Is it possible to add an matching engine which goes through all answers and calcs additive the matching percents, eg.:
33% for .*blue.*
33% for .*white.*
33% for .*red.*
(-10% for not .*,.*and.*)
? This would strongly simplify the permutations of partly correct answers.