In this challenge we have created a client-side script using HTML, CSS and JavaScript to help a Maths teacher create homework worksheets for their class.
Our HTML page uses a web form, for the teacher to select various options based on the Maths skills they want to cover and the desired level of difficulty.
The JavaScript code attached to the “Create Worksheet” button is retrieving the user inputs from the various drop down lists. It then uses these to generate list of arithmetic equations and display these on the HTML page.
HTML, CSS & JavaScript Code
See the Pen Maths Homework Generator by 101 Computing (@101Computing) on CodePen.
Your Task
Reverse engineer this JavaScript code to understand how it works. For instance can you identify:
- The purpose of the getDropDownListValue() function defined on lines 1 to 4?
- The purpose of lines 7 to 49?
- The purpose of the switch case on lines 12 to 33?
- The purpose of the for loop on line 37?
- The purpose of lines 38, 39 and 40?
- The purpose of line 42?
- The purpose of line 44?
Challenge #1: 2 or 3 operands per equation?
Now that you understand how this code works, complete it in order for the Maths teacher to be able to chose the number of operands per equations. For instance, if the Maths teacher chooses two operands it will generate equations such as “2+7”. If the teacher chooses three operands, an example of equation could be “2+4-7”.
Challenge #2: Find the missing operand
Change the code to generate equations with a missing operand. For instance: “2 + ??? = 9”
Challenge #3: Linear Equations
Change the code to generate linear equations. For instance: “3x + 2 = 11”
Challenge #4: Quadratic Equations
Change the code to generate quadratic equations. For instance: “4x2 + 5x + 2 = 0″
Prolog is a language built around the Logical Paradigm: a declarative approach to problem-solving.

Othello (a.k.a. Reversi) is a strategy board game for two players, played on an 8Ă—8 board. There are sixty-four identical game pieces called discs which are white on one side and black on the other. Players take turns placing discs on the board with their assigned color facing up. During a play, any discs of the opponent’s color that are in a straight line and bounded by the disc just placed and another disk of the current player’s color are turned over to the current player’s color.
Moroccan mosaic, aka Zellige (الزليج‎‎), is a form of Islamic art and one of the main characteristics of Moroccan architecture. It consists of geometrically patterned mosaics, used to ornament walls, ceilings, fountains, floors, pools and tables. Each mosaic is a tilework made from individually chiseled geometric tiles set into a plaster base.





In this challenge we are going to create a cat’s age convertor find out how old a cat is in “human years”. This is very useful to understand more about cats and the care they need and to find out at what stage of life a cat is.
“Guess how many sweets are in the jar” is a fundraising game. A large see-through jar is filled with a carefully counted number of sweets. People then try to guess how many sweets are in the jar. Each contestant has to donate a small amount of money to have a go. Guesses are recorded (name + guess). At the end of the game, the nearest guesser wins the content of the jar.
In mathematics, one of the most interesting number patterns is Pascal’s Triangle. It is named after Blaise Pascal (1623 – 1662), a famous French Mathematician and Philosopher.


