Ah, right, like a Standard Usability Score (SUS) survey.
Here is an updated demo file:
Likert Scale Quiz.rp (486.2 KB)
The most straightforward approach would be to rename the answer dots for the reverse-coded items, where “1” becomes “5”, “2” becomes “4”, etc. See the Basic Quiz (with reverse coding) page for this approach.
That could be a bit of a pain though. Also would be too easy to make mistakes, and hard to see at a glance if everything is set correctly for a given quiz item–is it normal or reverse? It would be nice if you could click a toggle switch to reverse-code any quiz item and quickly scan the questionnaire form in the editor to see which questions have been toggled to reverse-coding. For that, we need an algorithm to swap the scores.
I Googled likert scale reverse scoring algorithm to find this simple transform equation:
Reverse Score = Max + 1 - Score
See the Quiz Running Totals (with reverse) page for an algorithm-driven approach.
- To each quiz item group, I added a toggle image that I already had (made with Axure, btw) and set its selected style to load an image showing the toggle “on”.
- When the toggle is selected/on, a conditional case in each dot applies the reverse-coding expression when updating the Total value.
- To set an item as reverse-coded in the RP editor, click that item’s toggle, then on the Interactions pane, check the “Selected” checkbox. It will then show in the editor as “on”.
- All the toggles have a Loaded event to hide themselves automatically.
( I just thought of another few approaches, but I didn’t make examples of these. They work on the same logical principle as the toggle…
- You could use a global variable to store the item numbers that are reverse-coded, and then test if OnLoadVariable contains the current quiz item number, in the same way I test for the selection state of the toggle.
- Either set its default value in the Project > Global Variables dialog, e.g, set OnLoadVariable to “2,4,6”
- Or, you could use the Page Loaded event to set the global variable value.
- You could set it up so every other question is always reverse-coded, e.g., all the even-numbered questions. The conditional case for the dot click would be
If "[[ (LVAR1.Name.substring(1))%2 ]]" equals "0" where LVAR1 is a local variable pointing to the group, e.g., named “Q1”, “Q2”, etc.
The reverse coding algorithm is also needed for a repeater-based quiz. The “toggle” can be done with a datasheet column and a conditional case testing the value of that column. See the Quiz Repeater (supporting reverse) page.
- I added a sixth row and made the question items in rows 2, 4, 6 sound “negative”. Quick and easy.
- I added a column named, “Reverse” and set the value to “true” for rows 2, 4 6.
- I added an additional case for calculating the total value which applies the reverse coding expression if the Reverse column equals “true”.
- In the “Case Last” (row) case, I also added a
Wait 100 ms action before calculating the average to ensure everything gets set on the Count and Total widgets before trying to divide them.
- Also note that it only tries to calculate an average if the count is greater than 0, otherwise a math error would occur and the value would get set to “NaN” (for Not a Number).