Thursday, October 27, 2011

Publish Adobe Captivate results with Ruby on Rails

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 - and your Adobe installation comes with the necessary PHP scripts for making this happen - but if you prefer Rails, then you were out of luck, so let's see what I did or install the Ruby gem.

First, Captivate needs to know 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 since we're creating a Rails route, there is no need to append an ‘.rb’ to the end of this.

Second, in your Captivate installation you’ll find the PHP script with the right logic at ‘<yourCaptivateInstallation>\Adobe Captivate 5.5\Templates\’.  Open this and it should look like:

Now we need to translate the PHP to 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:

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

As you can see, POSTing to InternalServerReporting creates a params hash and then creates a directory for Captivate results with the values of these parameter keys. Now, go to your Rails root and change the permissions for your 'doc' 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.  Go through 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 a "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 those captivate SWF files working in Rails.

Check out my Ruby gem for this


  1. Sure, I'm working on that now and I'll do an update in a few days. By the way, I received your comment in email but not on here. Is it showing up for your browser? I'm using Chrome for Linux.

  2. Is there a way that you can create a text field in the Captivate presentation and then pull the information that was typed in the box along with what they specifically answered on that question?

  3. Drichmond Collapse

    I've gotten my script created but have a specific variable that is in the URL that i also need to post to the database as well (TicketID=jdfsad7234jkldsaf;kasdf) this is the encrypted ticket number of the quiz they just took. Is there any way for me to request this parameter and pass it to the custom script? I did this in captivate 4 all the time but now in 5 it looks like the custom posting to database is relegated to just posting score, time, coursename, learnername and just a couple of other things. I sell courses online and the ticketid is how i mark a quiz complete when i submit the score to the DB. Thanks!

  4. Very useful information shared about Ruby on rails. We offer best price in the industry and complete value of money to clients. We are one of the best companies offering ruby on rails development in India. We provide free trials before the final commitment and also free quote within 24 hours.