CodeRunner Documentation (V3.1.0)
7.1 The Twig QUESTION variable
The template variable
QUESTION is an object containing all the fields of the
PHP question object. Some of the other
QUESTION fields/attributes that might be of interest to authors include the
QUESTION.questionidThe unique internal ID of this question.
QUESTION.questiontextThe question text itself
QUESTION.answerThe supplied sample answer (null if not explicitly set).
QUESTION.languageThe language being used to run the question in the sandbox, e.g. "Python3".
QUESTION.useace'1'/'0' if the ace editor is/is not in use.
QUESTION.sandboxThe sandbox being used, e.g. "jobesandbox".
QUESTION.graderThe PHP grader class being used, e.g. "EqualityGrader".
QUESTION.cputimelimitsecsThe allowed CPU time (null unless explicitly set).
QUESTION.memlimitmbThe allowed memory in MB (null unless explicitly set).
QUESTION.sandboxparamsThe JSON string used to specify the sandbox parameters in the question authoring form (null unless explicitly set).
QUESTION.templateparamsThe JSON string used to specify the template parameters in the question authoring form. (Normally the question author will not use this but will instead access the specific parameters as in the previous section).
QUESTION.resultcolumnsThe JSON string used in the question authoring form to select which columns to display, and how to display them (null unless explicitly set).
Most of these are effectively read only - assigning a new value within the
template to the
cputimelimitsecs attribute does not alter the actual run time;
the assignment statement is being executed in the sandbox after all resource
limits have been set. The question author can however directly alter all
the above question attributes directly in the question authoring form.