Publish Adobe Captivate results with Ruby on Rails

October 27, 2011 § Leave a comment

Adobe allows you to use the results derived from Captivate quizzes without requiring each of your students to have a separate Adobe ID.  There are several tutorials showing how to publish these results using PHP as your Adobe installation has the necessary PHP scripts, but none that I could find concerning the increasingly popular Ruby on Rails framework.  So here we go…
First, we need to tell Captivate that we want to report quiz results.  In your Captivate quiz project, hit edit > Preferences > Reporting (located 4th from the bottom of the left-hand menu) then at the top check ‘Enable reporting for this project’.  After checking this, check ‘Internal Server’ and then hit ‘configure’.  In the popup window that comes up, you’ll see 4 mandatory fields.  The first field is the most important as this is where you’ll link Captivate to the familiar Rails routes – type  PHP projects will have a ‘.php’ appended to the end of that URL but we’re trying to create a Rails route so do not append a ‘.rb’ to the end of this.
Second, in your Captivate installation you’ll find the PHP script in question at ‘whereYouInstalledCaptivate\Adobe Captivate 5.5\Templates\’.  Open this and it should look like:
<!--?php # InternalServerReporting.php<br ?--># Copyright 2000-2008 Adobe Systems Incorporated. All rights reserved.
print "

   foreach ($_POST as $k => $v)
    if($k == "CompanyName")
    $CompanyName = $v;
      if($k == "DepartmentName")
    $DepartmentName = $v;
      if($k == "CourseName")
    $CourseName = $v;
      if($k == "Filename")
       $Filename = $v;
      if($k == "Filedata")
 $Filedata = stripslashes($v);
 $Filedata = $v;

 $ResultFolder = "./"."CaptivateResults";
 $CompanyFolder = $ResultFolder."//".$CompanyName;
 $DepartmentFolder = $CompanyFolder."//".$DepartmentName;
 $CourseFolder = $DepartmentFolder."//".$CourseName;
 $FilePath = $CourseFolder."//".$Filename;
 $Handle = fopen($FilePath, 'w');
 fwrite($Handle, $Filedata);

   print "

Now we need to translate this PHP into Ruby for our Rails controller.  Create a Rails controller such as ‘captivate_controller.rb’ so that we have a place where ‘’ will be routed to.  Don’t forget to add:

match '/InternalServerReporting', :to => 'captivate#InternalServerReporting'

(or whatever you named your controller and data-processing method) to config/routes.rb.  Now for the Ruby translation of the PHP file:

 def InternalServerReporting
    company_name = params[:CompanyName]
    department_name = params[:DepartmentName]
    course_name = params[:CourseName]
    file_name = params[:Filename]
    file_data = params[:Filedata]
    file_path = File.join("#{Rails.root}/doc", "Results", company_name, department_name, course_name)
    file_path = File.join(file_path, file_name)
    handle =, 'w' )
    handle << file_data

As you can see, POSTing to InternalServerReporting creates a params hash and we’re going to create a directory of Captivate results with the values of these parameter keys. Now, go to your Rails root and right-click ‘doc’ and change the permissions for the directory to ‘read, write, and execute, – make sure the change is recursive so that it affects all the directories within the ‘doc’ directory.
Everything is finished so let’s test. Take a quiz on your site as if you were a student and on the last slide you’ll see a ‘Post Result’ button that was automatically added when you checked ‘Enable Reporting For This Project’. Use whatever username and email combo you want and then exit the quiz and look in your ‘doc’ folder of your Rails root and you should see “Results” directory followed by the three directories that you named (after you specified your site’s URL) followed by an XML file with the results of the quiz you just took. Or you can spec this out.

In future posts, I’ll discuss how to send an email with these results to the student who took the quiz.  I’ll also post about ensuring that the username and email submitted by your students matches the username and email that they used to sign up for your site.  And how to get these captivate file working in Rails.

EDIT: I’ve made a Ruby Gem of this.

Advertisements and informal SEO and popularity study

October 9, 2011 § Leave a comment

Curious about SEO and the consensus that beats even though Google owns Blogger and Google is synonymous with SEO.  Since I’ve never blogged before and have no Internet presence outside of Facebook’s blue-walled vacuum, I’ll use my own content on both platforms as the sample.  My parameters:

I registered for both free blogging platforms close to the exact same time – wordpress followed by blogger a few minutes later.

I’ll use the free plan for both – no domain mapping.  The sub-domains and are comparable.

I’m using the same display name and even the same internal email address for both.

If I link to a post, I’ll link to both platforms.

I’ll be publishing both posts so close to simultaneously that the difference will be negligible.

And, of course, the content and the content’s title will always be the same.  I’ll be posting Ruby on Rails and  Node.js tutorials so I should see some hits.

Where Am I?

You are currently viewing the archives for October, 2011 at seminal.