Javascript to check if student answers a question correctly

cpliu Community Member Posts: 237
I'm trying to use Javascript to do the same thing as Lectora's action that checks if a question variable is correct. I know you can pass the value/string of a question variable to Javascript and then compare the string to see if it's correct, but that would require manual editing for each new cours.

The reason I would like to do answer judging is that I have custom quiz that the quiz question would go to different questions based on whether a person answers a question correctly. The answer judging would be used for custom scoring. I can do these in actions but the actions lose links to question variables when we copy and paste questions from a different file (generated with script).

It would save a lot of relinking if I can tap in Lectora's internal function to check if the user answer is correct with Javascript.




  • wheels
    wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 599 eLearning ROCKSTAR Admin Team
    What exactly loses variable references? If it is part of an action target or condition then please open a support ticket.

    You might try saving as a library object, then you can import the library object into other courses. Either way please let support know you are having an issue with losing references.