feat(exam): save registration timestamp

This commit is contained in:
Gregor Kleen 2019-07-03 16:26:24 +02:00
parent 31931e708e
commit 78e4369afb
2 changed files with 3 additions and 1 deletions

View File

@ -34,6 +34,7 @@ ExamRegistration
exam ExamId exam ExamId
user UserId user UserId
occurrence ExamOccurrenceId Maybe occurrence ExamOccurrenceId Maybe
time UTCTime default=now()
UniqueExamRegistration exam user UniqueExamRegistration exam user
ExamPartResult ExamPartResult
examPart ExamPartId examPart ExamPartId

View File

@ -815,7 +815,8 @@ postERegisterR tid ssh csh examn = do
formResult btnResult $ \case formResult btnResult $ \case
BtnRegister -> do BtnRegister -> do
runDB $ do runDB $ do
insert_ $ ExamRegistration eId uid Nothing now <- liftIO getCurrentTime
insert_ $ ExamRegistration eId uid Nothing now
audit' $ TransactionExamRegister (unTermKey tid) (unSchoolKey ssh) csh examn userIdent audit' $ TransactionExamRegister (unTermKey tid) (unSchoolKey ssh) csh examn userIdent
addMessageI Success $ MsgExamRegisteredSuccess examn addMessageI Success $ MsgExamRegisteredSuccess examn
redirect $ CExamR tid ssh csh examn EShowR redirect $ CExamR tid ssh csh examn EShowR