Skip to content

Conversation

@PhilippImhof
Copy link
Collaborator

The original code of the Formulas question plugin only allowed the following functions to be used by students in the answer type "Numerical formula":

abs, acos, asin, atan, ceil, cos, exp, fact, floor, ln, log10, sin, sqrt, tan

No functions accepting more than one argument could be used, e. g. atan2 was not allowed. Also, the function log was 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":

abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, exp, fact, floor, ln, log, log10, ncr, npr, sin, sinh, sqrt, tan, tanh

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.

@PhilippImhof
Copy link
Collaborator Author

As log is no longer (or still not) allowed, we add lg as a synonym for log10, because it is frequently used in certain countries and it is an official notation according to ISO 80000-2.

@coveralls
Copy link

coveralls commented Apr 20, 2025

Pull Request Test Coverage Report for Build 14559089128

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 95.81%

Totals Coverage Status
Change from base Build 14533404972: 0.003%
Covered Lines: 3773
Relevant Lines: 3938

💛 - Coveralls

@PhilippImhof PhilippImhof merged commit a4c6290 into FormulasQuestion:main Apr 20, 2025
46 checks passed
@PhilippImhof PhilippImhof deleted the restrict-student-func branch April 20, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants