Skip to content

Commit 1d27859

Browse files
adding AOI names to text and face tasks
1 parent 36a4d81 commit 1d27859

7 files changed

Lines changed: 71 additions & 6 deletions

File tree

webcamstudy/asset-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"files": {
33
"main.css": "https://seresl.unl.edu/webcamstudy/static/css/main.e2758196.css",
4-
"main.js": "https://seresl.unl.edu/webcamstudy/static/js/main.141a4a42.js",
4+
"main.js": "https://seresl.unl.edu/webcamstudy/static/js/main.f780c553.js",
55
"static/js/453.e44939a0.chunk.js": "https://seresl.unl.edu/webcamstudy/static/js/453.e44939a0.chunk.js",
66
"static/media/monkey_business.mp4": "https://seresl.unl.edu/webcamstudy/static/media/monkey_business.4c162ec3365ba53d0a3f.mp4",
77
"static/media/soccer-vid.mp4": "https://seresl.unl.edu/webcamstudy/static/media/soccer-vid.4aa09d7760e7c517c175.mp4",
@@ -223,11 +223,11 @@
223223
"static/media/5point_1920x1080.png": "https://seresl.unl.edu/webcamstudy/static/media/5point_1920x1080.16294bbf8c826fc2134e.png",
224224
"index.html": "https://seresl.unl.edu/webcamstudy/index.html",
225225
"main.e2758196.css.map": "https://seresl.unl.edu/webcamstudy/static/css/main.e2758196.css.map",
226-
"main.141a4a42.js.map": "https://seresl.unl.edu/webcamstudy/static/js/main.141a4a42.js.map",
226+
"main.f780c553.js.map": "https://seresl.unl.edu/webcamstudy/static/js/main.f780c553.js.map",
227227
"453.e44939a0.chunk.js.map": "https://seresl.unl.edu/webcamstudy/static/js/453.e44939a0.chunk.js.map"
228228
},
229229
"entrypoints": [
230230
"static/css/main.e2758196.css",
231-
"static/js/main.141a4a42.js"
231+
"static/js/main.f780c553.js"
232232
]
233233
}

webcamstudy/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="https://seresl.unl.edu/webcamstudy/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="https://seresl.unl.edu/webcamstudy/logo192.png"/><link rel="manifest" href="https://seresl.unl.edu/webcamstudy/manifest.json"/><title>Eye Tracking Webcam Study</title><script type="module">import EmbeddedPageSdk from"https://app.realeye.io/sdk/js/testRunnerEmbeddableSdk-1.7.1.js";let reSdk=null;window.addEventListener("DOMContentLoaded",()=>{reSdk=new EmbeddedPageSdk(!1,null,!1)}),window.addEventListener("endmeplease",()=>{reSdk&&reSdk.finishEyeTrackingTest()})</script><script defer="defer" src="https://seresl.unl.edu/webcamstudy/static/js/main.141a4a42.js"></script><link href="https://seresl.unl.edu/webcamstudy/static/css/main.e2758196.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="https://seresl.unl.edu/webcamstudy/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="https://seresl.unl.edu/webcamstudy/logo192.png"/><link rel="manifest" href="https://seresl.unl.edu/webcamstudy/manifest.json"/><title>Eye Tracking Webcam Study</title><script type="module">import EmbeddedPageSdk from"https://app.realeye.io/sdk/js/testRunnerEmbeddableSdk-1.7.1.js";let reSdk=null;window.addEventListener("DOMContentLoaded",()=>{reSdk=new EmbeddedPageSdk(!1,null,!1)}),window.addEventListener("endmeplease",()=>{reSdk&&reSdk.finishEyeTrackingTest()})</script><script defer="defer" src="https://seresl.unl.edu/webcamstudy/static/js/main.f780c553.js"></script><link href="https://seresl.unl.edu/webcamstudy/static/css/main.e2758196.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

