diff --git a/src/backend/db/migrations/5_trial_data_belongs_to_benchmark.sql b/src/backend/db/migrations/5_trial_data_belongs_to_benchmark.sql index c632a5ee..42a31694 100644 --- a/src/backend/db/migrations/5_trial_data_belongs_to_benchmark.sql +++ b/src/backend/db/migrations/5_trial_data_belongs_to_benchmark.sql @@ -2,16 +2,40 @@ ALTER TABLE trial_data ADD COLUMN benchmark_id uuid REFERENCES benchmark(benchmark_id); +-- Step 1a: Add due_date and trial_count to benchmark + +ALTER TABLE benchmark +ADD COLUMN due_date TIMESTAMPTZ; + +ALTER TABLE benchmark +ADD COLUMN trial_count INTEGER; + -- Step 2: Copy benchmark_id from tasks for existing records UPDATE trial_data SET benchmark_id = task.benchmark_id FROM task WHERE trial_data.task_id = task.task_id; +-- Step 2a: Copy due_date and trial_count from tasks for existing records +-- Taking the first result of tasks that matches the right benchmark_id + +UPDATE benchmark +SET due_date = task.due_date, trial_count = task.trial_count +FROM task +WHERE task.benchmark_id = benchmark.benchmark_id; + -- Step 3: Make benchmark_id required ALTER TABLE trial_data ALTER COLUMN benchmark_id SET NOT NULL; -- Step 4: Remove task_id column ALTER TABLE trial_data -DROP COLUMN task_id; \ No newline at end of file +DROP COLUMN task_id; + +-- Step 4a: Remove due_date, and trial_count from task + +ALTER TABLE task +DROP COLUMN due_date; + +ALTER TABLE task +DROP COLUMN trial_count; \ No newline at end of file diff --git a/src/backend/db/zapatos/schema.d.ts b/src/backend/db/zapatos/schema.d.ts index b49ab1f6..9de73d6c 100644 --- a/src/backend/db/zapatos/schema.d.ts +++ b/src/backend/db/zapatos/schema.d.ts @@ -419,6 +419,12 @@ declare module 'zapatos/schema' { */ description: string; /** + * **benchmark.due_date** + * - `timestamptz` in database + * - Nullable, no default + */ + due_date: Date | null; + /** * **benchmark.frequency** * - `text` in database * - `NOT NULL`, default: `''::text` @@ -472,6 +478,12 @@ declare module 'zapatos/schema' { * - `NOT NULL`, no default */ target_level: number; + /** + * **benchmark.trial_count** + * - `int4` in database + * - Nullable, no default + */ + trial_count: number | null; } export interface JSONSelectable { /** @@ -511,6 +523,12 @@ declare module 'zapatos/schema' { */ description: string; /** + * **benchmark.due_date** + * - `timestamptz` in database + * - Nullable, no default + */ + due_date: db.TimestampTzString | null; + /** * **benchmark.frequency** * - `text` in database * - `NOT NULL`, default: `''::text` @@ -564,6 +582,12 @@ declare module 'zapatos/schema' { * - `NOT NULL`, no default */ target_level: number; + /** + * **benchmark.trial_count** + * - `int4` in database + * - Nullable, no default + */ + trial_count: number | null; } export interface Whereable { /** @@ -603,6 +627,12 @@ declare module 'zapatos/schema' { */ description?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** + * **benchmark.due_date** + * - `timestamptz` in database + * - Nullable, no default + */ + due_date?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + /** * **benchmark.frequency** * - `text` in database * - `NOT NULL`, default: `''::text` @@ -656,6 +686,12 @@ declare module 'zapatos/schema' { * - `NOT NULL`, no default */ target_level?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + /** + * **benchmark.trial_count** + * - `int4` in database + * - Nullable, no default + */ + trial_count?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; } export interface Insertable { /** @@ -695,6 +731,12 @@ declare module 'zapatos/schema' { */ description: string | db.Parameter | db.SQLFragment; /** + * **benchmark.due_date** + * - `timestamptz` in database + * - Nullable, no default + */ + due_date?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | null | db.DefaultType | db.SQLFragment; + /** * **benchmark.frequency** * - `text` in database * - `NOT NULL`, default: `''::text` @@ -748,6 +790,12 @@ declare module 'zapatos/schema' { * - `NOT NULL`, no default */ target_level: number | db.Parameter | db.SQLFragment; + /** + * **benchmark.trial_count** + * - `int4` in database + * - Nullable, no default + */ + trial_count?: number | db.Parameter | null | db.DefaultType | db.SQLFragment; } export interface Updatable { /** @@ -787,6 +835,12 @@ declare module 'zapatos/schema' { */ description?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** + * **benchmark.due_date** + * - `timestamptz` in database + * - Nullable, no default + */ + due_date?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + /** * **benchmark.frequency** * - `text` in database * - `NOT NULL`, default: `''::text` @@ -840,6 +894,12 @@ declare module 'zapatos/schema' { * - `NOT NULL`, no default */ target_level?: number | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + /** + * **benchmark.trial_count** + * - `int4` in database + * - Nullable, no default + */ + trial_count?: number | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; } export type UniqueIndex = 'benchmark_pkey'; export type Column = keyof Selectable; @@ -2025,12 +2085,6 @@ declare module 'zapatos/schema' { */ created_at: Date; /** - * **task.due_date** - * - `timestamptz` in database - * - Nullable, no default - */ - due_date: Date | null; - /** * **task.seen** * - `bool` in database * - `NOT NULL`, default: `false` @@ -2042,12 +2096,6 @@ declare module 'zapatos/schema' { * - `NOT NULL`, default: `uuid_generate_v4()` */ task_id: string; - /** - * **task.trial_count** - * - `int4` in database - * - Nullable, no default - */ - trial_count: number | null; } export interface JSONSelectable { /** @@ -2069,12 +2117,6 @@ declare module 'zapatos/schema' { */ created_at: db.TimestampTzString; /** - * **task.due_date** - * - `timestamptz` in database - * - Nullable, no default - */ - due_date: db.TimestampTzString | null; - /** * **task.seen** * - `bool` in database * - `NOT NULL`, default: `false` @@ -2086,12 +2128,6 @@ declare module 'zapatos/schema' { * - `NOT NULL`, default: `uuid_generate_v4()` */ task_id: string; - /** - * **task.trial_count** - * - `int4` in database - * - Nullable, no default - */ - trial_count: number | null; } export interface Whereable { /** @@ -2113,12 +2149,6 @@ declare module 'zapatos/schema' { */ created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **task.due_date** - * - `timestamptz` in database - * - Nullable, no default - */ - due_date?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; - /** * **task.seen** * - `bool` in database * - `NOT NULL`, default: `false` @@ -2130,12 +2160,6 @@ declare module 'zapatos/schema' { * - `NOT NULL`, default: `uuid_generate_v4()` */ task_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; - /** - * **task.trial_count** - * - `int4` in database - * - Nullable, no default - */ - trial_count?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; } export interface Insertable { /** @@ -2157,12 +2181,6 @@ declare module 'zapatos/schema' { */ created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment; /** - * **task.due_date** - * - `timestamptz` in database - * - Nullable, no default - */ - due_date?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | null | db.DefaultType | db.SQLFragment; - /** * **task.seen** * - `bool` in database * - `NOT NULL`, default: `false` @@ -2174,12 +2192,6 @@ declare module 'zapatos/schema' { * - `NOT NULL`, default: `uuid_generate_v4()` */ task_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; - /** - * **task.trial_count** - * - `int4` in database - * - Nullable, no default - */ - trial_count?: number | db.Parameter | null | db.DefaultType | db.SQLFragment; } export interface Updatable { /** @@ -2201,12 +2213,6 @@ declare module 'zapatos/schema' { */ created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; /** - * **task.due_date** - * - `timestamptz` in database - * - Nullable, no default - */ - due_date?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; - /** * **task.seen** * - `bool` in database * - `NOT NULL`, default: `false` @@ -2218,12 +2224,6 @@ declare module 'zapatos/schema' { * - `NOT NULL`, default: `uuid_generate_v4()` */ task_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; - /** - * **task.trial_count** - * - `int4` in database - * - Nullable, no default - */ - trial_count?: number | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; } export type UniqueIndex = 'benchmark_assignee_unique' | 'task_pkey'; export type Column = keyof Selectable; @@ -2239,6 +2239,12 @@ declare module 'zapatos/schema' { export namespace trial_data { export type Table = 'trial_data'; export interface Selectable { + /** + * **trial_data.benchmark_id** + * - `uuid` in database + * - `NOT NULL`, no default + */ + benchmark_id: string; /** * **trial_data.created_at** * - `timestamptz` in database @@ -2270,12 +2276,6 @@ declare module 'zapatos/schema' { */ success: number; /** - * **trial_data.task_id** - * - `uuid` in database - * - Nullable, no default - */ - task_id: string | null; - /** * **trial_data.trial_data_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` @@ -2289,6 +2289,12 @@ declare module 'zapatos/schema' { unsuccess: number; } export interface JSONSelectable { + /** + * **trial_data.benchmark_id** + * - `uuid` in database + * - `NOT NULL`, no default + */ + benchmark_id: string; /** * **trial_data.created_at** * - `timestamptz` in database @@ -2320,12 +2326,6 @@ declare module 'zapatos/schema' { */ success: number; /** - * **trial_data.task_id** - * - `uuid` in database - * - Nullable, no default - */ - task_id: string | null; - /** * **trial_data.trial_data_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` @@ -2339,6 +2339,12 @@ declare module 'zapatos/schema' { unsuccess: number; } export interface Whereable { + /** + * **trial_data.benchmark_id** + * - `uuid` in database + * - `NOT NULL`, no default + */ + benchmark_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** * **trial_data.created_at** * - `timestamptz` in database @@ -2370,12 +2376,6 @@ declare module 'zapatos/schema' { */ success?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **trial_data.task_id** - * - `uuid` in database - * - Nullable, no default - */ - task_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; - /** * **trial_data.trial_data_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` @@ -2389,6 +2389,12 @@ declare module 'zapatos/schema' { unsuccess?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; } export interface Insertable { + /** + * **trial_data.benchmark_id** + * - `uuid` in database + * - `NOT NULL`, no default + */ + benchmark_id: string | db.Parameter | db.SQLFragment; /** * **trial_data.created_at** * - `timestamptz` in database @@ -2420,12 +2426,6 @@ declare module 'zapatos/schema' { */ success: number | db.Parameter | db.SQLFragment; /** - * **trial_data.task_id** - * - `uuid` in database - * - Nullable, no default - */ - task_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; - /** * **trial_data.trial_data_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` @@ -2439,6 +2439,12 @@ declare module 'zapatos/schema' { unsuccess: number | db.Parameter | db.SQLFragment; } export interface Updatable { + /** + * **trial_data.benchmark_id** + * - `uuid` in database + * - `NOT NULL`, no default + */ + benchmark_id?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** * **trial_data.created_at** * - `timestamptz` in database @@ -2470,12 +2476,6 @@ declare module 'zapatos/schema' { */ success?: number | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **trial_data.task_id** - * - `uuid` in database - * - Nullable, no default - */ - task_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; - /** * **trial_data.trial_data_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` diff --git a/src/backend/routers/iep.ts b/src/backend/routers/iep.ts index 44fb5cca..2d48b87b 100644 --- a/src/backend/routers/iep.ts +++ b/src/backend/routers/iep.ts @@ -390,24 +390,23 @@ export const iep = router({ return result; }), + // Not just hasPara, but check to make sure that the userId has a task with the benchmark_id getBenchmarkAndTrialData: hasPara .input( z.object({ - task_id: z.string(), + benchmark_id: z.string(), }) ) .query(async (req) => { - const { task_id } = req.input; + const { benchmark_id } = req.input; const result = await req.ctx.db .selectFrom("benchmark") - .innerJoin("task", "benchmark.benchmark_id", "task.benchmark_id") .innerJoin("goal", "benchmark.goal_id", "goal.goal_id") .innerJoin("iep", "goal.iep_id", "iep.iep_id") .innerJoin("student", "iep.student_id", "student.student_id") - .where("task.task_id", "=", task_id) + .where("benchmark.benchmark_id", "=", benchmark_id) .select((eb) => [ - "task.task_id", "benchmark.benchmark_id", "student.first_name", "student.last_name", @@ -417,9 +416,8 @@ export const iep = router({ "benchmark.frequency", "benchmark.number_of_trials", "benchmark.benchmark_id", - "task.due_date", - "task.seen", - "task.trial_count", + "benchmark.due_date", + "benchmark.trial_count", jsonArrayFrom( eb .selectFrom("trial_data") @@ -446,11 +444,6 @@ export const iep = router({ "=", "benchmark.benchmark_id" ) - .whereRef( - "trial_data.created_by_user_id", - "=", - "task.assignee_id" - ) .orderBy("trial_data.created_at") ).as("trials"), ]) @@ -462,19 +455,34 @@ export const iep = router({ markAsSeen: hasPara .input( z.object({ - task_id: z.string(), + benchmark_id: z.string(), }) ) .mutation(async (req) => { - const { task_id } = req.input; + const { benchmark_id } = req.input; + const { userId } = req.ctx.auth; - await req.ctx.db - .updateTable("task") - .set({ - seen: true, - }) - .where("task.task_id", "=", task_id) - .execute(); + const task = await req.ctx.db + .selectFrom("task") + .where("benchmark_id", "=", benchmark_id) + .where("assignee_id", "=", userId) + .selectAll() + .executeTakeFirst(); + + if (task?.seen) { + await req.ctx.db + .updateTable("task") + .set({ + seen: true, + }) + .where((eb) => + eb.and([ + eb("benchmark_id", "=", benchmark_id), + eb("assignee_id", "=", userId), + ]) + ) + .execute(); + } }), attachFileToTrialData: hasCaseManager diff --git a/src/backend/routers/para.ts b/src/backend/routers/para.ts index 78661095..9dc6bb61 100644 --- a/src/backend/routers/para.ts +++ b/src/backend/routers/para.ts @@ -76,19 +76,18 @@ export const para = router({ "student.first_name", "student.last_name", "goal.category", + "benchmark.benchmark_id", "benchmark.description", "benchmark.instructions", "benchmark.attempts_per_trial", "benchmark.number_of_trials", - "task.due_date", + "benchmark.due_date", "task.seen", - "task.trial_count", + "benchmark.trial_count", "task.created_at", - eb .selectFrom("trial_data") - .whereRef("trial_data.task_id", "=", "task.task_id") - .where("trial_data.created_by_user_id", "=", userId) + .whereRef("trial_data.benchmark_id", "=", "benchmark.benchmark_id") .where("trial_data.submitted", "=", true) .select(({ fn }) => fn.count("trial_data.trial_data_id").as("completed_trials") diff --git a/src/components/taskCard/taskCard.tsx b/src/components/taskCard/taskCard.tsx index 0ac27a0e..bff29645 100644 --- a/src/components/taskCard/taskCard.tsx +++ b/src/components/taskCard/taskCard.tsx @@ -6,6 +6,7 @@ import { useMemo } from "react"; import $taskCard from "./TaskCard.module.css"; interface ParaTaskCard { + // this should be based on TaskData, maybe have some Omit's. task_id: string; first_name: string; last_name: string; @@ -17,6 +18,7 @@ interface ParaTaskCard { seen: boolean; trial_count: number | null; completed_trials: string | number | bigint | null; + benchmark_id: string; } interface TaskCardProps { @@ -74,7 +76,7 @@ const TaskCard = ({ task, isPara }: TaskCardProps) => { {/* Para smaller screen view can click on card instead */} {!isPara ? ( View benchmark @@ -82,7 +84,7 @@ const TaskCard = ({ task, isPara }: TaskCardProps) => { ) : null} = 100 ? $button.inactive : "" }`} diff --git a/src/pages/benchmarks/[benchmark_id]/index.tsx b/src/pages/benchmarks/[benchmark_id]/index.tsx index e3b08a0f..cec91af3 100644 --- a/src/pages/benchmarks/[benchmark_id]/index.tsx +++ b/src/pages/benchmarks/[benchmark_id]/index.tsx @@ -30,12 +30,12 @@ const BenchmarkPage = () => { const { benchmark_id } = router.query; const utils = trpc.useContext(); const { - data: task, - isLoading: taskIsLoading, + data: benchmark, + isLoading: benchmarkIsLoading, isError, } = trpc.iep.getBenchmarkAndTrialData.useQuery( { - task_id: benchmark_id as string, // how does this line make sense? + benchmark_id: benchmark_id as string, // how does this line make sense? }, { enabled: Boolean(benchmark_id), @@ -69,7 +69,7 @@ const BenchmarkPage = () => { const [unsuccessInputValue, setUnsuccessInputValue] = useState(0); const [currentTrialIdx, setCurrentTrialIdx] = useState(0); - const currentTrial = task?.trials[currentTrialIdx] || null; + const currentTrial = benchmark?.trials[currentTrialIdx] || null; const [trialAdded, setTrialAdded] = useState(false); @@ -80,10 +80,10 @@ const BenchmarkPage = () => { // Sets the current trial to most recent whenever a new task is loaded. useEffect(() => { - if (task && task.trials.length > 0) { - setCurrentTrialIdx(task.trials.length - 1); + if (benchmark && benchmark.trials.length > 0) { + setCurrentTrialIdx(benchmark.trials.length - 1); } - }, [task]); + }, [benchmark]); // Sets all input states to saved values useEffect(() => { @@ -98,36 +98,45 @@ const BenchmarkPage = () => { } }, [currentTrial?.notes, currentTrial?.success, currentTrial?.unsuccess]); + // Move this to the backend, this page shouldn't have to deal with tasks, only + // benchmarks, we don't want mutations in useEffect, useEffect should be responding + // to UI changes and not making backend changes. // Marks this benchmark as seen (if it hasn't been seen yet) + // or: we can modify the seenMutation to take the benchmark_id and ask it to look up + // the task based on the current user id being the task's assignee_id useEffect(() => { - if (!seenMutation.isLoading && !taskIsLoading && task && !task.seen) { - seenMutation.mutate({ task_id: task.task_id }); + if (!seenMutation.isLoading && !benchmarkIsLoading && benchmark) { + seenMutation.mutate({ benchmark_id: benchmark.benchmark_id }); } - }, [task, seenMutation, taskIsLoading]); + }, [benchmark, seenMutation, benchmarkIsLoading]); // Creates a new data collection instance (if there are none in progress) useEffect(() => { if ( !trialAdded && !addTrialMutation.isLoading && - !taskIsLoading && - task && - (task.trials.length === 0 || - task.trials[task.trials.length - 1]?.submitted === true) + !benchmarkIsLoading && + benchmark && + (benchmark.trials.length === 0 || + benchmark.trials[benchmark.trials.length - 1]?.submitted === true) ) { addTrialMutation.mutate({ - task_id: task.task_id, + benchmark_id: benchmark.benchmark_id, success: 0, unsuccess: 0, notes: "", }); setTrialAdded(true); } - }, [task, addTrialMutation, taskIsLoading, trialAdded]); + }, [benchmark, addTrialMutation, benchmarkIsLoading, trialAdded]); const handleUpdate = (updates: DataUpdate) => { //Can only update if we're on the most recent trial - if (task && currentTrial && currentTrialIdx === task.trials.length - 1) { + if ( + benchmark && + currentTrial && + currentTrialIdx === benchmark.trials.length - 1 + ) { updateTrialMutation.mutate({ trial_data_id: currentTrial.trial_data_id, ...updates, @@ -179,7 +188,7 @@ const BenchmarkPage = () => { }); }; - if (taskIsLoading || !currentTrial) { + if (benchmarkIsLoading || !currentTrial) { return
Loading...
; } @@ -194,7 +203,7 @@ const BenchmarkPage = () => {

- Task: {task.description} + Benchmark: {benchmark.description}

@@ -228,9 +237,10 @@ const BenchmarkPage = () => { onDecrement={() => { setSuccessInputValue(successInputValue - 1); }} - disableInc={currentTrialIdx !== task.trials.length - 1} + disableInc={currentTrialIdx !== benchmark.trials.length - 1} disableDec={ - currentTrialIdx !== task.trials.length - 1 || successInputValue <= 0 + currentTrialIdx !== benchmark.trials.length - 1 || + successInputValue <= 0 } color="green" /> @@ -247,23 +257,23 @@ const BenchmarkPage = () => { onDecrement={() => { setUnsuccessInputValue(unsuccessInputValue - 1); }} - disableInc={currentTrialIdx !== task.trials.length - 1} + disableInc={currentTrialIdx !== benchmark.trials.length - 1} disableDec={ - currentTrialIdx !== task.trials.length - 1 || + currentTrialIdx !== benchmark.trials.length - 1 || unsuccessInputValue <= 0 } color="red" />

{successInputValue + unsuccessInputValue} attempts out of{" "} - {task.number_of_trials ?? "-"} + {benchmark.number_of_trials ?? "-"}

@@ -296,7 +306,9 @@ const BenchmarkPage = () => { Review diff --git a/src/pages/benchmarks/index.tsx b/src/pages/benchmarks/index.tsx index 2bd3750d..9b60a129 100644 --- a/src/pages/benchmarks/index.tsx +++ b/src/pages/benchmarks/index.tsx @@ -162,7 +162,7 @@ function Benchmarks() { {/* Temporary CM & Para View */} {isPara && !completed ? ( diff --git a/src/types/global.ts b/src/types/global.ts index 06cbce7f..d606a0e1 100644 --- a/src/types/global.ts +++ b/src/types/global.ts @@ -22,4 +22,5 @@ export interface TaskData { seen: boolean; completed_trials: string | number | bigint | null; created_at: Date; + benchmark_id: string; }