QScripts | ||
Script | Explanation | Example |
questionValue('Q1.1',1); | Sets value of a question within the survey; function requires 2 parameters: first the question code where value should be imported to, second one is answer code for chosen question. | $answer=[Q1]; questionValue('Q1a',$answer);
|
questionValueNoPropagate('Q440.9','1'); | Same as questionValue, but it will not execute question change script on the question that is being changed. | $s1=[s1.1]; $s2=[s1.2]; $sq=questionRowLastChanged('s1'); if($s1==1 && $sq==1){ questionValueNoPropagate('s1.2',""); } if($s2==1 && $sq==2){ questionValueNoPropagate('s1.1',""); } |
questionElementEnable(Q1.1,0); | Disables/enables a specific answer; function requires 2 parameters: first is the question code with row code included (column code as well if present), second one is Boolean, where 1 is enabled, 0 is disabled. | questionElementEnable(Q1.1,0); |
questionElementVisible(Q1.1.1,0); | Hides/shows a specific answer; function requires 2 parameters: first is the question code with row code included (column code as well if present), second one is Boolean, where 1 is show, 0 is hide. | $nmb=[Q1.1]; if($nmb==1){ questionElementVisible(Q2.1,0); } |
questionElementReplace(Q1.1.1,' '); | Replaces an answer; function requires 2 parameters: first is the question code with row code included (column code as well if present), second one is what answer should be replaced with. | $nmb=[Q1.1]; if($nmb==1){ questionElementReplace(Q2.1,'This text will show instead of answer option'); } |
questionRowOrder(Q1,$someVariable); | Creates a specific row order for a question; function requires 2 parameters: first is the question code, second is a variable that has been given a value of what order should be shown. | $ansrOrd=randomizeGroup(1,2,3,).',4,5'; questionRowOrder(Q2,$ansrOrd); questionRowOrder(Q3,$ansrOrd);
|
questionColumnOrder(Q1,$someVariable); | Creates a specific column order for a question; function requires 2 parameters: first is the question code, second is a variable that has been given a value of what order should be shown. | $ansrOrd=randomizeGroup(1,2,3,4,5,6).',7,8'; $ansrOrd1='8,7,6,5,4,3,2,1'; questionColumnOrder(Q2,$ansrOrd); questionRowOrder(Q2,$ansrOrd1);
|
alertMessage('Text goes here'); | Alerts the message or variable written inside the apostrophes. | alertMessage('Text goes here'); |
disableButtonsPage(O1,1); | Disables/enables all buttons on a page; function requires 2 parameters: first is the question code, second one is a Boolean, where 1 is disabled, 0 enabled.
| $s3=[S3]; if($s3==1){ disableButtonsPage(S3,1); setQuestionErrorMessage(S3,'this is the error'); } |
gotoURL('https://www.google.ca'); | Forces webpage change; requires only a website link, will NOT open in a new window. | setCandidateStatus(Screened Criteria); |
setCandidateStatus(Complete);
| Forces status change of the candidate, requires only one parameter: status you would want to update them to.
| setCandidateStatus(Screened Criteria); |
Available statuses:
| In Progress Complete Screened Quota Screened Criteria Timeout Declined Test Value Not Started | setCandidateStatus(Complete);
|
scrollToQuestion(Q2); | Scrolls to a specific question when page has a scroll down bar. Only need one parameter; question code. | scrollToQuestion(Q2); |
setQuestionErrorMessage(Q2,'this is the error'); | Sets a specific error message for a question; requires 2 parameters: first is question code of the page your message should be shown, second is the error message you want to show. | $s3=[S3]; if($s3==1){ disableButtonsPage(S3,1); setQuestionErrorMessage(S3,'this is the error'); } |
questionRowLastChanged('Q440'); | Gets value from last changed row, requires one parameter: Question code. | $s1=[s1.1]; $s2=[s1.2]; $sq=questionRowLastChanged('s1'); if($s1==1 && $sq==1){ questionValueNoPropagate('s1.2',""); } if($s2==1 && $sq==2){ questionValueNoPropagate('s1.1',""); } |
sendEmail(EMAIL_FROM,EMAIL_TO,EMAIL_SUBJECT,EMAIL_BODY); | Sends an email; need 4 parameters; first: from what email, second: to which email, third: email subject, fourth: the email body with html. | sendEmail(EMAIL_FROM,EMAIL_TO,EMAIL_SUBJECT,EMAIL_BODY); |
moveNextPage(); | Move the respondent to the next page; requires no parameters. | $ss=[s1]; if($ss==1){ moveNextPage(); } |
setPageOrderCode(Q15a_3,Q15,3); | Set a page order code ; requires 3 parameters ; first : page code, second : a group code, third : order code for said page. | setPageOrderCode(Q22,Group1,1); setPageOrderCode(Q23,Group1,2); setPageOrderCode(Q24a,Group1,3); setPageOrderCode(Q24b,Group1,4); $randomOrder=randomizeGroup(3_4,1,2); $randomOrder=str_replace('_',',',$randomOrder); pageOrder(Group1,$randomOrder); |
pageOrder(Q15,$randomOrder); | Set page order ; requires 2 parameters ; first : a group code , second : a variable where the order is specified. | setPageOrderCode(Q22,Group1,1); setPageOrderCode(Q23,Group1,2); setPageOrderCode(Q24a,Group1,3); setPageOrderCode(Q24b,Group1,4); $randomOrder=randomizeGroup(3_4,1,2); $randomOrder=str_replace('_',',',$randomOrder); pageOrder(Group1,$randomOrder); |
All Q-Script Functions and Examples Print
Created by: Sviatlana Litvinava
Modified on: Wed, 10 Nov, 2021 at 2:04 AM
Did you find it helpful? Yes No
Send feedbackSorry we couldn't be helpful. Help us improve this article with your feedback.