Explore the community Forums Lectora Lectora Questions & Answers Trigger Lectora event from JavaScript Reply To: Trigger Lectora event from JavaScript

#398448 Score: 0
Profile photo of Zachary Liquorman
Zachary Liquorman
Member
beginner
intermediate
friend finder
profile
curious george
wise owl
contributor
picture perfect
8 pts
@zliquorman1276

We need to track completions of a third-party survey from within our LMS. (Don’t ask.)

Oh god. I feel your pain, I need to track survey completion data from a survey I created that will be hosted on a third-party’s LMS…

To your question, this sounds less like triggering the Lectora event than it is triggering the LMS’s completion event. Are you publishing your title as a SCORM package to be hosted on your LMS? If that’s the case, then this is simple and you just need to trigger the specific event for that SCORM version. I’ve had to do this before as well.

See this SCORM run-time reference: https://scorm.com/scorm-explained/technical-scorm/run-time/run-time-reference/

If it’s a SCORM 1.2 package, you need to trigger the cmi.core.lesson_status event, which you can do manually via Javascript directly, or by using the pre-defined variable in Lectora (and creating some event/action trigger to fire which then sets the variable = “completed” or one of the other valid statuses listed in the run-time reference).

In my case when I did this, I had the user click a button to “submit survey and test results” which then triggered the submission of those relevant variables, and then set the completion status (assuming they passed the assessment) before taking them to a pass (or fail) page with a button to exit or retake the assessment if they failed.

What you can do is: After the survey has been submitted and the HTML object is hidden revealing the “You are done!” message, modify that message. Have it tell the user something like “click here to complete the submission”, and have a button for the user to click, and tie a Lectora action to that click event to trigger the above completion status event.