AskiaDesign 5.5.2
This article summarises some of the new features available in AskiaDesign 5.5.2.
Max visible iterations
We added a new property to loops named the Max visible iterations, which defines the number of the loop items that will appear on a single screen. This property affects the ADCs which manage the loop as a responsive table.
In order to have this property working on ADCs, we added two keywords in AskiaScript (AvailableAnswers and MaxVisibleIterations). So it means if you have created ADC, you will need to use . . .
CurrentQuestion.ParentLoop.AvailableAnswers
instead of . . .
CurrentQuestion.ParentLoop.Answers
We also added a new attribute manageLoopDepth in each output in the config.xml of the ADCs and a new constraint on the questions named requireLoopDepth.
manageLoopDepth
integer (an attribute of the output - N) zero (by default), if the output doesn’t manage the loop and an integer if the output manages the loop (1 if the output manages one loop level, 2 for 2 nested loop levels etc.).requireLoopDepth
integer (constraint on questions of the info - N) zero (by default), if the ADC doesn't need a parent loop; 1 if the ADC needs a parent loop; 2 if the ADC needs 2 nested loop levels, etc.
So you will also need to apply these modifications in order to have the new property working with your ADCs.
All our ADCs were updated and we changed the version number to 3 so you will need to use version 3 of the ADCs to have the new property taken into account.
We have added survey tags to questions and responses - It could be used for scripting and/or for automated analysis. Tags work like scenarios (but you can add a tag directly from the combo box or from the Edit menu).
In order to use it, we extended the AskiaScript keywords:
- Tags property added to the question and response object.
- FilterByTag() method added to the questions collection.
- Tags property added to the survey object.
Update ADX library
On clicking on "Help / Update ADX library", all the most recent files are downloaded from GitHub by calling https://api.github.com/repos/AskiaADX/default-adxs/contents.
Copy/Paste the Caption & Entry Code in one go to/from Excel
We can now copy 2 columns in Excel (the first column is for captions and the second is for entry codes) and then paste it in a closed question to paste both the caption and entry codes.
We can also copy a list of responses from a closed question and then paste it in Excel to paste both the caption and entry codes.
Execution of the routings
We can now define if a routing should be executed if an error happens (On error
) or when a restart of an interview happen (On restart
) or after all questions (After all questions
), or at the end of an interview (End
).
We also extended the AskiaScript keywords in the Interview object especially for the usage of the End
interview:
- OutOfQuotaQuestions - returns the question (or the list of questions if the quotas are nested) that triggered the out of quota.
- LastResultCode - returns the last result code to the call or web interview.
- LastSubResultCode - returns the last sub result code to the call or web interview.
Multi conditions
We can now use several questions/conditions for a routing in Assisted Mode. We have also reordered the routings condition(s) and action horizontally.
Theme colour properties as script
We can now define the theme colour properties with a script to have it dynamic.
For instance:
!!On(Gender.Value Has {2},"255, 122, 239","54, 81, 175")!!
Survey feedback
In the properties of your survey in Supervisor, you have an option called “Allow feedback”. If you allow that for test interviews (or all interviews), it means that anyone can report a problem in an Askia Survey, highlight the error and the survey programmer receives the error, a capture of the screen with the highlight and the interview with the actual data.
How does the the survey programmer get this information? By clicking View / Feedback issues… and all the selected issues are imported and you can reproduce the interview in AskiaDesign at the exact same place that where the issue was reported, with the exact same interview data and the correct quota state.
Test your quota in AskiaDesign
For AskiaDesign, this means you can modify a survey directly without Supervisor, but that’s not the main advantage. You can query the state of the quota in CCA and test your survey with these very quota. You can – in Design – change the targets, the number of completes and see how it affects your complicated least filled quotas.
Final pages and ADP
!!CurrentADP.SetProperty("display_previous","no").SetProperty("display_next","no").Redirect("https://askia.com",5).ShowMessage("
<center>
<br>
Thank you for your participation<br><br>
You will be redirected in <span id='countdown'>5</span> seconds<br><br>
</center>
<script type='text/javascript'>
document.addEventListener('DOMContentLoaded',function(event){
var timeleft = 4;
var downloadTimer = setInterval(function(){
document.getElementById('countdown').innerHTML = timeleft;
timeleft -= 1;
if (timeleft <= 0){
clearInterval(downloadTimer);
}
},1000);
});
</script>
")!!
We can now use the code of the ADP in the final pages using AskiaScript instead of putting the entire HTML code for the page.
We extended the CurrentADP object with 3 new methods:
- SetProperty() - Returns the current ADP with the modified property.
- Redirect() - Returns the current ADP with a meta http-equiv refresh added in the head of the html page.
- ShowMessage() - Returns the HTML code of the ADP as string.
Note:
- In order to chain the methods, you will need to always terminate with the ShowMessage() method.
- Inside the string parameter of the show message, use only single quotes and not double quotes for instance for the HTML or JavaScript code you want to use.
Script keywords
New Global keywords:
- Survey - Contains all the available information about the survey itself.
New Survey Object properties and methods:
- Id -Returns the identifier of the survey (as registered in the CCA), or 0 when not yet registered.
- Name - Returns the name of the survey (as it register in the CCA) or the filename of the survey when not yet registered.
- FileName - Returns the file name of the survey.
- Revision - Returns the revision number of the survey file.
- Languages - Returns the list of survey languages.
- Scenarios - Returns the list of survey scenarios.
- Tags - Returns an Array of String.
- ChildQuestions - Return the list of questions at the level 0 in the treeview.
- Questions - Return the list of questions of the survey.
- ToString() - Return a string representation of the survey (expressed in JSON format).
- TypeOf() - Always return "survey".
New Interview properties:
- OutOfQuotaQuestions - Returns the question (or the list of questions if the quotas are nested) that triggered the out of quota - this is only available in a routing at the end of the survey or on an edit routing.
- LastResultCode - Returns the Last result code to the call or web interview - this is only available in a routing at the end of the survey or on an edit routing.
- LastSubResultCode - Returns the Last sub result code to the call or web interview - this is only available in a routing at the end of the survey or on an edit routing.
New CurrentADP methods (to use in final pages):
- SetProperty() - Returns the current ADP with the modified property.
- Redirect() - Returns the current ADP with the modified property.
- ShowMessage() - Returns the HTML code of the ADP as string.
New Questions collections methods:
- FilterByTag() - Return the list of all the questions with the tag provided as string or the list of tags provided as array of string.
- FilterUnAnswered() - Return the list of all the questions with missing answers for mandatory questions.
- FindByShortcut() - Return the question with the exact shortcut.
New Question properties and methods:
- AvailableAnswers - Returns the list of available loop items in the selected order and taking into account the MaxVisibleIterations properties of the loop.
- ChildQuestions - Returns the list of direct child questions.
- IsSkipped - Returns true if the question is skipped.
- IsAnonymised - Returns true if the question is anonymised.
- MaxVisibleIterations - Returns the MaxVisibleIterations properties set on a loop.
- ParentQuestion - Returns the parent question.
- Questions - Returns the list of all the child questions.
- Tags - Returns an Array of String.
- GotoURL() - Returns the URL to use to go to this question.
New String method:
- ReplaceRegexp() - Returns a new string and replace the first match of the specified regexp pattern by the specified replacement.