Skip to content

Commit e2ec79a

Browse files
committed
fixing
1 parent 0c8a202 commit e2ec79a

7 files changed

Lines changed: 954 additions & 1085 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"eslint-config-airbnb": "^19.0.4",
5050
"firebase": "^11.2.0",
5151
"hjson": "^3.2.2",
52-
"konva": "^9.3.22",
5352
"jszip": "^3.10.1",
53+
"konva": "^9.3.22",
5454
"localforage": "^1.10.0",
5555
"lodash.debounce": "^4.0.8",
5656
"lodash.merge": "^4.6.2",
@@ -77,6 +77,7 @@
7777
"vega": "^5.32.0",
7878
"vega-lite": "^5.23.0",
7979
"vite": "^7.1.6",
80+
"vite-plugin-commonjs": "^0.10.4",
8081
"wavesurfer-react": "^3.0.4",
8182
"wavesurfer.js": "^7.10.1",
8283
"yaml": "^2.8.1"

src/analysis/individualStudy/thinkAloud/TextEditor.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
Group, Stack, Text,
77
Tooltip,
88
} from '@mantine/core';
9-
import { isArray } from 'lodash';
109
import { IconInfoCircle } from '@tabler/icons-react';
1110
import { useEvent } from '../../../store/hooks/useEvent';
1211
import {
@@ -21,7 +20,7 @@ async function getTags(storageEngine: StorageEngine | undefined) {
2120
if (storageEngine) {
2221
const tags = await storageEngine.getTags('text');
2322

24-
if (isArray(tags)) {
23+
if (Array.isArray(tags)) {
2524
return tags;
2625
}
2726
return [];

src/analysis/individualStudy/thinkAloud/ThinkAloudFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ export function ThinkAloudFooter({
359359
selectedTags={partTags ? partTags.taskTags[currentTrial] || [] : []}
360360
/>
361361
</Stack>
362-
<Button mt="lg" variant="light" component="a" href={isReplay ? `/analysis/stats/${studyId}/tagging?participantId=${participantId}&currentTrial=${currentTrial}` : `/${studyId}/${encryptIndex(participant ? +participant.answers[currentTrial].trialOrder.split('_')[0] : 0)}?participantId=${participantId}&currentTrial=${currentTrial}`} target="_blank">
362+
<Button mt="lg" variant="light" component="a" href={isReplay ? `/analysis/stats/${studyId}/tagging?participantId=${participantId}&currentTrial=${currentTrial}` : `/${studyId}/${encryptIndex(participant ? +(participant.answers[currentTrial]?.trialOrder.split('_')[0] || 0) : 0)}?participantId=${participantId}&currentTrial=${currentTrial}`} target="_blank">
363363
{isReplay ? 'Open Audio Analysis' : 'Open Replay'}
364364
</Button>
365365
</Group>

src/components/audioAnalysis/AudioProvenanceVis.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,9 @@ export function AudioProvenanceVis({
296296
}, [taskName, playTime, setTimeString, startTime, totalAudioLength]);
297297

298298
useEffect(() => {
299-
if (!analysisHasAudio) {
300-
// eslint-disable-next-line no-unsafe-optional-chaining
301-
const length = answers[taskName]?.endTime - answers[taskName]?.startTime;
302-
setTotalAudioLength(length > -1 ? length / 1000 : 0);
303-
}
299+
// eslint-disable-next-line no-unsafe-optional-chaining
300+
const length = answers[taskName]?.endTime - answers[taskName]?.startTime;
301+
setTotalAudioLength(length > -1 ? length / 1000 : 0);
304302
}, [analysisHasAudio, answers, taskName]);
305303

306304
const isAnalysis = useIsAnalysis();
@@ -333,11 +331,10 @@ export function AudioProvenanceVis({
333331
setWaveSurferLoading(false);
334332
// setAnalysisHasAudio(true);
335333

336-
console.log(waveSurfer.getDuration());
337-
338334
setWaveSurferWidth(waveSurfer.getWidth());
339335
setAnalysisHasAudio(true);
340336
waveSurfer.setPlaybackRate(speed);
337+
waveSurfer.setOptions({ duration: totalAudioLength });
341338
waveSurfer.seekTo(0);
342339
waveSurfer.on('redrawcomplete', () => setWaveSurferWidth(waveSurfer.getWidth()));
343340
} catch (error: unknown) {

src/parser/StudyConfigSchema.json

Lines changed: 78 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
},
203203
"style": {
204204
"$ref": "#/definitions/Styles",
205-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
205+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
206206
},
207207
"stylesheetPath": {
208208
"description": "The path to the external stylesheet file.",
@@ -318,7 +318,7 @@
318318
},
319319
"style": {
320320
"$ref": "#/definitions/Styles",
321-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
321+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
322322
},
323323
"stylesheetPath": {
324324
"description": "The path to the external stylesheet file.",
@@ -420,7 +420,7 @@
420420
},
421421
"style": {
422422
"$ref": "#/definitions/Styles",
423-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
423+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
424424
},
425425
"stylesheetPath": {
426426
"description": "The path to the external stylesheet file.",
@@ -635,7 +635,7 @@
635635
},
636636
"style": {
637637
"$ref": "#/definitions/Styles",
638-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
638+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
639639
},
640640
"stylesheetPath": {
641641
"description": "The path to the external stylesheet file.",
@@ -818,7 +818,7 @@
818818
},
819819
"style": {
820820
"$ref": "#/definitions/Styles",
821-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
821+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
822822
},
823823
"stylesheetPath": {
824824
"description": "The path to the external stylesheet file.",
@@ -1132,7 +1132,7 @@
11321132
},
11331133
"style": {
11341134
"$ref": "#/definitions/Styles",
1135-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
1135+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
11361136
},
11371137
"stylesheetPath": {
11381138
"description": "The path to the external stylesheet file.",
@@ -1258,7 +1258,7 @@
12581258
},
12591259
"style": {
12601260
"$ref": "#/definitions/Styles",
1261-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
1261+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
12621262
},
12631263
"stylesheetPath": {
12641264
"description": "The path to the external stylesheet file.",
@@ -1330,7 +1330,7 @@
13301330
},
13311331
"style": {
13321332
"$ref": "#/definitions/Styles",
1333-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
1333+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
13341334
},
13351335
"stylesheetPath": {
13361336
"description": "The path to the external stylesheet file.",
@@ -1480,6 +1480,14 @@
14801480
"description": "The width of the left sidebar. If present, will override the sidebar width setting in the uiConfig.",
14811481
"type": "number"
14821482
},
1483+
"style": {
1484+
"$ref": "#/definitions/Styles",
1485+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
1486+
},
1487+
"stylesheetPath": {
1488+
"description": "The path to the external stylesheet file.",
1489+
"type": "string"
1490+
},
14831491
"timeoutMessage": {
14841492
"type": "string"
14851493
},
@@ -1597,7 +1605,7 @@
15971605
},
15981606
"style": {
15991607
"$ref": "#/definitions/Styles",
1600-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
1608+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
16011609
},
16021610
"stylesheetPath": {
16031611
"description": "The path to the external stylesheet file.",
@@ -1700,7 +1708,7 @@
17001708
},
17011709
"style": {
17021710
"$ref": "#/definitions/Styles",
1703-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
1711+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
17041712
},
17051713
"stylesheetPath": {
17061714
"description": "The path to the external stylesheet file.",
@@ -1846,6 +1854,14 @@
18461854
"description": "The width of the left sidebar. If present, will override the sidebar width setting in the uiConfig.",
18471855
"type": "number"
18481856
},
1857+
"style": {
1858+
"$ref": "#/definitions/Styles",
1859+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
1860+
},
1861+
"stylesheetPath": {
1862+
"description": "The path to the external stylesheet file.",
1863+
"type": "string"
1864+
},
18491865
"timeoutMessage": {
18501866
"type": "string"
18511867
},
@@ -1954,7 +1970,7 @@
19541970
},
19551971
"style": {
19561972
"$ref": "#/definitions/Styles",
1957-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
1973+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
19581974
},
19591975
"stylesheetPath": {
19601976
"description": "The path to the external stylesheet file.",
@@ -2015,7 +2031,7 @@
20152031
},
20162032
"RankingResponse": {
20172033
"additionalProperties": false,
2018-
"description": "The RankingResponse interface is used to define the properties of a ranking widget response. RankingResponses render as a ranking widget with user specified options. There are three types of ranking widgets: sublist, categorical, and pairwise.\n\n```js { \"id\": \"ranking-sublist\", \"type\": \"ranking-sublist\", \"prompt\": \"Rank the following options\", \"location\": \"belowStimulus\", \"options\": [\"Option 1\", \"Option 2\", \"Option 3\"] \"numItems\": 2 } ```",
2034+
"description": "The RankingResponse interface is used to define the properties of a ranking widget response. RankingResponses render as a ranking widget with user specified options.\n\nThere are three types of ranking widgets: Ranking Sublist: The participant is asked to rank a subset of items from a larger list. Ranking Categorical: The participant is asked to rank items within categories: HIGH, MEDIUM, and LOW. Ranking Pairwise: The participant is asked to rank items by comparing them in pairs.\n\n```js { \"id\": \"ranking-sublist\", \"type\": \"ranking-sublist\", \"prompt\": \"Rank your top 2 favorite fruits from the list below\", \"location\": \"belowStimulus\", \"options\": [\"Apple\", \"Banana\", \"Orange\", \"Strawberry\", \"Grapes\"], \"numItems\": 2 }, { \"id\": \"ranking-categorical\", \"type\": \"ranking-categorical\", \"prompt\": \"Sort these hobbies into the categories of HIGH, MEDIUM, and LOW based on your level of interest.\", \"location\": \"belowStimulus\", \"options\": [\"Drawing\", \"Singing\", \"Hiking\", \"Dancing\", \"Photography\"] }, { \"id\": \"ranking-pairwise\", \"type\": \"ranking-pairwise\", \"prompt\": \"Which meal would you prefer\", \"location\": \"belowStimulus\", \"options\": [\"Pizza\", \"Sushi\", \"Burger\", \"Pasta\", \"Salad\", \"Tacos\"] } ```",
20192035
"properties": {
20202036
"hidden": {
20212037
"description": "Controls whether the response is hidden.",
@@ -2030,7 +2046,7 @@
20302046
"description": "Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`"
20312047
},
20322048
"numItems": {
2033-
"description": "The number of options to render. Applies only to sublist and categorical ranking widgets.",
2049+
"description": "The number of items to rank. Applies only to sublist and categorical ranking widgets.",
20342050
"type": "number"
20352051
},
20362052
"options": {
@@ -2072,7 +2088,7 @@
20722088
},
20732089
"style": {
20742090
"$ref": "#/definitions/Styles",
2075-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
2091+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
20762092
},
20772093
"stylesheetPath": {
20782094
"description": "The path to the external stylesheet file.",
@@ -2232,6 +2248,14 @@
22322248
"description": "The width of the left sidebar. If present, will override the sidebar width setting in the uiConfig.",
22332249
"type": "number"
22342250
},
2251+
"style": {
2252+
"$ref": "#/definitions/Styles",
2253+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
2254+
},
2255+
"stylesheetPath": {
2256+
"description": "The path to the external stylesheet file.",
2257+
"type": "string"
2258+
},
22352259
"timeoutMessage": {
22362260
"type": "string"
22372261
},
@@ -2307,7 +2331,7 @@
23072331
},
23082332
"style": {
23092333
"$ref": "#/definitions/Styles",
2310-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
2334+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
23112335
},
23122336
"stylesheetPath": {
23132337
"description": "The path to the external stylesheet file.",
@@ -2460,7 +2484,7 @@
24602484
},
24612485
"style": {
24622486
"$ref": "#/definitions/Styles",
2463-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
2487+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
24642488
},
24652489
"stylesheetPath": {
24662490
"description": "The path to the external stylesheet file.",
@@ -2574,7 +2598,7 @@
25742598
},
25752599
"style": {
25762600
"$ref": "#/definitions/Styles",
2577-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
2601+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
25782602
},
25792603
"stylesheetPath": {
25802604
"description": "The path to the external stylesheet file.",
@@ -2931,7 +2955,7 @@
29312955
},
29322956
"style": {
29332957
"$ref": "#/definitions/Styles",
2934-
"description": "You can set styles here, using React CSSProperties, for example: {\"width\": 100} or {\"width\": \"50%\"}"
2958+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
29352959
},
29362960
"stylesheetPath": {
29372961
"description": "The path to the external stylesheet file.",
@@ -3068,6 +3092,10 @@
30683092
"description": "The message to display when the study ends.",
30693093
"type": "string"
30703094
},
3095+
"stylesheetPath": {
3096+
"description": "The path to the external stylesheet file.",
3097+
"type": "string"
3098+
},
30713099
"timeoutReject": {
30723100
"description": "Whether to redirect a timed out participant to a rejection page. This only works for components where the `nextButtonDisableTime` field is set.",
30733101
"type": "boolean"
@@ -3235,6 +3263,14 @@
32353263
"description": "The width of the left sidebar. If present, will override the sidebar width setting in the uiConfig.",
32363264
"type": "number"
32373265
},
3266+
"style": {
3267+
"$ref": "#/definitions/Styles",
3268+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
3269+
},
3270+
"stylesheetPath": {
3271+
"description": "The path to the external stylesheet file.",
3272+
"type": "string"
3273+
},
32383274
"timeoutMessage": {
32393275
"type": "string"
32403276
},
@@ -3397,6 +3433,14 @@
33973433
"description": "The width of the left sidebar. If present, will override the sidebar width setting in the uiConfig.",
33983434
"type": "number"
33993435
},
3436+
"style": {
3437+
"$ref": "#/definitions/Styles",
3438+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
3439+
},
3440+
"stylesheetPath": {
3441+
"description": "The path to the external stylesheet file.",
3442+
"type": "string"
3443+
},
34003444
"timeoutMessage": {
34013445
"type": "string"
34023446
},
@@ -3563,6 +3607,14 @@
35633607
"description": "The width of the left sidebar. If present, will override the sidebar width setting in the uiConfig.",
35643608
"type": "number"
35653609
},
3610+
"style": {
3611+
"$ref": "#/definitions/Styles",
3612+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
3613+
},
3614+
"stylesheetPath": {
3615+
"description": "The path to the external stylesheet file.",
3616+
"type": "string"
3617+
},
35663618
"timeoutMessage": {
35673619
"type": "string"
35683620
},
@@ -3730,6 +3782,14 @@
37303782
"description": "The width of the left sidebar. If present, will override the sidebar width setting in the uiConfig.",
37313783
"type": "number"
37323784
},
3785+
"style": {
3786+
"$ref": "#/definitions/Styles",
3787+
"description": "You can set styles here, using React CSSProperties, for example: `{\"width\": 100}` or `{\"width\": \"50%\"}`"
3788+
},
3789+
"stylesheetPath": {
3790+
"description": "The path to the external stylesheet file.",
3791+
"type": "string"
3792+
},
37333793
"timeoutMessage": {
37343794
"type": "string"
37353795
},

0 commit comments

Comments
 (0)