-
Hello, let repetition_count = 0;
const droneExp1 = {
timeline: [{
type: jsPsychHtmlButtonResponse,
stimulus: function () {
var html = `
<header>
<h1>Dronenbilder</h1>
</header>
<div class="box">
<div id="containerLive">
<button onclick="displayLive({ time: '${jsPsych.timelineVariable('times')}', temp: '${jsPsych.timelineVariable('temps')}', weather: '${jsPsych.timelineVariable('weathers')}', wind: '${jsPsych.timelineVariable('winds')}'})">Zeige
Livebilder</button>
</div>
<div id="containerInfos">
<nav id="infoTabs">
<ul>
<li class="tab"
onclick="displaygeoData({
temp: '${jsPsych.timelineVariable('temps')}',
weather: '${jsPsych.timelineVariable('weathers')}',
wind: '${jsPsych.timelineVariable('winds')}',
windV: '${jsPsych.timelineVariable('windVs')}',
clouds: '${jsPsych.timelineVariable('cloudss')}',
sight: '${jsPsych.timelineVariable('sights')}',
air: '${jsPsych.timelineVariable('airs')}',
rain: '${jsPsych.timelineVariable('rains')}'
})">
<h3>Wetterinformationen</h3>
</li>
<li class="tab" onclick="showMap()">
<h3>Karte</h3>
</li>
</ul>
</nav>
<div id="infoBox">
</div>
<div id="mapBox">
</div>
</div>
</div>
<p>Experiment Trial number: </p>`
return html;
},
choices: ['Weiter'],
button_html: '<button class="button">%choice%</button>',
trial_duration: 10000,
response_ends_trial: true,
},
questionaire
],
repetitions: 5,
response_ends_trial: true,
timeline_variables: [
{ times: "12:00", temps: "20", weathers: '20', winds: '20', windVs: '20', cloudss: '20', sights: '20', airs: '20', rains: '20' },
{ times: "13:00", temps: '21', weathers: '21', winds: '21', windVs: '21', cloudss: '21', sights: '21', airs: '21', rains: '21' },
{ times: "14:00", temps: '22', weathers: '22', winds: '22', windVs: '22', cloudss: '22', sights: '22', airs: '22', rains: '22' },
{ times: "11:00", temps: '21', weathers: '21', winds: '21', windVs: '21', cloudss: '21', sights: '21', airs: '21', rains: '21' },
{ times: "11:30", temps: '21', weathers: '21', winds: '21', windVs: '21', cloudss: '21', sights: '21', airs: '21', rains: '21' },
],
randomize_order: true,
on_timeline_start: function () {
repetition_count++;
console.log('Repetition number ', repetition_count, ' has just started.');
},
on_timeline_finish: function () {
console.log('Repetition number ', repetition_count, ' has just finished.')
}
} and the questionaire looks like this: const questionaire = {
type: jsPsychSurvey,
pages: [
[
{
type: 'html',
prompt: `<h1>Trial: Nun interessiert es uns wie sie diese Situation einschätzen.</h1>`
},
{
type: 'multi-choice',
prompt: 'Wie würden Sie die Situation bewerten? Schadensart/Einsatzart //pro Bewertungeinheit mehere Optionen wählbar machen. Eine Tabelle machbar? ',
options: ["Option A", "Option B", "Brandeinsätze", "Option D"],
correct_response: "Option D", //set correct answer
required: false //set true
},
{
type: 'multi-choice',
prompt: 'Wie würden Sie die Situation erweitert bewerten? Erweiterung //pro Bewertungeinheit mehere Optionen wählbar machen. Eine Tabelle machbar? ',
options: ["Option A", "Option B", "Option C", "Option D"],
correct_response: "Option D", //set correct answer
required: false //set true
},
{
type: 'multi-choice',
prompt: 'Wie würden Sie die Situation ergänzend bewerten? Ergänzung //pro Bewertungeinheit mehere Optionen wählbar machen. Eine Tabelle machbar? ',
options: ["Option A", "Option B", "Option C", "Option D"],
correct_response: "Option D", //set correct answer
required: false //set true
}
],
[
{
type: 'html',
prompt: `<h1>Trial: Nun folgen einige Fragen zu der Situation (22 Fragen)</h1>`
},
{
type: 'multi-choice',
prompt: "SAGAT Level 1",
options: ["Option A", "Option B", "Option C", "Option D"],
correct_response: "Option D", //set correct answer
required: false //set true
},
{
type: 'multi-choice',
prompt: "SAGAT Level 1",
options: ["Option A", "Option B", "Option C", "Option D"],
correct_response: "Option D", //set correct answer
required: false //set true
},
{
type: 'multi-choice',
prompt: "SAGAT Level 1",
options: ["Option A", "Option B", "Option C", "Option D"],
correct_response: "Option D", //set correct answer
required: false //set true
},
{
type: 'multi-choice',
prompt: "SAGAT Level 1",
options: ["Option A", "Option B", "Option C", "Option D"],
correct_response: "Option D", //set correct answer
required: false //set true
},
{
type: 'multi-choice',
prompt: "SAGAT Level 1",
options: ["Option A", "Option B", "Option C", "Option D"],
correct_response: "Option D", //set correct answer
required: false //set true
},
],
[
{
type: 'html',
prompt: `<h1>Trial: Nun folgen einige Fragen zum Szenario</h1>`
},
{
type: 'likert-table',
prompt: 'Nun folgen einige Aussagen, die sich auf Ihre Einschätzung der Situation beziehen. Bitte geben Sie an, inwieweit Sie den folgenden Aussagen zustimmen.',
statements: [
{ prompt: 'Ich bin sicher, die Situation richtig bewertet zu haben.', name: 'SingleUncertainty' }
],
options: ['Stimmt überhaupt nicht zu', 'Stimmt nicht zu', 'Neutral', 'Stimmt zu', 'Stimmt voll und ganz zu'],
required: false //set true
}
]
],
button_label_next: 'Nächste Seite',
button_label_back: 'Vorherige Seite',
button_label_finish: 'Fertig',
on_finish: function () {
}
} I tried various things with an on_finish function at the questionaire to end the trial and increase so the counter of repetitons, but that does not work. Maybe someone has a solution to how i can change my code so the droneExp1 trial is executed 5 times. And the button_label_finish ends it, because I think that might be the problem to not getting in the next repetition. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@L0i0n0a just to clarify - you say you want 5 repetitions of the |
Beta Was this translation helpful? Give feedback.
Oh thank you very much, your question made me think about the repetitions and timeline_variables and solved the problem. It seems like it is now repeating the 5 variables 5 times, where I intended to only let the 5 timeline_variables be executed. I have fixed the problem by removing the repetitions, now only one repetition is made with the 5 different variables!