Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added frequency to database schema #380

Merged
merged 7 commits into from
Nov 2, 2024
Merged
1 change: 1 addition & 0 deletions src/backend/db/migrations/1_initial-migrations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ CREATE TABLE "subgoal" (
setup TEXT NOT NULL,
instructions TEXT NOT NULL DEFAULT '',
materials TEXT NOT NULL DEFAULT '',
frequency TEXT NOT NULL DEFAULT '',
target_level SMALLINT NOT NULL CHECK (target_level BETWEEN 0 AND 100),
baseline_level SMALLINT NOT NULL CHECK(baseline_level BETWEEN 0 AND 100),
current_level SMALLINT CHECK(current_level BETWEEN 0 AND 100), --To be calculated as trial data is collected
Expand Down
30 changes: 30 additions & 0 deletions src/backend/db/zapatos/schema.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/backend/routers/iep.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ test("basic flow - add/get goals, subgoals, tasks", async (t) => {
setup: "Setup here",
instructions: "instructions here",
materials: "materials",
frequency: "twice a week",
target_level: 85,
baseline_level: 60,
metric_name: "words",
Expand All @@ -42,6 +43,7 @@ test("basic flow - add/get goals, subgoals, tasks", async (t) => {
setup: "",
instructions: "",
materials: "materials",
frequency: "frequency",
target_level: 100,
baseline_level: 20,
metric_name: "words",
Expand All @@ -57,6 +59,7 @@ test("basic flow - add/get goals, subgoals, tasks", async (t) => {
setup: "",
instructions: "",
materials: "materials",
frequency: "once a week",
target_level: 100,
baseline_level: 20,
metric_name: "words",
Expand Down Expand Up @@ -129,6 +132,7 @@ test("addTask - no duplicate subgoal_id + assigned_id combo", async (t) => {
setup: "",
instructions: "",
materials: "materials",
frequency: "frequency",
target_level: 100,
baseline_level: 20,
metric_name: "words",
Expand Down Expand Up @@ -191,6 +195,7 @@ test("assignTaskToParas - no duplicate subgoal_id + para_id combo", async (t) =>
setup: "",
instructions: "",
materials: "materials",
frequency: "frequency",
target_level: 100,
baseline_level: 20,
metric_name: "words",
Expand Down Expand Up @@ -245,6 +250,7 @@ test("add benchmark - check full schema", async (t) => {
setup: "Setup here",
instructions: "instructions here",
materials: "materials",
frequency: "twice a day",
target_level: 85,
baseline_level: 60,
metric_name: "words",
Expand Down
4 changes: 4 additions & 0 deletions src/backend/routers/iep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const iep = router({
setup: z.string(),
instructions: z.string(),
materials: z.string(),
frequency: z.string(),
target_level: z.number().min(0).max(100),
baseline_level: z.number().min(0).max(100),
metric_name: z.string(),
Expand All @@ -95,6 +96,7 @@ export const iep = router({
setup,
instructions,
materials,
frequency,
target_level,
baseline_level,
metric_name,
Expand All @@ -111,6 +113,7 @@ export const iep = router({
setup,
instructions,
materials,
frequency,
target_level,
baseline_level,
metric_name,
Expand Down Expand Up @@ -410,6 +413,7 @@ export const iep = router({
"goal.category",
"subgoal.description",
"subgoal.instructions",
"subgoal.frequency",
"subgoal.number_of_trials",
"subgoal.subgoal_id",
"task.due_date",
Expand Down
1 change: 1 addition & 0 deletions src/backend/routers/para.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ test("getMyTasks", async (t) => {
setup: SETUP,
instructions: INSTRUCTIONS,
materials: "materials",
frequency: "FREQUENCY",
target_level: 100,
baseline_level: 20,
metric_name: "words",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/benchmarks/[benchmark_id]/instructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const InstructionsPage = () => {
</div>
<div className={$box.default}>
<h4>Frequency:</h4>
<p>*insert frequency here*</p>
<p>{subgoal.frequency}</p>
</div>
<div className={$box.default}>
<h4>Materials:</h4>
Expand Down
Loading
Loading