regexp in shortanswer

regexp in shortanswer

by mart van der niet -
Number of replies: 5

Has anyone got ever regexp in shortanswer in Lesson to work?

Struggling with it and can't find he right solution! Even the most trivial examples break.....

 

Thanks in advance

Average of ratings: -
In reply to mart van der niet

Re: regexp in shortanswer

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Mart,

I use the same Moodle as you, Moodle 2.3.1 (Build: 20120706), and regexp in the short answer question page works just fine. If you go to Joseph Rézeau's page at http://joseph.rezeau.pagesperso-orange.fr//eao/developpement/expandRegexpToString.htm# he has it set up so that you can tryout his examples and tryout your own attempts at making regexp that work.

I was really struggling to understand it myself until I visited his page.

HTH,

AL

In reply to AL Rachels

Re: regexp in shortanswer

by mart van der niet -

Hi Al,

 

Thanks for your reply. This means I'm doing something wrong. It is not so much the structure of the regexp I'm concerned about, I can't even get the examples from the documentation to work....

Could there be something in the settings of the Lesson?

Could you post an example of yours that is working?

 

Thanks in advance,

MvdN

In reply to mart van der niet

Re: regexp in shortanswer

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi mart,

Could you please provide one or more examples of regexp questions that do NOT work for you?

Joseph

In reply to Joseph Rézeau

Re: regexp in shortanswer

by mart van der niet -

Hi Joseph,


Please find attached a sample.

 

(any chance of seeing your regexp plugin on 2.3.1 ???)

 

Thanks again!

 

Short answer - Use regular expressions
Answer 1: de zes beheersaspecten
Response 1

Juist. Zolang het project ten opzichte van de zes beheersaspecten niet meer afwijkt dan is afgesproken, hoeft er niet ingegrepen te worden.

Score 0
Jump Next page
Answer 2: --.*(zes|6).*/i
Response 2 ten opzichte van hoeveel aspecten?
Score 0
Jump This page
Answer 3: --.*beheersaspect.*/i
Response 3 Afwijkingen ten opzichte van wat?
Score 0
Jump This page
In reply to mart van der niet

Re: regexp in shortanswer

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi mart, thanks for your example, which works as expected for me in moodle 2.3.1.

Your answer: de beheersaspecten
ten opzichte van hoeveel aspecten?
 
Your answer: de zes aspecten
Afwijkingen ten opzichte van wat?
 
Your answer: de zes beheersaspecten
Juist. Zolang het project ten opzichte van de zes beheersaspecten niet meer afwijkt dan is afgesproken, hoeft er niet ingegrepen te worden.
 
I notice you set the score to 0 (zero). I suppose you don't want the Lesson to be graded.
 
Joseph
 
PS.- I don't understand why you put a "6" in Answer 2:     --.*(zes|6).*/i