--
You received this message because you are subscribed to the Google Groups "jsPsych" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jspsych+u...@googlegroups.com.
To post to this group, send email to jsp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jspsych/c34c5a3a-bd04-44b1-939e-aa79cdfda886%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to jspsych+unsubscribe@googlegroups.com.
Can I follow up on this? I have the same issue with Hayley. I'm using jsPsych 6.0.5 and I wasn't quite sure if there's a right way to make the survey-text show up. My reproducible code is below.
Thank you so much!
Sakol
-----------------------------------
var timeline = [];
var all_lang = {
type: 'survey-multi-select',
preamble: '<h3>Languages</h3>',
questions: [ {
prompt: "Which language(s) did you grow up with? Select all that apply",
options: [ "American English", "African American English", "Spanish",
"Chinese", "Korean", "Japanese", "Other"] } ],
data: {trial: 'all_lang'},
}
timeline.push(all_lang);
var other_text = {
type: 'survey-text',
questions: [{prompt: "Because you selected other, please specify"}],
}
var loop = {
timeline: [other_text],
conditional_function: function(){
var data = jsPsych.data.getLastTrialData();
if(JSON.parse(data.responses).Q0 == "Other") {
return true;
} else {
return false;
}
}
}
timeline.push(loop);
--
You received this message because you are subscribed to the Google Groups "jsPsych" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jspsych+u...@googlegroups.com.
To post to this group, send email to jsp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jspsych/fa580ae3-5cef-42e9-a285-05311845b62a%40googlegroups.com.
var all_lang = {
type: 'survey-multi-select',
preamble: '<h4>Languages</h4>',
questions: [
{
prompt: "Which language(s) did you grow up with? Check all that apply",
//sample answers here in options
options: ["American English", "African American English",
"Native American Languages", "French", "German", "Other"]
}
],
required: true,
data: {trial: 'house_lang'},
}
timeline.push(all_lang);
var other_houselang = {
type: 'survey-text',
preamble: "<h4>Other Languages</h4>" +
"<p style = 'font-size: 15px;'> Because you selected 'other' in the previous question, please list language(s) you grew up with:</p> ",
questions: [ {prompt: ""} ],
data: {trial: 'house_lang_other'}
}
var otherlang_loop = {
timeline: [other_houselang],
conditional_function: function() {
var dat = jsPsych.data.getLastTrialData().values()[0];
var answer = JSON.parse(dat.responses).Q0;
if(answer.includes('Other') == true) {
return true;
} else {
return false;
}
},
}
timeline.push(otherlang_loop);