Using PHP/MySQL to create Algebra Equations

RavinDJ

Supreme [H]ardness
Joined
Apr 9, 2002
Messages
4,444
I wanted to create a little website for my students. I want the website to run on PHP/MySQL and be able to create random equations, such as:

2x+5=25
Solve for x

(2x+5)/10 + 1.5 = 4
Solve for x

x+1/x = 5x - 3
Solve for x

Is this even possible? Or should I just take the time and manually create 100 or 200 equations and have the website randomly select it from the MySQL database?

Thanks!!
 
Probably be easier to assign and call it from a database rather than get involved with naming a crazy amount of variables, no? Just randomly select them.
 
I think you would need to be more specific about what you're trying to do. Are you trying to make a simplified version of wolfram alpha?
 
No database required here, this is pretty trivial to do on the front end with Javascript
 
Is this even possible? Or should I just take the time and manually create 100 or 200 equations and select them from a MySQL database?
I argue you're better off w/the latter. Partly b/c I don't buy the random-question-generation bit. Defining the questions is more straightforward and gives you complete control over the questions presented (specifics, length, answers, difficulty level, etc.).

And it's not that the random question thing is terribly hard, but as you said:
I want to create a little website for my students.
... so do that first, the simplest and quickest way possible. B/c if you can't even get a simple v1 up and running, the random-question feature becomes irrelevant. Once you have a viable end-to-end solution, you'll be in a better position to work in the random-question-generator feature (if you're still convinced it's necessary).

Also consider if a solution already exists for this. Even if you have to pay $10-$50 a month, that should still be worth it in terms of time savings and the additional features a paid solution will likely provide (although I have no idea about external influences that may prohibit this, such as privacy policies or expectations the school or parents have w/3rd party apps).
 
Last edited:
Do it in Javascript. No need for PHP/SQL.
 
Do it in Javascript. No need for PHP/SQL.

Agreed!

The only downside is that depending on the implementation the clever students could look at the source code to determine the answer, but if they're at that point they probably already know the algebra :D
 
Back
Top