Description The following types of questions are supported:
- Text: a text question with a free format answer.
- Choice: a multiple choice question.
- Type: question about the type of a Rascal expression.
- Value: question about the value of a Rascal expression.
Text gives the question text and lists all possible good answers.
Choice is a straightforward listing of good and bad answers.
Type and
Value questions are based on a template that consists of an optional
listing and an
equality:
There should be exactly one
hole (indicated by
<?>
) in this template that is to be filled in by the student; it may occur in the listing
or in one of the sides of the equality. The general structure is therefore:
fill in the hole such that the equality holds.
Given that the listing is optional, this template represents 5 different question styles.
Type and
Value questions use
TypeDescriptors to describe desired values and share certain common steps (
QSteps
):
-
prep: RascalCommand
describes preparatory steps needed to execute the question. Typically, required imports can be listed here.
-
make: Var = TypeDescriptor
: makes a new value generated according to TypeDescriptor
and assigns it to a new variable Var
. Var
can be used in later steps in the same question.
-
expr: Var = Expr
: introduces a new variable Var
and assigns to it the result of evaluating Expr
. Expr
may contain references to previously introduced variables using <Var>
.
-
type: TypeDescriptor
-
hint: Text
: a hint to be given to the student in response to a wrong answer. Text
may contain references to previously introduced variables.
-
test: Expr1 == Expr2
: the equality that should hold. The expressions may contain references to variables. One side may contain a hole (<?>
).
-
list: Text
: a listing that runs until the next question or the end of the concept. It may contain a hole.