Maths Homework Generator
October 10, 2017

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
JS
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β³
Reference : https://www.101computing.net/maths-homework-generator/
Last updated
Was this helpful?