cancel
Showing results for 
Search instead for 
Did you mean: 

New Quizzes: Validate Student Input (with Regular Expressions)

New Quizzes: Validate Student Input (with Regular Expressions)

It would be very helpful to be able to require that input into a free text assignment submission or free text entry in a quiz match a regular expression - not for checking the correct answer, but so that a student enters a valid attempt at an answer.  For example, currently a numerical blank in a quiz will not allow students to enter letters.  With this option, a fill in the blank question + regular expression could behave similarly, for more than only numerical fields - students could not enter numbers, multiple words, or accidentally copy in html tags when a blank or assignment submission requires a single alphabetic word (specified by a regular expression).  This would also discourage students from entering full names when usernames are requested and similar errors.  It would enable the assignment turn in to better validate many types of submissions - commit IDs, specific types of URLs, single words, etc. 

2 Comments
James
Navigator

 @erinpac1  

I want to make sure people understand this feature request correctly.

You are asking that students be prevented from entering invalid responses. That is, you want students to know as they type, before they submit, that the answer doesn't mean the correct criteria (isn't numeric, doesn't match a phone number, doesn't begin with a letter followed by up to 8 letters or digits, etc) as specified by a regular expression 

It sounds like you want more than just the typical "not a valid number" type response that happens when the field loses focus, but that they would not be able to even type a character that was not allowed.

This differs from the existing functionality of New Quizzes where regular expressions can be used on fill in the blank questions after the student has submitted their answers.

James
Navigator

Here is a similar idea but limited in scope to numeric response questions: https://community.canvaslms.com/ideas/14905-new-quizzes-allow-only-numeric-values-for-numeric-questi... 

It explains some background related to user response validation.