I’m using sgapiResultsQuestionAverage to calculate the average score for several quiz score actions. And in conjunction, I’m attempting to use sgapiSetValue to then set those average scores as values in a continuous sum question. But I can’t get the continuous sum question to populate!
I’m using the following articles: https://script.surveygizmo.com/help/sgapisetvalue; https://script.surveygizmo.com/help/sgapiresultsquestionaverage
And here’s the code I’ve put together so far (with minor surgery):
I’ve also tried to define the array as it’s separate variable (i.e., %%average_all) and use sgapiSetValue(10,%%average_all) … but no luck.
It looks like there are several syntax errors to me.
your variable assignments should use = instead of .=
you need to remove the semicolon from the middle of the assignment statements
you would use . instead of + for concatenating the period on to the end, except that there seems to be no good reason for the ending period in any case.
An example that might work better would be:
%%average_definingprivacy = sgapiResultsQuestionAverage(34);
%%average_datatransmission = sgapiResultsQuestionAverage(35);