title: how to add dynamic math to webpage
body: <p>I'm a math teacher wanting to insert some dynamic math into a website. What I'd like to achieve is to have a button that a student can press to randomly vary a question so that it's the same type of question, but with different numbers. For example,</p>
  
  <p>Factor the quadratic expression of the form ax^2 + bx + c, where a = 1, and b and c are positive integers between 1 and 100, and such that the roots would be real whole numbers.</p>
  
  <p>If I'm using MathML to encode the math (e.g., like the markup below), stored in a database (e.g., MySQL), how could I set things up so that the computer automatically and randomly varies the math expression in the way I described above? I don't know much about server-side scripting... could I achieve this with PHP? Or would this be more a job of JavaScript on the client side? I'm just looking for some advice to guide my choice of study path.
  Thank you</p>
  
  <pre><code>&lt;math xmlns='http://www.w3.org/1998/Math/MathML'&gt;
   &lt;mrow&gt;
    &lt;msup&gt;
     &lt;mi&gt;x&lt;/mi&gt;
     &lt;mn&gt;2&lt;/mn&gt;
    &lt;/msup&gt;
    &lt;mo&gt;+&lt;/mo&gt;
    &lt;mrow&gt;
     &lt;mn&gt;7&lt;/mn&gt;
     &lt;mo&gt;&amp;#8290;&lt;/mo&gt;
     &lt;mi&gt;x&lt;/mi&gt;
    &lt;/mrow&gt;
    &lt;mo&gt;+&lt;/mo&gt;
    &lt;mn&gt;12&lt;/mn&gt;
   &lt;/mrow&gt;
  &lt;/math&gt;
  </code></pre>