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
ronmarx
Community Contributor

Kelley,

I totally get this. I strive to see the big picture, however, and be as inclusive of ideas that make the tools we use to build content better. I felt James's analysis shut down this idea to simply maintain the status quo. The machines we use—including the Canvas LMS—are only as intelligent as we make them. There are basic tools that are nearly perfect because there are no practical improvements to them that wouldn't transform them into another tool (think construction tools like hammers and hand saws).

If a designer or teacher doesn't need a particular tool offered in Canvas, then don't use it. James himself mentioned the still-increasing library of work-arounds to get Canvas to work more effectively and efficiently. For example, the idea is pretty widely used, especially by teachers in K-12 school districts, and especially when they're migrating content from another LMS to Canvas. Bulk creation of content doesn't seem to be treated by the Canvas work environment, and teachers/designers have to resort to repetitive tasks that suck the joy out of creating new courses. Being able to select multiple items in Modules, multiple pages in Pages, multiple assignments, etc. in order to move/manipulate them seems obvious.

The grief you experienced using regular expressions in FIB or SA questions may have simply been a common symptom of a learning curve. Had James proffered a better solution, then my responses to him and elsewhere would have been different. Having regular expressions in the Quizzes layer of Canvas seems obvious too, especially when you remember in the first place why we're using digital tools to grade assessments.

We all want to make Canvas better, and that usually means change. That's the type of conversation I want to drive here, and why I don't entertain ideas that do nothing more than shut down the conversation. That being said, I've learned a few little-documented procedures and work-arounds that solved issues I was experiencing. I wouldn't have found them if I retreated into a position of not having the conversation to begin with.

Best regards,

Ron M

rwatkins
Community Novice
Author

Kelley,

Add Regular Expressions to Quizzes in open until October 5th.

https://community.canvaslms.com/ideas/5826

Randy Watkins
Contra Costa College

rafael_chavez
Community Novice

I see James Jones's point that not everybody knows how to write regex, and that writing the wrong regex can lead to mismatched answers (wrong or right);  but the same is also true now. I ask in one question to write an equation; if the student adds extra spaces between the signs to make it more legible, it will be marked incorrect even though it is correct. Anticipating every possible correct answer is very difficult, but having regex as an option would reduce the possibilities for those who know them or are willing to learn them.

mhspico
Community Novice

As part of this feature, maybe adding a regex tester would be a good idea. There are plenty on the web, but putting one directly into the Canvas Quiz engine would probably reduce the regex mismatching that James is describing. A simple "Test my regex" button after the regex input field, where users could input text to see if Canvas marked it right or wrong, should work perfectly.

And yes, adding regex importing to the course import tool would probably be a good idea, assuming this gets approved.

CraigOgden
Community Participant

I know how to use Regular Expressions so this would be a nice feature.  I don't think it needs to be "regular expressions", but at least something like it.

Maybe have a dialog box with different option like:

ignore caps, exact, contains, etc...

Regular expressions are nice but can be complicated for non-programmers.

jlmiller
Community Novice

YES - and yes to this feature... I use many fill-in-the-blank questions and it would great to even be able to give credit for spelling variations... "s" or no "s" etc.

jsparks
Instructure Alumni
Instructure Alumni

Hi friends.  We are thinking about this and a lot of other features for quizzes.  We will consider this for implementation. Please take a look at my InstCon presentation for more information.

Jason

CraigOgden
Community Participant

I am liking what I am seeing in that presentation.  Do you know when Quizzes 2 will be coming out?

jsparks
Instructure Alumni
Instructure Alumni

I don't have a timeline to share at the moment, but we are working on it!

jrowe
Community Member

Moodle has simple wildcard characters for answers to fill in the blank questions. 

I am requesting that Canvas staff start by implementing Moodle simple wildcards as a feature request.  
example of Moodle simple wildcards here>  Short-Answer question type - MoodleDocs

http://metadatace.cci.drexel.edu/omeka/items/show/2242" title="http://metadatace.cci.drexel.edu/omek...

I'm not really fond of these quotes, as they feel less than polite.

"rarely understood by the masses"  and "humans without training" and " faculty who will think they know what they're doing when they don't."