Forum Discussion

sofiaabdelkafi's avatar
sofiaabdelkafi
Community Member
2 years ago

Javascript maths

Hello there, 

I have a .story file that has a few slides that include maths. User has to enter data and a formula calculates  a result with javascript. 

This file works well when uploaded to an lms as a stand alone. 
But when i include these stories to another scene and then republish. The calculations do not work anymore in the LMS. 

Also, if i maintain the file as a stand alone but i edit font and colors. Same, then when republished and uploaded to an lms, it doesnt work anymore.


Thanks for letting me know what to do and why does it  do this, 

thanks, 
Sofia.  

 

  • So the same story has now been uploaded to storyline within an existing project as a scene and then published. The calculation doesnt work. 

    So basically the calculation only works when i upload to storyline as a new project not within an existing scene or even project. 

     

    • Jürgen_Schoene_'s avatar
      Jürgen_Schoene_
      Community Member

      if you copy a slide with input text from one course to another, the variable names can change (if there is a conflict)

      this seems to be happend with

      • TextEntry1
      • TextEntry2
      • TextEntry3
      • TextEntry4

      now the result of the Javascript is not written into the correct variable (of the text entry field)

      check for all 4 slides

      that the variable in Javascript matches to the vaiable in the text entry field