Everyone,
We are currently using Moodle 2.6.5+ and Articulate Studio 13 (Update 5) to publish SCORM content. In some of this content I have embedded javascript as Articulate web objects to capture the students email address.
Basically, the student starts the SCORM presentation, the first slide asks them to enter their email address, the email address is used as an identifier in subsequent slides.
I would like to know if there is a way to capture the students email address from Moodle so they don't have to enter it. Is there anyone out there doing this currently? If so would you be willing to share your code?
Here is the current javascript code I use to have the student enter their email address.
<script type="text/javascript">
function saveEmail(){
window.parent.emailaddy = document.myform.email.value;
if (window.parent.emailaddy == null || window.parent.emailaddy == "") {
alert("Email address must be filled out");
return false;
}
window.parent.emailaddy = document.myform.email.value;
var atpos = window.parent.emailaddy.indexOf("@");
var dotpos = window.parent.emailaddy.lastIndexOf(".");
if (atpos< 1 || dotpos<atpos+2 || dotpos+2>=window.parent.emailaddy.length) {
alert("Not a valid e-mail address");
return false;
}
alert("Email successfully submitted. Close this window and click Next to continue");
console.log('saveEmail '+window.parent.emailaddy)
}
</script>
</head>
<body>
<form class="form" name="myform" action="" method="get">
Enter your email address in the box: <br>
<input class="input" type="text" name="email" value="">
<INPUT class="button" TYPE="button" NAME="button" Value="Submit" onClick="saveEmail()">
</form>
Scott