fillDB adjusted for StudyFeatues
This commit is contained in:
parent
57cb80ecf8
commit
4db9e5c18a
@ -302,8 +302,8 @@ registerForm registered msecret extra = do
|
|||||||
(msecretRes', msecretView) <- case msecret of
|
(msecretRes', msecretView) <- case msecret of
|
||||||
(Just _) | not registered -> bimap Just Just <$> mreq textField (fslpI MsgCourseSecret "Code") Nothing
|
(Just _) | not registered -> bimap Just Just <$> mreq textField (fslpI MsgCourseSecret "Code") Nothing
|
||||||
_ -> return (Nothing,Nothing)
|
_ -> return (Nothing,Nothing)
|
||||||
(sfRes' , sfView) <- if not registered then return (Nothing,Nothing) else
|
(_sfRes' , _sfView) <- if not registered then return (Nothing,Nothing) else
|
||||||
mopt (studyFeaturesPrimaryFieldFor (error "TODO SJ REMOVE")) (fslI MsgCourseStudyFeature) Nothing
|
bimap Just Just <$> mopt (studyFeaturesPrimaryFieldFor (error "TODO SJ REMOVE")) (fslI MsgCourseStudyFeature) Nothing
|
||||||
(btnRes, btnView) <- mreq (buttonField $ bool BtnRegister BtnDeregister registered) "buttonField ignores settings anyway" Nothing
|
(btnRes, btnView) <- mreq (buttonField $ bool BtnRegister BtnDeregister registered) "buttonField ignores settings anyway" Nothing
|
||||||
|
|
||||||
let widget = $(widgetFile "widgets/register-form/register-form")
|
let widget = $(widgetFile "widgets/register-form/register-form")
|
||||||
|
|||||||
@ -198,7 +198,7 @@ fillDb = do
|
|||||||
, termActive = True
|
, termActive = True
|
||||||
}
|
}
|
||||||
ifi <- insert' $ School "Institut für Informatik" "IfI"
|
ifi <- insert' $ School "Institut für Informatik" "IfI"
|
||||||
mi <- insert' $ School "Institut für Mathematik" "MI"
|
mi <- insert' $ School "Institut für Mathematik" "MI"
|
||||||
void . insert' $ UserAdmin gkleen ifi
|
void . insert' $ UserAdmin gkleen ifi
|
||||||
void . insert' $ UserAdmin gkleen mi
|
void . insert' $ UserAdmin gkleen mi
|
||||||
void . insert' $ UserAdmin fhamann ifi
|
void . insert' $ UserAdmin fhamann ifi
|
||||||
@ -210,13 +210,70 @@ fillDb = do
|
|||||||
let
|
let
|
||||||
sdBsc = StudyDegreeKey' 82
|
sdBsc = StudyDegreeKey' 82
|
||||||
sdMst = StudyDegreeKey' 88
|
sdMst = StudyDegreeKey' 88
|
||||||
|
sdLAR = StudyDegreeKey' 33
|
||||||
|
sdLAG = StudyDegreeKey' 35
|
||||||
repsert sdBsc $ StudyDegree 82 (Just "BSc") (Just "Bachelor" )
|
repsert sdBsc $ StudyDegree 82 (Just "BSc") (Just "Bachelor" )
|
||||||
repsert sdMst $ StudyDegree 88 (Just "MSc") (Just "Master" )
|
repsert sdMst $ StudyDegree 88 (Just "MSc") (Just "Master" )
|
||||||
|
repsert sdLAR $ StudyDegree 33 (Just "LAR") Nothing -- intentionally left unknown
|
||||||
|
repsert sdLAG $ StudyDegree 35 Nothing Nothing -- intentionally left unknown
|
||||||
let
|
let
|
||||||
sdInf = StudyTermsKey' 79
|
sdInf = StudyTermsKey' 79
|
||||||
sdMath = StudyTermsKey' 105
|
sdMath = StudyTermsKey' 105
|
||||||
|
sdMedi = StudyTermsKey' 121
|
||||||
|
sdPhys = StudyTermsKey' 128
|
||||||
repsert sdInf $ StudyTerms 79 (Just "IfI") (Just "Institut für Informatik")
|
repsert sdInf $ StudyTerms 79 (Just "IfI") (Just "Institut für Informatik")
|
||||||
repsert sdMath $ StudyTerms 105 (Just "MI" ) (Just "Mathematisches Institut")
|
repsert sdMath $ StudyTerms 105 (Just "MI" ) (Just "Mathematisches Institut")
|
||||||
|
repsert sdMedi $ StudyTerms 121 (Just "MnfI") Nothing -- intentionally left unknown
|
||||||
|
repsert sdPhys $ StudyTerms 128 Nothing Nothing -- intentionally left unknown
|
||||||
|
sfMMp <- insert $ StudyFeatures -- keyword type prevents record syntax here
|
||||||
|
maxMuster
|
||||||
|
sdBsc
|
||||||
|
sdInf
|
||||||
|
FieldPrimary
|
||||||
|
2
|
||||||
|
now
|
||||||
|
True
|
||||||
|
sfMMs <- insert $ StudyFeatures
|
||||||
|
maxMuster
|
||||||
|
sdBsc
|
||||||
|
sdMath
|
||||||
|
FieldSecondary
|
||||||
|
2
|
||||||
|
now
|
||||||
|
True
|
||||||
|
_sfTTa <- insert $ StudyFeatures
|
||||||
|
tinaTester
|
||||||
|
sdBsc
|
||||||
|
sdInf
|
||||||
|
FieldPrimary
|
||||||
|
4
|
||||||
|
now
|
||||||
|
False
|
||||||
|
sfTTb <- insert $ StudyFeatures
|
||||||
|
tinaTester
|
||||||
|
sdLAG
|
||||||
|
sdPhys
|
||||||
|
FieldPrimary
|
||||||
|
1
|
||||||
|
now
|
||||||
|
True
|
||||||
|
sfTTc <- insert $ StudyFeatures
|
||||||
|
tinaTester
|
||||||
|
sdLAR
|
||||||
|
sdMedi
|
||||||
|
FieldPrimary
|
||||||
|
7
|
||||||
|
now
|
||||||
|
True
|
||||||
|
_sfTTd <- insert $ StudyFeatures
|
||||||
|
tinaTester
|
||||||
|
sdMst
|
||||||
|
sdMath
|
||||||
|
FieldPrimary
|
||||||
|
3
|
||||||
|
now
|
||||||
|
True
|
||||||
|
|
||||||
-- FFP
|
-- FFP
|
||||||
let nbrs :: [Int]
|
let nbrs :: [Int]
|
||||||
nbrs = [1,2,3,27,7,1]
|
nbrs = [1,2,3,27,7,1]
|
||||||
@ -256,6 +313,12 @@ fillDb = do
|
|||||||
insert_ $ SheetEdit gkleen now feste
|
insert_ $ SheetEdit gkleen now feste
|
||||||
keine <- insert $ Sheet ffp "Keine Gruppen" Nothing NotGraded NoGroups Nothing Nothing now now Nothing Nothing (Upload True) UserSubmissions False
|
keine <- insert $ Sheet ffp "Keine Gruppen" Nothing NotGraded NoGroups Nothing Nothing now now Nothing Nothing (Upload True) UserSubmissions False
|
||||||
insert_ $ SheetEdit gkleen now keine
|
insert_ $ SheetEdit gkleen now keine
|
||||||
|
void . insertMany $ map (\(u,sf) -> CourseParticipant ffp u now sf)
|
||||||
|
[(fhamann , Nothing)
|
||||||
|
,(maxMuster , Just sfMMs)
|
||||||
|
,(tinaTester, Just sfTTc)
|
||||||
|
]
|
||||||
|
|
||||||
-- EIP
|
-- EIP
|
||||||
eip <- insert' Course
|
eip <- insert' Course
|
||||||
{ courseName = "Einführung in die Programmierung"
|
{ courseName = "Einführung in die Programmierung"
|
||||||
@ -328,7 +391,11 @@ fillDb = do
|
|||||||
insert_ $ CourseEdit jost now pmo
|
insert_ $ CourseEdit jost now pmo
|
||||||
void . insert $ DegreeCourse pmo sdBsc sdInf
|
void . insert $ DegreeCourse pmo sdBsc sdInf
|
||||||
void . insert $ Lecturer jost pmo
|
void . insert $ Lecturer jost pmo
|
||||||
void . insertMany $ map (\u -> CourseParticipant pmo u now) [fhamann, maxMuster, tinaTester]
|
void . insertMany $ map (\(u,sf) -> CourseParticipant pmo u now sf)
|
||||||
|
[(fhamann , Nothing)
|
||||||
|
,(maxMuster , Just sfMMp)
|
||||||
|
,(tinaTester, Just sfTTb)
|
||||||
|
]
|
||||||
sh1 <- insert Sheet
|
sh1 <- insert Sheet
|
||||||
{ sheetCourse = pmo
|
{ sheetCourse = pmo
|
||||||
, sheetName = "Blatt 1"
|
, sheetName = "Blatt 1"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user