Doenet / DoenetML

Semantic markup for building interactive web activities
https://www.doenet.org/
GNU Affero General Public License v3.0
3 stars 16 forks source link

Content written against doenetML 0.6 causes low level error #29

Open jaltekruse opened 11 months ago

jaltekruse commented 11 months ago

This content was written against the version of DoenetML currently in production on the doenet.org site. Trying to render it with the tip of the DoenetML repo here, the in-progress 0.7 version gives the internal error "Cannot read properties of undefined (reading 'componentName')"

          <setup>
     <select name="slope">-4 -2 2 4</select>
     <select name="vertex_y">-4 -3 -2 -1 0 1 2 3 4</select>
 </setup>

 <p>Sketch the derivative of <m>y=<math>$slope/2*x^2+$vertex_y</math></m></p>

 <graph aspectRatio="1" xmin="-10" xmax='10' ymin='-10' ymax='10' grid>

     <function name='f' variables='x'>$slope/2*x^2+$vertex_y</function>

     <point name="p1" stylenumber="2" x="-1" y='3'>
         <constraints><attractToGrid /></constraints>
     </point>

     <point name="p2" stylenumber="2" x="0" y='3'>
         <constraints><attractToGrid /></constraints>
     </point>

     <point name="p3" stylenumber="2" x="1" y='3'>
         <constraints><attractToGrid /></constraints>
     </point>

     <parabola name="deriv" through="$p1 $p2 $p3" stylenumber="2"/>

 </graph>

 <answer>
     <award>
         <when>
 ($p1.y-$p2.y)/($p1.x-$p2.x) = $slope and 
 ($p1.y-$p2.y)/($p1.x-$p2.x)*$p1.x-$p1.y = 0 and 

 ($p1.y-$p3.y)/($p1.x-$p3.x) = $slope and 
 ($p1.y-$p3.y)/($p1.x-$p3.x)*$p1.x-$p1.y = 0 and 

 ($p3.y-$p2.y)/($p3.x-$p2.x) = $slope and 
 ($p3.y-$p2.y)/($p3.x-$p2.x)*$p2.x-$p2.y = 0 
         </when>
     </award>
 </answer>
dqnykamp commented 11 months ago

Here's something closer to a MWE that exhibits same flaw:

<select name="slope">1 2</select>

<answer>
  <award>
    <when>
      $slope = 2
    </when>
  </award>
</answer>