Skip to content

Commit

Permalink
Merge pull request #827 from BIDMCDigitalPsychiatry/gyroscope
Browse files Browse the repository at this point in the history
Gyroscope game changes in dashboard
  • Loading branch information
sarithapillai8 authored Aug 13, 2024
2 parents 3fb8f50 + 32d9ca6 commit dc0c1f9
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 654 deletions.
675 changes: 26 additions & 649 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"jsonata": "^1.8.4",
"jsonexport": "^3.2.0",
"jspdf": "^2.3.1",
"lamp-core": "^2024.8.7",
"lamp-core": "^2022.3.8",
"material-icons": "^1.10.11",
"monaco-editor": "^0.33.0",
"notistack": "^2.0.5",
Expand Down Expand Up @@ -138,4 +138,4 @@
"not ie <= 11",
"not op_mini all"
]
}
}
1 change: 1 addition & 0 deletions src/components/EmbeddedActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const demoActivities = {
"lamp.maze_game": "maze_game",
"lamp.emotion_recognition": "emotion_recognition",
"lamp.symbol_digit_substitution": "symbol_digit_substitution",
"lamp.gyroscope": "gyroscope",
}

export default function EmbeddedActivity({ participant, activity, name, onComplete, noBack, tab, ...props }) {
Expand Down
1 change: 1 addition & 0 deletions src/components/Participant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export default function Participant({
}, [])

useEffect(() => {
setLoading(true)
if (activities !== null) {
Service.getAllTags("activitytags").then((result) => {
if ((result || []).length == 0) {
Expand Down
1 change: 1 addition & 0 deletions src/components/Researcher/ActivityList/Activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const games = [
"lamp.maze_game",
"lamp.emotion_recognition",
"lamp.symbol_digit_substitution",
"lamp.gyroscope",
]

const useStyles = makeStyles((theme: Theme) =>
Expand Down
23 changes: 23 additions & 0 deletions src/components/Researcher/ActivityList/ActivityMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,29 @@ export const SchemaList = () => {
},
},
},
"lamp.gyroscope": {
type: "object",
properties: {
settings: {
title: i18n.t("Activity Settings"),
required: ["level"],
type: "object",
properties: {
level: {
title: i18n.t("Game Level"),
description: i18n.t(
'"Easy" - 10 rotation trials, "Medium" - 20 trials with rotations +15, -15, +30, -30, "Hard" - 30 trails with rotation +15, -15, +30, -30, +45, -45 degrees'
),
type: "string",
minLength: 1,
enum: ["Easy", "Medium", "Hard"],
enumNames: [i18n.t("Easy"), i18n.t("Medium"), i18n.t("Hard")],
default: "Easy",
},
},
},
},
},
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/components/Researcher/ActivityList/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Header from "./Header"
import { sortData } from "../Dashboard"
import Pagination from "../../PaginatedElement"
import useInterval from "../../useInterval"

import LAMP from "lamp-core"
const useStyles = makeStyles((theme: Theme) =>
createStyles({
backdrop: {
Expand Down Expand Up @@ -72,6 +72,7 @@ export const games = [
"lamp.maze_game",
"lamp.emotion_recognition",
"lamp.symbol_digit_substitution",
"lamp.gyroscope",
]
export default function ActivityList({
researcherId,
Expand Down Expand Up @@ -106,6 +107,7 @@ export default function ActivityList({
)

useEffect(() => {
// LAMP.ActivitySpec.all().then((res) => console.log(res))
let params = JSON.parse(localStorage.getItem("activities"))
setPage(params?.page ?? 0)
setRowCount(params?.rowCount ?? 40)
Expand Down
1 change: 1 addition & 0 deletions src/components/Survey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const games = [
"lamp.maze_game",
"lamp.emotion_recognition",
"lamp.symbol_digit_substitution",
"lamp.gyroscope",
]

export default function Survey({ participant, activities, showStreak, ...props }) {
Expand Down
2 changes: 0 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import "regenerator-runtime/runtime"
import "url-search-params-polyfill"
import "material-icons"
import "./i18n"
import { sensorEventUpdate } from "./components/BottomMenu"

// in index.html: <!DOCTYPE html><html></html>
let root = document.createElement("div")
Expand All @@ -40,7 +39,6 @@ input, textarea, .contenteditable, .lamp-editable *, .swagger-ui * {
user-select: text;
cursor: text;
}`

// IE9+ CustomEvent polyfill.
;(function () {
if (typeof window.CustomEvent === "function") return false
Expand Down

0 comments on commit dc0c1f9

Please sign in to comment.