UI - Formula questions with multiple declarations

Closes CNVS-10740.

A fix for variables that are declared more than once were not showing up
correctly because the code was using indices to reference the variables
(expecting them to be unique) when they may not be.

TEST PLAN
---- ----

  - create a quiz, add a formula/calculated question
  - fill it in with something like: [a][a][c]
  - set a custom min/max range for each variable
  - generate solutions, save the question, and save the quiz
  - re-edit the quiz, and then the question, and:
    - verify that the min/max ranges (and all values) of all variables
      are intact

Change-Id: I7266d36852a7794b69419b755776bd54c2a9e8c4
Reviewed-on: https://gerrit.instructure.com/29568
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>