Instructions Slider convert result to label

--------------------------------------------

---Explanation---

This template will change the result you get in the data file resulting from running the experiment.

If you have 5 options in the slider, you can keep everything as it is and just change the names of the labels in the slider according to your liking.

---Please note---

Keep in mind, if you use this template, you will have an additional value in your Excel data file that depicts the labels that is called "Slider_Trial_Slider.responseaslabel".
Nonetheless, you still have the regular results in a number format as "Slider_Trial_Slider.response".
Like that, you will create a new column in the Excel data file that lists the label of the value selected as defined in the code. Nonetheless, the precise values that the participants select will also be noted.
That way, you can combine efficiency and precision by seeing the precise value and the label that was probably meant to be chosen.


If you want to replace the number value by its label, change the last line of the code from:

trials.addData('Slider_Trial_Slider.responseaslabel', rating)

to:

trials.addData('Slider_Trial_Slider.response', rating)

Though, your results will be less precise if you do so as you will not save the precise number values of the partcipant's response.

---Add or delete an option---

If you add or delete an option in the slider, you will of course have to add or delete a label in the slider as well.
In addition, you would have to change the code component "Convert_to_labels" in the routine "Slider_Trial".

To add an option, take a part of the code or the following code that is in that file as well:

elif 4.5 <= rating <= 5:
    rating = labels[4]

This snippet covers the case that someone selects something between 4.5 and 5 on the slider which would be a 5 in general. 
To add, a sixth option, change the values in the first line from "4.5" to "5.5" and from "5" to "6".
Then, change the value "4" in the second line to "5".
It should look like this:

elif 5.5 <= rating <= 6:
    rating = labels[5]

To delete an option, just delete the last option aka the last elif-condition of the code (the last line that contains the word "elif" and the line after that).
Then, change the elif-condition before that by making the last number in the first line of the condition a round number.
Also, make the smaller sign a smaller-or-same-as sign.
For example, if you delete the fifth option, the fourth option will be the last one.
In that case, the new last elif-condition will be the following:

elif 3.5 <= rating < 4. 5:
    rating = labels[3]

Change it to:

elif 3.5 <= rating <= 4:
    rating = labels[3]


------------------------------

If you have any questions regarding the usage of the template file or if you have constructive criticism on how to improve these instructions, please message one of the email addresses listed for PsychoPy support in the Gitlab of the PsychoPy workshop. Thank you!