Maintainer | bastiaan.heeren@ou.nl |
---|---|
Stability | provisional |
Portability | portable (depends on ghc) |
Safe Haskell | None |
Language | Haskell98 |
This module defines some common functions used in the exercise specific assessment functions.
Synopsis
- generateEvidence :: (Approach -> EvBuilder ()) -> Approach -> [[Attribute]] -> Evidence
- answerCorrect :: Expr -> [[Attribute]] -> Node Bool -> Evidence
- stringNode :: Maybe String -> Node String -> Evidence
- failOnInvalidEquationAny :: Constraint EvBuilder [Attribute]
- failOnInvalidEquation :: Expr -> Expr -> Constraint EvBuilder [Attribute]
- failOnIncorrectDistribution :: Constraint EvBuilder [Attribute]
- failOnCommonMistake :: Constraint EvBuilder [Attribute]
- failOnUnequalRelationAny :: Constraint EvBuilder [Attribute]
- failOnUnequalRelation :: Relation Expr -> Relation Expr -> Constraint EvBuilder [Attribute]
- failOnAtomMixedUpAny :: Constraint EvBuilder [Attribute]
- failOnAnyMistake :: Constraint EvBuilder [Attribute]
- withoutFailure :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute]
- giveNodeAndCollect :: Verifiable b => Node b -> Constraint EvBuilder [Attribute] -> EvBuilder ()
- giveNodeAndCollectAll :: Verifiable b => Node b -> [Constraint EvBuilder [Attribute]] -> EvBuilder ()
- giveNodeAndCollectAllKnown :: Verifiable b => Node b -> [Constraint EvBuilder [Attribute]] -> EvBuilder ()
- giveNodeAndCollectDefault :: Verifiable b => Node b -> Constraint EvBuilder [Attribute] -> Expr -> Expr -> EvBuilder ()
Generate evidence
:: (Approach -> EvBuilder ()) | Function for building the evidence |
-> Approach | Category of solution |
-> [[Attribute]] | Collected attributes to use as input |
-> Evidence |
Generic function for gathering evidence
Failure constraints
failOnInvalidEquationAny :: Constraint EvBuilder [Attribute] Source #
Generates a failure if some InvalidEquation attribute is present
failOnInvalidEquation :: Expr -> Expr -> Constraint EvBuilder [Attribute] Source #
Generates a failure if an InvalidEquation attribute with the two specified expression is present
failOnIncorrectDistribution :: Constraint EvBuilder [Attribute] Source #
Generates a failure if the IncorrectDistribution attribute or the NonMatchingParenthese attribute is present
failOnCommonMistake :: Constraint EvBuilder [Attribute] Source #
Generates a failure if the CommonMistake attribute is present
failOnUnequalRelationAny :: Constraint EvBuilder [Attribute] Source #
Generates a failure if the UnequalRelations attribute is present
failOnUnequalRelation :: Relation Expr -> Relation Expr -> Constraint EvBuilder [Attribute] Source #
Generates a failure if the UnequalRelations attribute with the two specified relations is present
failOnAtomMixedUpAny :: Constraint EvBuilder [Attribute] Source #
Generates a failure if the AtomMixedUp attribute is present
failOnAnyMistake :: Constraint EvBuilder [Attribute] Source #
Combines all the above mentioned failure functions
withoutFailure :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] Source #
Combines the given constraint with the constraint that there should be no failures
Evidence collecting
giveNodeAndCollect :: Verifiable b => Node b -> Constraint EvBuilder [Attribute] -> EvBuilder () Source #
Takes the given constraint, couples it to the node and stores the evidence.
giveNodeAndCollectAll :: Verifiable b => Node b -> [Constraint EvBuilder [Attribute]] -> EvBuilder () Source #
Useful when multiple constraints spread over multiple steps have to be verified. Takes the given constraints and couples them to the node. The evidence is true if ALL given results are successful. (= no unknwon results) The evidence is false if ANY known result is false. The evidence is unknown if all known results are succesful, but there are unknown results.
giveNodeAndCollectAllKnown :: Verifiable b => Node b -> [Constraint EvBuilder [Attribute]] -> EvBuilder () Source #
Useful when multiple constraints spread over multiple steps have to be verified. Takes the given constraints and couples them to the node. The evidence is true if ALL known results are successful. The evidence is false if ANY known result is false. The evidence is unknown if there are no known results.
giveNodeAndCollectDefault :: Verifiable b => Node b -> Constraint EvBuilder [Attribute] -> Expr -> Expr -> EvBuilder () Source #
Takes the given constraint, couples it to the node and stores the evidence. If the evidence is unknown then we assign a value to the given assessment variable