## Question algorithm parametersWIRIS quizzes admits the possibility to add parameters to question algorithms. This may be useful if we want to do several questions about the same mathematical expression, if we want to chain some questions (in the sense that some output from a question is used in the algorithm of the following one) or other uses. It is also useful to translate strings in the algorithm and therefore have a multilanguage question. This feature is available through the WIRIS quizzes generic integration library. Therefore the author will be able to use this feature only if the platform integration provides a way to do it. And the way it must be used will heavily depend on the integration. Parameters must be defined in algorithms using the keyword parameter. For example: Then, once instantiated the question, the platform integration may use the API function QuestionInstance.setParameter to overwrite the values of the parameters. The integration needs to manage where to store and find the actual parameter values for each question instance. Following the same example, we could have the code in the platform integration:
When the algorithm evaluates, the values of the parameters defined in the algorithm will be overriden by the values specified by the integration. If some parameters are not specified, the values deined in the algorithm will be used. |