Limit functions allowed in student answers #188
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The original code of the Formulas question plugin only allowed the following functions to be used by students in the answer type "Numerical formula":
No functions accepting more than one argument could be used, e. g. atan2 was not allowed. Also, the function
logwas not allowed, in order to avoid ambiguity as to whether the student meant the natural or common logarithm.With the newer parser method, the list of possible functions has grown bigger. However, for the moment, it might be better to stay with the original functions plus some more, but to still disallow functions with more than one argument. The following functions can be used in the answer type "Numerical formula":
The intention behind that limitation is that once multi-argument functions are allowed, it cannot be taken back. However, having multi-argument functions means that the comma becomes a meaningful character in student responses and that will make it much more complicated to allow the use of the comma as a decimal point.
When allowing multi-argument functions, it might be necessary to force students to use the semi-colon as the argument separator, or to find other (better) solutions. Keeping those functions our for the moment leaves time to think that through.