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
user UserId
occurrence ExamOccurrenceId Maybe
time UTCTime default=now()
UniqueExamRegistration exam user
ExamPartResult
examPart ExamPartId

View File

@ -815,7 +815,8 @@ postERegisterR tid ssh csh examn = do
formResult btnResult $ \case
BtnRegister -> 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
addMessageI Success $ MsgExamRegisteredSuccess examn
redirect $ CExamR tid ssh csh examn EShowR