Problem/Motivation

In a future version of Mechanical Tutor, it should be possible to view old questions. This is not possible at the moment, since the question object takes care of building all the necessary variable itself.

Proposed resolution

Let the calling function collect the question variables, and pass these as a parameter to the relevant methods. Then other callers can fetch old question variables, and pass these instead.

Remaining tasks

Refactor the code.
Update the example questions.

User interface changes

API changes

  • The methods buildQuestion() and evaluateAnswer() will get an extra parameter, (array) $question_variables.
  • The questionVariablesGet() method will disappear alltogether, as will questionVariablesReset().

Comments

itangalo’s picture

Status: Active » Fixed

Fixed and committed.

Now all the fetching of question variables are initiated by the caller of the function, not the function itself.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.