Follow Algorithm Editor syntax rules

Variables and functions that are entered into the Algorithm Editor to generate algorithmic questions must follow specific syntax rules to be properly interpreted by Möbius.

Syntax rules for variables

Naming

Variables must first be defined for the function to be able to display randomly-generated values in the algorithmic question.

The naming of your variable must follow these rules:

  • Must be of the form $name.

  • String name can consist of letters (a-z and A-Z), numbers (0-9), and the underscore character (_).

  • First character of the name must be an alphabetic character (a-z or A-Z).

  • The variable e shouldn't be assigned as a global variable in Maple code (it can be used, however, as a local variable).

Structure

The use of the dollar sign character ($) is reserved for introducing an algorithmic variable.

Variables can be:

  • Fixed strings (Example — $a="triangle";)

  • Fixed numbers (Example — $a=5;)

  • Other variables (Example — $a=$m;)

  • Mathematical expressions (Example — $a=x^2-3*x+4;)

  • Functions (Example — $a=sig(3, 20.8571);)

Usage

You can define as many variables as needed to author your perfect algorithmic question.

The defined algorithmic variable can then be inserted into question text.

You can enter your defined variable(s) in other areas associated with question authoring beyond the question text, such as:

  • Feedback

  • Hints

  • Answer regions

Syntax rules for functions

Naming

Check out Available functions for algorithmic questions for a comprehensive list of the available functions that can be used for generating algorithmic questions.

Structure

The general structure for an algorithmic command with a function in the Algorithm Editor consists of:

  • Dollar sign ($) — Character used to introduce the algorithmic variable in the command line.

  • Variable name — Character(s) used to name the algorithmic variable.

  • Function — Algorithmic function name.

  • Placeholder — Placeholder(s) that represent the number(s) or string that you want to use for your algorithmic question, acted upon by the function.

  • Semicolon (;) — Character to be used at the end of every algorithmic command.

  • Equal sign (=) — Character to separate the algorithmic variable from the function.

Usage

You can enter as many command lines (consisting of variables and functions) as needed to author your perfect algorithmic question.