diff --git a/plugins/jspsych-virtual-chin-rest.js b/plugins/jspsych-virtual-chin-rest.js
index 86116c11..819b7cef 100644
--- a/plugins/jspsych-virtual-chin-rest.js
+++ b/plugins/jspsych-virtual-chin-rest.js
@@ -1,6 +1,9 @@
/*
- * plugin based in Qisheng Li 11/2019. /// https://github.com/QishengLi/virtual_chinrest
- Modified by Gustavo Juantorena 08/2020
+ * plugin for jsPsych based in Qisheng Li 11/2019. /// https://github.com/QishengLi/virtual_chinrest
+
+ Modified by Gustavo Juantorena 08/2020 // https://github.com/GEJ1
+
+ Work in progress in jsPsych discussion: https://github.com/jspsych/jsPsych/discussions/975
*/
jsPsych.plugins['virtual-chin'] = (function() {
@@ -23,12 +26,7 @@ jsPsych.plugins['virtual-chin'] = (function() {
pretty_name: 'Pixels per unit',
default: 100,
description: 'After the scaling factor is applied, this many pixels will equal one unit of measurement.'
- },
- prompt_instructions: {
- type: jsPsych.plugins.parameterType.STRING,
- default: null,
- description: 'Any content here will be displayed above card image.'
- },
+ }
// prompt_card: {
// type: jsPsych.plugins.parameterType.STRING,
// default: null,
@@ -112,7 +110,6 @@ jsPsych.plugins['virtual-chin'] = (function() {
});
-
//=============================
//Ball Animation
@@ -194,28 +191,9 @@ jsPsych.plugins['virtual-chin'] = (function() {
// You can then DO SOMETHING HERE TO PROCEED TO YOUR NEXT STEPS OF THE EXPERIMENT. For example, add a button to go to the next page.
// display_element.innerHTML = `
"Press space bar to start the experiment.
`
- display_element.innerHTML =
-
- `
Este experimento consta de dos tipos de ensayos:
-
- Los ensayos del primer tipo consisten en una serie de números del 1 al 20 rodeados cada
- uno por un círculo. Su objetivo será unir con un trazo continuo los puntos en orden creciente, tratando de
- evitar que los trazos se toquen. Tendrá un límite de tiempo fijo para resolver cada ensayo.
- AL COMENZAR CADA ENSAYO VERÁ UNA CRUZ EN EL CENTRO DE LA PANTALLA, CUANDO ESTA DESAPAREZCA Y VEA LOS CIRCULOS
- DEBERÁ PRESIONAR EL BOTON IZQUIERDO DEL MOUSE (O SU PAD DE NOTEBOOK) Y
- MANTENERLO PRESIONADO HASTA TERMINARLO. No levante el dedo del botón al menos que
- hayas terminado el ensayo, o que este haya terminado por superar el tiempo límite.
- El otro tipo de ensayo consiste en una serie de números del 1 al 10 y letras de la A
- a la J. Su objetivo será unir con un trazo continuo los puntos de manera alternada (ejemplo 1-A-2-B-3-C,
- etc).
-
- Su objetivo será realizar la tarea SIN PASAR POR ENCIMA DE SU PROPIO TRAZO y lo más rápido posible.
- Los ensayos van a aparecer siempre alternadamente.
-
- ¡Suerte y muchas gracias por participar!
-
-
Para comenzar por favor presione la barra espaciadora
- `
+ display_element.innerHTML =
+ "
When you are ready, please press space bar to start the experiment.
" +
+ `
Your viewing distance is about ${dist.toString()} cm
`
return trial_data.viewing_distance_cm;
}
@@ -234,35 +212,37 @@ jsPsych.plugins['virtual-chin'] = (function() {
// You can write functions here that live only in the scope of plugin.trial
function show_stimulus(){
- display_element.innerHTML = `
Por favor repetí la medición de la tarjeta,pero esta vez utilizando la barra deslizante.
`
+ display_element.innerHTML = `
Please use any credit card that you have available (it can also be a grocery store membership
+ card, your drivers license, or anything that is of the same format), hold it onto the screen, and adjust the slider below to its size.
`
- var html = "
";
+ var html = "
";
// html += "
Let’s find out what your monitor size is (click to go into
full screen mode
).";
- html += "
Por favor repita la medición de la misma tarjeta, pero esta vez utilizando la barra deslizante.
";
-
- html += "Asegúrese de poner la tarjeta sobre la pantalla.";
+ html += "
Please use any credit card that you have available (it can also be a grocery store membership card, your drivers license, or anything that is of the same format), hold it onto the screen, and adjust the slider below to its size.
";
+ html += "
(If you don't have access to a real card, you can use a ruler to measure image width to 3.37inch or 85.6mm, or make your best guess!)
";
+ html += "Make sure you put the card onto your screen.";
html += '
';
html += "";
html += '
';
- html +='
';
+ html +='
';
html += '
';
html += '';
- html += "
Ahora vamos a estimar su distancia a la pantalla.
";
+ html += "
Now, let's quickly test how far away you are sitting.
";
+ html += "
You might know that vision tests at a doctor's practice often involve chinrests; the doctor basically asks you to sit away from a screen in a specific distance. We do this here with a 'virtual chinrest'.
";
- html += '
Instrucciones
';
- html += '
1. Coloque su dedo índice en la barra espaciadora
';
- html += '
2. Cierre su ojo derecho. (Tip:Quizá le resulte más fácil tapándolo con su mano!)
';
- html += '
3. Usando su ojo izquierdo, haga foco en el cuadrado negro.
';
- html += '
4. Presione el botón de abajo para iniciar la animación de la pelotita roja. Esa pelotita roja va a desaparecer de su vista en algún momento. Ni bien la deje de ver (siempre enfocando en el cuadrado negro) presione una vez la barra lo más rápidamente posible.
';
- html += '
Por favor repita el proceso cinco veces. Mantenga su ojo derecho cerrado y presione la barra espaciadora lo más rápidamente posible!
';
- html += '';
+ html += '
Instructions
';
+ html += '
1. Put your finger on space bar on the keyboard.
';
+ html += '
2. Close your right eye. (Tips: it might be easier to cover your right eye by hand!)
';
+ html += '
3. Using your left eye, focus on the black square.
';
+ html += '
4. Click the button below to start the animation of the red ball. The red ball will disappear as it moves from right to left. Press the Space key as soon as the ball disappears from your eye sight.
';
+ html += '
Please do it five times. Keep your right eye closed and hit the Space key fast!
';
+ html += '';
html += '';
- html += "Presioná la barra
5
veces más!
";
+ html += "Hit 'space'
5
more times!
";
display_element.innerHTML = html; //
@@ -316,7 +296,7 @@ jsPsych.plugins['virtual-chin'] = (function() {
}
function end_trial(){
- document.getElementsByClassName("jspsych-content-wrapper")[0].style.backgroundColor = 'gray'; //Background color
+ // document.getElementsByClassName("jspsych-content-wrapper")[0].style.backgroundColor = 'gray'; //Background color
// trial_data.viewingDistance= JSON.stringify(viewingDistance); // best practice for saving in jsPsych. It is a JSON instead of array.
jsPsych.finishTrial(trial_data); // ends trial and save the data
display_element.innerHTML = ' '; // clear the display