Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match_at_least_N() function #32

Open
Canx opened this issue Sep 14, 2017 · 4 comments
Open

match_at_least_N() function #32

Canx opened this issue Sep 14, 2017 · 4 comments

Comments

@Canx
Copy link

Canx commented Sep 14, 2017

I would like to have a function that could match at least N responses, something between match_any() and match_all(). For example:

match_at_least_2(
match_mow(...)
match_mow(...)
match_mow(...)
)

Or is there any way of doing this with the current functions?

@timhunt
Copy link
Member

timhunt commented Sep 14, 2017

There is no easy way to do that in general.

The only example I know that is a bit like that is the SI units question in the documentation here: http://www.open.edu/openlearncreate/mod/oucontent/view.php?id=52747&section=2.2.1

@Canx
Copy link
Author

Canx commented Sep 20, 2017

I tried using | operators but that seems to work only with simple words.

I guess there should be a similar class like pmatch_matcher_mach_any or pmatch_matcher_match_all, but checking the number of subcontents matched in the match_whole_expression method.

How this plugin is developed and funded?

@sgparry
Copy link

sgparry commented Jan 18, 2020

Me too on this please. This would make certain use cases so much easier. You can do equivalent but only by creating big permutational sets of answer rules (e.g. creating seven copies of the same four match rules)

@garetharnott
Copy link

Oh yes this would be an amazing thing. For example in a case where you want to partially grade three 'facts' you can do a match_all, then a match_2 then a match_any. At the moment for the middle option you need a complex nested match_any with 3 match_all sub-heading for the 3 permutations of getting 2/3 correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants