diff --git a/client/.eslintrc.json b/client/.eslintrc.json index bdd629ed9..7e7be7d7e 100644 --- a/client/.eslintrc.json +++ b/client/.eslintrc.json @@ -13,7 +13,11 @@ ], "overrides": [ { - "files": ["**/*.spec.js", "**/*.spec.jsx", "**/*.test.js"], + "files": [ + "**/*.spec.js", + "**/*.spec.jsx", + "**/*.test.js" + ], "env": { "jest": true } @@ -23,7 +27,10 @@ "ecmaVersion": "latest", "sourceType": "module" }, - "plugins": ["react", "jest"], + "plugins": [ + "react", + "jest" + ], "settings": { "react": { "createClass": "createReactClass", diff --git a/client/package-lock.json b/client/package-lock.json index c0f28b1d2..a52cf928e 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -7498,9 +7498,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", + "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -10724,9 +10724,9 @@ } }, "node_modules/filelist/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz", + "integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -10857,7 +10857,9 @@ } }, "node_modules/flatted": { - "version": "3.3.1", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", "license": "ISC" }, "node_modules/follow-redirects": { @@ -17228,9 +17230,9 @@ } }, "node_modules/jsonpath": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.2.1.tgz", - "integrity": "sha512-Jl6Jhk0jG+kP3yk59SSeGq7LFPR4JQz1DU0K+kXTysUhMostbhU3qh5mjTuf0PqFcXpAT7kvmMt9WxV10NyIgQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.3.0.tgz", + "integrity": "sha512-0kjkYHJBkAy50Z5QzArZ7udmvxrJzkpKYW27fiF//BrMY7TQibYLl+FYIXN2BiYmwMIVzSfD8aDRj6IzgBX2/w==", "license": "MIT", "dependencies": { "esprima": "1.2.5", @@ -17472,9 +17474,9 @@ } }, "node_modules/lint-staged/node_modules/yaml": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", - "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz", + "integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==", "dev": true, "license": "ISC", "bin": { @@ -18052,9 +18054,9 @@ } }, "node_modules/node-forge": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.3.tgz", - "integrity": "sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.0.tgz", + "integrity": "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==", "license": "(BSD-3-Clause OR GPL-2.0)", "engines": { "node": ">= 6.13.0" @@ -18505,9 +18507,9 @@ "license": "ISC" }, "node_modules/path-to-regexp": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", - "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", + "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==", "license": "MIT" }, "node_modules/path-type": { @@ -18528,7 +18530,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "license": "MIT", "engines": { "node": ">=8.6" @@ -19147,13 +19151,18 @@ } }, "node_modules/postcss-load-config/node_modules/yaml": { - "version": "2.4.1", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz", + "integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==", "license": "ISC", "bin": { "yaml": "bin.mjs" }, "engines": { - "node": ">= 14" + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" } }, "node_modules/postcss-loader": { @@ -23243,9 +23252,9 @@ } }, "node_modules/sucrase/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz", + "integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -25574,7 +25583,9 @@ "license": "ISC" }, "node_modules/yaml": { - "version": "1.10.2", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz", + "integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==", "license": "ISC", "engines": { "node": ">= 6" diff --git a/client/public/img/lab_images/what-is-cognitive-bias-image.png b/client/public/img/lab_images/what-is-cognitive-bias-image.png new file mode 100644 index 000000000..5e6ef9e92 Binary files /dev/null and b/client/public/img/lab_images/what-is-cognitive-bias-image.png differ diff --git a/client/public/img/lab_thumbnails/cognitivebiasai.jpg b/client/public/img/lab_thumbnails/cognitivebiasai.jpg new file mode 100644 index 000000000..ccdb8fa96 Binary files /dev/null and b/client/public/img/lab_thumbnails/cognitivebiasai.jpg differ diff --git a/client/src/App.js b/client/src/App.js index 2db10d0e2..6f7378d38 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -21,6 +21,7 @@ import { default as ExerciseLab9 } from "./components/exercise/lab9/Main"; import { default as ExerciseLab10 } from "./components/exercise/lab10/Main"; import { default as ExerciseLab11 } from "./components/exercise/lab11/Main"; import { default as ExerciseLab12 } from "./components/exercise/lab12/Main"; +import { default as ExerciseLab13 } from "./components/exercise/lab13/Main"; import { default as ExerciseLab14 } from "./components/exercise/lab14/Main"; import { Sections } from "./constants/index"; @@ -115,7 +116,7 @@ const App = () => { const renderLabs = () => { return ( -
{card.title}
+
+
{card.body}
diff --git a/client/src/components/all-components/DragAndDrop/DroppableBank.js b/client/src/components/all-components/DragAndDrop/DroppableBank.js
index 993efb2bd..2dacf5c45 100644
--- a/client/src/components/all-components/DragAndDrop/DroppableBank.js
+++ b/client/src/components/all-components/DragAndDrop/DroppableBank.js
@@ -3,13 +3,18 @@ import React from "react";
import DraggableCard from "./DraggableCard";
import PropTypes from "prop-types";
-const DroppableBank = ({ bank, bankStyle, cardStyle }) => {
+const DroppableBank = ({ bank, bankStyle, cardStyle, cardIcon }) => {
const { setNodeRef } = useDroppable({ id: "bank" });
return (
{ - const options = [ - "Strongly Disagree", - "Disagree", - "Neutral", - "Agree", - "Strongly Agree", - ]; +const defaultOptions = [ + "Strongly Disagree", + "Disagree", + "Neutral", + "Agree", + "Strongly Agree", +]; +const Likert = ({ + options = defaultOptions, + onAnswerSelected, + name = "likert", +}) => { return (
Time Remaining: {elapsed}
)} diff --git a/client/src/components/all-components/UserPfp.js b/client/src/components/all-components/UserPfp.js new file mode 100644 index 000000000..ae429abba --- /dev/null +++ b/client/src/components/all-components/UserPfp.js @@ -0,0 +1,33 @@ +import useMainStateContext from "src/reducers/MainContext"; +import PropTypes from "prop-types"; +import DefaultUser from "../../assets/images/DefaultUser.png"; + +// User profile picture circle +const UserPfp = ({ onClick }) => { + const { state } = useMainStateContext(); + const user = state.main.user; + const className = `tw-w-full tw-h-full tw-object-cover tw-rounded-full ${onClick ? "tw-cursor-pointer" : ""}`; + + return user?.userpfp ? ( +