-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
623 lines (566 loc) · 35.9 KB
/
index.html
File metadata and controls
623 lines (566 loc) · 35.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
<!DOCTYPE html>
<html>
<head>
<title>Critical Thinking Skills Experiment</title>
<script src="https://unpkg.com/jspsych@8.2.2"></script>
<script src="https://unpkg.com/@jspsych/plugin-instructions@2.1.0"></script>
<script src="https://unpkg.com/@jspsych/plugin-survey-multi-choice@2.1.0"></script>
<script src="https://unpkg.com/@jspsych/plugin-survey-text@2.1.0"></script>
<script src="https://unpkg.com/@jspsych/plugin-preload@2.0.0"></script>
<script src="https://unpkg.com/@jspsych/plugin-html-keyboard-response@2.0.0"></script>
<script src="https://unpkg.com/@jspsych/plugin-fullscreen@2.1.0"></script>
<script src="https://unpkg.com/@jspsych/plugin-html-button-response@2.1.0"></script>
<script src="https://unpkg.com/@jspsych-contrib/plugin-pipe"></script>
<link href="https://unpkg.com/jspsych@8.2.2/css/jspsych.css" rel="stylesheet" type="text/css" />
<style>
body {
margin: 0;
padding: 0;
}
.jspsych-content {
font-size: 18px;
line-height: 1.6;
max-width: 600px;
margin: 60px auto;
padding: 20px 30px;
}
.pdf-wrapper {
position: relative;
width: 100%;
height: 85vh;
overflow: auto;
border: 1px solid #ccc;
border-radius: 4px;
background: #f0f0f0;
}
.pdf-container {
width: 100%;
height: 100%;
border: none;
transition: transform 0.3s ease;
transform-origin: top left;
}
.pdf-controls {
display: flex;
justify-content: center;
gap: 10px;
margin: 15px 0;
flex-wrap: wrap;
}
.pdf-controls button {
padding: 10px 20px;
font-size: 14px;
cursor: pointer;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
transition: background-color 0.3s;
}
.pdf-controls button:hover {
background-color: #45a049;
}
.pdf-controls button:active {
background-color: #3d8b40;
}
.pdf-controls button.secondary {
background-color: #2196F3;
}
.pdf-controls button.secondary:hover {
background-color: #0b7dda;
}
.pdf-controls button.danger {
background-color: #f44336;
}
.pdf-controls button.danger:hover {
background-color: #da190b;
}
.zoom-level {
display: inline-block;
padding: 10px 15px;
background-color: #f0f0f0;
border-radius: 4px;
font-weight: bold;
min-width: 60px;
text-align: center;
}
.consent-box {
border: 2px solid #333;
padding: 20px;
margin: 20px 0;
background-color: #f9f9f9;
max-height: 400px;
overflow-y: auto;
}
</style>
</head>
<body></body>
<script>
// ============================================
// (0) INITIALIZE JSPSYCH
// ============================================
const jsPsych = initJsPsych();
var timeline = [];
// ============================================
// (1) SONA STUDY ID COLLECTION
// ============================================
const sonaID = {
type: jsPsychSurveyText,
questions: [
{
prompt: "[READ VERY CAREFULLY TO GET SONA CREDITS] PLEASE ENTER BOTH THE TIME AND DATE OF THE TIMESLOT YOU SIGNED UP FOR ON SONA BELOW (NOT THE CURRENT DATE/TIME). Please submit your SONA timeslot information this format: MM/DD/YYYY ; SIGN-UP TIME ON SONA. It is ESSENTIAL to do this step properly so you can be awarded your credits:",
required: true,
name: "sona_id"
}
],
button_label: "Continue",
data: {
task: 'sona_id_collection'
}
};
timeline.push(sonaID);
// ============================================
// (2) CONSENT FORM
// ============================================
const consent = {
type: jsPsychHtmlButtonResponse,
stimulus: [
`<div class="consent-box">
<h2>Informed Consent Form</h2>
<p><strong>Title of Research Study:</strong> Critical Thinking Skills Learning Study</p>
<p><strong>Purpose:</strong>You are being invited to participate in a research study titled “Reproducibility of Psychological Science and Instruction.” This study is being done by Dr. Bria Long from UC San Diego and associated graduate students in Experimental Methods course. You were selected to participate in this study because you are an adult in the U.S. and have been a represented population in previous psychology studies.</p>
<p><strong>Risks and Benefits:</strong> The purpose of this study is to better understand how well previously published studies in the psychological field replicate online and with different populations. Your participation in this research should last approximately 5-30 minutes If you agree to take part in this study, you may be asked to view a set of stimuli, including pictures, sounds, written text, or videos and then giving some responses via key-presses, verbally, or with paper-and-pencil. We may also observe your choices or preferences among an array of stimuli. These stimuli will be taken directly from or closely adapted from studies that already exist in the published psychological literature. Stimuli will include, e.g., pictures of objects and human faces, audio and video clips, short text passages, etc. None of the stimuli will be disturbing, threatening, or offensive. The online and in-person experiments described in this protocol will take no more than 30 minutes. An example game you might play would be to click on an image on the screen that matches a word you hear being said out loud. Your total expected time commitment for this study is between 5-30 minutes, and is specified in the study description.</p>
<p><strong>Confidentiality:</strong> Your responses will be kept confidential and anonymous. Data will be stored securely and used only for research purposes.</p>
<p><strong>Voluntary Participation:</strong> We will not be asking for any personally identifying information, and we will handle responses as confidentially as possible. Your SONA IDs will never be tied to your responses on this survey. However, we cannot guarantee the confidentiality of information transmitted over the Internet. To minimize this risk, data containing anything that might be personally identifiable (e.g. SONA IDs or IP addresses) will be encrypted on transfer and storage and will only be accessible to qualified lab personnel. We will be keeping data collected as part of this experiment indefinitely. This anonymized data (containing neither Prolific IDs nor IP addresses) may be shared with the scientific community or with other participants to be used as stimuli in future studies.</p>
<p><strong>Contact Information:</strong> If you have questions about this project or if you have a research-related problem, you may contact the researcher(s), Dr. Bria Long, brlong@ucsd.edu. If you have any questions concerning your rights as a research subject, you may contact the UC San Diego Office of IRB Administration at irb@ucsd.edu or 858-246-4777.</p>
<p><strong>By clicking "I Agree" below, you indicate that:</strong></p>
<ul>
<li>You have read and understood the information above</li>
<li>You voluntarily agree to participate</li>
<li>You are at least 18 years old</li>
</ul>
</div>`
],
choices: ['I Agree', 'I Do Not Agree'],
data: { task: 'consent' },
on_finish: function (data) {
if (data.response === 1) {
jsPsych.endExperiment('You have chosen not to participate in this study. Thank you for your time.');
}
}
};
timeline.push(consent);
// ============================================
// (2) PRETEST
// ============================================
// Pretest Instructions
const pretestinstructions = {
type: jsPsychInstructions,
pages: [
"Welcome to the experiment! Click next to begin. <br><br> For Part 1 of the study, you will answer a total of 8 questions. Please read each question carefully, and then choose the best option. Additionally, please complete ALL of the questions. <br><br> Once you are ready, click 'Next' to begin."
],
show_clickable_nav: true,
data: {
task: 'pretest_instructions'
}
};
timeline.push(pretestinstructions);
// Pretest
const pretest = {
type: jsPsychSurveyMultiChoice,
questions: [
{
prompt: "Below you will find two statements. Assume that they are true!<br><br> Proposition 1: Nuts can be eaten. <br> Proposition 2: Some rocks cannot be eaten. <br><br> What can you conclude about rocks based on these two statements?",
options: ["Some rocks can be eaten", "Some rocks are nuts", "Some rocks are not nuts", "No correct conclusion possible"],
required: true
},
{
prompt: "How much effort did it take you to answer this question?",
options: ["Very little effort", "Little effort", "Not a little nor a lot of effort", "Quite a lot of effort", "A lot of effort"],
required: true
},
{
prompt: "Imagine that there are four blocks labeled in this exact order: X, Y, 2, 7. The rule is, if the letter Y is on the front, then the number 2 is on the back.Which blocks do you turn over to see if the rule is being broken?",
options: ["X and 2", "X and 7", "Y and 2", "Y and 7"],
required: true
},
{
prompt: "How much effort did it take you to answer this question?",
options: ["Very little effort", "Little effort", "Not a little nor a lot of effort", "Quite a lot of effort", "A lot of effort"],
required: true
},
{
prompt: "The Jacobs family has decided to buy a new car, choosing a solid and safe German car-either an Audi or a BMW. They want to do some research before deciding. They receive a copy of a report in which experts state that both cars are mechanically sound, although the Audi performs better in some areas. Consumer research shows that Audi owners report fewer mechanical defects than BMW owneres. The Jacobs family is about to start negotiating with the Audi dealer. Suddenly, they remember two friends, one with a BMW and one with an Audi and call them. The BMW owner reported a few minor issues, but nothing major. The Audi owner nearly exploded on the phone, saying that the fuel injection computer broke, resulting in $800 in damage. They continued to say that there are problems with the steering, and then another problem with the transmission and clutch. After three years and significant repair costs, I finally got rid of the Audi. Hearing these two sides, what is the best thing for the Jacobs family to do?",
options: ["Maybe they would be better off buying the BMW", "They would definitely be better off buying the BMW", "Maybe they would be better off buying the Audi", "They would definitely be better off buying the Audi"],
required: true
},
{
prompt: "How much effort did it take you to answer this question?",
options: ["Very little effort", "Little effort", "Not a little nor a lot of effort", "Quite a lot of effort", "A lot of effort"],
required: true
},
{
prompt: "Below you will find two statements. Assume that they are true! <br><br> Proposition 1: All living things need water. <br> Proposition 2: Roses need water. <br><br> What can you conclude about roses based on these two statements?",
options: ["All roses are living things", "Some roses are living things", "Roses are not living things", "No correct conclusion possible"],
required: true
},
{
prompt: "How much effort did it take you to answer this question?",
options: ["Very little effort", "Little effort", "Not a little nor a lot of effort", "Quite a lot of effort", "A lot of effort"],
required: true
},
{
prompt: "Karin is a young woman who is 31 years old, single, spontaneous, and a philosophy graduate. During her studies, she was socially active, concerned about declining tolerance in society, and participated in demonstrations against the construction of new nuclear power plants. Which option is most likely?",
options: ["Karin works at a bank", "Karin works at a bank and is active in the environmental movement.", "Karin works at a bank and is active for a local political party", "Karin works at a bank and is active in the environmental movement and for a local political party"],
required: true
},
{
prompt: "How much effort did it take you to answer this question?",
options: ["Very little effort", "Little effort", "Not a little nor a lot of effort", "Quite a lot of effort", "A lot of effort"],
required: true
},
{
prompt: "A study of 1,000 people recruited 975 women and 25 men. Robin is a randomly selected participant. Robin is 23 years old, has a mechanical engineering degree, enjoys going out with friends, enjoys a beer, and is a fan of hard rock music.What are the odds that robin is male?",
options: ["More than 75%", "50%", "30%", "Less than 3%"],
required: true
},
{
prompt: "How much effort did it take you to answer this question?",
options: ["Very little effort", "Little effort", "Not a little nor a lot of effort", "Quite a lot of effort", "A lot of effort"],
required: true
},
{
prompt: "Each of the blocks show a specific behavior (drinking beer or cola) on one side and an age (15 or 18 year old) label on the other side.The rules are the following: If a person drinks beer, than he is 18 years old. Which blocks would you turn over to see if the rule is being broken?",
options: ["15 and beer", "15 and cola", "18 and beer", "18 and cola"],
required: true
},
{
prompt: "How much effort did it take you to answer this question?",
options: ["Very little effort", "Little effort", "Not a little nor a lot of effort", "Quite a lot of effort", "A lot of effort"],
required: true
},
{
prompt: "A public administration instructor has found that when students discuss the material in small groups during lectures, they're more likely to perform better on the exam. Therefore, the instructor regularly interrupts the lecture to pose a question to students that they can discuss together. The instructor expects positive results from this. Which of the following options do you think is the most likely to succeed?",
options: ["The students score at least 0.1 point higher on the exam", "The students score at least 0.3 points higher on the exam", "The students score at least 0.7 points higher on the exam", "The students score at least 1.0 points higher on the exam"],
required: true
},
{
prompt: "How much effort did it take you to answer this question?",
options: ["Very little effort", "Little effort", "Not a little nor a lot of effort", "Quite a lot of effort", "A lot of effort"],
required: true
},
{
prompt: "Melinda is interested in alright this is just a test. If you are paying attention, click 'X and 2' as your answer.",
options: ["X and 3", "Y and 2", "X and 2", "Y and 3"],
required: true,
name: "attention_check_pretest_question"
},
{
prompt: "In this question, we are testing to see whether or not you are actually paying attention. Please click 'quite a lot of effort' for this question.",
options: ["Very little effort", "Little effort", "Not a little nor a lot of effort", "Quite a lot of effort", "A lot of effort"],
required: true,
name: "attention_check_pretest_effort"
}
],
button_label: "Submit Answers",
data: {
task: 'pretest'
},
on_finish: function (data) {
const r = data.response;
data.attention_question_passed = (r.attention_check_pretest_question === "X and 2");
data.attention_effort_passed = (r.attention_check_pretest_effort === "Quite a lot of effort");
},
}
timeline.push(pretest);
// ============================================
// (3) CONDITION RANDOMIZATION
// ============================================
// Randomize participants into two conditions
// Using true random assignment for each participant
var condition;
var participant_id = jsPsych.data.getURLVariable('participant_id') || Math.floor(Math.random() * 1000000);
// True random assignment: each participant has 50/50 chance of either condition
condition = Math.random() < 0.5 ? 'self_explanation' : 'no_self_explanation';
// Store condition in jsPsych data
jsPsych.data.addProperties({
participant_id: participant_id,
condition: condition
});
// Define PDF files for each condition
// Update these paths to point to your actual PDF files
var pdf_files = {
'self_explanation': '1.pdf', // Update with actual filename
'no_self_explanation': '2.pdf' // Update with actual filename
};
var selected_pdf = pdf_files[condition];
// Instruction & Practice for CT Skills
const practice_instructions = {
type: jsPsychInstructions,
pages: [
"You have completed Part 1 of the study. Now we will move on to Part 2.",
`In this part, you will learn about critical thinking skills through educational materials. ${condition === 'self_explanation' ? 'You will be asked to provide self-explanations as you read.' : 'Please read the materials carefully.'} Click 'Next' to begin!`
],
show_clickable_nav: true,
data: {
task: 'practice_instructions',
condition: condition
}
};
timeline.push(practice_instructions);
// Preload the selected PDF
var preload_pdf = {
type: jsPsychPreload,
files: [selected_pdf],
show_progress_bar: true,
message: 'Loading educational materials...',
continue_after_error: false,
error_message: 'Failed to load the educational materials. Please check the file path.',
data: {
task: 'preload_pdf',
condition: condition,
pdf_file: selected_pdf
}
};
timeline.push(preload_pdf);
// Enter fullscreen mode before displaying PDF
var enter_fullscreen = {
type: jsPsychFullscreen,
fullscreen_mode: true,
message: '<p>The experiment will switch to fullscreen mode when you press the button below.</p><p>This will help you read the materials more comfortably.</p>',
button_label: 'Enter Fullscreen',
data: {
task: 'enter_fullscreen',
condition: condition
}
};
timeline.push(enter_fullscreen);
// Display the PDF based on condition
var pdfId = 'pdf-display';
var zoomLevel = 100;
var pdfHTML = `
<div id="pdf-display-container" style="text-align: center;">
<h3>Educational Materials</h3>
${condition === 'self_explanation' ? '<p style="color: #2196F3; font-weight: bold;">Remember: As you read, please provide self-explanations about what you are learning.</p>' : ''}
<div class="pdf-controls">
<button onclick="zoomPDF('${pdfId}', -25)">Zoom Out (-)</button>
<button onclick="zoomPDF('${pdfId}', 25)">Zoom In (+)</button>
<button onclick="resetZoomPDF('${pdfId}')">Reset Zoom</button>
<span class="zoom-level" id="zoom-${pdfId}">100%</span>
</div>
<div class="pdf-wrapper" id="wrapper-${pdfId}">
<iframe id="${pdfId}" src="${selected_pdf}" class="pdf-container"></iframe>
</div>
<p style="margin-top: 10px; font-size: 12px; color: #666;">
Use zoom controls above or browser zoom (Ctrl/Cmd + Mouse Wheel). Press spacebar when you have finished reading and are ready to continue.
</p>
</div>
`;
// TIMER LOCKED PDF TRIAL
// ========================
let canContinue = false;
const pdf_display = {
type: jsPsychHtmlKeyboardResponse,
stimulus: pdfHTML + `
<p id="timer-message" style="font-size:16px; color:#c00; margin-top:20px;">
Please read for <span id="countdown"></span> seconds before continuing.
</p>
`,
choices: [' '],
data: {
task: 'pdf_display',
condition: condition,
pdf_file: selected_pdf
},
on_load: () => {
let seconds = 120; // ← Set required reading time here
const countdownSpan = document.getElementById('countdown');
countdownSpan.textContent = seconds;
const interval = setInterval(() => {
seconds--;
countdownSpan.textContent = seconds;
if (seconds <= 0) {
clearInterval(interval);
canContinue = true;
document.getElementById('timer-message').innerHTML =
"<span style='color: green;'>You may now press the spacebar to continue.</span>";
}
}, 1000);
},
on_finish: function (data) {
// BLOCK leaving early
if (!canContinue) return false;
}
};
timeline.push(pdf_display);
// Exit fullscreen mode after PDF is displayed
var exit_fullscreen = {
type: jsPsychFullscreen,
fullscreen_mode: false,
delay_after: 0,
data: {
task: 'exit_fullscreen',
condition: condition
}
};
timeline.push(exit_fullscreen);
// Zoom functions
window.zoomPDF = function (pdfId, delta) {
var iframe = document.getElementById(pdfId);
var zoomDisplay = document.getElementById('zoom-' + pdfId);
if (!iframe || !zoomDisplay) return;
var currentZoom = parseFloat(iframe.style.transform.replace('scale(', '').replace(')', '')) || 1;
var newZoom = Math.max(0.25, Math.min(3, currentZoom + (delta / 100)));
iframe.style.transform = 'scale(' + newZoom + ')';
iframe.style.width = (100 / newZoom) + '%';
iframe.style.height = (100 / newZoom) + '%';
zoomDisplay.textContent = Math.round(newZoom * 100) + '%';
};
window.resetZoomPDF = function (pdfId) {
var iframe = document.getElementById(pdfId);
var zoomDisplay = document.getElementById('zoom-' + pdfId);
if (!iframe || !zoomDisplay) return;
iframe.style.transform = 'scale(1)';
iframe.style.width = '100%';
iframe.style.height = '100%';
zoomDisplay.textContent = '100%';
};
// ============================================
// (4) PRACTICE QUESTIONS (Self-Explanation Condition Only)
// ============================================
// Ensure we use the condition from part 3 randomization
// The condition variable is set in part 3 (line 253-263) and stored in jsPsych data (line 266-269)
// At timeline construction time, we use the condition variable directly (set synchronously in part 3)
// This ensures parts 4 and 5 are based on the same randomization from part 3
var condition_for_practice = condition; // Use condition from part 3
// Define effort options (used in both practice and posttest)
const effortOpts = [
"Very little effort", "Little effort", "Not a little nor a lot of effort",
"Quite a lot of effort", "A lot of effort"
];
// Practice questions for self-explanation condition
const practiceItems = [
{
id: "practice_q1",
stem: "Draw a conclusion based on the following two statements. <br> Proposition 1: All participants in the EDM have talent. <br> Proposition 2: DJs have talent. <br> Which conclusion is correct?" + "<br><br>" + "A) Some DJs are participants in the EDM. <br> B) Some DJs are not participants in the EDM. <br> C) All DJs are participants in the EDM. <br> D) No correct conclusion possible."
},
{
id: "practice_q2",
stem: "A survey of 400 people, conducted in collaboration with EDM, is being conducted by 50 avowed salsa enthusiasts and 350 avowed dance enthusiasts. Juan is a randomly selected participant in this survey. Juan is 18 years old, originally from Spain, loves sangria, has flexible hips, and has been ballroom dancing since childhood. What are the chances that Juan is an outspoken dance fan?" + "<br><br>" + "A) More than 85% <br> B) 50% <br> C) 30% <br> D) Less than 15%"
},
{
id: "practice_q3",
stem: "The official responsible for approving the EDM event permit has doubts about the quality of the event's safety plan. If the official adheres to the event policy's safety requirements, the safety plan will not meet all the requirements. The safety requirements were established by a reliable and recognized research institution. However, an experienced colleague claims that the requirements the safety plan does not meet are not particularly important. The experienced colleague believes the safety plan can simply be approved. What is the best thing for the civil servant to do?" + "<br><br>" + "A) Decides to follow the event policy, which means rejecting the safety plan, <br> B) Perhaps follow the event policy, which means rejecting the safety plan. <br> C) Perhaps follow the advice of the experienced colleague, that is, approve the safety plan. <br> D) Decide to follow the advice of the experienced colleague, that is, approve the safety plan."
}
];
function makePracticeBlock(q) {
const text = {
type: jsPsychSurveyText,
questions: [{ prompt: q.stem + "<br><br>First, type the letter of the answer you selected. Then, please explain why is this answer correct. Explain clearly in steps how you arrived at this answer.", rows: 8, required: true, name: `${q.id}_text` }],
data: { item: q.id, phase: "text", task: "practice", condition: condition_for_practice }
};
return { timeline: [text] };
}
// Create practice timeline (only for self-explanation condition)
var practice_timeline = [];
if (condition_for_practice === 'self_explanation') {
const practice_instructions_questions = {
type: jsPsychInstructions,
pages: [
"Now you will practice applying what you learned with a few practice questions.",
"For each practice question, you will explain your reasoning step by step. This practice will help you prepare for the final test. Click 'Next' to begin the practice questions!"
],
show_clickable_nav: true,
data: {
task: 'practice_instructions_questions',
condition: condition_for_practice
}
};
practice_timeline.push(practice_instructions_questions);
const randomizedPracticeBlocks = jsPsych.randomization.shuffle(practiceItems.map(makePracticeBlock));
practice_timeline.push(...randomizedPracticeBlocks);
}
// Add practice timeline to main timeline
timeline.push(...practice_timeline);
// ============================================
// (5) POSTTEST
// ============================================
// Ensure we use the condition from part 3 randomization
// The condition variable is set in part 3 (line 253-263) and stored in jsPsych data (line 266-269)
// At timeline construction time, we use the condition variable directly (set synchronously in part 3)
// This ensures parts 4 and 5 are based on the same randomization from part 3
var condition_for_posttest = condition; // Use condition from part 3
// Posttest Instructions
const posttestinstructions = {
type: jsPsychInstructions,
pages: [
"Now we are in Part 3 of the study. You will be tasked to complete a total of 8 questions.",
"Please read the assignments carefully, and then choose the best option. Then, EXPLAIN step by step how you arrived at this answer. Try to provide clear reasoning, even if you find the question difficult. Click 'Next' when you are ready to begin!"
],
show_clickable_nav: true,
data: {
task: 'posttest_instructions',
condition: condition_for_posttest
}
};
timeline.push(posttestinstructions);
// Posttest Items
const posttestItems = [
{ id: "q1", stem: "Below you will find two statements. Assume that they are true! <br<br> Proposition 1: All birds can fly. <br> Proposition 2: Some chickens cannot fly. <br><br> What can you conclude about chickens based on these two statements", opts: ["Some chickens can fly", "Some chickens are birds.", "Some chickens are not birds.", "No correct conclusion possible."] },
{ id: "q2", stem: "A North Brabant law firm has two vacancies for legal assistants. For the past 15 years, this firm has had excellent experiences with numerous law graduates from Tilburg University. Therefore, the firm's management prefers these graduates when filling vacancies. However, a new HR manager proposes giving HBO graduates a chance. At a company where he previously worked, he gained experience with a graduate of Avans University of Applied Sciences. This graduate performed well from the start, and after two years, he even considered him to be performing at an excellent level. The HR manager believes that an HBO graduate is at least as talented as a university graduate and proposes giving Avans University of Applied Sciences graduates priority when filling the vacancies. What should the firm do?", opts: ["Definitely give preference to graduates of Tilburg University.", "Perhaps give preference to graduates of Tilburg University.", "Perhaps give preference to graduates of Avans University of Applied Sciences.", "Definitely give preference to graduates of Avans University of Applied Sciences."] },
{ id: "q3", stem: "Below you will find two statements. Assume that they are true! <br><br> Proposition 1: All major events must apply for a permit. <br> Proposition 2: Some music events require a permit. <br><br> What can you conclude about music events based on these two statements?", opts: ["All music events are big events.", "Some music events are big events.", "Some music events aren't big events.", "No correct conclusion possible."] },
{ id: "q4", stem: "The blocks below from a game show a spade or heart on one side and the number 9 or 2 on the other. The rule is: if there's a heart on one side, there's a 2 on the other. Which blocks do you turn over to see if the rule is being broken?", opts: ["Hearts and 9", "Hearts and 2", "Spades and 9", "Spades and 2"] },
{ id: "q5", stem: "Jacques is an introverted man of small stature. He enjoys French literature and classical music, and he practices Tai Chi every morning. Which of the following is most likely?", opts: ["Jacques is a caretaker and is a member of the Tai Chi Association Netherlands", "Jacques is a concierge and organizes the annual Poetry Night", "Jacques is a janitor", "Jacques is a caretaker, is a member of the Dutch Tai Chi Association and organizes the annual Night of Poetry"] },
{ id: "q6", stem: "In a study, 1,000 people are tested. Among the participants are 950 who buy their clothes at C&A and 50 who buy their clothes at high-end clothing stores. Sacha is a randomly selected participant. Sacha is a 36-year-old woman who works as a wealth management director at a bank and drives a Porsche. She lives with her boyfriend in a penthouse. What is the probability that Sacha buys her clothes at high-end clothing stores?", opts: ["More than 75%", "50%", "30%", "Less than 10%"] },
{ id: "q7", stem: "Each of the tickets below shows a destination on one side and a company on the other. The rule is: If Madrid is the destination, then the flight is operated by Ryanair. Which tickets do you turn over to see if the rule is being violated?", opts: ["Madrid and Ryanair", "Madrid and Transavia", "Barcelona and Ryanair", "Barcelona and Transavia"] },
{ id: "q8", stem: "Eindhoven aims to reposition itself in the nightlife sector by extending closing hours. The goal is to increase the number of visitors to Eindhoven's nightlife by 5%. Based on market research, measures are being implemented, such as improving quality, focusing more on consumers, and a more experience-oriented nightlife campaign. Which option is most likely?", opts: ["Within 5 years, the number of visitors will increase by 2%", "Within 5 years, the number of visitors will increase by 5%", "Within 5 years, the number of visitors will increase by 7%", "Within 5 years, the number of visitors will increase by 10%"] }
];
function makePosttestBlock(q) {
const mc = {
type: jsPsychSurveyMultiChoice,
questions: [{ prompt: q.stem, options: q.opts, required: true, name: `${q.id}_mc` }],
data: { item: q.id, phase: "mc", condition: condition_for_posttest }
};
const text = {
type: jsPsychSurveyText,
questions: [{ prompt: "Explain your reasoning:", rows: 8, required: true, name: `${q.id}_text` }],
data: { item: q.id, phase: "text", condition: condition_for_posttest }
};
const effort = {
type: jsPsychSurveyMultiChoice,
questions: [{ prompt: "How much effort did it take?", options: effortOpts, required: true, name: `${q.id}_effort` }],
data: { item: q.id, phase: "effort", condition: condition_for_posttest }
};
return { timeline: [mc, text, effort] }; // locked order
}
const randomizedPosttestBlocks = jsPsych.randomization.shuffle(posttestItems.map(makePosttestBlock));
timeline.push(...randomizedPosttestBlocks);
// ============================================
// (6) END MESSAGE
// ============================================
// ============================================ SAVE TRIAL DATA
const expID = "CgetHBPXUjQP";
// Generate a random participant ID.
const participantID = jsPsych.randomization.randomID(10);
const save_data = {
type: jsPsychPipe,
action: "save",
experiment_id: expID,
filename: `${participantID}_SONA.csv`,
data_string: () => jsPsych.data.get().csv()
};
timeline.push(save_data);
//====================================== THANK YOU MESSAGE
var end_message = {
type: jsPsychHtmlKeyboardResponse,
stimulus: '<p>Thank you for participating in this experiment! Our study was trying to understand how writing self-explanations enhance critical thinking skills. Your responses have been recorded.</p><p>Press any key to finish.</p>',
data: {
task: 'end',
condition: condition_for_posttest
}
};
timeline.push(end_message);
// Run the experiment
jsPsych.run(timeline);
</script>
</html>