Set question score using Javascript/API | XM Community
Skip to main content
Solved

Set question score using Javascript/API

  • June 6, 2019
  • 4 replies
  • 295 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.

Best answer by TomG

> @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.

4 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • June 7, 2019
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.

  • Author
  • June 7, 2019
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.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • June 7, 2019
> @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.

  • Author
  • June 7, 2019
> @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.