# Geometry Problem Generator

**Update 1/22**: Added another Problem Generator link to the bottom of the post. Original post is below:

Short Version of this Post: Watch This Video of me using Geogebra & Javascript to make my life easier

Full Version of this Post:

So here’s something I found annoying as a geometry teacher: it’s a pain in the butt to create my own geometry problems that incorporate solving an algebra problem. Some examples:

The difficulty in generating these problems is:

- Any algebra expression you create usually has to involve positive variables or a positive evaluated result (since it wouldn’t make sense for x = 7, but when you plug it in, the length of AB = -4)
- The algebra expressions depend on each other (for example: if you have two parallel lines and one of the angles is 47, then any algebra problem students need to solve must end up being equal to 47)
- There usually aren’t enough of these types of problems in textbooks to make them worth your time, but they’re
**really valuable**for reinforcing algebra skills while also teaching geometry.

Right now I teach an intervention class for sophomores who are in geometry, so I would *love it* if I could find a ton of these problems because they let me talk about both geometry *and* algebra at the same time (which is great!)

Luckily for me, I created a Geogebra program that lets me generate as many of these as I want. It uses Javascript to randomly generate problems and put them on the screen, then I use Geogebra to make it look pretty and save it as a picture, which I can paste into a word document. With this, I can generate 20 problems in 20 minutes – pictures, algebra, and answers in all.

So – if you’re interested in how I do this, I made a video and put it on Youtube. All you need is a copy of Geogebra and to be somewhat familiar with how Geogebra works. You don’t really need to know any programming, if you want to make more complicated problems, you’ll want to play around with what I have below.

Here is the link to the video where I demonstrate how to make your own problems

Here is the link to the Geogebra Javascript code that you will need

Here is a link to a more sophisticated program using the features I talk about in the video

Here is a link to a program that will generate Similarity problems

I love it. I’ve tried to use the GeoGebra scripting language before, ran into trouble, and moved on. It helps me a lot to see what you can accomplish with it!

I also have done scripting in GeoGebra to create loads of problems. Thanks for sharing your code and workflow.

Check out https://numbas.mathcentre.ac.uk/. It lets you combine python / javascript / html to generate questions, which can even be combined into (online) tests. I only discovered it recently, and I’m not sure how well it would actually work for this particular problem (I don’t think it’d be possible to have text appear as labels on a diagram…). It uses a bit more programming knowledge (knowing python is useful, but the help and documentation is pretty good), and right now the user-base is pretty skewed towards higher math so the library of existing questions doesn’t have hardly anything for algebra or geometry.

Oh wow, I was weighing up whether to mention Numbas here and I see I’ve been beaten to it. Thanks, Andrew!

I’m the main developer of Numbas. It would be ideal for the kind of thing you’re doing. I’ve recently been doing some work on integrating JSXGraph diagrams into questions – it’s a geometry system like GeoGebra, but written entirely in javascript, so it’s a bit easier to do complicated things with.

Anyway, your GeoGebra thing is clever – I didn’t know it could use javascript. I’ll have to have another look at GeoGebra now…

Love this! Ate an hour of time I didn’t have this morning. Here’s my first implementation: http://www.geogebratube.org/material/show/id/71106 – before I saw your nicer one. (Read all the way to the bottom before trying? Novel idea…)

Have you played at all with passing geometric information to the javascript code? So it could use the actual length of a segment in the equations, for example.

John,

Yes I have. I’ve done it with angles more than with segments.

Let’s say you have a segment in Geogebra with the name ‘a’. If you want to use its length as part of the problem, you use these lines of code within the button:

var a = parseInt(ggbApplet.getValue(“a”));

generateProblemOneSide(“text1”, “text2”, “answerText”, “x”, a);

This site is a treasure-trove of ways to interact with Geogebra from within Javascript: http://wiki.geogebra.org/en/Reference:JavaScript

I liked the program you put on Geogebratube – nice use of checkboxes to show and hide the answers =)

Awesome stuff here. I’ve used an assessment creator called Examview and had to work out the variables and algorithms by hand to get the pictures to draw nicely. Using Geogebra should shortcut that significantly. Thanks for the information and sharing with everyone.

Awesome! It makes my head hurt a little, I’ll admit, but I so admire your programming chops!

Thank you. This is wonderful. I’m a novice at geogebra, but am willing and desiring to become accomplished, so I’m grateful for your video.