flex-tasks-0.0.0
Safe HaskellNone
LanguageHaskell2010

FlexTask.Interpreter

Description

Functions using Interpreter to run time compile and evaluate various aspects of a task. The interpreted code is usually supplied by accessing data stored in FlexInst or FlexConf.

Synopsis

Documentation

checkSolution Source #

Arguments

:: String

Data made available to checker functions

-> String

Global module

-> String

Module containing configuration options

-> String

Module containing parseSubmission

-> String

Module containing checkSyntax and checkSemantics

-> [(String, String)]

Additional code modules

-> String

Student solution

-> FilePath

Path images will be stored in

-> IO (Either InterpreterError ([Output], Maybe (Maybe Rational, [Output]))) 

Use task data and interpret three code modules to evaluate a submission. The submission ist parsed by function parseSubmission. The result is evaluated by functions checkSyntax and checkSemantics. The result is a tuple of syntax feedback and optional semantics feedback. If the syntax check fails, then no semantics feedback is provided. Semantics feedback is coupled with a rating given as a Rational (0 to 1).

genFlexInst Source #

Arguments

:: FlexConf 
-> (Gen GenOutput -> a -> GenOutput)

Method of running the random generator

-> a

Generator seed

-> IO FlexInst 

Use a FlexConf to generate a FlexInst. Interprets taskDataModule to generate the input form and task data. Apply the given method to run the generator with a seed.

prettyError :: InterpreterError -> String Source #

Custom display of Hint InterpreterError messages.

validateSettings Source #

Arguments

:: String

Global module

-> String

Module containing configuration options

-> [(String, String)]

Additional code modules

-> IO (Either InterpreterError [Output]) 
 

validDescription Source #

Arguments

:: forall (m :: Type -> Type). OutputCapable m 
=> String

Data available for making the description

-> String

Global module

-> String

Settings module

-> String

Module containing the description function

-> [(String, String)]

Additional code modules

-> FilePath

Path images will be stored in

-> IO (LangM m)

OutputCapable representation of task description

Produce the task description by using task data and two interpreted modules or restore a cached result. Should the solution not yet exist on disc, then it will be created by interpreting description and saved in a file. If the task description already exists on disc, it is read. Then, if any of the image links of that description are invalid (have been deleted), the description is interpreted again to regenerate the missing files.