Category Archives: creativity

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.

https://support.google.com/edu/classroom/thread/39155344

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:

Advertisement

COVID california [mv]

COVID California (c) 26-JUL-2020
Lyrics/Guitars: James Lui
Backing Track: By Bojo of Guitarbackingtrack.com
Bass, Drum, Rhythm Gtr, Keys
LED Lighting by FretZealot
All rights reserved.

Westbound on the 15
Leaving Vegas behind
Plexiglas on the tables
Buffets politely declined
Up ahead in the distance
An agricultural stop
But instead of looking for fruits
Thermographic cameras pop

Checking out at TJ’s
Got my cauliflower rice
Karen comes in screaming
No masks, freedom and vice
Seems like peace and quiet
Are so far away
Yet only six months have passed
Since I heard them say

Welcome to our COVID California
Such a lovely place,
A chaotic space
Masking it up in our COVID California
Any time of year,
You’re not welcome here

Facebook’s full of bullies
Twitter’s gone insane
Newsom’s got himself a recall
Garcetti’s in his own lane
Health officials calling it quits
They can’t stand the heat
Hoping for some better stats
But Rona’s got us beat

Keeping socially distanced
Working from home all the time
Try to vacation out of the State
Find a 2 week mountain to climb
The health commissioners
All showed us the way
We ignored all the warning signs
Just to hear them say

Welcome to post COVID California
Such a lovely place,
An infected trace
Masking it up in post COVID California
Any time of year,
we’re infectious here

Silicon Valley’s tripping
Last year was so nice
“We are all just prisoners here
Of our own device”
Bears, coyotes and cougars
Have replaced the police
Nature’s just taking back it’s land
And we’re just here on lease

Is there a new vaccine
Can there be a cure
Acoording to the internet
You can never be sure
Here in the Golden State
You get what you receive
You can check out any time you like
But you can never leave”

Replace a Yamaha PSR-S900 Keyboard LCD Display

Full  Keyboard
Yamaha PSR-S900 Arranger Keyboard Full-view

I have one of these (Yamaha PSR-S900 Arranger Keyboard Workstation) and after 7 years, the display started going defective – half of the screen was duplicated, lines running through the middle of the display.

Yamaha PSR-S900 LCD Display Going Bad
Yamaha PSR-S900 LCD Display Going Bad (defective)

This renders use of the keyboard relatively impossible (because there is still a composite video out that can be sent to a portable DVD/LCD player, which will still work for the purposes of reading what’s on the display – your patch selections, mixer settings, scoring, sheet music, file selections, etc.)

I hit eBay and found a few replacement display units for about $150 (shipped from China, but made in Japan), and figured it would be worth trying (after all, a new PSR-S950 still runs about $2000.)

The replacement looks like this:

PSR-S900 replacement LCD
Example PSR-S900 replacement LCD image from eBay

There’s a single pair red/white power lead with a small white modular plug used to connect it to the high-voltage power daughterboard. (my plug had one fewer white connections, so I used a modeling knife to trim off the extra middle connector).

PSR-S900 LCD Display - Reverse-side
Example PSR-S900 LCD Display replacement – Reverse-side

The display itself connects via a 10-wire flat ribbon connector that is press-fit into the LCD’s connector. These are the somewhat fragile, but when carefully removed, basically easily re-inserted into the same receptacle (similar to re-wiring a video game console mod.) In the photo, this receptacle is on the right-center side of the display.

Since I didn’t happen to have the service manual, we dive in with the screwdriver (all phillips-head).  Flipping the keyboard over and laying it on a mattress (to avoid scratches,) you’ll find 14 3/4 inch panel screws,  4 slightly longer 1-1/2 inch panel screws used in the center holes of the keyboard, and about 24 larger headed 1-inch panel screws connecting 2 wood panels to the speakers and bottom frame.  You get to remove ALL of these to get the bottom and top shells separated (just keep them in separate dishes/jars.)

The bottom assembly sort of resembles this view from a PSR-1500 (for general reference – the PSR-S900 is more symmetrical in design) The larger screws are connecting the bottom boards to the 2 speaker enclosures and then attaching the wood panels to the bottom plastic shell; the smaller screws go into those taller pyramid-looking tower holes in the bottom case:

PSR-1500 Lower Case Assembly Diagram
PSR-1500 Lower Case Assembly Diagram

This is an interior view of where the LCD is actually mounted (underneath the front panel; this view is of the bottom of the top half of the keyboard):

PSR-S900 LCD Display - front panel mounting (viewed from below)
PSR-S900 LCD Display – front panel mounting (viewed from below)

To access this view, you will be removing the 6 mounting screws holding the CPU board box (the large aluminum vented box sitting on top of the LCD panel area.)  There are grounding wires on 3 sides of this box that are simply attached with more of the small panel screws.  You can either remove the screws that attach the box to the mounting posts, or the screws that hold the posts to the top assembly (whichever ones you can access most easily.)  The only connections I removed to access the LCD were the ethernet cable plugging into the CPU box, and the 2 white multi-wire connections that plug into the back-panel connector board (the one that has the USB plugs, video connectors and MIDI In/Out – it’s mounted to the top (silver) case assembly):

PSR-S900 Back panel connectors
Back panel connectors – top (silver), bottom (black)

Once the CPU box is unmounted and moved aside (untaping the wires that are taped to the box), you can usually access the first 2 (of 4) screws mounting the LCD to the front panel (these are the 2 closest to the keyboard.) You can remove just the screws attaching the LCD to the aluminum mounts (you do not need to remove the mounts themselves).  To access the other 2 (the ones towards the back panel), if you don’t have a right-angle screwdriver that can fit under the back-panel connector board (about 1-inch clearance), you can remove the 6 screws holding the connector board to the top case assembly (4 of these have bendable wire tie-downs on them; the other 2 seem to hold the mylar foil shielding tabs.)  There is also a single screw that connects the coaxial video connector to the back panel that must also be removed to move the board.

PSR-S900 Interior View Open Case Assembly
Yamaha PSR-S900 Interior View Open Case Assembly

Inside my particular model (which might have been an earlier build than the one my replacement LCD was designed to fit) the high voltage board was connected with a longer set of leads to the defective LCD.  So I unmounted it, rotated it clockwise 90 degrees to move the connector closer to the LCD, and re-mounted it using a single screw to hold it in-place again.

After un-mounting the defective LCD, I removed the existing ribbon connector and before mounting the new one, re-attached the ribbon into the new LCD (drawing a line with a marker on the ribbon helps you remember how deep it was plugged in before).  Plugged in the HV power lead and tested the power up to confirm the new display actually works (the first time, there were a bunch of alternating shadows, indicating I hadn’t seated the ribbon connector properly.)

4 screws back in to hold the LCD, 6+1 screws to re-mount the connector board, 6 more to remount the CPU box (and re-connect the ground wires, and 2 of them hold the box shut), then you can shut the case and replace all of those other screws you took out that hold the case together.

Nothing particularly technical – mostly a bunch of screws and tape.  And about an hour and an eBay purchase later, the keyboard is back up and running fine.