Skip to content

Instantly share code, notes, and snippets.

@rtucker-mozilla
Created April 22, 2014 16:44
Show Gist options
  • Select an option

  • Save rtucker-mozilla/11186162 to your computer and use it in GitHub Desktop.

Select an option

Save rtucker-mozilla/11186162 to your computer and use it in GitHub Desktop.
Loop iteration over an array in surveygizmo syntax
%%pageid = 1;
%%errormsg_qid = 6;
%%completed_percent = 0;
%%slider_array = array(4,7,21,22,23,24,25,26);
foreach(%%slider_array as %%slider_id){
%%completed_percent = %%completed_percent + sgapiGetValue(%%slider_id);
}
if (%%completed_percent != 100){
sgapiHideQuestion(%%errormsg_qid,false);
sgapiJumpToPage(%%pageid);
}else{
sgapiHideQuestion(%%errormsg_qid,true);
}
@gregglind
Copy link
Copy Markdown

Thanks for making this! Example SurveyGizmo script are rare!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment