Pattern Match when not matched

Pattern Match when not matched

by Susan Ware -
Number of replies: 2

HI 

I have a question which asks students to define/explain what an indigenous tree is ie native to New Zealand.  However they currently will get it marked as correct if they write 'not native to new zealand'.

So essentially I want this answer to be marked as incorrect and have tried the 'not' with not much luck in the pattern match question.

I have attached the file which has the question and in the feedback section I have put some of the syntax I tried ...

If someone could help that would be super awesome - thank you.

Kind Regards

Sue

Average of ratings: -
In reply to Susan Ware

Re: Pattern Match when not matched

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Susan,

I used the "rule creation assistant" and got (Answer 1, grade 100 %):

match_all (
    match_w (native)
    match_w (New)
    match_w (Zealand)
    not (
        match_w (not)
    )
)

which seems to be working properly. See the attached XML file.

Average of ratings: Useful (1)
In reply to Susan Ware

Re: Pattern Match when not matched

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Dominique has already given one good answer to this, but as is always the way with something as complex as pattern-match, there is more than one way to do it.

Another possibility, which is sometimes a useful trick to know, is to use more than one answer pattern. That way you can first get rid of things you want to mark wrong, and then you don't have to worry about that any more when you are making the rule to grade what is right.

Answer 1: match_w(not) -> 0%, and perhaps give some feedback telling them not to use the word 'not'.
Answer 2: match_mow(native New Zealand) -> 100%
Average of ratings: Useful (1)