Setting Lectora variables from an external HTML page

 Ben:

Actually is pretty simple - I like using the iframe approach - the only issue is that you have to "own" the content in the iframe that is being accessed so that communication can occur with the parent lectora file - otherwise cross domain issues negate communication.

That being said: You have to init the variable that you want to address on the root of the page itself that holds the iframe - in other words on Show action Modify Variable target yourvariableNAME value VAR(yourvariableNAME)

This makes sure that the variable is actually available to address by the iframe content.

From the iframe content you have to use a javascript function to tell the parent (Lectora file) what value to set the Lectora variable to: parent.Varvariable.value = 'whatever'.You might have to use the lectora syntax to set the value of the variable like this: parent.Varvariable.set(value). One or the other will work.

Peter

benpitman said:

Does anyone know how to set Lectora variables from an external HTML (non-Lectora) page? I am trying to get test scores created in an external testing system (HTML) passed back to Lectora. I have tried using the Varvariable.set(___) but no success. I have tried accessing the page via an i-frame and as a GoTo Web address in a separate window.

 

Discussions have been disabled for this post