Send results by email, flashcommand.js

Nov 05, 2012

Hi all, I am sure some of you have seen the tutorial on sending the results via email using PHP.

Well I followed this tutorial and got it working but my intwention is too store the results in a mySQL database using php.

Original Tutorial: Articulate - E-Learning Software and Authoring Tools

I can do this but the problem comes when I tried to edit the flashcommand.js file to only send a percentage correct score.This is the section I thought I needed to edit so I tried editing this and removed almost everything but it still seems to be sending all of the same info as before its really odd. Can anyone tell me what I would need to change only to send a total score?

function EmailResults(strAddress)
{
	var g_strSubject = "Quiz Results";
	var strQuizResults = "";
	var strMainHeader = "\nStatus, Raw Score, Passing Score, Max Score, Min Score, Time\n";
	var strLineHeader = "\n\nDate, Time, Score, Interaction ID, Objective Id, Interaction Type, Student Response, Result, Weight, Latency\n";
	var strMainData = "\n";
	var strLineData = "\n";
		
	// Status
	strMainData += g_oQuizResults.strResult + ",";
	
	// Score
	// strMainData += g_oQuizResults.strScore + ",";
	
	// Raw Score
	strMainData += g_oQuizResults.strPtScore + ",";
	
	// Passing Score
	strMainData += Math.round((g_oQuizResults.strPassingScore/100) * g_oQuizResults.strPtMax) + ",";
	
	// Max Score
	strMainData += g_oQuizResults.strPtMax + ",";
	
	// Min Score
	strMainData += 0 + ",";
	
	// Time
	strMainData += GetTime(g_oQuizResults.dtmFinished);
	
	for (var i = 0; i < g_arrResults.length; i++)
	{
		//Date
		strLineData += GetDate(g_arrResults[i].dtmFinished) + ",";
		
		// Time
		strLineData += GetTime(g_arrResults[i].dtmFinished) + ",";
		
		// Score
		strLineData += g_arrResults[i].nPoints + ",";
		
		// Interaction Id
		strLineData += g_arrResults[i].strInteractionId + ",";
		
		// Objective Id
		strLineData += g_arrResults[i].strObjectiveId + ",";

		// Interaction Type
		strLineData += g_arrResults[i].strType + ",";

		// Student Response
		strLineData += g_arrResults[i].strStudentResponse + ",";
		
		// Result
		strLineData += g_arrResults[i].strResult + ",";
		
		// Weight
		strLineData += "1,";
		
		// Latency
		strLineData += g_arrResults[i].strLatency;
		
		strLineData += "\n";
	}
	
	strQuizResults = strMainHeader + strMainData + strLineHeader + strLineData;

	var sHTML = "";
	sHTML += '<FORM id="formQuiz" method="POST" action="sendmail.php" enctype="text/plain">';
	sHTML += '<INPUT TYPE="hidden" NAME="QuizResults" VALUE=\'' + strQuizResults + '\'>';
	sHTML += '<br><input type="submit"><br>';
	sHTML += '</FORM>';
	document.getElementById("divEmail").innerHTML = sHTML;
	document.getElementById("formQuiz").submit();
}
3 Replies

This discussion is closed. You can start a new discussion or contact Articulate Support.