Tag Archives: wrong

Google forms and regular expressions for response validation

I was kind of shocked with the proliferation of teachers now using Google Classroom to conduct classes, that the documentation for the Quiz sections of the Classwork assignments is quite insufficient (or presumes you’re an IT geek like me, and can just figure out what programming is available to you.)

The example situation is given by this Blog entry related to Google Classroom and students’ answers being marked Incorrect because on Short Text responses, every answer is matched as a “literal” string – that is, upper and lowercase letters MATTER (a lot!)

Link to:
Student’s answers were marked wrongly in a short answer quiz by Google Forms.


The odd thing is while Google provided a solution for simple e-mail address validation, and various numerical responses, it’s been horrible at dealing with text answers.

The answer is in the 3rd category of Response Validation: Regular Expressions. RegEx’s are commonly used in programming languages and OS shells (like Linux, Unix, HPUX, etc.) since when scripting various commands, we often need to parse parameters and do things with various input like file directory listings, and long lists of things separated by some arbitrary character (like a comma or a vertical bar character.)

Thus here in my example, dealing with a student who was marked with Incorrect answers simply because they didn’t provide the exact case required by the 3 answer versions entered by the instructor (e.g. “Any Dog”, “any dog”, “ANY DOG”) – and the student typed “Any dog” and got it marked Incorrect.

One more typical way to prevent this is specifying in the Quiz preamble the exact format responses you want as an instructor for the short answers. For example, “Please enter all short answers in lowercase letters only, with no leading or trailing space or tab characters.”

But a more practical way is exercising that Regular Expression engine that’s built into Google Forms.

My example question wanting a response from the student like “inner core” (preferably providing a graphic picture of the planet’s layers and just labeling them A/B/C/D/E would have been simpler, but maybe I’m testing vocabulary at this point.)

Selecting the Response Validation type “Regular expression” and using “Matches” the pattern: “^[A-Z]” is interepreted as meaning, “if the Short answer text contains any uppercase letters from A to Z” then display the warning text “Please use all lowercase answers only!” – and do not accept the answer, as submitted.

Regular Expressions can get really complicated, but if you think of them as basically describing what’s in a string of text and matching it as either TRUE or FALSE (and preferably keeping your Answer expectations limited unless you happen to be teaching a course in OS-level scripting, in which case, go ahead and get as complicated as you’d like…) I think you’ll find your student’s will be gently guided into providing the answers in the form you were thinking of when you prepared the Quiz.

And isn’t that what this was all about in the first place?

Here’s a link to a more thorough (and lengthy, and complicated) discussion of the power of Google Forms using Regular Expressions:


2013-11 Shinnyo-en Buddhism Podcast – Leadership By Example

2013-11 Shinnyo-en Buddhism Podcast – Leadership By Example

  • Hey, You’re Religious. Why Aren’t You Perfect?
  • We Still Hate Being Wrong
  • How We Become Unintentional Hypocrites
  • The Path is Wherever You Are and Wherever You Go

Subscribe to this Podcast (RSS) or iTunes or via Flipboard

(From Resonance, Issue 6, 11/2013) In 1952, Shojushinin, co-founder of Shinnyo-en, expressed many thoughts about what was happening during the period after World War II when Japan, after losing it’s guiding-light Emperor, became severely polarized spiritually. Half of the populace wanted to forget the entirety of the past and just embrace “westernization” while the rest fragmented into what eventually became over 700 newly formed religions, trying to seek meaning to life, and a reason to believe in their own fought-for cultural history.

Shinnyo-en was not spared any judgements during this tumultuous period and encountered its own share of criticism and devaluation by people confused by the sheer nature of having been defeated at battle, and having lost faith in everything their culture and history represented.

With the emergence of so many fragmented religious organizations, she observed that many people stop listening in annoyance when they hear of anything they think might represent a new religion.  Those who expressed enthusiasm about their religious practice and shared it with others often faced a cold reception, criticism, or outright rejection. Curiosity about new things or concepts is often forgotten as youth passes into adulthood bringing mindsets of determination (and self-preservation) about ones’ own perceived values, ideals, and morals.  It’s human nature, and particularly adult nature, to dislike being “wrong.”  That means sometimes irrationally defending your own positions, even if it comes at the expense of harmony.

One reason for these negative reactions towards differing beliefs is that people hold religious practitioners to a higher standard of behavior than others, mistakenly thinking that we receive immediate spiritual disciplinary benefits from walking a path, or that our actions should, by definition, be exemplary. We are scrutinized down to the smallest detail, and should we fall short of those higher standards or our actions contradict what we profess to believe, we soon become the target of far-reaching public criticism.  Notice how “disciple” and “discipline” are interrelated?

Similarly, people may act the part of a religious zealot on some occasions and behave irreligiously at other times, raising doubts about them and their practice in the minds of others. Why would you have reason to trust when witnessing inconsistent and contradictory behavior by someone? It’s simply the ages-old wisdom observing that consistency is borne of actions based upon stated intentions – walk as you talk.

Remember that hypocritical behavior is a sure sign that a person has yet to achieve any true measure of awakening. It is important to reflect continually and deeply on our actions and the manner of our practice.  Are you only consistent of your vow to “Do unto others..” up to when someone cuts you off in traffic, and then you act on your emotions and frustrations instead?  How about speaking of “putting yourself into others shoes” but when it comes time to dealing with bitter conflict, you instead rely on your gut instinct to ‘look out for Number One?”

A farmer who speaks of looking forward to a season of hard work, but doesn’t till the soil, isn’t going to have a magically produced harvest at year’s end.

That being said, we’re still human. And the world around us is still filled with conflict, controversy, opposing opinions. And when opening our minds and hearts towards experiencing truth, the pain that comes from “being wrong” diminishes because you start seeing yourself just standing on a different place on the same soil and seeing things from a different point of view.  Nothing wrong, or false – just different, as is the other person.

And when someone makes a mistake, it’s less powerful to forgive and forget (and feel regretful if the mistake is repeated), than to observe the actions thereafter, whether corrections or continuing mistakes. It’s up to you to decide how you accept or avoid such behavior, and whether you assist in the correction or simply condemn the mistake and feel reinforced by your being “correct.”

In human potential, the concept of self-empowerment comes from embracing the idea that literally no one else can make you feel anything – love, hate, jealousy, sadness, remorse, neglect or determination.  All such feelings come from within yourself. Are you holding others to an ideal based upon your expectations of them? Are they doing the same to you? So how the actions of others affect your behavior, really is up to you.