I am trying to create a lengthy survey. Each question has unique JavaScript code to ensure that participants can only move forward if they type in the correct answer within a specified timeframe. Because there are so many questions, doing this manually has become time-consuming.
What I have done is save the unique JavaScript for each question as .js files. I have them uploaded to Google Drive (can use any similar site if you have suggestions). Want I would like to do is have code for each question (I can just copy the questions with this code) that reads the QID of the current question, identifies whether a file with the same name exists in the Google Drive, and loads the JavaScript in that file for that specific question.
My questions are 1) Is this possible and if so, 2) can you please provide a template of what the code might look like?
Thanks in advance for your help!