haskell-template-task-0.2: A task type for haskell tasks developed for the e-learning platform Autotool
Safe HaskellSafe-Inferred
LanguageHaskell2010

Haskell.Template.Task

Synopsis

Documentation

check :: MonadIO m => (forall a. Doc -> m a) -> (Doc -> m ()) -> FilePath -> String -> m () Source #

defaultSolutionConfig :: SolutionConfigOpt Source #

finaliseConfigs :: [SolutionConfigOpt] -> Maybe SolutionConfig Source #

getCodeWorldButtonOption :: String -> Bool Source #

Extract the value of the addCodeWorldButton option. Defaults to False if not specified. Also returns False in case the config cannot be read.

getCodeWorldRenderButtonOption :: String -> Bool Source #

Extract the value of the addCodeWorldRenderButton option. Defaults to False if not specified. Also returns False in case the config cannot be read.

getCodeWorldPartialRenderButtonOption :: String -> Bool Source #

Extract the value of the addCodeWorldPartialRenderButton option. Defaults to False if not specified. Also returns False in case the config cannot be read.

getHlintFeedback Source #

Arguments

:: MonadIO m 
=> (Doc -> m a) 
-> SolutionConfig 
-> FilePath

directory where to write additional.yaml for hints to check to

-> String 
-> (SolutionConfig -> Identity [String]) 
-> m [a] 

grade Source #

Arguments

:: MonadIO m 
=> (m () -> m ())

Evaluation function for the syntax phase

-> (m () -> m ())

Evaluation function for the semantics phase

-> (forall c. Doc -> m c)

display a message and fail

-> (Doc -> m ())

display a message and continue

-> FilePath

parent directory to use for file operations

-> String

the task

-> String

the submission

-> m Bool

whether the conditions outlined in the description apply or not

Generate consecutive syntax and possible semantics feedback in the context of an evaluation Monad.

This Monad is expected to provide a mechanism to prematurely end the evaluation in case of failure.

This function returns an encapsulated Bool value if all tests pass. It will only be True if the submission contains a clone of the sample solution, the semantics phase is not disabled by disableSemantics and the task was also configured to add a custom message on clones via messageOnCloningSampleSolution. Otherwise, the value will always be False. This can be used by the caller to conditionally add the sample solution after the grading is already completed, with maybeSampleSolution.

matchTemplate :: Monad m => (forall a. Doc -> m a) -> SolutionConfig -> Int -> [Extension] -> String -> String -> m () Source #

maybeSampleSolution :: String -> Maybe Doc Source #

Extract the sample solution if one was provided, provideSampleSolution is enabled and disableSemantics is not enabled.

parse :: Monad m => (forall a. Doc -> m a) -> [Extension] -> String -> m (Module SrcSpanInfo) Source #

rejectMatch :: Applicative m => (forall a. Doc -> m a) -> SolutionConfig -> Int -> String -> String -> Location -> m () Source #

toSolutionConfigOpt :: SolutionConfig -> SolutionConfigOpt Source #