webcamstudy/src/components/FaceTask.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ const FaceTask = ({ onSubmit }) => {
310310
{grid.map((image, idx) => {
311311
const row = Math.floor(idx / gridSize) + 1;
312312
const column = (idx % gridSize) + 1;
313+
const rowStr = row.toString();
314+
const colStr = column.toString();
315+
const correctness = image.isCorrect ? 'correct' : 'incorrect';
316+
const aoName = `face-task-${taskIndex}-trial-${trial}-row${rowStr}-col${colStr}-${correctness}`;
313317
return (
314318
<img
315319
key={`${taskIndex}-${trial}-${image.id}`}
@@ -319,7 +323,7 @@ const FaceTask = ({ onSubmit }) => {
319323
data-correct={image.isCorrect ? 'T' : 'F'}
320324
data-emotion={emotion}
321325
data-gender={gender}
322-
data-re-aoi-name={`${row}-${column}-${image.isCorrect ? 'correct' : 'incorrect'}`}
326+
data-re-aoi-name={aoName}
323327
alt={`${gender} ${emotion} face`}
324328
style={{
325329
objectFit: 'cover',

webcamstudy/src/components/Text/TextTask.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,21 @@ const formatText = (text, ref) => {
4141
let isSpace = /^\s+$/.test(word);
4242
let wordBlock = document.createElement("span");
4343
wordBlock.classList.add("word-block");
44+
// Always set an AOI name for the word block
4445
if (isWord) {
4546
wordBlock.setAttribute("data-re-aoi-name", `s${sentenceCount}-w${wordCount}`);
47+
} else if (isSpace) {
48+
wordBlock.setAttribute("data-re-aoi-name", `s${sentenceCount}-space-${wordCount}`);
49+
} else {
50+
wordBlock.setAttribute("data-re-aoi-name", `s${sentenceCount}-punct-${wordCount}`);
4651
}
4752
word.split('').forEach(char => {
4853
let charSpan = document.createElement("span");
4954
charSpan.textContent = isSpace ? '' : char;
50-
charSpan.setAttribute("data-re-aoi-name", character_id++);
55+
// Create descriptive AOI names for characters
56+
let charType = isSpace ? 'space' : (isWord ? 'letter' : 'punct');
57+
charSpan.setAttribute("data-re-aoi-name", `s${sentenceCount}-${charType}-c${character_id}`);
58+
character_id++;
5159
charSpan.classList.add(isSpace ? "space" : "letter");
5260
wordBlock.appendChild(charSpan);
5361
});

webcamstudy/static/js/main.f780c553.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* @license React
3+
* react-dom-client.production.js
4+
*
5+
* Copyright (c) Meta Platforms, Inc. and affiliates.
6+
*
7+
* This source code is licensed under the MIT license found in the
8+
* LICENSE file in the root directory of this source tree.
9+
*/
10+
11+
/**
12+
* @license React
13+
* react-dom.production.js
14+
*
15+
* Copyright (c) Meta Platforms, Inc. and affiliates.
16+
*
17+
* This source code is licensed under the MIT license found in the
18+
* LICENSE file in the root directory of this source tree.
19+
*/
20+
21+
/**
22+
* @license React
23+
* react-jsx-runtime.production.js
24+
*
25+
* Copyright (c) Meta Platforms, Inc. and affiliates.
26+
*
27+
* This source code is licensed under the MIT license found in the
28+
* LICENSE file in the root directory of this source tree.
29+
*/
30+
31+
/**
32+
* @license React
33+
* react.production.js
34+
*
35+
* Copyright (c) Meta Platforms, Inc. and affiliates.
36+
*
37+
* This source code is licensed under the MIT license found in the
38+
* LICENSE file in the root directory of this source tree.
39+
*/
40+
41+
/**
42+
* @license React
43+
* scheduler.production.js
44+
*
45+
* Copyright (c) Meta Platforms, Inc. and affiliates.
46+
*
47+
* This source code is licensed under the MIT license found in the
48+
* LICENSE file in the root directory of this source tree.
49+
*/

webcamstudy/static/js/main.f780c553.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)