-
Notifications
You must be signed in to change notification settings - Fork 7
Question sets
Question sets are a pretty unique feature of Ayamel. What makes them interesting is that the actual data isn't hosted on Ayamel.
A question set is an embedded Google Form. The user authors it from the default Google editor. When a user takes a question set, the form is embedded in an iframe on an Ayamel page.
There are no general APIs that deal with Google Forms. There is, however, a new tool from Google called Google Scripts. While I won't describe here how they work, I will give a brief overview of the scripts used in Ayamel. A copy of the scripts are located under the scripts
folder.
For each of the scripts in the folder, a script was created and authorized at https://script.google.com/ under the ARCLITE lab Google account. Links to these scripts are in the configuration file.
This script will create a new Google Form, set the name, and add the provided email as an author. Note that the email must be a Google account otherwise this script will fail.
When a user submits a response we want to know which response is theirs. No user information is saved in the actual responses on the Google Form. This script returns the index of the form submission. With the index we can grade it.
This is the grading script. Given the index of the form submission, it compares each question response with the corresponding answer. The answer key is the first submission.
Google Forms aren't a perfect fit. There is limited access to them. Here are some of the challenges faced when implementing this feature.
One of the biggest challenges with using Google Forms is the fact that, due to cross domain policies and a lack of Google APIs, we have limited access to the form when embedded. It's hard to tell when the user is done.
What we can do is detect when there is a page change in the iframe. A Google form may have multiple pages so we cannot assume that the first page change means the user is done. So when a page change is detected we display a button which says something like "Click me when you're done".
Two Google Scripts were created just for grading. One is called when data is submitted which gets the index of the submission. When the user says that he/she is done by clicking on the done button, the second script is called with the index passed in. This script grades the submission and returns the result.
Grading is pretty simple. For single answer (free response, multiple choice, list, scale, date, time) it's all right or nothing. For array answers (checkboxes, grid) partial credit is given, but no penalty is given for incorrect answers.