diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a35d0ada..8d31da0b8 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 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 842bab541..6dca12a20 100644 --- a/backend-test/Controllers/CourseControllerTests.hs +++ b/backend-test/Controllers/CourseControllerTests.hs @@ -101,7 +101,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\":\"20269\",\"weekDay\":0},{\"endHour\":14,\"startHour\":13,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"SS\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"SS\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"20269\",\"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\":\"20269\",\"weekDay\":0},{\"endHour\":14,\"startHour\":13,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"SS\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"SS\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"20269\",\"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" @@ -153,7 +153,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\":\"20269\",\"weekDay\":0},{\"endHour\":14,\"startHour\":13,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"SS\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"SS\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"20269\",\"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\":\"20269\",\"weekDay\":0},{\"endHour\":14,\"startHour\":13,\"timeLocation\":{\"buildingAddress\":\"N/A\",\"buildingCode\":\"SS\",\"buildingLat\":1,\"buildingLng\":1,\"buildingName\":\"SS\",\"buildingPostalCode\":\"A1A 1A1\"},\"timeSession\":\"20269\",\"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" @@ -178,7 +178,32 @@ 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 exists with a recommended preparation" + , "CSC311" + , Map.fromList + [ ("name", "CSC311H1") + , ("title", "Introduction to Machine Learning") + , + ( "description" + , "An introduction to methods for automated learning of relationships on the basis of empirical data. Classification and regression using nearest neighbour methods, decision trees, linear models, and neural networks. Clustering algorithms. Problems of overfitting and of assessing accuracy." + ) + , ("prep", "( MAT235H1, MAT236H1)/ MAT235Y1/ MAT237Y1/ MAT257Y1") + , + ( "exclusions" + , "CSC411H1, STA314H1, ECE421H1, CSC311H5, CSC411H5, CSCC11H3. NOTE: Students not enrolled in the Computer Science Major or Specialist program at A&S, UTM, or UTSC, or the Data Science Specialist at A&S, are limited to a maximum of 1.5 credits in 300-/400-level CSC/ECE courses." + ) + , ("breadth", "The Physical and Mathematical Universes (5)") + , + ( "prereqString" + , "CSC207H1/ CSC207H5/ CSCB07H3; MAT235H1/ MAT235Y1/ MAT237Y1/ MAT257Y1/ (minimum of 77% in MAT130H1/ MAT135H1 and MAT136H1)/ (minimum of 73% in MAT148H1/ minimum of 67% in MAT158H1 and minimum of 73% in MAT149H1/ minimum of 67% in MAT159H1)/ minimum of 73% in MAT137Y1/ minimum of 67% in MAT157Y1; MAT223H1/ MAT240H1; STA237H1/ STA247H1/ STA255H1/ STA257H1" + ) + ] + , [] + , 200 + , "{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":null,\"description\":\"An introduction to methods for automated learning of relationships on the basis of empirical data. Classification and regression using nearest neighbour methods, decision trees, linear models, and neural networks. Clustering algorithms. Problems of overfitting and of assessing accuracy.\",\"distribution\":null,\"exclusions\":\"CSC411H1, STA314H1, ECE421H1, CSC311H5, CSC411H5, CSCC11H3. NOTE: Students not enrolled in the Computer Science Major or Specialist program at A&S, UTM, or UTSC, or the Data Science Specialist at A&S, are limited to a maximum of 1.5 credits in 300-/400-level CSC/ECE courses.\",\"name\":\"CSC311H1\",\"prep\":\"( MAT235H1, MAT236H1)/ MAT235Y1/ MAT237Y1/ MAT257Y1\",\"prereqString\":\"CSC207H1/ CSC207H5/ CSCB07H3; MAT235H1/ MAT235Y1/ MAT237Y1/ MAT257Y1/ (minimum of 77% in MAT130H1/ MAT135H1 and MAT136H1)/ (minimum of 73% in MAT148H1/ minimum of 67% in MAT158H1 and minimum of 73% in MAT149H1/ minimum of 67% in MAT159H1)/ minimum of 73% in MAT137Y1/ minimum of 67% in MAT157Y1; MAT223H1/ MAT240H1; STA237H1/ STA247H1/ STA255H1/ STA257H1\",\"title\":\"Introduction to Machine Learning\",\"videoUrls\":[]}" ) , ( "Course does not exist" @@ -214,6 +239,7 @@ runRetrieveCourseTest (label, courseName, courseData, meetingTimes, expectedCode , courseTitle = Map.lookup "title" courseData , courseDescription = Map.lookup "description" courseData , coursePrereqs = Map.lookup "prereqs" courseData + , coursePrep = Map.lookup "prep" courseData , courseExclusions = Map.lookup "exclusions" courseData , courseBreadth = Nothing , courseDistribution = Nothing @@ -249,7 +275,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 +346,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" @@ -334,11 +360,17 @@ courseInfoTestCases = , "MAT" , "[]" ) + , + ( "Department with a course that has a recommended preparation" + , [csc311] + , "CSC" + , "[{\"allMeetingTimes\":[],\"breadth\":null,\"coreqs\":null,\"description\":\"An introduction to methods for automated learning of relationships on the basis of empirical data. Classification and regression using nearest neighbour methods, decision trees, linear models, and neural networks. Clustering algorithms. Problems of overfitting and of assessing accuracy.\",\"distribution\":null,\"exclusions\":\"CSC411H1, STA314H1, ECE421H1, CSC311H5, CSC411H5, CSCC11H3. NOTE: Students not enrolled in the Computer Science Major or Specialist program at A&S, UTM, or UTSC, or the Data Science Specialist at A&S, are limited to a maximum of 1.5 credits in 300-/400-level CSC/ECE courses.\",\"name\":\"CSC311H1\",\"prep\":\"( MAT235H1, MAT236H1)/ MAT235Y1/ MAT237Y1/ MAT257Y1\",\"prereqString\":\"CSC207H1/ CSC207H5/ CSCB07H3; MAT235H1/ MAT235Y1/ MAT237Y1/ MAT257Y1/ (minimum of 77% in MAT130H1/ MAT135H1 and MAT136H1)/ (minimum of 73% in MAT148H1/ minimum of 67% in MAT158H1 and minimum of 73% in MAT149H1/ minimum of 67% in MAT159H1)/ minimum of 73% in MAT137Y1/ minimum of 67% in MAT157Y1; MAT223H1/ MAT240H1; STA237H1/ STA247H1/ STA255H1/ STA257H1\",\"title\":\"Introduction to Machine Learning\",\"videoUrls\":[]}]" + ) , ( "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 +384,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 +405,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 +424,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 @@ -398,6 +433,28 @@ courseInfoTestCases = , courseCoreqs = Nothing , courseVideoUrls = [] } + csc311 = + Course + { courseCode = "CSC311H1" + , courseTitle = Just "Introduction to Machine Learning" + , courseDescription = + Just + "An introduction to methods for automated learning of relationships on the basis of empirical data. Classification and regression using nearest neighbour methods, decision trees, linear models, and neural networks. Clustering algorithms. Problems of overfitting and of assessing accuracy." + , coursePrereqs = + Just + "CSC207H1/ CSC207H5/ CSCB07H3; MAT235H1/ MAT235Y1/ MAT237Y1/ MAT257Y1/ (minimum of 77% in MAT130H1/ MAT135H1 and MAT136H1)/ (minimum of 73% in MAT148H1/ minimum of 67% in MAT158H1 and minimum of 73% in MAT149H1/ minimum of 67% in MAT159H1)/ minimum of 73% in MAT137Y1/ minimum of 67% in MAT157Y1; MAT223H1/ MAT240H1; STA237H1/ STA247H1/ STA255H1/ STA257H1" + , coursePrep = Just "( MAT235H1, MAT236H1)/ MAT235Y1/ MAT237Y1/ MAT257Y1" + , courseExclusions = + Just + "CSC411H1, STA314H1, ECE421H1, CSC311H5, CSC411H5, CSCC11H3. NOTE: Students not enrolled in the Computer Science Major or Specialist program at A&S, UTM, or UTSC, or the Data Science Specialist at A&S, are limited to a maximum of 1.5 credits in 300-/400-level CSC/ECE courses." + , courseBreadth = Nothing + , courseDistribution = Nothing + , coursePrereqString = + Just + "CSC207H1/ CSC207H5/ CSCB07H3; MAT235H1/ MAT235Y1/ MAT237Y1/ MAT257Y1/ (minimum of 77% in MAT130H1/ MAT135H1 and MAT136H1)/ (minimum of 73% in MAT148H1/ minimum of 67% in MAT158H1 and minimum of 73% in MAT149H1/ minimum of 67% in MAT159H1)/ minimum of 73% in MAT137Y1/ minimum of 67% in MAT157Y1; MAT223H1/ MAT240H1; STA237H1/ STA247H1/ STA255H1/ STA257H1" + , courseCoreqs = Nothing + , courseVideoUrls = [] + } -- | Run a test case (case, database state, input [dept], expected JSON output) on the courseInfo function runCourseInfoTest :: (String, [Course], T.Text, String) -> TestTree 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 86c2c52f7..a6e12f502 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 bce2fbcfe..c38cb992d 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 d975ac129..1cf4be41b 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,