75 lines
2.0 KiB
HTML
75 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Document</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
line-height: 1.6;
|
|
margin: 20px;
|
|
background-color: #f4f4f4;
|
|
color: #333;
|
|
}
|
|
button {
|
|
display: block;
|
|
width: 20%;
|
|
padding: 10px;
|
|
background: #bc0ba8;
|
|
color: #fff;
|
|
border: none;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
font-size: 16px;
|
|
margin-top: 20px;
|
|
}
|
|
section {
|
|
background: #fff;
|
|
padding: 20px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
}
|
|
button:not(:disabled):hover {
|
|
background: #5d0570;
|
|
}
|
|
div {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div>
|
|
<section>
|
|
<h1 id="caption">Incorrect! You selected the wrong letter.</h1>
|
|
<h3 id="info-text">Don't worry, you can try again!</h3>
|
|
</section>
|
|
|
|
<button id="end-trial">Restart</button>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
var responses = JSON.parse(
|
|
jsPsych.data.get().last(1).select("responses").values
|
|
);
|
|
var controlLetter = jsPsych.data.get().last(1).select("controlLetter1")
|
|
.values[0];
|
|
|
|
if (responses.Q1 == controlLetter) {
|
|
document.getElementById("caption").innerText = "Correct!";
|
|
document.getElementById("info-text").innerText =
|
|
"You selected the correct letter! Now you can proceed to the study.";
|
|
document.getElementById("end-trial").innerText = "Let's go!";
|
|
} else {
|
|
document.getElementById("caption").innerText =
|
|
"Incorrect! You selected the wrong letter.";
|
|
document.getElementById("info-text").innerText =
|
|
"Don't worry, you can try again!";
|
|
document.getElementById("end-trial").innerText = "Restart";
|
|
}
|
|
</script>
|
|
</html>
|