We use google forms to send out tests to our students and must find a solution for the (as per title) following situation:
The scenario limitations:
NOT all our students can have a google account. We have to have the form public. We already have a spreadsheet (STU-INFO) with all our students' information.
Workflow:
A) Taking the test.
Using our existing STU-INFO we send an email to the students. The student receives an email.
Dear STUDENT,
There is a new test for you: CLICK HERE FOR "YOUR NEW TEST"
bla, bla, bla
Good luck
The student goes to the form and submits the test.
B) We would like the following:
When the student submits the form, the response gets "on-the-fly" auto checked whether the email submitted for the RESPONSES spreadsheet, matches one of the emails that already exist in our STU-INFO spreadsheet.
If the email matches, the respond gets recorded.
Otherwise the response should be discarded without even being recorded.
Ideally a pop-up message should be shown to the submitter. "Success!!!" OR "Sorry you are not registered for the test "YOUR NEW TEST" . Your answers are disregarded".
Worst case scenario? Instead of the pop-up {when the email does not match) an email is auto sent to the submitter with the test ID auto filled. "Sorry you are not registered for this test ID "YOUR NEW TEST". Your answers are disregarded."
I have little experience with scripts and the script editor in Google Sheets. As a final note, other add-ons (formmule, flubaroo and AutoCrat) also use the same RESPONSES Google Spreadsheet.
EDIT:
After reading the comment and answer left respectively by @Canadian Luke and @Ruben I feel I need to explain further why we do need such a function.
First of all we do give not one but two "warning" messages when students try to fill in their email addresses at the very beginning of the form.
The first one in the form of a hint: "ONLY REGISTERED students are allowed to take the test. ALL duplicate and/or unregistered responses will be discarded."
The second one comes as a custom message under Data Validation:
Data Validation--> Text--> Email address--> "Please make sure you type your registered email correctly so as to receive your grade"
About Ruben's answer. We have already tried and currently use pre-filled URL forms. The issue though is that (as explained in the beginning) the forms have to be public. Unregistered students, trying to be "funny" fill out the forms using pseudo-addresses anyway.