Closed BillFoster closed 11 years ago
This is yet another shonky type-system problem. It will need some thinking.
Lazy evaluation and weak type-analysis don't mix. This will keep popping up until I rewrite the JME system in the Summer.
I still have the same problems.
I have put the code of an attempt to use subarrays (only the variables part of the code) here git://gist.github.com/1892601.git
No problem about accepting the variable factmess It is the variable valmess:"if(si[2][0]=0, etc"
If not equal to 0 then fine, if equal to 0 then the following error:
TypeError: Cannot use ‘in’ operator to search for ‘0’ in 0 at [object Object].evaluate (file:///D:/Numbas/output/q4home/scripts/jme.js:1491:19) at Object.evaluate (file:///D:/Numbas/output/q4home/scripts/jme.js:460:18) at Object.texsubvars (file:///D:/Numbas/output/q4home/scripts/jme.js:725:17) at Object.contentsubvars (file:///D:/Numbas/output/q4home/scripts/jme.js:642:16) at Object.evaluate (file:///D:/Numbas/output/q4home/scripts/jme.js:450:27) at [object Object].evaluate (file:///D:/Numbas/output/q4home/scripts/jme.js:1400:15) at Object.evaluate (file:///D:/Numbas/output/q4home/scripts/jme.js:460:18) at compute (file:///D:/Numbas/output/q4home/scripts/jme-variables.js:171:26) at Object.makeVariables (file:///D:/Numbas/output/q4home/scripts/jme-variables.js:176:4) at file:///D:/Numbas/output/q4home/scripts/question.js:59:39
Forget the last comment - found an obvious error in the code
Not working properly.
Easiest example is
{abs([ 1, [ 2 , 3 ] ] [ 1 ] )} gives NaN
I have pulled in the last fix on null arrays
More complicated examples can be given - but this is typical.