Pulling a variable from a webpage/hiding web window

Let me start off by saying I don't use Lectora/CourseMill to capture survey information, I use SurveyMonkey. I realize using Lectora's built-in survey tools would solve this problem, but that's not what I'm necessarily after.


I need to have users access and complete a survey (in SurveyMonkey) before accessing the final page in a course. The problem is, I need a way to pass a variable from the external wepage to Lectora. So, I embed a SurveyMonkey survey in Lectora, the student completes it, and then allows them to advance to the last page.


Currently, I just have SurveyMonkey open in a new window on top of the course (clicking a button opens the survey in a new window and navigates the user to the last page), but that doesn't 100% ensure the student takes the survey - they could just as easily close the window and continue on in the course.


Thoughts?

Discussion (2)

Or... protect your Next button with a password (easy to build with conditional Lectora actions) and show that password in the custom "Thank you!" message at the end of the survey.

A few ideas:


1. Use an onTimer action that executes JavaScript that accesses the iframe and checks for the line "Thank you for completing our survey!". If that line isn't there, the survey hasn't been completed. If that line is there, the survey has been completed and you can show the Next button.


2. In SurveyMonkey, you can redirect users to a certain webpage after they complete the survey. So redirect them to a page that will execute JavaScript code "parent.doSomething()" that will show the Next button. You can even execute "parent.TrivNextPage()" to immediately jump to the next page in your title.


The only problem, modern browsers do not allow iframes from different domains (in your case, SurveyMonkey and your LMS) to communicate with each other, so this will not always work. So you will have to try this:

1. Place the completion redirect page on the same domain as your course.

2. Use location hashtags to communicate (see this: http://stackoverflow.com/questions/4324108/unsafe-javascript-attempt-to-access-frame-with-url)

3. Try http://easyxdm.net/wp/

Discussions have been disabled for this post