Comments (4)
I looked into this a little. The upToConstant
checker option inserts an adaptive parameter. So the real issue is whether adaptive parameters handle complex numbers, and according to this comment, they don't:
Line 190 in 9cefdf9
I didn't keep thinking about it more though. Maybe they can be elevated to support complex contexts.
I'm not sure what your immediate needs are, but a custom checker could take the student answer and subtract 2xy
, then see if both derivatives (wrt x, y) agree with the zero function. Not as nice as with upToConstant
, and also might come with more gotchas. But it's what I would do.
from pg.
As it turns out, I realized after submitting the bug report that I didn't actually need it right now. But it is still surprising that upToConstant
doesn't allow complex constants.
from pg.
As Alex points out, the upToConstant
option currently uses adaptive parameters to handle the constant, and those are limited to real numbers. I've never been all that happy with the adaptive parameter setup, but that's how the original WeBWorK answer checkers worked before MathObjects, and when I developed MathObjects, I included the options available in the legacy answer checkers. The FormulaUpToConstant
object was intended to be the better way to do this using MathObjects.
Unfortunately, FormulaUpToConstant
also uses adaptive parameters, so has the same limitation. I have written a new version of parserFormulaUpToConstant.pl
, attached below as parserFormulaUpToConstant2.pl
, that uses a different method to compare the formulas. This works for complex as well as real-valued formulas, and works with multi-variable formulas, and even vector-valued formulas as well. There are some caveats, so do look at the POD documentation for details.
Note that the traditional FormulaUpToConstant
object requires the student to explicitly give a +C
(or whatever constant they choose), whereas the upToConstant
option does not. This new FormulaUpToConstant()
allows you to set a requireConstant => 0
on the cmp()
method (or in the context flags) that determines whether the student must include +C
or not (it is always allowed, but may or may not be required). So this can be used in the situation you had for upToConstant
if you don't want to force the +C
in the student answer.
parserFormulaUpToConstant2.pl.zip
from pg.
Related Issues (20)
- Bug when a matrix Math Object is reused as an answer HOT 10
- PGML.pl has lines that should have been removed. HOT 1
- checkboxlist within a RadioMultiAnswer HOT 4
- keyboard issue with GraphTool HOT 8
- inconsistency in multiple choice macros HOT 4
- run-perltidy deletes .bak files
- Error answers now are escaped when they shouldn't be. HOT 1
- Cropping from pgfplots is not always working for final SVG output HOT 13
- variables declared with `my` lead to errors HOT 1
- student answers get spaces normalized
- iframeResizer, feedback popover, and mqeditor HOT 16
- Updating AnswerFormatHelp.pl HOT 5
- Viewing all correct answers at the same time HOT 4
- PTX "image" tag getting changed to "img" HOT 5
- error with brace and x HOT 9
- PG editor not decoding as expecting HOT 1
- macros/graph/PGnauGraphics.pl doesn't use unique name, which can break tests. HOT 1
- CheckboxList reveals the correct answers HOT 3
- MathQuill toolbar placement in a relatively positioned parent - bug when in an RTL course. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pg.