Fraction Subtraction Puzzle: Random Questions with Auto-Checking

Fraction Subtraction Puzzle: Random Questions with Auto-Checking
Loading the math board and drawing, please wait…
2023-01-30 20:40
This example demonstrates an interactive “maze/level” practice for fraction subtraction: it randomly generates tasks and hint placements, lets students enter answers in the designated region, and then automatically checks correctness. The core mathematics is subtracting fractions, computed by separating numerator and denominator logic to produce an expected solution fraction that can be compared t

GeoGebra Commands & Parameters

  1. Shuffle(1…10) → randomNumbers, {5, 3, 10, 2, 1, 4, 9, 8, 7, 6}
  2. Element(randomNumbers, Mod[questionCount, Length[randomNumbers]] + 1) → randomNumber
  3. Element(Element[allSolutionsSplitted, randomNumber], 2) → expectedSolutionZaehler
  4. Element(Element[allSolutionsSplitted, randomNumber], 3) → expectedSolutionNenner
  5. Element(Element[allSolutionsSplitted, randomNumber], 1) → expectedSolutionGanze
  6. If(Defined[expectedSolutionGanze], expectedSolutionGanze + expectedSolutionZaehler / expectedSolutionNenner, expectedSolutionZaehler / expectedSolutionNenner) → expectedSolutionValue
  7. Flatten({labyrinthW01, labyrinthW02, labyrinthW03, labyrinthW04}) → labyrinthWaagrecht
  8. Flatten({labyrinthS01, labyrinthS02, labyrinthS03, labyrinthS04}) → labyrinthSenkrecht
  9. Flatten({labyrinthSenkrecht, labyrinthWaagrecht}) → labyrinth
  10. Length(randomNumbers) → numberOfQuestions
  11. Sequence(Polygon[Element[questionsPositions, i], Element[questionsPositions, i] + sizeWaagrecht, Element[questionsPositions, i] + sizeWaagrecht + sizeSenkrecht, Element[questionsPositions, i] + sizeSenkrecht], i, 1, Length[questionsPositions]) → questionsRectangles
  12. IsInRegion(A, Element[questionsRectangles, actualQuestionNeeded]) → showQuestion
  13. Textfield(studentAnswer01) → inputBox01
  14. Textfield(studentAnswer02) → inputBox02
  15. Textfield(studentAnswer03) → inputBox03
  16. Text("\textsf{" + (Element[allTasks, randomNumber]) + "}", txtTaskPosition, true, true, -1, 0) → txtTask
  17. If((¬needGanze) ∧ needBruch, 0, 1) → startPositionBruchXValue
  18. Text("\textsf{" + (Element[allQuestions, randomNumber]) + "}", txtQuestionPos, true, true, -1, 0) → Text1
  19. Numerator(studentAnswer02 / studentAnswer03) → studentAnswer02gekurzt
  20. Denominator(studentAnswer02 / studentAnswer03) → studentAnswer03gekurzt
  21. Text(Text9, B, false, true, 0, 0) → Text10
  22. Segment(C, D) → f
  23. Segment(E, I) → g
  24. Segment(G, H) → h