To take the quizzes, you must log in.

*Username:***student***Password:***Formulas.1**You can view this site in

the language of your choice.

- Character string answer
### Character string answer

## Character string answer

The Formulas question was not designed to accept answers that consist of words or phrases. However, it is possible to use the algebraic formula answer as a workaround to do so.

Note that when word or phrase answers are required, it is generally easier to use Moodle's core Short-Answer question or Embedded answers (Cloze) question.

The point here is that questions requiring words or phrares as answer can be made with the

**Formulas**question.Here are key points to remember:

- The algebraic formula answer is a string of characters.
- Words of the desired answer can be represented by variables of the algebraic formula.
- The multiplication of variables is denoted by a space.

The following examples illustrate how to do it.

### Example

This example illustrates how to accept an answer that consists of words.

General Question name! Highest mountain on the Moon Variables Global variables a=1; b=302741; Mons=a; Mount=a; Huygens=b; Main question Question text! String of characters answer {#1} Part 1 Part's mark* 1 Answer type Algebraic formula Answer* "a*b" Grading criteria* Absolute error == 0 Placeholder name #1 Part's text What is the name of the highest mountain on the Moon? {_0}

Valid answers are Mons Huygens, Mount Huygens and Huygens, as well as a*b, a b, b, 302741 and any formula that evaluates to a*b, b, or 302741.

The value 302741 is simply a random value unlikely to be given as an answer. a and b are defined such that a*b = b in order to accept a b (i.e. Mons Huygens or Mount Huygens) and b (i.e. Huygens) as valid answers.

The answers a b and b can be prevented by replacing a by say a302741 and b by b302741 (as it is done in the xml file).

The Formulas question should look like this:

### Example

This example illustrates how a

**fill in the blanks**question can be done.General Question name! Did you do that? (all or nothing) Variables Global variables a=302741; b=302741; Did=a; do=b; Main question Question text! Fill in the blanks in the following sentence: [Did] you [do] that? Both answers must be correct in order to get a point: {#1} Part 1 Part's mark* 1 Answer type Algebraic formula Answer* ["a","b"] Grading criteria* Absolute error == 0 Placeholder name #1 Part's text {_0} you {_1} that?

Since both answers are in the same Part, both answers must be correct for the student to get a point.

The Formulas question should look like this:

### Example

This example is the same as the previous one, except that each answer is worth half a point.

General Question name! Did you do that? (half a point for each answer) Variables Global variables a=302741; b=302741; Did=a; do=b; Main question Question text! Fill in the blanks in the following sentence: [Did] you [do] that? Each correct answer is worth half a point: <div><span style="display:inline-block;">{#1}</span> you <span style="display:inline-block;">{#2}</span> that?</div> Part 1 Part's mark* 0.5 Answer type Algebraic formula Answer* "a" Grading criteria* Absolute error == 0 Placeholder name #1 Part's text {_0} Part 2 Part's mark* 0.5 Answer type Algebraic formula Answer* "b" Grading criteria* Absolute error == 0 Placeholder name #2 Part's text {_0}

Each correct answer is worth 0.5 point because each answer is in separate Part with the Part's mark set to 0.5 point.

In the Question text, the HTML code <span style="display:inline-block;"></span> is used to force the answer boxes to be displayed on the same line as the rest of the sentence.

The Formulas question should look like this: