I have a project letting teachers indicate who is still taking a class after add-drop. Rather than have the teacher type out which people have dropped the class, the idea is to list the roster as checklist and let teachers indicate which students are no longer attending by interacting with the form.
The roster is sent dynamically via JSON using a webservice call. I'm using JS to parse it into an array, and can add the items to the checklist, but the items do not register when clicked.
So, my questions:
- Is what I'm trying even possible? Is there another way I'm not seeing?
- If it is, what in my condensed code isn't working?
Condensed code: (The HTML code for the checkbox is copied from an existing option; checkboxNumber is used to indicate if this is the 2nd, 3rd, etc. option we're inserting.)
var checkboxCode = "[HTML code for checklist item]";
var mainList = document.getElementsByClassName('ChoiceStructure')[0];
mainList.innerHTML += checkboxCode;
// Add the new choices to the choices array.
var thisBlockChoices = Qualtrics.SurveyEngine.QuestionInfo[thisQuestionId]['Choices'];
var thisCourseChoices = { 'Exclusive': false, 'RecodeValue': checkboxNumber, 'VariableName': checkboxNumber, 'Text': checkboxText};
thisBlockChoices[checkboxNumber] = thisCourseChoices;
This seems to work on the console, but clicking added items gets the following error: "
Missing bound path: runtime.Choices.2.Selected". The runtime doesn't seem to see the added options, no matter what I do.
Thank you in advance for your help!