How to create the TeX source

Creating the File

Since these exercises are based on applets, we must use the type japs.problem.applet as document class:


Then follows the declaration of the required meta information:
  \name{My Exercise}
    a multiple choice problem
  \copyrightinfo{(c) by me}
    \component{applet}{<Reference to problem applet>}{applet}
  \corrector{<Reference to problem corrector>}
  \generic{<Reference to generic document>}
    13.02.2009 initial

The default applet and corrector names are:
  • MCDefaultProblemApplet
  • MCDefaultProblemCorrector
    The reference must point to a meta XML file inside the content tree of the Mumie installation.

Now comes the execute environment for the applet:


The applet's width and height must be at least equal to the required content's size in order to prevent scrollbars inside the applet.

The problem's "real" content is defined in a content environment, its title can be set via the title command. The hidden environment for the following content is required because nothing of the problem's data should be directly visible in the document:

\title{My Exercise}
    ... % <-- here comes the content!

Note: All following data declarations must be defined inside the hidden environment; their order inside the questions or even the whole problem is not important.

Adding Questions

A question is defined through its data below a common/problem/question_X path. Its answer type is set with a type element, which may be unique, multiple or yesno:


The question's task is set via the task element, which may contain TeX texts along with variables for displaying values inside the text:

\data{common/problem/question_1/task}{Select the equivalent(s): \$f\$=}

The question's calculations are based on a specific number field which is real per default but also may be integer, rational, complex or complex-rational. The number field is declared in a field element. We choose the real numbers, which are also the default, so the following declaration could be omitted:


The rendering precision can be changed via the precision element; its values must be whole numbers. We choose a precision of 2, which is also the default, so the following declaration could be omitted:


Defining Variables

We already used a variable called f but did not declare it yet. Variables are referenced in texts using a "%%$...$%%" statement with their identifier as content. Note that the "%%$%%" character must be quoted outside a mathematical environment in TeX! Their mathematical content is defined below a vars path inside a question (or even answer, see below). Their name is bound to their path. We distinguish two types of variables: functions and numbers.

A function's content is defined inside a content element and contains an algebraic expression containing other variables or constants. This expression can be written in or outside a mathematical environment, which affects the data format in the further processing (math mode uses MathML). Since the syntax without math mode is easier to write, we have:


It executes an action for the variables it contains. The default is replace which substitutes every contained variable with its value. Another possibility is the calculate action which substitutes the variables and calculates the expression. The calculation will give a number if every variable can be substituted and reduced to a number. We choose the replace action, which is also the default, so the following declaration could be omitted:


In general every leave in such an operation tree must be a (random) number. Unlike functions, they must always be declared inside a mathematical environment must not reside in a content element. Nevertheless numbers could also be treated as constant functions and may be defined therefore outside a mathematical environment (see variable y):


This creates the variables a, b and c inside the intervals [2,9], [-5,5]/{0}, [3,5] and the constants x and y with the value 2.

Other types of random numbers can be used, but observe that the question's number field must be changed if the two number fields are incompatible (e.g. a complex number inside a real calculation):
  • whole numbers: \ppdrandint[zero]{path}{min}{max}
  • real numbers: \ppdrandreal[zero]{path}{min}{max}
  • rational numbers: \ppdrandrat[zero]{path}{num_min}{num_max}{den_min}{den_max}
    Rational numbers are the only who have two entries to be defined (numerator and denominator). The zero flag indicates that the resulting number may be equal to zero (value z) or that it must be different to zero (value Z). The expression [z] is the default and can be omitted.

As we saw, variables can be defined for questions which we call global variable. But it is also possible to define them only for an answer, which we call then local variable. Observe that local variables overwrite global ones and that global variables may contain local ones.

Adding Answers

An answer is defined with data below a common/problem/question_X/choice_Y path. The text is set with an assertion element:

\data{common/problem/question_1/choice_3/assertion}{None of the answers above.}

The correct solution is set by the solution element. Its values may be true, false and compute. The later stands for an automaticaly evaluated solution defined by a relation. We use this type for a correction that tests two variables of equality:
[...] % same as for choice 1

Note that all variables must exist in order to solve the relation. On fixed solutions, the relation is useless.

Finally we set an explanation for an incorrect solution:

\data{common/problem/question_1/choice_1/explanation}{Note that ...}

Add picture from clipboard (Maximum size: 500 MB)