Apply_Carousel_5_Write_in_Questions_Array_Writer_General: Batch apply the carousel presentation style to a list of...

View source: R/Carousel_5_GENERAL_Write_in_Questions_Array_Writer.R

Apply_Carousel_5_Write_in_Questions_Array_Writer_GeneralR Documentation

Batch apply the carousel presentation style to a list of questions belonging to various groups that display the entries from a prior free text write-in questions (which can either be in the group or somewhere else in the survey)

Description

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 Freetext_Questions 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!

Usage

Apply_Carousel_5_Write_in_Questions_Array_Writer_General(
  Huge_Free_Text_List,
  Text_Question_List,
  Freetext_Questions
)

Arguments

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:

  • sid: <this column is mandatory!> the sid of the survey where this question is found

  • gid: <this column is mandatory!> the gid of the group that the respective question belongs to

  • qid: <this column is mandatory!> the qid of the respective question

  • title: <this column is mandatory!> the title of the question

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.

  • sid: <this column is mandatory!> the sid of the survey where this question is found

  • gid: <this column is mandatory!> the gid of the group that the respective question belongs to

  • qid: <this column is mandatory!> the qid of the respective question

  • title: <this column is mandatory!> the title of the question

  • freetext_top_name: <this column is mandatory!> the title of the parent free text question that should be associated with the given row (the row representing one of the array writer text questions)

  • left_prompt: <this column is optional, default is blank> You can optionally place instructions beneath the selection buttons- this would be the prompt on the left side of a separator.

  • right_prompt: <this column is optional, default is blank> You can optionally place instructions beneath the selection buttons- this would be the prompt on the right side of a separator.

  • separator: <this column is optional, default is blank> The text that serves as a separator between left prompt and right prompt. Defaults to blank, but my suggestion would be " || " if you intend to use this.

  • top_question: <this column is optional, default is "<h1>Please evaluate the following:</h1>"> This is the large text shown above the individual questions. You can use html text in this string to specify how you want this question to be presented!

  • language: <this column is optional, defaults to base language> the language of the questions you are trying to set. If you have multiple languages, you need to have one row for each!

  • submit_button_text: <this column is optional, default is "Submit Recommendations"> the text that should be shown on the "Next" button

  • set_mandatory: <this column is optional, default is FALSE> should next button be disabled until all questions answered? Forces respondents to answer all the slider questions before they can progress.

  • progress_bar: <this column is optional, default = FALSE> should there be a progress bar shown?

  • progress_bar_start: <this column is optional, default is "0 completed"> what should the text by the progress bar be before first question is answered?

  • progress_text: <this column is optional, default is "completed of"> if you opt for a progress bar, it is shown both visually and in text. The text says something like, "1 of 10" and automatically counts everything for you. You just have to use this variable as the text between the numbers (for example, if you ask the question in different languages- these will not be automatically translated like the rest of limesurvey!)

  • progress_indicator: <this column is optional, default is "Progress"> the text that should be shown next to the visual progress bar

Freetext_Questions

A simple list of questions with the following columns- and, by the way, it has to include both the top questions and the subquestions. Short free text write in questions are of type "Q":

  • qid <mandatory!>: This is the code that you want to associate the evaluations with in your output. Your "question code" in other words.

  • title <mandatory!>: This is the code that you want to associate the evaluations with in your output. Your "question code" in other words.

  • parent_qid <mandatory!>: This is the question that will be shown to the respondent

  • question_order <mandatory!>: This is the title of the Limesurvey question this question should be assigned to

  • language <optional, default is base language>: The target language where this question will be added.

Details

The only difference between this function and the "normal" Array Writer 5 is in the Freetext_Questions. So, if you know your way around that function, you can skip down to the section on the Freetext_Questions parameter and read that.

Basically, this function takes three data.tables as input-

  1. a data.table of Huge free text questions that will be used as the "data storage"

  2. 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

  3. 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.

Limitations

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.

Results storage

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.

Advice for usage

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!

Additional comments

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".

Examples

## Not run: 
Apply_Carousel_5_Array_Writer(Huge_Free_Text_List, Text_Question_List, Question_List)

## End(Not run)


bpresentati/surveyR documentation built on March 19, 2022, 3:40 a.m.