Set question score using Javascript/API | XM Community
Solved

Set question score using Javascript/API

  • 7 June 2019
  • 4 replies
  • 173 views

I am using JS to score questions in a Qualtrics survey. Each question has 4 choices (radio buttons). The student gets to select as many of these as they want, but their score is lowered by 1 for each wrong choice. What I'm having trouble with is pushing this final score into the survey. The API has a setChoiceAnswerValue() function, but I can't find any examples of this in use (even after a Google search). Has anyone done this, and if so, how?

Thanks.
icon

Best answer by TomG 7 June 2019, 20:26

View original

4 replies

Userlevel 7
Badge +27
Use and embedded data field to save the score to the response data. Initialize the embedded data field to 0 at the beginning of the survey flow. Pipe the score into your JS, then use setEmbeddedData() to update the score from your JS.
Thanks! I appreciate the fast response. I have a follow up:

I'm not familiar with Qualtrics, so I am wondering how the people running the test will see the embedded data. Does it show up for them? Thanks again.
Userlevel 7
Badge +27
> @dpadilla said:
> Thanks! I appreciate the fast response. I have a follow up:
>
> I'm not familiar with Qualtrics, so I am wondering how the people running the test will see the embedded data. Does it show up for them? Thanks again.

I'm not sure if "people running the test" are respondents or the people reviewing the responses. Respondents will see it if you pipe it into the survey or an end of survey message or provide a response report. People with Qualtrics access (reviewers) can see it through the Data & Analysis tab.
> @TomG said:
> > @dpadilla said:
> > Thanks! I appreciate the fast response. I have a follow up:
> >
> > I'm not familiar with Qualtrics, so I am wondering how the people running the test will see the embedded data. Does it show up for them? Thanks again.
>
> I'm not sure if "people running the test" are respondents or the people reviewing the responses. Respondents will see it if you pipe it into the survey or an end of survey message or provide a response report. People with Qualtrics access (reviewers) can see it through the Data & Analysis tab.

I'm referring to "reviewers", but actually I may provide an end of survey message. Thanks.

Leave a Reply