View source: R/Carousel_5_Array_Writer.R
Apply_Carousel_5_Array_Writer | R Documentation |
This version will form your questions into a slider presentation with five answer buttons: 1 Red, 3 Yellow, 1 Green- the text on them are the numbers 1 (on red) to 5 (on green). This lends itself to 5-point Likert style rating questions. The current incarnation does not allow you to change the colors or text on the buttons- if there is a need for this, please let me know. The information that you need to provide is discussed in the arguments list, but I would encourage you to do a "test merge" of the Text_Question_List (without the "question" column) and the Question_List and check the results, especially if you are using this on a large number of questions or for many different languages- make sure you've added all the questions you think you've added!
Apply_Carousel_5_Array_Writer( Huge_Free_Text_List, Text_Question_List, Question_List )
Huge_Free_Text_List |
These are the huge free text questions that will hold the array data. One should be placed inside the same group as the TEXT question (that contains the HTML/Javascript). This argument should be a data.table with the following columns, listing all of the questions:
|
Text_Question_List |
A data.table with the "TEXT" questions that are in the group with the respective storage question, and that should "receive" the html/javascript payload- this data.table contains the sid, gid, and qid of these questions, as well any other parameters to define their style/presentation. You can think about these questions as the "shell" that provides the prompt (something like, "please respond to the following statements:") and is filled by the questions listed in the Question_List.
|
Question_List |
A simple list of questions with at least three columns:
|
Basically, this function takes three data.tables as input-
a data.table of Huge free text questions that will be used as the "data storage"
a data.table of Text questions- these are the questions that are paired with the huge free text questions in the same group in order to provide the canvas to paste in the html/javascript
a data.table with the question list- the actual questions you want to pose
And turns them into a mobile-friendly slider-type limesurvey question, with very little effort.
To date it appears that limesurvey has a limit on the amount of code that can be placed in a given question (1000 lines). This roughly translates to 50 of this style of question. This means you have to cap any given Text_Question_List entry to having 50 subquestions. While this is unfortunate, you still have a net positive effect- in exchange for 2 LS questions, you can pose 50. This means that the LS limit of ~1400 questions in any given survey can be increased 25 fold to 35000.
The questions generated for this function store all results as arrays in the Huge_Free_Text_List in the format evaluation-title. For example: 1-ABE303024 or 5-Question1. They are comma separated. The function Parse_Array_Writer (in this package) has been written explicitly to parse these questions into a long format, which is very easy to use in further analysis.
This function can be paired nicely with the Get_Question_List function (also in this package). With that function you can retrieve the Huge Free Text questions you need for Huge_Free_Text_List and the text questions you need for the Text_Question_List. The Question_List is up to you to populate how you see fit- but please make sure the Text_Title corresponds to the titles of questions that actually exist in the respective survey!
One of the many strengths of this question style/approach is that you can change questions on the fly and the data stored is maintained. For example, if you are using this to show the respondent a long list of companies that they should evaluate (how environmentally friendly they think they are) you can change the list while the survey is running without damaging anything. The question codes are not stored in the export column names, they are stored in the fields. So, if you ask respondents about Walmart and Target in the first three days of your survey, the responses from those respondents will look like, "1-Walmart, 3-Target", which will be maintained if you change to Petsmart and Costco on day four, when new respondents will see those companies and have responses like, "3-Petsmart, 4-Costco".
## Not run: Apply_Carousel_5_Array_Writer(Huge_Free_Text_List, Text_Question_List, Question_List) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.