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
Renee_Carney
Community Team
Community Team

This idea was moved from Under Consideration stage (no longer in use) to the Product Radar stage.  

This change was made as part of a feature idea process evolution.  Find more information, and contribute insights, by joining Focus Group: DRAFT Feature Idea Space

ryan_corris
Community Contributor

This would be a very nice feature!

tsawicki
Community Novice

This sounds far superior to trying to guess and enter every possible correct permutation to an answer.  I would certainly take the time to learn how to use this.

ronmarx
Community Contributor

I would certainly take the time to learn how to use this too!

Hopefully regex will become part of the Quizzes.Next upgrade.

hasti
Community Champion

Please, please, please, a thousand times please, add this feature to quizzes!!!!!!

I teach computer programming/math based classes and the ability to at least be able to specify that spaces are unimportant is critical (including leading spaces, which currently students can enter but I can't enter as legit correct answers!).

Quick trivial example: write an expression that finds the sum of 1, 2, and 3 in that order. As it stands now, I need to give a bazillion different versions of the correct answer (or tell students not to include spaces, even though it might make the answer more readable):

1+2+3

1 +2+3

1 + 2+3

1 + 2 +3

1 + 2 + 3

1+ 2+3

1+ 2 +3

etc.

Literally 16 different possibilities for spaces around the + signs, or a total 64 answers if spaces are allowed before and/or after the expression and Canvas allowed me to specify a correct answer that started with a space (since it does allow students to give a response that starts with a space - it just always marks it incorrect).

Moreover, when the students see the correct answer, they see all the variations (which tends to cause confusion, because they don't understand why the "same" answer is being shown over and over).

ja46272
Community Novice

I relied on these in our previous LMS.  As was mentioned above, yes, if you don't know how to use regex it can be graded as wrong.  However, it would be very very useful instead of needing to either A) create lots and lots of multiple choice options (for instance, if I say which City has the most people), or B) create lots and lots of correct responses.  Please add this.

michael_fedyk
Community Novice

Hi  @rwatkins ‌, it's great to see this idea is on the product radar as it is very much needed in the  accounting quizzes that we create in our University. 

For example, My issue is that there is multiple ways to write one thousand, eg, 1000, 1,000, 1000.00, 1,000.00, $1000, $1,000, $1000.00, $1,000.00, that's 8, if I have two possible answers, ie GST, my answers become 1000 and 100, so therefore I have 12 combinations. CANVAS doesn't allow me to copy and past answers, but rather I have to input into 12 different boxes the 12 possible answers. 1 of my assignments has 132 answers, multiple by 12, and then I have a pool of 6 possible assignments, equals 9,500 bits of text input into 9,500 answer boxes, with no ability to copy and paste. This can take too long. A wildcard would mean [$]1[,]000[.00] , [$]100[.00]. Copy and paste and move on. 

Cheers,

hasti
Community Champion

So it's been a year since the update by Deactivated user‌. Any word on whether this critical feature for any modern quizzing tool will ever be added to Canvas (I don't have time to watch a year-old 41 minute presentation - searchable text is much, much, much more easy for me to deal with, especially since the computer my Computer Sciences department has provided me with is unable to create sound).

Stef_retired
Instructure Alumni
Instructure Alumni

 @hasti ‌, we've got an active beta testing focus group underway for the new quiz tool at Quizzes LTI User Group‌ and you'll also find documentation on the new quiz tool there. During the beta testing period new features and new documentation are being added regularly, so be sure to "follow" the group and post questions as they arise.

hasti
Community Champion

Is there no search function within that Quizzes LTI User Group? I don't have time to do the work I have to do this semester as it is, so digging through a pile of unsearchable links is less than helpful. I was hoping for a yes/no response on the issue of regular expressions.

I have neither the interest nor time to be an unpaid developer/beta tester for Instructure.