diff --git a/src/components/EmbeddedActivity.tsx b/src/components/EmbeddedActivity.tsx
index 1395807e..71b93fee 100644
--- a/src/components/EmbeddedActivity.tsx
+++ b/src/components/EmbeddedActivity.tsx
@@ -52,6 +52,7 @@ const demoActivities = {
"lamp.funny_memory": "funnymemory",
"lamp.trails_b": "dottouch",
"lamp.voice_survey": "speechrecording",
+ "lamp.digit_span": "digitspan",
}
export default function EmbeddedActivity({ participant, activity, name, onComplete, noBack, tab, ...props }) {
diff --git a/src/components/Example.stories.tsx b/src/components/Example.stories.tsx
deleted file mode 100644
index 598ed509..00000000
--- a/src/components/Example.stories.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import React from "react"
-import { Button } from "@material-ui/core"
-export default {
- title: "Components/Button",
- component: Button,
-}
-export const Basic = () => (
-
-)
diff --git a/src/components/PreventSelectedActivities.tsx b/src/components/PreventSelectedActivities.tsx
index cc6688e6..df66ce5f 100644
--- a/src/components/PreventSelectedActivities.tsx
+++ b/src/components/PreventSelectedActivities.tsx
@@ -252,6 +252,12 @@ export const strategies = {
: (parseInt(slices.score ?? 0).toFixed(1) || 0) > 100
? 100
: parseInt(slices.score ?? 0).toFixed(1) || 0,
+ "lamp.dcog": (slices, activity, scopedItem) =>
+ slices.score == "NaN"
+ ? 0
+ : (parseInt(slices.score ?? 0).toFixed(1) || 0) > 100
+ ? 100
+ : parseInt(slices.score ?? 0).toFixed(1) || 0,
"lamp.balloon_risk": (slices, activity, scopedItem) => parseInt(slices.points ?? 0).toFixed(1) || 0,
"lamp.pop_the_bubbles": (slices, activity, scopedItem) => {
let temporalSlices = slices.filter(function (data) {
@@ -266,6 +272,12 @@ export const strategies = {
return (slices || []).map((x) => (!!x.type ? 1 : 0)).reduce((prev, cur) => prev + cur, 0)
},
"lamp.cats_and_dogs": (slices, activity, scopedItem) => (slices.correct_answers / slices.total_questions) * 100,
+ "lamp.digit_span": (slices, activity, scopedItem) =>
+ slices.score == "NaN"
+ ? 0
+ : (parseInt(slices.score ?? 0).toFixed(1) || 0) > 100
+ ? 100
+ : parseInt(slices.score ?? 0).toFixed(1) || 0,
"lamp.memory_game": (slices, activity, scopedItem) => (slices.correct_answers / slices.total_questions) * 100,
"lamp.funny_memory": (slices, activity, scopedItem) =>
(slices.number_of_correct_pairs_recalled / slices.number_of_total_pairs) * 100,
diff --git a/src/components/Researcher/ActivityList/Activity.tsx b/src/components/Researcher/ActivityList/Activity.tsx
index 8dbac62f..bf4338a3 100644
--- a/src/components/Researcher/ActivityList/Activity.tsx
+++ b/src/components/Researcher/ActivityList/Activity.tsx
@@ -35,6 +35,7 @@ export const games = [
"lamp.trails_b",
"lamp.voice_survey",
"lamp.fragmented_letters",
+ "lamp.digit_span",
]
const useStyles = makeStyles((theme: Theme) =>
diff --git a/src/components/Researcher/ActivityList/ActivityHeader.tsx b/src/components/Researcher/ActivityList/ActivityHeader.tsx
index a69adaae..9133daa4 100644
--- a/src/components/Researcher/ActivityList/ActivityHeader.tsx
+++ b/src/components/Researcher/ActivityList/ActivityHeader.tsx
@@ -204,6 +204,7 @@ export default function ActivityHeader({
"lamp.symbol_digit_substitution",
"lamp.spin_wheel",
"lamp.fragmented_letters",
+ "lamp.digit_span",
].includes(activitySpecId) && (
setVisualSettings(val)}
diff --git a/src/components/Researcher/ActivityList/ActivityMethods.ts b/src/components/Researcher/ActivityList/ActivityMethods.ts
index 24c2425e..a18a5594 100644
--- a/src/components/Researcher/ActivityList/ActivityMethods.ts
+++ b/src/components/Researcher/ActivityList/ActivityMethods.ts
@@ -1257,6 +1257,15 @@ export const SchemaList = () => {
},
},
},
+ "lamp.digit_span": {
+ type: "object",
+ properties: {
+ settings: {
+ title: i18n.t("Activity Settings"),
+ type: "object",
+ },
+ },
+ },
"lamp.cats_and_dogs_new": {
type: "object",
properties: {
diff --git a/src/components/Researcher/ActivityList/AddActivity.tsx b/src/components/Researcher/ActivityList/AddActivity.tsx
index 4732f608..6875c2d1 100644
--- a/src/components/Researcher/ActivityList/AddActivity.tsx
+++ b/src/components/Researcher/ActivityList/AddActivity.tsx
@@ -162,6 +162,7 @@ export default function AddActivity({
"lamp.trails_b": `${t("Trails B")}`,
"lamp.voice_survey": `${t("Speech Recording")}`,
"lamp.fragmented_letters": `${t("Fragmented Letters")}`,
+ "lamp.digit_span": `${t("Digit Span")}`,
}
const getActivitySpec = async (id) => {
@@ -179,6 +180,7 @@ export default function AddActivity({
useEffect(() => {
;(async () => {
const allSpecs = await LAMP.ActivitySpec.all()
+ console.log(allSpecs)
let availableSpecs = allSpecs.filter((x: any) => Object.keys(activitiesObj).includes(x?.id))
let otherSpecs = allSpecs.filter((x: any) => !Object.keys(activitiesObj).includes(x?.id))
let i = 0
diff --git a/src/components/Researcher/ActivityList/Index.tsx b/src/components/Researcher/ActivityList/Index.tsx
index fdf0a743..1f3d0027 100644
--- a/src/components/Researcher/ActivityList/Index.tsx
+++ b/src/components/Researcher/ActivityList/Index.tsx
@@ -64,6 +64,7 @@ export const availableActivitySpecs = [
"lamp.trails_b",
"lamp.voice_survey",
"lamp.fragmented_letters",
+ "lamp.digit_span",
]
export const games = [
"lamp.jewels_a",
@@ -82,6 +83,7 @@ export const games = [
"lamp.trails_b",
"lamp.voice_survey",
"lamp.fragmented_letters",
+ "lamp.digit_span",
]
export default function ActivityList({
researcherId,
diff --git a/src/components/Survey.tsx b/src/components/Survey.tsx
index 6c0a87c9..1150a23f 100644
--- a/src/components/Survey.tsx
+++ b/src/components/Survey.tsx
@@ -37,6 +37,7 @@ export const games = [
"lamp.funny_memory",
"lamp.trails_b",
"lamp.voice_survey",
+ "lamp.digit_span",
]
export default function Survey({ participant, activities, showStreak, ...props }) {