Using AskiaDesign via the Command Line
AskiaDesign can be used via the command line to merge two surveys (QEX or XML) or update a portion of a survey using a second survey (from version 5.5.3.4+).
Note 1: In the secondary survey, where shortcuts start with a minus, AskiaDesign will look to see if the “main” survey already has variables with the same name without the minus and use these ones instead of the “secondary” survey and make sure that the routings and inline script and everything in the “secondary” survey uses the “main” survey variables. In this way we avoid having duplicate variables in the final survey.
Note 2: From 5.6.1 (August 2021)
Management of the Start, Restart, All questions and End start question routings through command line.
Description format and example:
/****Module CortexSettings asx version checks*/
So the description should fit in one row and should be unique . . .
-
Start with /****
-
then Module
-
then a space
-
then the name of the module
-
then a space
-
then the description that should be unique between the routings
-
ends with */
The name of the module should not contain any space or special characters.
The underscore is permitted.
It is case sensitive.
INSERT:
Add all the Start, Restart, All questions and End routings even if there is no description.
UPDATE:
Update only all the Start, Restart, All questions and End routings with a description using the format explained above.
Note 3: Since 5.6.1 (28 March 2022)
When you have dependencies of resources between the QEX files you can refer to resources in the target QEX file (pictures, audios, videos, miscellaneous files, ASX files) with a minus (-) in front of the name of the file. When using an /insertsurvey or /updatesubsurvey, the system knows that it will not update the resources in the source QEX file. The resources in the source QEX file must exist or an error is returned.
Definition
Here is the list of arguments that can appear in the command line to start AskiaDesign:
Argument | Value | Description |
{None}
|
String | Path of the (main) survey file, QEX or XML, specified between quotes "" |
/create
|
- |
Available as an action command parameter: The flag used to request the creation of a new QEX file. The system uses what's defined in your options settings default QEX version to create the QEX file. If you prefer to specify on which version to create the QEX file, then use /major and /minor in conjunction with the /create. |
/major
|
Number |
Available with /create: The flag used to specify on which major version to create the new QEX file. If omitted the system uses what's defined in your options. |
/minor
|
Number |
Available with /create: The flag used to specify on which minor version to create the new QEX file. If omitted the system uses what's defined in your options. |
/insertsurvey
|
- |
Available as an action command parameter: The flag used to request an insert of a secondary survey. |
/updatesubsurvey
|
- |
Available as an action command parameter: The flag used to request an update of a part of the (main) survey from another (second) survey. |
/configurationfile
|
String |
Available with /insertsurvey and /updatesubsurvey: The flag used to specify the path of the JSON configuration file to use for the interactive surveys in order to resolve the placeholders for text replacement, insert the list of responses and scenarios to be managed. To be able to perform a text replacement, use a translation key. Then you need to wrap your key with double curly brackets: {{yourtranslationKey}} To be able to insert a list of responses from listOfResponsesKeys you need to wrap your key with double square brackets in a response caption: [[yourlistOfResponsesKey]] Attached QEX files example with bat file and JSON. Execute the bat file with the latest AskiaDesign 5.6.1: Note: The name of the key used should follow the camelCase syntax. The JSON look like this: { "translationKeys": [ { "key": "SurveyTopic", "translations": [ { "language": "en-GB", "text": "beer GB" }, { "language": "fr-FR", "text": "bière FR" } ] }, { "key": "MainBrand", "translations": [ { "language": "en-GB", "text": "Asahi GB2" }, { "language": "fr-FR", "text": "Asahi FR2" } ] } ], "listOfResponsesKeys": [ { "key": "Competitors", "responses": [ { "entryCode": "A2", "translations": [ { "language": "en-GB", "text": "Corona GB2", "resourceUrl" : "https://surveys01-dev.ipsosinteractive.com/WebProd/exResources/TestPathIS/asahien.jpg" }, { "language": "fr-FR", "text": "Corona FR2", "resourceUrl" : "https://surveys01-dev.ipsosinteractive.com/WebProd/exResources/TestPathIS/asahifr.jpg" } ], |
/allowmissingkeys |
- |
Available with /insertsurvey and /updatesubsurvey when a /configurationfile is used: When a JSON interactive file if given to the survey and calling the DOF command line with InsertSurvey, do not replace the tokens if they are not present in the interactive file. It generate an error message (ERR_MISSING_CONFIGURATION_KEY -35) if you do not specify it and some keys are missing. |
/mustuseallkeys
|
- |
Available with /insertsurvey and /updatesubsurvey when a /configurationfile is used: It generate an error message when you use a configuration file and one of the variable exist in the config file and not in the QEX file |
/deletesubsurvey
|
- |
Available as an action command parameter: The flag used to request a delete of a module of the (main) survey. The deletion process will remove all the sub-questions and also the targeted chapter. It deletes the routings based on the module name in the description for the all questions / start / onrestart / end routings. It also deletes the routings where the start question is one of the questions deleted. The screens for the deleted questions are deleted as well. |
/addresources
|
String |
Available as an action command parameter: Specify the path of the resources and separate using comma separators. Example: Design.exe ".\first.qex" /addresources:".\settings1.json,.\logo.png" /saveas:".\final.qex" /logfile:".\logfile.txt" |
/deleteresources
|
String |
Available as an action command parameter: Specify the name (with extension) of the resources and separate using comma separators. Example: Design.exe ".\first.qex" /deleteresources:"settings.json,modules.json" /saveas:".final.qex" /logfile:".\logfile.txt" |
/updateresources
|
String |
Available as an action command parameter: Specify the path of the resources and separate using comma separators. Example: design.exe ".\first.qex" /updateresources:".\settings.json,.\matter.adp" /saveas:".\final.qex" /logfile:".\logfile.txt" |
/updatequota
|
- |
Available as an action command parameter: Replace the entire definition of the quota in the target QEX from the source QEX. |
/appendquota
|
- |
Available as an action command parameter: Add the quota defined in the source QEX at the end of the quota definition of the target QEX. |
/removeunusedtranslations
|
- |
Available as an action command parameter: The flag used to request to remove the unused translations. It keeps only the captions of the languages present in the survey. |
/replaceemptylongcaptions
|
- |
Available as an action command parameter: The flag used to replace a question with an empty long caption with the short caption if it is not empty, in priority else use the shortcut. Only perform this if the long caption is empty. |
/replaceemptyroutingnames
|
- |
Available as an action command parameter: The flag used to replace the name of the routings using the description, if the description is not empty. Only perform this if the routing is empty using the description. |
/keywordlist
|
- |
Available as an action command parameter: The flag used to get a list of all available keywords in AskiaScript. Example: Design.exe /keywordlist /saveas:".\keywordList.txt"
|
/runwizard |
- |
Available as an action command parameter: v650 - The flag used to run the wizard of the QEX. Example: Design.exe "Wizard.qex" /runwizard /saveas:"NewSurvey.qex" |
/duplicateresources
|
String |
Available with /insertsurvey but not with /updatesubsurvey: Used to duplicate the existing resources and rename them like we do for questions, when we duplicate questions if the resources already exist. If the files are not in the other QEX - in this case there will be no duplicates made. Separate resources using comma separators. Example: we have minion.jpg audio.pm3 video.mp4 as a JSON file. If using /duplicateresources:"minion.jpg,settings.json" then the result will be: |
/modulename
|
String |
Available with /insertsurvey or /updatesubsurvey or /deletesubsurvey: Mandatory: flag used to specify the name of the second files to use. This modification was introduced in v.561 August 2021 and is mandatory now. |
/defaultlanguage
|
String |
Available with /create or /insertsurvey or /updatesubsurvey: Used to specify the default language of the survey. You can use the LCID code of the language or the ABBR of the language. Note: if there is already an existing default language, the system will check if there is caption defined for the new language and if there isn’t, copy it from the old language (for questions / modalities / routings). |
/otherlanguages
|
String |
Available with /create or /insertsurvey or /updatesubsurvey: Used to add language(s) in a survey. You can use the LCID code of the language or the ABBR of the language. Note: separate the LCID or ABBR by a coma ","). |
/surveypath
|
String |
Available with /insertsurvey or /updatesubsurvey or /updatequota or /appendquota: Used to specify the source QEX or XML file for the secondary survey. |
/questionshortcut
|
String |
Available with /insertsurvey (optional) or /updatesubsurvey (mandatory) or /deletesubsurvey (mandatory): Used to specify the question shortcut target where to insert/update the secondary survey or to delete. If missing, the insert is done at the end of the main survey.
|
/before
|
- |
Available with /insertsurvey: Used to add the “secondary” survey before the target question shortcut define by /questionshortcut. |
/inside
|
- |
Available with /insertsurvey: Used to add the “secondary” survey inside the target question shortcut define by /questionshortcut. |
/after
|
- |
Available with /insertsurvey: Used to add the “secondary” survey after the target question shortcut define by /questionshortcut. |
/keepalllanguages
|
- |
Available with /insertsurvey or /updatesubsurvey: Used to to keep all the languages of the two surveys “main” and “secondary” survey. If this parameter is omitted then keep only the common languages between the “main” and “secondary” surveys. |
/usedefaultwhenempty
|
- |
Available with /insertsurvey or /updatesubsurvey: Use the default caption for the empty captions of the secondary survey instead of inserting or updating with empty captions. |
/updatefinalpages
|
- |
Available with /insertsurvey or /updatesubsurvey: Updates the main survey with the content of the final pages of the secondary survey. |
/updateadp
|
- |
Available with /insertsurvey or /updatesubsurvey: Updates the main survey with the content of the ADP of the secondary survey. |
/adpproperties
|
String |
Available with /insertsurvey or /updatesubsurvey when using /updateadp: Updates certain properties from the ADP without overwriting all of them by using /adpproperties:"property1,property2,property3". If using /adpproperties:"*" or miss it at all, all properties are updated. If using /adpproperties:"-" only the ADP are updated but none of the properties are updated. |
/updatetheme
|
- |
Available with /insertsurvey or /updatesubsurvey: Updates the main survey with the content of the theme of the secondary survey. |
/updatewebsettings
|
- |
Available with /insertsurvey or /updatesubsurvey: Updates all the web settings so same as using /updatefinalpages and /updateadp and /updatetheme |
/updatemessages
|
- |
Available with /insertsurvey or /updatesubsurvey:
Updates all the error messages from the secondary survey to the main survey. |
/updatescreengeneration
|
- |
Available with /insertsurvey or /updatesubsurvey: Updates the main survey with the content of the screen generation settings of the secondary survey |
/overwrite
|
String |
Available with /insertsurvey or /updatesubsurvey: Perform a full overwrite of the specified fields of the main survey using the secondary survey. The possible values separated by commas are:
Example: /overwrite:"beforecontent,aftercontent,css,js" |
/append
|
String |
Available with /insertsurvey or /updatesubsurvey: Perform an append of the specified fields of the main survey using the secondary survey. The possible values separated by commas are:
Example: /append:"beforecontent,aftercontent,css,js" |
/replace
|
String |
Available with /insertsurvey or /updatesubsurvey: Perform an "intelligent" replace of the specified fields of the main survey using the secondary survey - using a marker on the first and last line. The possible values separated by commas are:
Example: /replace:"beforecontent,aftercontent,css,js" The markers for the different fields are: Before or After content using the html comments: Additional CSS using the CSS comments: Additional JS using the JS comments: Here Survey1 is the module name as specified by the parameter /modulename. |
/keepquestions
|
- |
Available with /updatesubsurvey: Used to keep all the questions from the main and secondary surveys. |
/keeporder
|
- |
Available with /updatesubsurvey and used along with /keepquestions: Used to keep the order of the questions on the main survey. If omitted, then we use the order of the secondary survey and put the questions of the main survey not present in the secondary survey at the end of the target. |
/saveas
|
String |
Available with /insertsurvey or /updatesubsurvey or /deletesubsurvey or /updatequota or /appendquota or /addresources or /deleteresources or /updateresources or /removeunusedtranslations or /replaceemptylongcaptions or /replaceemptyroutingnames: Used to specify where to save the final survey. Could be used to save a QEX, QES, XML, or QEW to a QEX, QES or XML. Note: if this parameter doesn’t exist in the command line then design will modify the “main” survey. |
/logfile
|
String |
Available with /insertsurvey or /updatesubsurvey or /deletesubsurvey or /updatequota or /appendquota or /addresources or /deleteresources or /updateresources Used to specify where to save the log file. What is included in the log: IDS_QUESTION_TO_BE_DELETED |
/verifyscreens
|
- |
Available with /insertsurvey or /updatesubsurvey: Optional: Returns an error (-11) if there is any error on any of the screens including an absent control on an invisible question. |
/verifysurvey
|
- |
Available with /insertsurvey or /updatesubsurvey or /deletesubsurvey or /saveas: Optional: We have added the possiblity to add the following parameter /verifysurvey which verifies the integrity of the survey (as you would before a save as in Design) #define ERR_INVALID_QUESTION_RESPONSE -17 |
/tokenlist |
- |
Available as an action command parameter: Get the list of interactive tokens used in a survey and where they are used. Usage: Design.exe "mySurvey.qex" /tokenlist /saveas:"tokenlist.txt" Result: {{SurveyTopic}}- [Intro] [ListBrands] [FavoriteBrand] {{MainBrand}}- [KnowBrand] [ListBrands] [QAudio] [Ad] [LikeAd] [[Competitors]]- [ListBands] |
/help
|
- |
Available as an action command parameter: Produce help message, i.e. the list of parameters available in command line. Usage: Design.exe /help |
Examples
Merge QEX files and save as new
This command line operation creates a final.qex file without modifying main.qex or secondary.qex file and opens first the main.qex and merges secondary.qex at the end of the main.qex and keeps only the common components between main.qex and secondary.qex:
Design.exe "D:\Qex\main.qex" /insertsurvey /surveypath:"D:\Qex\secondary.qex" /modulename:"secondary" /saveas:"D:\Qex\final.qex"
Insert a QEX file
This second command line opens final.qex and merges third.qex file inside it after the question q12 (if q12 doesn’t exist then it merges the third.qex file at the end of the final.qex file). It also indents (because the usage of /inside) the content of the third.qex file and keeps only the common components between final.qex and third.qex. It also creates a log file.
Design.exe "D:\Qex\final.qex" /insertsurvey /surveypath:"D:\Qex\third.qex" /modulename:"third" /questionshortcut:"q12" /inside /logfile:"D:\output\logfile.txt"
Update sub survey
This command line updates chapter1 of the main.qex survey file using the secondary.qex file and keeps only the common components between main.qex and secondary.qex. It also create a log file:
Design.exe "D:\Qex\main.qex" /updatesubsurvey /surveypath:"D:\Qex\secondary.qex" /modulename:"secondary" /questionshortcut:"chapter1" /logfile:"D:\output\logfile.txt"
QEX, QES, XML, or QEW save as
This command line saves the main.qex survey file as main.xml Note: you can use a QEX, QES, XML, or QEW file and save it as QEX, QES or XML file.
Design.exe "D:\Qex\main.qex" /saveas:"D:\Qex\main.xml"
Create a blank QEX file
This command line creates a blank QEX file. Note you can use the LCID code or ABBR of the language.
Design.exe "D:\Qex\MyNewFile.qex" /create /defaultlanguage:ITA /otherlanguages:FRA,ENG
Design.exe "D:\Qex\MyNewFile.qex" /create /defaultlanguage:1040 /otherlanguages:1036,2057
Return error codes
Add this on a new line after your command has run to capture the error code in the command window:
cmd /k echo Exit Code is %errorlevel%
The process can return the values below. For more information, you may find this article useful.
If the process runs without error, it returns a 0. These are the possible error codes:
#define ERR_CANNOT_OPEN_MAIN_SURVEY -1
#define ERR_CANNOT_SAVE -2
#define ERR_CANNOT_OPEN_SOURCE_SURVEY -3
#define ERR_MISSING_QUESTION_IN_SOURCE -4
#define ERR_MISSING_TARGET_QUESTION -5
#define ERR_CANNOT_UPDATE_SURVEY -6
#define ERR_WRONG_PARAMETERS -7
#define ERR_INVALID_LANGUAGE -8
#define ERR_VERSIONS_NOT_COMPATIBLE -9
#define ERR_WRONG_QEX_VERSION -10
#define ERR_INVALID_SCREEN -11
#define ERR_RESOURCE_FILE_DOES_NOT_EXIST -12
#define ERR_RESOURCE_TYPE_NOT_SUPPORTED -13
#define ERR_RESOURCE_ALREADY_EXISTS -14
#define ERR_RESOURCE_NOT_FOUND -15
#define ERR_CANNOT_IMPORT_QUOTA -16
#define ERR_INVALID_QUESTION_RESPONSE -17
#define ERR_INVALID_ROUTING -18
#define ERR_RESOURCE_NOT_READABLE -19
#define ERR_SRC_QUOTA_UNDEFINED -20
#define ERR_TGT_QUOTA_QUESTION_MISSING -21
#define ERR_TGT_QUOTA_RESPONSE_MISSING -22
#define ERR_QUOTA_DUPLICATE_QUESTION -23
#define ERR_CANNOT_READ_CONFIGURATION -24
#define ERR_CANNOT_PARSE_CONFIGURATION -25
#define ERR_BROKEN_EXTENSION -26
#define ERR_BROKEN_EXTENSION_IN_SOURCE -27
#define ERR_EXISTING_QUESTION_OUTSIDE_MODULE -28
#define ERR_MISSING_RESOURCE -29
#define ERR_SURVEY_NOT_INTERACTIVE -32
#define ERR_CONFIGURATION_KEYS_NOT_ALL_USED -33
#define ERR_MISSING_CONFIGURATION_KEY -35