-
MathType
-
WirisQuizzes
-
LearningLemur
-
CalcMe
-
MathPlayer
-
Store FAQ
-
VPAT for the electronic documentation
-
MathFlow
-
BF FAQ
-
Miscellaneous
-
Wiris Integrations
Understanding Advanced Logic in LearningLemur
Reading time: 2minAdvanced Logic in LearningLemur allows you to generate dynamic mathematical questions using controlled randomization, conditional rules, loops, and custom functions. It enables teachers to create robust, reusable question templates that automatically produce multiple valid variations while preserving pedagogical intent.
What It Is
Advanced Logic is the rule-based engine that powers dynamic question generation in LearningLemur. Instead of manually writing each question variation, you define:
- Variables
- Mathematical relationships
- Conditions
- Constraints
The system then automatically generates consistent, mathematically valid problem instances. Advanced Logic is conceptually similar to using a lightweight programming language inside your question. It supports:
- Random value generation
- Conditional statements
- Loops
- Mathematical functions
- Vector and matrix operations
- Custom function definitions
It is designed specifically for educational use, not general-purpose programming.
Why It Matters
Without Advanced Logic, teachers would need to:
- Manually create multiple versions of the same exercise
- Risk inconsistent difficulty between variations
- Lose control over edge cases (e.g., irrational roots, invalid fractions, non-unique systems)
Advanced Logic solves these problems by allowing you to:
- Control mathematical properties (e.g., "solutions must be integers")
- Avoid undesired outcomes (e.g., zero denominators, non-square discriminants)
- Guarantee pedagogical constraints
- Scale a single question into unlimited variants
This increases question quality, reduces repetition, and improves assessment fairness.
How It Works
Advanced Logic executes in stages when a question is generated.
Stage 1: Variable Initialization
The system evaluates all variable definitions in the algorithm section. Example conceptual actions:
- Generate random numbers
- Define sets
- Initialize matrices or vectors
All variables are computed before the question is rendered.
Stage 2: Constraint Enforcement
If your logic includes loops or conditions, the system ensures that mathematical constraints are satisfied. Common mechanisms include:
-
whileloops -
repeat…untilloops - Logical conditions (
&&,||)
If a condition is not met, the system regenerates values until the constraint is satisfied. This is how you guarantee properties such as:
- Coprime numbers
- Perfect square discriminants
- Non-zero determinants
Stage 3: Derived Calculations
Once valid variables are established, dependent values are computed. Examples:
- Computing solutions
- Building matrices
- Calculating right-hand side vectors
These derived variables are typically used for grading or answer validation.
Stage 4: Rendering and Grading
After all logic is evaluated:
- The question statement is rendered using computed variables
- Student responses are compared against the defined solution logic
- Grading rules are applied
The logic is executed on the server and is not visible to students.
Key Rules or Behaviours
- Logic is executed before the question is displayed
- All constraints must terminate — infinite loops will prevent question generation
- Variables defined later in the algorithm can depend on earlier ones
- Zero exclusion syntax (e.g.,
/[0]) prevents invalid mathematical cases - Deterministic logic produces reproducible results per attempt
Examples
Example 1: Controlled Random Fractions
You generate two fractions but enforce coprime numerator/denominator pairs. Result: Fractions are always irreducible.
Example 2: Guaranteed Integer Solutions
You first define a solution vector and then compute the coefficients backward. Result: The generated system always has the intended solution.
Common Misunderstandings
Misconception: Advanced Logic is programming
Clarification: It uses programming-like syntax, but its purpose is mathematical control, not software development.
Misconception: Random automatically means unpredictable
Clarification: Random values can be fully controlled through constraints and validation loops.
Misconception: Loops are risky
Clarification: Loops are safe when intervals are properly designed, and termination conditions are guaranteed.