Examples of the pmatch question type

Examples of the pmatch question type

by Marcus Green -
Number of replies: 26
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Does anyone have any simple examples of how to use the pmatch quesiton type.

I have read through the documentation here

https://docs.moodle.org/37/en/Pattern-match_question_type_detailed_documentation

But the examples are mainly in the form of screen shots rather than copiable text to practice with and the examples seem somewhat complex.  I put some effort into understanding it many about five years ago and gave up but I'd like to have another go at it. 

I think it would be motivating to have a small number of samples exported to xml. That way people could download, install and experiment with it locally.

Average of ratings: -
In reply to Marcus Green

Re: Examples of the pmatch question type

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Thank you for raising this Marcus. It is a good point.

I agree that most of the given examples are at the more complicated end (to show what is possible). It is probably better to start with simpler examples, and just use Moodle as a slightly better short-answer question type. So, just rules like match_mow(key words you want in the response). (The modifiers are m = allow misspellings like decreased/deceased, o = word-order does not matter, w = extra words in the answer don't matter).

Also, the docs page has not been updated to cover the latest improvements in pmatch. There is now a built in too where you can enter, or upload, a whole lot of possible answers, and whether you think they should be graded correct or incorrect. Then, it will compare those 'human' grades agains the 'computer' grades that your current set of matching rules gives. That lets you see if your matching rules are working the way you hope, and that makes it much more practical to use this question type.
Average of ratings:Useful (2)
In reply to Tim Hunt

Re: Examples of the pmatch question type

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
'That lets you see if your matching rules are working the way you hope, and that makes'
I remember you announcing that and thinking it was a great idea.
I tried to create some examples a few years ago but never got to the point of anything usable to share with people sad
This question type can offer people something very, very special if they can get over the initial learning curve....
In reply to Marcus Green

Re: Examples of the pmatch question type

by Chris Nelson -
Picture of Plugin developers

"This question type can offer people something very, very special if they can get over the initial learning curve...."

Indeed. Rewriting the PatternMatch documentation has been sitting at about #4 on my 'To do' list since July (unfortunately a lot of new things keep getting put in the top three...).

Given all of the new features we've been working on recently (and will shortly deliver...), it is ripe was a re-write, and with Embedded Moodle Quiz Questions, we can (theoretically) also show the question construction and end result using PatternMatch/Combined PatternMatch/Reverse PatternMatch.

In reply to Chris Nelson

Re: Examples of the pmatch question type

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I'll settle for one trivial example and in exchange It will appear on at least one slide at a hugely prestigious international conference smile...
Average of ratings:Useful (1)
In reply to Marcus Green

Re: Examples of the pmatch question type

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Well, if you want a trivial example:

Question text: What it the best Virtual Learning Environment in the world?
Answer 1: match(Moodle)
Grade: 100%

You may also need need to, under Answer options, add

Add these words to dictionary: moodle
(or alternatively turn off spell checking).

And there is a pedagogic question about whether you turn on the Case sensitivity option.

Essentially this example attached.

Average of ratings:Useful (2)
In reply to Tim Hunt

Re: Examples of the pmatch question type

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
This is too simple, Tim. Could you please post a few examples which demonstrate some (not all) of the useful features of pMatch.
Thanks.
In reply to Joseph Rézeau

Re: Examples of the pmatch question type

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You'll need to wait for Chris's examples for that. Or experiment yourself.
Average of ratings:Useful (1)
In reply to Tim Hunt

Re: Examples of the pmatch question type

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Excellent start Tim. I will play with that.
In reply to Marcus Green

Re: Examples of the pmatch question type

by Chris Nelson -
Picture of Plugin developers

If it's Barcelona, the most apt one that springs to mind is....

Stem: "What does M.o.o.d.l.e. stand for?"

Option: convert to space: -

Answer:

match (modular object oriented dynamic learning environment)


This will accept "modular object-oriented dynamic learning environment" and "modular object oriented dynamic learning environment".

Average of ratings:Useful (1)
In reply to Chris Nelson

Re: Examples of the pmatch question type

by Chris Nelson -
Picture of Plugin developers
Stem: In the UK, what does DVLA stand for?

Answer:
match (Driv* [and|&] Vehicle [Licensing|Licence] Agency)

  • This will accept "Driv" and any ending. Drive, Driven, Driving.
  • Text group using single square brackets with pipe (shift-backslash on QWERTY keyboard)  for 'OR' function. In this case to allow 'and' OR '&'.
  • Could have gone with Licen* for any ending, but restricted to two specific words.
This allows many slightly different inputs to work:
Author question input test screen
Average of ratings:Useful (1)
In reply to Chris Nelson

Re: Examples of the pmatch question type

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Thanks for this example, Chris. I have imported your question file and it does work as expected. However, when I try to edit a new pMatch question, there is nowhere in the interface to enter those "sample responses (4)" that you have in your sample DVLA question.
"sample responses" seems to be different from " Model answer", in which you can only enter one string
This is confusing!
In reply to Joseph Rézeau

Re: Examples of the pmatch question type

by Chris Nelson -
Picture of Plugin developers
Ah, so what you might see if you've imported the question is a 'Test' link when your 'Preview' the question.

If you are writing a new PatternMatch, you have to 'Save' the question (or 'Save and continue editing'), and then use the 'Preview' link for the 'Test this question' link to show.

That will take you to the author response-testing page I've shown above.
In reply to Chris Nelson

Re: Examples of the pmatch question type

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Thanks! On the Question Preview screen, the "Test this question" link, is blue on blue and tiny font weight, so I had not seen it...
In reply to Chris Nelson

Re: Examples of the pmatch question type

by Chris Nelson -
Picture of Plugin developers

Just to show off some of the newer features, which might not work if you don't have the latest version of PMatch and configured a French dictionary....

Stem:

"What is the French for asking "How are you"?"

Answer options:

  • Switch on French dictionary.
  • Add "Ca" to question dictionary.
  • Remove "?" from "Sentence end points".

Answer 1:

match ([Ça|Ca] va?)

Grade: 100%

Feedback: C'est vrai.

Answer 2:

match ([Ça|Ca] va)

Grade: 80%
Feedback: "C'est presque vrai. Le point d'interrogation est manquant.

(That's almost right - the question mark is missing)"

-----------------------------------------------------------------------------

(Apologies if I've erred here - my French is very rusty).

In reply to Chris Nelson

Re: Examples of the pmatch question type

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

Thanks for this example, Chris, but I can't get it to work.

"Switch on French dictionary." this is greyed out. In the pMatch settings it says "No spell checking available". How to solve this?

In reply to Joseph Rézeau

Re: Examples of the pmatch question type

by Chris Nelson -
Picture of Plugin developers
Ah, sounds like you need to switch on some plugin settings. You can add dictionaries from there.

So Site Admin > Plug-ins > Question types > Pattern Match.

[server]/admin/settings.php?section=qtypesettingpmatch
Average of ratings:Useful (1)
In reply to Chris Nelson

Re: Examples of the pmatch question type

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Nope, as I wrote, In the pMatch settings it says "No spell checking available".
In reply to Joseph Rézeau

Re: Examples of the pmatch question type

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The spell-checking uses the 'Enchant' PHP library: https://www.php.net/manual/en/book.enchant.php, which in turn uses spell-checking libraries available from your operating system.

So, that is what you need to get working to make spell-checking work in pmatch.
Average of ratings:Useful (1)
In reply to Tim Hunt

Re: Examples of the pmatch question type

by Germán Valero -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Re: 'the docs page has not been updated to cover the latest improvements in pmatch'

When I tried to update the Spanish language Moodle Docs page, I ran into some hard-coded English language strings.

Please see https://github.com/moodleou/moodle-qtype_pmatch/issues/46

Thanks in advance.
Average of ratings:Useful (1)
In reply to Germán Valero

Re: Examples of the pmatch question type

by Paul Raper -

I have been asked to create a couple of questions which based on what I have read about the Pattern-Match plugin, should work. The only problem is, I don't quite see how to make it work. Perhaps someone here can shed some light on the solution.

The first question is that students have to come up with any two of the following list:

Beobachtungen, Tagebuchstudien, Contextual Inquiry & Design, Interviews, Fragebogen, Fokusgruppen, Workshops, User Experience Sketching, Studium Geschäftsprozessdokus, Aufgabenmodellierung / Task Models, Personas / Benutzerprofile, Szenarien

So what I'm trying to do is say: students enter two words, and if they match any of those listed above, they get two points.

The second question involves the students typing in a free text and provided that somewhere in their text they have four of the key words shown in bold, they get the points.

Mit dem Value Proposition Canvas können auf der Seite Benutzerprofil Pains&Gains, sowie Jobs der Benutzergruppe sehr gut festgehalten werden. Später kommen für die drei Teile dann Werteversprechen/Lösungsmöglichkeiten dazu.

In theory I think pattern match can handle that, or am I mis-understanding the scope of the plugin?


Average of ratings:Useful (1)
In reply to Paul Raper

Re: Examples of the pmatch question type

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
In reply to Marcus Green

Re: Examples of the pmatch question type

by Paul Raper -
Hi Markus,
I've looked through the posts, and the original documentation, so the link didn't really help: sorry. sad
In reply to Paul Raper

Re: Examples of the pmatch question type

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Your first question is very like the one in diagram "2.24 A response match" here https://www.open.edu/openlearncreate/mod/oucontent/view.php?id=52747&section=2.2.1 (although a very different subject matter!)

The second question is not really the sort of thing that pmatch is designed to do - I mean the student's answer is limited to 20 words. But, if you are happy to work within that limit, I think something like

match_all(
match_mw(word1)
match_mw(word2)
match_mw(word3)
match_mw(word4)
)

In my experience, the secrect to creating pmatch rules is

  1. Start matching with a simple test, and make sure that works as expected, and then gradually add complexity to get to the full rule you want.
  2. Use the built in question testing tool, where you can input sample responses that should, or should not, match, and use that to verify your matching rules. Normally, you add more and more example responses and you make your matching rules more complex.
Average of ratings:Useful (1)
In reply to Tim Hunt

Re: Examples of the pmatch question type

by Paul Raper -
I shall take a look into this. I do agree, that by starting with a simpler concept, and then building up from there a lot can be learnt and gained. I already managed to get one situation to work where the students have to select Four key words. I shall now take a deeper look at these two ideas. I agree with question 2, perhaps that could be split into two separate tasks, or maybe condensed somehow, I shall talk to my colleague on that one.
In reply to Paul Raper

Re: Examples of the pmatch question type

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Paul,
Could you please translate your examples into English so I can understand what you are wanting to achieve? Thanks!
I don't understand at all your first "2 lists" example.
In reply to Joseph Rézeau

Re: Examples of the pmatch question type

by Paul Raper -
Hi Joseph

I have been asked to create a couple of questions which based on what I have read about the Pattern-Match plugin, should work. The only problem is, I don't quite see how to make it work. Perhaps someone here can shed some light on the solution.

The first question is that students have to come up with any two of the following list:

Observations, Diary Studies, Contextual Inquiry & Design, Interviews, questionnaires, focus groups, Workshops, User Experience Sketching, Business studies process documentation, Task Modelling / Task Models, People / User Profiles, Scenarios

So what I'm trying to do is say: students enter two words, and if they match any of those listed above, they get two points.

The second question involves the students typing in a free text and provided that somewhere in their text they have four of the key words shown in bold, they get the points.

With the Value Proposition Canvas, the Pains & Gains user profile page, as well as jobs of the user group, can be recorded very well. Later, value propositions/solutions are added for the three parts.

In theory I think pattern match can handle that, or am I mis-understanding the scope of the plugin?

I hope that helps.