• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FormulasQuestion / moodle-qtype_formulas / 13615610519 / 7
98%
main: 98%

Build:
DEFAULT BRANCH: main
Ran 02 Mar 2025 01:11PM UTC
Files 22
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Mar 2025 12:52PM UTC coverage: 93.899% (-0.008%) from 93.907%
13615610519.7

push

github

web-flow
better handling of vars vs. functions in student responses (#165)

If a student wrote 'sin 30', the parser used to interpret 'sin' as the sine function. This was done in order to have a syntax error (because of the missing parens) and thus allow the student to correct their mistake. The downside was that in '3 min' the 'min' would also be read as function, making it impossible to have minutes as units. (That could have been solved, because min is not among the functions a student may use. But the problem would have remained the same for "strange" units that someone might want to define for whatever reason, e. g. a unit 'exp' that would have been possible in versions 5.x and earlier. And who knows, maybe we will someday add a new function that could clash with a more common unit name.)

Now, we consider sin or min as variables, because they are not followed by parens. As students are not allowed to use variables in numerical answer types (number, numeric, numerical formula), this will still lead to a warning for the student while allowing for correct splitting even for units that are named after functions. So we lose no functionality, but have better separation.

For algebraic formulas, however, there would now be no error anymore, because students are allowed to use variables, so 'sin*30' would be syntactically valid. Therefore, the PR adds some code to disallow variables named like existing functions in student answers. This is still backwards compatible, because in older versions, function names were reserved and not available for variables at all, even for the teacher. Also, it does not interfere with the unit splitting, because there is no combined answer field for the answer type algebraic formula.

3663 of 3901 relevant lines covered (93.9%)

68.55 hits per line

Source Files on job 13615610519.7
  • Tree
  • List 22
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 13615610519
  • 99d438ef on github
  • Prev Job for on main (#13332863908.8)
  • Next Job for on main (#13805288875.4)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc