From 0e91feb52bfcda2740959413755389258830c19b Mon Sep 17 00:00:00 2001
From: angelsanddevslol
Date: Fri, 24 Jul 2026 12:40:02 -0400
Subject: [PATCH 1/2] add recommended preparation field to courses
---
app/Database/Tables.hs | 1 +
app/Models/Course.hs | 3 +++
app/WebParsing/ArtSciParser.hs | 4 ++--
.../Controllers/CourseControllerTests.hs | 21 ++++++++++++-------
.../Controllers/GenerateControllerTests.hs | 1 +
.../__tests__/CourseModalUpdate.test.js | 1 +
.../common/__tests__/InfoModalFields.test.js | 4 ++++
js/components/common/react_modal.js.jsx | 7 +++++++
.../graph/__mocks__/aaa100-course-info.js | 1 +
.../graph/__mocks__/bbb100-course-info.js | 1 +
.../graph/__mocks__/ccc100-course-info.js | 1 +
.../grid/__tests__/CoursePanel.test.js | 1 +
12 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/app/Database/Tables.hs b/app/Database/Tables.hs
index 25af90215..8fc61a164 100644
--- a/app/Database/Tables.hs
+++ b/app/Database/Tables.hs
@@ -69,6 +69,7 @@ Course
title T.Text Maybe
description T.Text Maybe
prereqs T.Text Maybe
+ prep T.Text Maybe
exclusions T.Text Maybe
breadth BreadthId Maybe
distribution DistributionId Maybe
diff --git a/app/Models/Course.hs b/app/Models/Course.hs
index d7f695418..871ea9763 100644
--- a/app/Models/Course.hs
+++ b/app/Models/Course.hs
@@ -37,6 +37,7 @@ import Database.Tables (
courseDescription,
courseDistribution,
courseExclusions,
+ coursePrep,
coursePrereqString,
courseTitle,
courseVideoUrls
@@ -63,6 +64,7 @@ data CourseData
, prereqString :: Maybe T.Text
, allMeetingTimes :: Maybe [MeetTime']
, name :: !T.Text
+ , prep :: Maybe T.Text
, exclusions :: Maybe T.Text
, distribution :: Maybe T.Text
, coreqs :: Maybe T.Text
@@ -118,6 +120,7 @@ buildCourse allMeetings course = do
(coursePrereqString course)
(Just allMeetings)
(courseCode course)
+ (coursePrep course)
(courseExclusions course)
cDistribution
(courseCoreqs course)
diff --git a/app/WebParsing/ArtSciParser.hs b/app/WebParsing/ArtSciParser.hs
index a73bb6cd8..9c9e47dd2 100644
--- a/app/WebParsing/ArtSciParser.hs
+++ b/app/WebParsing/ArtSciParser.hs
@@ -133,8 +133,7 @@ parseCourses tags =
description = maybe "" ((courseContents !!) . (+ 1)) i1
prereqString = getValue "Prerequisite:" courseContents
coreq = getValue "Corequisite:" courseContents
- -- TODO: add a "recommended preparation" field to the database
- -- prep = getValue "Recommended Preparation:" courseContents
+ prep = getValue "Recommended Preparation:" courseContents
exclusion = getValue "Exclusion:" courseContents
distribution = fromMaybe "" $ getValue "Distribution Requirements:" courseContents
breadth = fromMaybe "" $ getValue "Breadth Requirements:" courseContents
@@ -143,6 +142,7 @@ parseCourses tags =
(Just title)
(Just description)
(fmap (T.pack . show . parseReqs . T.unpack) prereqString)
+ prep
exclusion
Nothing
Nothing
diff --git a/backend-test/Controllers/CourseControllerTests.hs b/backend-test/Controllers/CourseControllerTests.hs
index 8b1e335bd..949de7c8e 100644
--- a/backend-test/Controllers/CourseControllerTests.hs
+++ b/backend-test/Controllers/CourseControllerTests.hs
@@ -36,6 +36,7 @@ retrieveCourseTestCases =
, "An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation."
)
, ("prereqs", "STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5")
+ , ("prep", "null")
,
( "exclusions"
, "ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5"
@@ -101,7 +102,7 @@ retrieveCourseTestCases =
]
]
, 200
- , "{\"allMeetingTimes\":[{\"meetData\":{\"cap\":50,\"code\":\"STA238\",\"enrol\":15,\"extra\":0,\"instructor\":\"Instructor Name\",\"section\":\"LEC0101\",\"session\":\"F\",\"wait\":0},\"timeData\":[{\"endHour\":11,\"startHour\":10,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"MP\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"MP\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"F\",\"weekDay\":0},{\"endHour\":14,\"startHour\":13,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"SS\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"SS\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"F\",\"weekDay\":2}]}],\"breadth\":null,\"coreqs\":\"CSC108H1/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation.\",\"distribution\":null,\"exclusions\":\"ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5\",\"name\":\"STA238H1\",\"prereqString\":\"STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5\",\"title\":\"Probability, Statistics and Data Analysis II\",\"videoUrls\":[\"https://example.com/video1\",\"https://example.com/video2\"]}"
+ , "{\"allMeetingTimes\":[{\"meetData\":{\"cap\":50,\"code\":\"STA238\",\"enrol\":15,\"extra\":0,\"instructor\":\"Instructor Name\",\"section\":\"LEC0101\",\"session\":\"F\",\"wait\":0},\"timeData\":[{\"endHour\":11,\"startHour\":10,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"MP\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"MP\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"F\",\"weekDay\":0},{\"endHour\":14,\"startHour\":13,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"SS\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"SS\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"F\",\"weekDay\":2}]}],\"breadth\":null,\"coreqs\":\"CSC108H1/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation.\",\"distribution\":null,\"exclusions\":\"ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5\",\"name\":\"STA238H1\",\"prep\":null,\"prereqString\":\"STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5\",\"title\":\"Probability, Statistics and Data Analysis II\",\"videoUrls\":[\"https://example.com/video1\",\"https://example.com/video2\"]}"
)
,
( "Course exists with meeting times"
@@ -114,6 +115,7 @@ retrieveCourseTestCases =
, "An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation."
)
, ("prereqs", "STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5")
+ , ("prep", "null")
,
( "exclusions"
, "ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5"
@@ -153,7 +155,7 @@ retrieveCourseTestCases =
]
]
, 200
- , "{\"allMeetingTimes\":[{\"meetData\":{\"cap\":50,\"code\":\"STA238\",\"enrol\":15,\"extra\":0,\"instructor\":\"Instructor Name\",\"section\":\"LEC0101\",\"session\":\"F\",\"wait\":0},\"timeData\":[{\"endHour\":11,\"startHour\":10,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"MP\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"MP\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"F\",\"weekDay\":0},{\"endHour\":14,\"startHour\":13,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"SS\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"SS\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"F\",\"weekDay\":2}]}],\"breadth\":null,\"coreqs\":\"CSC108H1/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation.\",\"distribution\":null,\"exclusions\":\"ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5\",\"name\":\"STA238H1\",\"prereqString\":\"STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5\",\"title\":\"Probability, Statistics and Data Analysis II\",\"videoUrls\":[\"https://example.com/video1\",\"https://example.com/video2\"]}"
+ , "{\"allMeetingTimes\":[{\"meetData\":{\"cap\":50,\"code\":\"STA238\",\"enrol\":15,\"extra\":0,\"instructor\":\"Instructor Name\",\"section\":\"LEC0101\",\"session\":\"F\",\"wait\":0},\"timeData\":[{\"endHour\":11,\"startHour\":10,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"MP\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"MP\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"F\",\"weekDay\":0},{\"endHour\":14,\"startHour\":13,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"SS\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"SS\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"F\",\"weekDay\":2}]}],\"breadth\":null,\"coreqs\":\"CSC108H1/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation.\",\"distribution\":null,\"exclusions\":\"ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5\",\"name\":\"STA238H1\",\"prep\":null,\"prereqString\":\"STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5\",\"title\":\"Probability, Statistics and Data Analysis II\",\"videoUrls\":[\"https://example.com/video1\",\"https://example.com/video2\"]}"
)
,
( "Course exists"
@@ -166,6 +168,7 @@ retrieveCourseTestCases =
, "An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation."
)
, ("prereqs", "STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5")
+ , ("prep", "null")
,
( "exclusions"
, "ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5"
@@ -178,7 +181,7 @@ retrieveCourseTestCases =
]
, []
, 200
- , "{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":\"CSC108H1/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation.\",\"distribution\":null,\"exclusions\":\"ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5\",\"name\":\"STA238H1\",\"prereqString\":\"STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5\",\"title\":\"Probability, Statistics and Data Analysis II\",\"videoUrls\":[\"https://example.com/video1\",\"https://example.com/video2\"]}"
+ , "{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":\"CSC108H1/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation.\",\"distribution\":null,\"exclusions\":\"ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5\",\"name\":\"STA238H1\",\"prep\":null,\"prereqString\":\"STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5\",\"title\":\"Probability, Statistics and Data Analysis II\",\"videoUrls\":[\"https://example.com/video1\",\"https://example.com/video2\"]}"
)
,
( "Course does not exist"
@@ -214,6 +217,7 @@ runRetrieveCourseTest (label, courseName, courseData, meetingTimes, expectedCode
, courseTitle = Map.lookup "title" courseData
, courseDescription = Map.lookup "description" courseData
, coursePrereqs = Map.lookup "prereqs" courseData
+ , coursePrep = Nothing
, courseExclusions = Map.lookup "exclusions" courseData
, courseBreadth = Nothing
, courseDistribution = Nothing
@@ -249,7 +253,7 @@ runRetrieveCourseTests = map runRetrieveCourseTest retrieveCourseTestCases
insertCourses :: [T.Text] -> SqlPersistM ()
insertCourses = mapM_ insertCourse
where
- insertCourse code = insert_ (Course code Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing [])
+ insertCourse code = insert_ (Course code Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing [])
-- | Helper function to insert MeetTimes into the database
insertMeetingTimes :: [MeetTime] -> SqlPersistM ()
@@ -320,13 +324,13 @@ courseInfoTestCases =
( "Department with one course in database called"
, [csc108, sta237, sta238]
, "CSC"
- , "[{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":null,\"description\":\"Programming in a language such as Python. Elementary data types, lists, maps. Program structure: control flow, functions, classes, objects, methods. Algorithms and problem solving. Searching, sorting, and complexity. Unit testing. Floating-point numbers and numerical computation. No prior programming experience required.\",\"distribution\":null,\"exclusions\":\"CSC110Y1, CSC111H1, CSC120H1, CSC121H1, CSC148H1, CSC108H5, CSC148H5, CSCA08H3, CSCA20H3, CSCA48H3\",\"name\":\"CSC108H1\",\"prereqString\":null,\"title\":\"Introduction to Computer Programming\",\"videoUrls\":[]}]"
+ , "[{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":null,\"description\":\"Programming in a language such as Python. Elementary data types, lists, maps. Program structure: control flow, functions, classes, objects, methods. Algorithms and problem solving. Searching, sorting, and complexity. Unit testing. Floating-point numbers and numerical computation. No prior programming experience required.\",\"distribution\":null,\"exclusions\":\"CSC110Y1, CSC111H1, CSC120H1, CSC121H1, CSC148H1, CSC108H5, CSC148H5, CSCA08H3, CSCA20H3, CSCA48H3\",\"name\":\"CSC108H1\",\"prep\":null,\"prereqString\":null,\"title\":\"Introduction to Computer Programming\",\"videoUrls\":[]}]"
)
,
( "Department with two courses in database called"
, [csc108, sta237, sta238]
, "STA"
- , "[{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":\"( CSC108H1/ equivalent programming experience)/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to probability using simulation and mathematical frameworks, with emphasis on the probability needed for more advanced study in statistical practice. Topics covered include probability spaces, random variables, discrete and continuous probability distributions, probability mass, density, and distribution functions, expectation and variance, independence, conditional probability, the law of large numbers, the central limit theorem, sampling distributions. Computer simulation will be taught and used extensively for calculations and to guide the theoretical development.\",\"distribution\":null,\"exclusions\":\"STA247H1, STA201H1, STA255H1, STA257H1, ECO227Y1, MAT370H1, STAB52H3, STA256H5, ECO227Y5\",\"name\":\"STA237H1\",\"prereqString\":\"( MAT135H1, MAT136H1)/ MAT137Y1/ MAT157Y1/ ( MATA30H3, MATA36H3)/ ( MATA31H3, MATA37H3)/ ( MAT135H5, MAT136H5)/ MAT137Y5/ MAT157Y5/ ( MAT137H5, MAT139H5)/ ( MAT157H5, MAT159H5)\",\"title\":\"Probability, Statistics and Data Analysis I\",\"videoUrls\":[]},{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":\"CSC108H1/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation.\",\"distribution\":null,\"exclusions\":\"ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5\",\"name\":\"STA238H1\",\"prereqString\":\"STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5\",\"title\":\"Probability, Statistics and Data Analysis II\",\"videoUrls\":[\"[https://example.com/video1\",\"https://example.com/video2]\"]}]"
+ , "[{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":\"( CSC108H1/ equivalent programming experience)/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to probability using simulation and mathematical frameworks, with emphasis on the probability needed for more advanced study in statistical practice. Topics covered include probability spaces, random variables, discrete and continuous probability distributions, probability mass, density, and distribution functions, expectation and variance, independence, conditional probability, the law of large numbers, the central limit theorem, sampling distributions. Computer simulation will be taught and used extensively for calculations and to guide the theoretical development.\",\"distribution\":null,\"exclusions\":\"STA247H1, STA201H1, STA255H1, STA257H1, ECO227Y1, MAT370H1, STAB52H3, STA256H5, ECO227Y5\",\"name\":\"STA237H1\",\"prep\":null,\"prereqString\":\"( MAT135H1, MAT136H1)/ MAT137Y1/ MAT157Y1/ ( MATA30H3, MATA36H3)/ ( MATA31H3, MATA37H3)/ ( MAT135H5, MAT136H5)/ MAT137Y5/ MAT157Y5/ ( MAT137H5, MAT139H5)/ ( MAT157H5, MAT159H5)\",\"title\":\"Probability, Statistics and Data Analysis I\",\"videoUrls\":[]},{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":\"CSC108H1/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation.\",\"distribution\":null,\"exclusions\":\"ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5\",\"name\":\"STA238H1\",\"prep\":null,\"prereqString\":\"STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5\",\"title\":\"Probability, Statistics and Data Analysis II\",\"videoUrls\":[\"[https://example.com/video1\",\"https://example.com/video2]\"]}]"
)
,
( "Department with no courses in database called"
@@ -338,7 +342,7 @@ courseInfoTestCases =
( "Empty department called in a non-empty database -- should return the entire database"
, [csc108, sta237, sta238]
, ""
- , "[{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":null,\"description\":\"Programming in a language such as Python. Elementary data types, lists, maps. Program structure: control flow, functions, classes, objects, methods. Algorithms and problem solving. Searching, sorting, and complexity. Unit testing. Floating-point numbers and numerical computation. No prior programming experience required.\",\"distribution\":null,\"exclusions\":\"CSC110Y1, CSC111H1, CSC120H1, CSC121H1, CSC148H1, CSC108H5, CSC148H5, CSCA08H3, CSCA20H3, CSCA48H3\",\"name\":\"CSC108H1\",\"prereqString\":null,\"title\":\"Introduction to Computer Programming\",\"videoUrls\":[]},{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":\"( CSC108H1/ equivalent programming experience)/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to probability using simulation and mathematical frameworks, with emphasis on the probability needed for more advanced study in statistical practice. Topics covered include probability spaces, random variables, discrete and continuous probability distributions, probability mass, density, and distribution functions, expectation and variance, independence, conditional probability, the law of large numbers, the central limit theorem, sampling distributions. Computer simulation will be taught and used extensively for calculations and to guide the theoretical development.\",\"distribution\":null,\"exclusions\":\"STA247H1, STA201H1, STA255H1, STA257H1, ECO227Y1, MAT370H1, STAB52H3, STA256H5, ECO227Y5\",\"name\":\"STA237H1\",\"prereqString\":\"( MAT135H1, MAT136H1)/ MAT137Y1/ MAT157Y1/ ( MATA30H3, MATA36H3)/ ( MATA31H3, MATA37H3)/ ( MAT135H5, MAT136H5)/ MAT137Y5/ MAT157Y5/ ( MAT137H5, MAT139H5)/ ( MAT157H5, MAT159H5)\",\"title\":\"Probability, Statistics and Data Analysis I\",\"videoUrls\":[]},{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":\"CSC108H1/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation.\",\"distribution\":null,\"exclusions\":\"ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5\",\"name\":\"STA238H1\",\"prereqString\":\"STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5\",\"title\":\"Probability, Statistics and Data Analysis II\",\"videoUrls\":[\"[https://example.com/video1\",\"https://example.com/video2]\"]}]"
+ , "[{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":null,\"description\":\"Programming in a language such as Python. Elementary data types, lists, maps. Program structure: control flow, functions, classes, objects, methods. Algorithms and problem solving. Searching, sorting, and complexity. Unit testing. Floating-point numbers and numerical computation. No prior programming experience required.\",\"distribution\":null,\"exclusions\":\"CSC110Y1, CSC111H1, CSC120H1, CSC121H1, CSC148H1, CSC108H5, CSC148H5, CSCA08H3, CSCA20H3, CSCA48H3\",\"name\":\"CSC108H1\",\"prep\":null,\"prereqString\":null,\"title\":\"Introduction to Computer Programming\",\"videoUrls\":[]},{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":\"( CSC108H1/ equivalent programming experience)/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to probability using simulation and mathematical frameworks, with emphasis on the probability needed for more advanced study in statistical practice. Topics covered include probability spaces, random variables, discrete and continuous probability distributions, probability mass, density, and distribution functions, expectation and variance, independence, conditional probability, the law of large numbers, the central limit theorem, sampling distributions. Computer simulation will be taught and used extensively for calculations and to guide the theoretical development.\",\"distribution\":null,\"exclusions\":\"STA247H1, STA201H1, STA255H1, STA257H1, ECO227Y1, MAT370H1, STAB52H3, STA256H5, ECO227Y5\",\"name\":\"STA237H1\",\"prep\":null,\"prereqString\":\"( MAT135H1, MAT136H1)/ MAT137Y1/ MAT157Y1/ ( MATA30H3, MATA36H3)/ ( MATA31H3, MATA37H3)/ ( MAT135H5, MAT136H5)/ MAT137Y5/ MAT157Y5/ ( MAT137H5, MAT139H5)/ ( MAT157H5, MAT159H5)\",\"title\":\"Probability, Statistics and Data Analysis I\",\"videoUrls\":[]},{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":\"CSC108H1/ CSC110Y1/ CSC148H1 *Note: the corequisite may be completed either concurrently or in advance.\",\"description\":\"An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation.\",\"distribution\":null,\"exclusions\":\"ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5\",\"name\":\"STA238H1\",\"prep\":null,\"prereqString\":\"STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5\",\"title\":\"Probability, Statistics and Data Analysis II\",\"videoUrls\":[\"[https://example.com/video1\",\"https://example.com/video2]\"]}]"
)
]
where
@@ -352,6 +356,7 @@ courseInfoTestCases =
, coursePrereqs =
Just
"( MAT135H1, MAT136H1)/ MAT137Y1/ MAT157Y1/ ( MATA30H3, MATA36H3)/ ( MATA31H3, MATA37H3)/ ( MAT135H5, MAT136H5)/ MAT137Y5/ MAT157Y5/ ( MAT137H5, MAT139H5)/ ( MAT157H5, MAT159H5)"
+ , coursePrep = Nothing
, courseExclusions =
Just "STA247H1, STA201H1, STA255H1, STA257H1, ECO227Y1, MAT370H1, STAB52H3, STA256H5, ECO227Y5"
, courseBreadth = Nothing
@@ -372,6 +377,7 @@ courseInfoTestCases =
Just
"An introduction to statistical inference and practice. Statistical models and parameters, estimators of parameters and their statistical properties, methods of estimation, confidence intervals, hypothesis testing, likelihood function, the linear model. Use of statistical computation for data analysis and simulation."
, coursePrereqs = Just "STA237H1/ STA247H1/ STA257H1/ STAB52H3/ STA256H5"
+ , coursePrep = Nothing
, courseExclusions =
Just
"ECO220Y1/ ECO227Y1/ GGR270H1/ PSY201H1/ SOC300H1/ SOC202H1/ SOC252H1/ STA220H1/ STA221H1/ STA255H1/ STA248H1/ STA261H1/ STA288H1/ EEB225H1/ STAB22H3/ STAB27H3/ STAB57H3/ STA220H5/ STA221H5/ STA258H5/ STA260H5/ ECO220Y5/ ECO227Y5"
@@ -390,6 +396,7 @@ courseInfoTestCases =
Just
"Programming in a language such as Python. Elementary data types, lists, maps. Program structure: control flow, functions, classes, objects, methods. Algorithms and problem solving. Searching, sorting, and complexity. Unit testing. Floating-point numbers and numerical computation. No prior programming experience required."
, coursePrereqs = Nothing
+ , coursePrep = Nothing
, courseExclusions =
Just "CSC110Y1, CSC111H1, CSC120H1, CSC121H1, CSC148H1, CSC108H5, CSC148H5, CSCA08H3, CSCA20H3, CSCA48H3"
, courseBreadth = Nothing
diff --git a/backend-test/Controllers/GenerateControllerTests.hs b/backend-test/Controllers/GenerateControllerTests.hs
index 587329b4d..37190586d 100644
--- a/backend-test/Controllers/GenerateControllerTests.hs
+++ b/backend-test/Controllers/GenerateControllerTests.hs
@@ -32,6 +32,7 @@ insertCoursesWithPrerequisites = mapM_ insertCourse
, courseTitle = Nothing
, courseDescription = Nothing
, coursePrereqs = prereqString
+ , coursePrep = Nothing
, courseExclusions = Nothing
, courseBreadth = Nothing
, courseDistribution = Nothing
diff --git a/js/components/common/__tests__/CourseModalUpdate.test.js b/js/components/common/__tests__/CourseModalUpdate.test.js
index 428528619..d05820460 100644
--- a/js/components/common/__tests__/CourseModalUpdate.test.js
+++ b/js/components/common/__tests__/CourseModalUpdate.test.js
@@ -18,6 +18,7 @@ describe("componentDidUpdate", () => {
title: "Foundations of Computer Science I",
description: null,
prereqs: null,
+ prep: null,
exclusions: null,
breadth: null,
distribution: null,
diff --git a/js/components/common/__tests__/InfoModalFields.test.js b/js/components/common/__tests__/InfoModalFields.test.js
index b5b638400..0ee625431 100644
--- a/js/components/common/__tests__/InfoModalFields.test.js
+++ b/js/components/common/__tests__/InfoModalFields.test.js
@@ -11,6 +11,7 @@ describe("Displays course information fields iff they are non-empty.", () => {
description: "test description",
prereqString: ["ABC101H1"],
coreqs: ["DEF101H1"],
+ prep: ["JKL101H1"],
exclusions: ["GHI101H1"],
distribution: "Sciences",
breadth: "The Physical and Mathematical Universes (5)",
@@ -20,6 +21,7 @@ describe("Displays course information fields iff they are non-empty.", () => {
await screen.findByText("test description")
await screen.findByText("ABC101H1")
await screen.findByText("DEF101H1")
+ await screen.findByText("JKL101H1")
await screen.findByText("GHI101H1")
await screen.findByText("Sciences")
await screen.findByText("The Physical and Mathematical Universes (5)")
@@ -31,6 +33,7 @@ describe("Displays course information fields iff they are non-empty.", () => {
description: "",
prereqString: [],
coreqs: [],
+ prep: [],
exclusions: [],
distribution: "",
breadth: "",
@@ -39,6 +42,7 @@ describe("Displays course information fields iff they are non-empty.", () => {
render()
expect(screen.queryByText("Prerequisite:")).toBeNull()
expect(screen.queryByText("Corequisite:")).toBeNull()
+ expect(screen.queryByText("Recommended Preparation:")).toBeNull()
expect(screen.queryByText("Exclusion:")).toBeNull()
expect(screen.queryByText("Distribution Requirement Status:")).toBeNull()
expect(screen.queryByText("Breadth Requirement:")).toBeNull()
diff --git a/js/components/common/react_modal.js.jsx b/js/components/common/react_modal.js.jsx
index ba0a1636b..f7ad7f280 100644
--- a/js/components/common/react_modal.js.jsx
+++ b/js/components/common/react_modal.js.jsx
@@ -107,6 +107,7 @@ class CourseModal extends React.Component {
description: this.convertToLink(course.description),
prereqString: this.convertToLink(course.prereqString),
coreqs: this.convertToLink(course.coreq),
+ prep: this.convertToLink(course.prep),
exclusions: this.convertToLink(course.exclusions),
}
@@ -374,6 +375,12 @@ class Description extends React.Component {
{this.props.course.coreqs}
)}
+ {this.props.course.prep?.length > 0 && (
+
+ Recommended Preparation:
+ {this.props.course.prep}
+
+ )}
{this.props.course.exclusions?.length > 0 && (
Exclusion:
diff --git a/js/components/graph/__mocks__/aaa100-course-info.js b/js/components/graph/__mocks__/aaa100-course-info.js
index bffc22fa9..f963a9908 100644
--- a/js/components/graph/__mocks__/aaa100-course-info.js
+++ b/js/components/graph/__mocks__/aaa100-course-info.js
@@ -365,6 +365,7 @@ export default {
videoUrls: [],
breadth: "The Physical and Mathematical Universes (5)",
name: "AAA100H1",
+ prep: "AAA101H1",
exclusions: "",
title: "Introduction to AAA Thinking",
description:
diff --git a/js/components/graph/__mocks__/bbb100-course-info.js b/js/components/graph/__mocks__/bbb100-course-info.js
index 5457bd1c7..a06553187 100644
--- a/js/components/graph/__mocks__/bbb100-course-info.js
+++ b/js/components/graph/__mocks__/bbb100-course-info.js
@@ -365,6 +365,7 @@ export default {
videoUrls: [],
breadth: "The Physical and Mathematical Universes (5)",
name: "BBB100H1",
+ prep: "BBB101H1",
exclusions: "",
title: "Introduction to BBB Thinking",
description:
diff --git a/js/components/graph/__mocks__/ccc100-course-info.js b/js/components/graph/__mocks__/ccc100-course-info.js
index 52dc91bcd..0bf1b9b17 100644
--- a/js/components/graph/__mocks__/ccc100-course-info.js
+++ b/js/components/graph/__mocks__/ccc100-course-info.js
@@ -365,6 +365,7 @@ export default {
videoUrls: [],
breadth: "The Physical and Mathematical Universes (5)",
name: "CCC100H1",
+ prep: "CCC101H1",
exclusions: "",
title: "Introduction to CCC Thinking",
description:
diff --git a/js/components/grid/__tests__/CoursePanel.test.js b/js/components/grid/__tests__/CoursePanel.test.js
index b23e5befd..03473209f 100644
--- a/js/components/grid/__tests__/CoursePanel.test.js
+++ b/js/components/grid/__tests__/CoursePanel.test.js
@@ -32,6 +32,7 @@ describe("CoursePanel", () => {
title: "Foundations of Computer Science I",
description: null,
prereqs: null,
+ prep: null,
exclusions: null,
breadth: null,
distribution: null,
From f179b5f23341bbb3ea2b8a3115346ca34cbeb554 Mon Sep 17 00:00:00 2001
From: angelsanddevslol
Date: Fri, 24 Jul 2026 12:55:28 -0400
Subject: [PATCH 2/2] update changelog
---
CHANGELOG.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 373e1f68c..e7b27115d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,8 @@
### ✨ New features/enhancements
+- Added recommended preparation field to courses and updated the course info modal
+
### 🐛 Bug fixes
- Fixed CSS styling of background colour and let the application have full height