Add Regular Expressions to Quizzes

This idea has been developed and deployed to Canvas

 

          

Currently in quizzes, for fill-in-the-blank or short-answer questions, you have to come up with every possible phrase combinations to match what students might type that would be correct. Previous recommendations asked that the answer "contain" keywords rather than match.

I would like to see regular expressions, which have been in every major programming language since the 1950's and every LMS until Canvas. Regular expressions are also known as regex, pattern matching, and wildcards.

Here is a good example:

    Who was the major African-American civil rights leader of the 1960's assassinated in 1968?

The official answer is "Dr. Martin Luther King, Jr.", but what if they forget to put "Dr.", abbreviate Luther as "L.", or forget "Jr.". Is it wrong? How many permutations of the right answer could there be? Is punctuation included?

Using regex, the answer would be /.*Martin.*L.*King.*/i, meaning anything before Martin, must contain an L
between Martin and King, can contain anything after King, and "i" means case insensitive. If you use "g" with the "i", you
can apply multiple phrases across an entire document so you can check papers for content automatically.

Please add this to quizzes. Most programming languages (including JavaScript) accept this as a phrase or function.

This extends upon Allow fill-in-the-blank answers that can *contain* a term vs having to match a term  and Improve Regular Expression Tool (pattern matching).

 

Comments from Instructure

This idea was completed with general availability of Quizzes.Next.  You can find more information about the overall project in the Quizzes.Next User Group.‌

  • Quizzes.Next is now available for all paid accounts.
  • Quizzes.Next documentation will live in the Quizzes.Next User Group until July 14, 2018. On July 14, 2018, all of the documentation will be moved to the Canvas Guides in the Canvas Instructor Guide or Canvas Student Guide
  • Quizzes.Next updates will be included in the Canvas Release Notes. This includes new features, updated features, and relevant fixed bugs. New and updated features will be deployed to Quizzes.Next near the same time as the Canvas release. Fixed bugs may be deployed at any time.
44 Comments
pcharles
Community Explorer

This is potentially a powerful tool, but I cannot figure out what code would be needed to grade something like “Iron(ii) chloride” so that it would all ignore case, and space between “n” and “(“.  

Right I do have each half entered in separate boxes and use “close enough” for the metal cation name and list all answers for the non-metal cation, but while close enough ignores case  it also grades (ii) and (iii) and (i) as correct. That is not good.

if I can figure out the regex I think it would be powerful for my needs.

Nyssa73
Community Explorer

Hi @pcharles ,

I've had luck with using regex. Maybe I can help?

I think I have set up my account such that I can get a private message. If you send me a few examples that you need regexs for, I can try to hash them out.

Regards,

Dr. B

KristinL
Community Team
Community Team
Status changed to: New
 
KristinL
Community Team
Community Team
Status changed to: Completed