• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Converted internalServerReporting from .php to .cfm

Engaged ,
Mar 18, 2014 Mar 18, 2014

Copy link to clipboard

Copied

I posted this on the general discussion forum but it doesn't seem to be getting any looks....

Hi

I recently converted the internalServerReporting.php file to .cfm, since I'm not yet using a LMS and I just needed to capture quiz results.

I'm writing the results of my Captivate 7 quiz to a .txt file successfully (an insert query too). My Captivate 7 quiz completes and immediately after the user fills out and clicks the Send button in the Post Results dialog box (where they enter their name and email id) I get an Adobe Captivate error message in a dialog box with "Unknown Error" and an OK button.

I think this is a Captivate error and not a Coldfusion error, as my Coldfusion "internalServerReporting.cfm" writes the text file as expected, and the Coldfusion server error logs are empty. Does anyone know how I can turn on/enable any available debugging data in Captivate so that I can trap this error?

For your convenience my .cfm file is pasted below.

Thanks in advance for your help,

Rich

Rich Leach

Interactive Media Developer

Advanced Certified ColdFusion Developer

<cfsavecontent variable="results">

<cfoutput>

Company name: #form.companyname#<br>

Department name: #form.departmentname#<br>

Course name: #form.coursename#<br>

File name: #form.filename#<br>

File data: #form.filedata#<br>

<cfset retXml=#xmlParse(form.filedata)#>

Learner name: #retXml.Course.LearnerName.xmlAttributes["value"]#<br>

Learner email: #retXml.Course.LearnerID.xmlAttributes["value"]#<br>

Lesson name: #retXml.Course.LessonName.xmlAttributes["value"]#<br>

Quiz attempts: #retXml.Course.QuizAttempts.xmlAttributes["value"]#<br>

Total questions: #retXml.Course.TotalQuestions.xmlAttributes["value"]#<br>

Status: #retXml.Course.Result.CoreData.Status.xmlAttributes["value"]#<br>

Location: #retXml.Course.Result.CoreData.Location.xmlAttributes["value"]#<br>

Raw Score: #retXml.Course.Result.CoreData.RawScore.xmlAttributes["value"]#<br>

Max Score: #retXml.Course.Result.CoreData.MaxScore.xmlAttributes["value"]#<br>

Min Score: #retXml.Course.Result.CoreData.MinScore.xmlAttributes["value"]#<br>

Session Time: #retXml.Course.Result.CoreData.SessionTime.xmlAttributes["value"]#<br >

</cfoutput>

</cfsavecontent>

<cffile action="write" file="/Applications/ColdFusion10/internal.timetracker/runtime/work/Ca talina/localhost/tmp/captivateTestResults.txt" output="#results#" nameconflict="overwrite">

TOPICS
Advanced

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Mar 18, 2014 Mar 18, 2014

Copy link to clipboard

Copied

Captivate is expecting the server to return a 200 status OK.  Are you returning anything back to the client from your .cfm script?... such as html, text, or JSON?  What is the JavaScript console reporting in the web browser?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 18, 2014 Mar 18, 2014

Copy link to clipboard

Copied

The script is in fact returning a status of 200, although it's not returning any headers (I didn't do that because the .php script isn't doing that either). FWIW if I simply blank out the .cfm script (make the .cfm file a completely empty file) the error still persists.... The .php file is not sending any acknowledgements and is only writing the file's contents.... Is there anyway to debug a compiled Captivate project? I published my test project to HTML only and I'm running it in the browser (both Chrome and IE on the Mac).

Thanks,

Rich

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Mar 19, 2014 Mar 19, 2014

Copy link to clipboard

Copied

richardELeach wrote:

Is there anyway to debug a compiled Captivate project?

If you published to htm/swf, you could try using the Monster Debugger:

http://www.monsterdebugger.com/

I would create a widget or swf animation with Monster inside, then insert that into your Cp project and set its duration for "rest of project".  This should allow you to see what's happening at runtime.  Here more info on how to accomplish this:

http://www.infosemantics.com.au/widgetking/category/debugging/

If you published to HTML5, you have access to the source files: JS, CSS and HTML files.  Using your browser's debug console is your best bet.  I'd recommend setting a break point in the JavaScript and stepping through the code in order to find the error.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 19, 2014 Mar 19, 2014

Copy link to clipboard

Copied

Jim

...jeez, what a rookie mistake....

I did some debugging and found this reported error in my browser (Chrome):

XMLHttpRequest cannot load http://127.0.0.1:8503/captivate/internalServerReporting.cfm. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

From my years of web development I immediately recognized this error; it's a cross domain issue. But, I'm running everything localhost, what's not in the same dom.... Oh yeah, right after publishing the Captivate movie a dialog box appears "Publish was successful. Do you wish to view the output?" Naturally I clicked yes, which opened the .html file locally in my browser (as in File:Open) and NOT served from the web server (as in http://127.0.0.1/myCaptivateTest/).

As soon as I ran my Captivate test movie from the web server everything ran just fine.

Thanks for your help and patience. This script officially now works, so if anyone needs to record Captivate test/quiz results on a Coldfusion server, feel free to copy the above Coldfusion code into your own "internalServerReporting.cfm" and tell Captivate in your preferences where to expect it on your Coldfusion server.

🙂

Rich

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Mar 19, 2014 Mar 19, 2014

Copy link to clipboard

Copied

LATEST

Glad you found the issue Rich.  Cross domain issues are probably the biggest problem when using internal server reporting.  The Cp workflow makes it so easy to fall into this trap... we've all been there... and back again!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources