In this next set of articles I am going to show you how we can take Data Collection Scripts and get them to make some cool things. To me a survey can be so much more than just a survey, it can, with the use of some simple concepts, be a dashboard , online comments cleaner, panel or report delivery system. So what skills do we have to have to make let’s say a very simple dashboard system. Well if you know how to write a data collection survey , you know how to edit JavaScript , you have read my posts on ODBC connections and have learnt HTML you have all the tools you need.
IOM Scripting
Survey Scripting Questions
Add Context , Populate & Strip HTML out
You would have recently seen in LinkedIn that Barb asked the following question. “When you add html code into your survey, it displays beautifully but then it displays as code in your tabs. Is there a way in a DMS to globally eliminate any HTML code?” and I pointed him to a post that had been written awhile ago. Also in my comment I mentioned that I had a script that would add a context to an MDD and then strip out the HTML and put just the text in it. This article shows you the code for that script.
Upload File example.
Its been a while since i wrote something , so i thought i better step up my game and get posting again. Every so often i am asked if I had ever written a script to upload a physical file onto the data collection server. So this article will show you how this can be done, the main thing to think about is you must be able to copy some files to the server and make a few directories. If you are running this in a cluster you will have to think a little differently , but here is some code that can be used.
Question Example : Grid – Repeat Header Every Two Rows
Description : This examples shows you how your grid can have headers every two rows of the grid.
V601 Author Wizard Files : Click Here Copy entire folder to your templates folder.
Professional IVS File : Click Here, Click File, Import Metadata in professional to load.
Question Example : Grid – Headers Top Bottom Left Right
Description : This examples shows you how your grid can have headers on the Top, bottom, left and right of the grid.
V601 Author Wizard Files : Click Here Copy entire folder to your templates folder.
Professional IVS File : Click Here, Click File, Import Metadata in professional to load.
Question Example : Grid – Headers Top Bottom
Description : This examples shows you how your grid can have headers on the Top and the Bottom of the grid.
V601 Author Wizard Files : Click Here Copy entire folder to your templates folder.
Professional IVS File : Click Here, Click File, Import Metadata in professional to load.
Question Example : Grid – Headers Left Right Middle
Description : This examples shows you how your grid can have headers on the left and the right and the middle of the grid.
V601 Author Wizard Files : Click Here Copy entire folder to your templates folder.
Professional IVS File : Click Here, Click File, Import Metadata in professional to load.
Calculating Points Update
Here is another way that points could be worked out using custom properties. First off put the values in the metadata
Metadata(en-AU, Question, label) Q1 "Gender" categorical [1] { _1 "Male" [iScore = 10], _2 "Female" [iScore = 20] }; End Metadata
In this case Male is worth 10 points and female is worth 20. Then in your routing write a quick function to loop the results and total up the score.
Routing(Web) Dim iTotal Q1.Ask() iTotal = iTotal + Score(Q1) debug.MsgBox(ctext(iTotal)) Function Score(oQuestion) Dim oResp,iScore For each oResp in oQuestion.response.value iScore = iScore + oQuestion.categories[format(oresp,"a")].properties["iScore"] Next Score = iScore End Function End Routing
Q & A : Randomization of categorical codes
A few days ago we where asked the following,
Q: I have a categorical question that i would like to randomize the responses. However some of the responses must be randomized , but must not be next to each other.
To randomize the response on a categorical question is easy , we just use the ran keyword, for example ,
Randomize the text of a question.
Have you ever wanted to randomize the text in a question. For example , if you are running a telephone interviewing job you may want the interviewer to read read the list out in a different order each time. In this article we will show you one way that this can be done.