Scroll

Command line in Askiadesign

Command line in Askiadesign

Follow
Summary This article describes how to automate task by command line in askiadesign.
Applies to askiadesign
Written for Survey scripter
Keywords command line; automate; task; design; askiadesign; commandline; cmd;

Table of contents:


askiadesign can be used via Command line to merge two surveys (QEX or XML) or update a portion of a survey using a second survey (design v5.5.3.4).

Note: In the secondary survey, when shortcuts start with a minus, design looks if the “main” survey have already a variable with the same name without minus and use this one instead of the “secondary” survey and make sure the routings and inline script and everything in the “secondary” survey use the “main” survey variable. Like that, we avoid having duplicates variables in the final survey.

Definition

Here the list of arguments which 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 "
/insertsurvey - flag used to request an insert of a secondary survey
/updatesubsurvey - flag used to request an update of a part of the (main) survey from another (second) survey
/create - flag used to request to create a new qex file
/defaultlanguage
String

Used to specify the default language of the survey. You can use the LCID code of the language or the ABBR of the language. (Used by /create, /insertsurvey and /updatesubsurvey)

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 Used to add language(s) in a survey. You can use the LCID code of the language or the ABBR of the language. (Used by /create, /insertsurvey and /updatesubsurvey). Note: separate the LCID or ABBR by a coma ",").
/surveypath String Used to specify the source QEX or XML file for the secondary survey
/saveas String

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: for the /insertsurvey and /updatesubsurvey, if this parameter doesn’t exist in the command line then design will modify the “main” survey.

/questionshortcut String Used to specify the question shortcut target where to insert the secondary survey (available with /insertsurvey optional and if missing the insert is done at the end of the main survey) or to specify the question shortcut of the chapter or question to update (available with /updatesubsurvey mandatory for this action)
/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 - 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.
/updatefinalpages - Updates the main survey with the content of the final
pages of the secondary survey
/updateadp - Updates the main survey with the content of the ADP
of the secondary survey
/updatetheme - Updates the main survey with the content of the Theme
of the secondary survey
/updatewebsettings - Updates all the web settings so same as using
/updatefinalpages and /updateadp and /updatetheme
/overwrite String

Perform a full overwrite of the specified fields of
the main survey using the secondary survey.

The possible values separated by commas are:

  • beforecontent (for the html before content field)
  • aftercontent (for the html after content field)
  • css (for the additional css field)
  • js (for the additional js field)

Example: 

/overwrite:"beforecontent,aftercontent,css,js"
/append String Perform an append of the specified fields of the main
survey using the secondary survey.

The possible values separated by commas are:

  • beforecontent (for the html before content field)
  • aftercontent (for the html after content field)
  • css (for the additional css field)
  • js (for the additional js field)

Example: 

/append:"beforecontent,aftercontent,css,js"
/replace String

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:

  • beforecontent (for the html before content field)
  • aftercontent (for the html after content field)
  • css (for the additional css field)
  • js (for the additional js field)

Example: 

/replace:"beforecontent,aftercontent,css,js"

The marker for the different field are:

Before or After content using the html comments:
<!--start-Survey1-->
<!--end-Survey1-->

Additional CSS using the css comments
/* start-Survey1*/
/* end-Survey1*/

Additional JS using the js comments
/* start-Survey1*/
/* end-Survey1*/

/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.
/logfile String

Used to specify where to save the log file. What is included in the log:

IDS_QUESTION_TO_BE_DELETED
IDS_RESPONSE_TO_BE_DELETED
IDS_QUESTION_ADDED
IDS_RESPONSE_ADDED
IDS_LANGUAGE_ADDED
IDS_SCENARIO_ADDED
IDS_TAG_ADDED
IDS_ROUTING_ADDED
IDS_RESOURCE_ADDED
IDS_RESOURCE_UPDATED

/help -  Produce help message, ie: the list of parameters available in command line. Usage:
Design.exe /help


Examples

1. Merge 2 qex files and save as a new qex

This command line create a final.qex file without modifying main.qex or secondary.qex file and open first main.qex and merge secondary.qex at the end of the main.qex and keeps only the common languages between main.qex and secondary.qex:

Design.exe "D:\Qex\main.qex" /insertsurvey /surveypath:"D:\Qex\secondary.qex" /saveas:"D:\Qex\final.qex" 

2. Insert a qex file

This second command line open final.qex and merge 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 indent (because the usage of /inside) the content of third.qex file and keeps only the common languages between final.qex and third.qex. It also create log file.

Design.exe "D:\Qex\final.qex" /insertsurvey /surveypath:"D:\Qex\third.qex" /questionshortcut:"q12" /inside /logfile:"D:\output\logfile.txt"

3. Update sub survey

This command line update the chapter1 of the the main.qex survey file using the secondary.qex file and keeps only the common languages between main.qex and secondary.qex. It also create log file:

Design.exe "D:\Qex\main.qex" /updatesubsurvey /surveypath:"D:\Qex\secondary.qex" /questionshortcut:"chapter1" /logfile:"D:\output\logfile.txt"

 

4. QEX, QES, XML, or QEW save as QEX, QES or XML

This command line save 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"

 

5. Create a blank qex file

This command line create 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 run without error, it return 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

 

Have more questions? Submit a request

Comments