Your design submission has been saved.
- Though you can continue working on it and re-submit it later.
-
- Proceed with a personalized link
- |]
- )
+-- | renders data from supplied exercise or default values
+exerciseForm :: Maybe Exercise -> AForm Handler ExerciseData
+exerciseForm mE = ExerciseData <$>
+ areq textField (labeledField "description") (exerciseDescription <$> mE) <*>
+ aopt fileField (labeledField "image") Nothing <*>
+ areq doubleField (labeledField "scale (obsolete)")
+ (Just $ fromMaybe 0.5 $ exerciseScale <$> mE) <*>
+ aopt fileField (labeledField "geometry") Nothing <*>
+ areq boolField (labeledField "Allow students to add/delete objects.")
+ (Just $ fromMaybe False $ exerciseCanAddDeleteGeom <$> mE) <*>
+ areq htmlField (labeledField "On-submit html message. Use ${userId}, ${userName}, and ${exerciseId} to customize it.")
+ (Just $ fromMaybe
+ [shamlet|
+ Thank you, ${userName}!
+