Reporting the Quiz Results to a local server

One of the most requested features in Adobe Captivate was the ability to store the course results on the local servers or database. Adobe Captivate 5 comes with an all new reporting workflow, being highlighted as Alternate Reporting, which enables its users to store and track their course results using their own servers and database.

Alternate Reporting allows the users to integrate their content with their own webservers. Let us see how…in a very few steps…

Step I: Set-up the Web server

For integrating the course with a web server, first the user needs to setup a web server. Here, I will take an example of integrating the Captivate course with WAMP server (PHP-enabled server).

WAMP server is an open source project and a free to use web server. It can be downloaded from www.wampserver.com/en/downloads.php.

Tutorials for installing WAMP server can be found at: http://www.tagbytag.org/tutorials/getting-started/web-design-software/wamp-guide

Step II: Create a Reporting Script

Since some of the users want the results to be stored on their local servers and some want to be stored on some database, Adobe Captivate 5 provides a template script file – InternalServerReporting.php, which is available at the following location – [InstallDirectory]/Adobe Captivate 5/Templates/Publish/. Users can use this script file and modify it accordingly to solve their purpose. Also, there is no restriction on the scripting language used for the reporting script. Users can use any scripting language like PHP or ASP.

Once the script file is ready, you just need to place this file in the root folder of the web server. To check whether the script is correct and accessible or not, please try accessing it using the web browser.

For eg : If the server is on local machine, you can try the following link in your web browser : http://localhost/InternalServerReporting.php.

No error should be displayed in the browser.

Step III: Set the Quiz Reporting Preferences in Adobe Captivate 5

After the server is up and running, and the script file is in place, you need to set the preferences in Adobe Captivate 5, so that the results get reported to the web server.

Adobe Captivate 5 comes with two new reporting options available in the Reporting preferences of Quiz.

For tracking the results using the web server, you need to select and configure Internal Server as the reporting option.

Step IV: Configure the Internal Server

Now, user needs to configure the internal server to his own web server. For this, you should provide the link to the script file in the Server text area of the Alternate Reporting dialog. Also, you should provide the names of the Institute, Department and Course name in the respective fields. All these fields are mandatory and are used to store the course results in a formal structure.

And now, your course is integrated with your web server.

Whenever a student will take this course he will see a Post Results button on the result slide. Once the student uses this button to post the results, the results get posted on your web server.

How can you store the results on a database?

You can anytime modify your script file to connect to a database. Now whenever the results are passed to this script, the code in the script would directly store the results onto the database.

Hence, you can see how easy it is to store the course results on your own web servers/database using Alternate Reporting feature of Adobe Captivate 5.

I’ll give some more highlights on the code in the script in my further blog posts. So keep tuned.

131 Responses

  1. 2 questions: I would like to have the date the quiz was taken displayed when viewing results from the Quiz Results Analyzer but I don’t see it. Am I missing something? How can I have them display?

    Also, my IT guys tell me the scripts shipped with Captivate don’t work with Linux without customization. Will this be offered soon?

      • Hiii…I am unable to view the results that are being stored in the local databse.I have gone though the above steps but i am inable to figure it out where exactly i am going wrong…Can any one help me out clearly.I am doing it using sql server and .net..Help will be appriciated… Kindly let me know through my mail id…”tagurgautham@gmail.com”

  2. I am trying to Create a Reporting Script using asp instead of php. How do I do this? How do I translate php code into asp? DO I need to translate internalserverread.php also to asp file?
    I tried printing Request.form(“Company”) – it returns nothing.

    Thank you.

  3. I currently have a website that uses Captivate 3 and I post the results to a database on my website server using the post results by email tutorial and sending to a database. The issue that I have is that I need the full test posted which includes the questions and answers to the questions along with if they are right or wrong.
    Rihgt now I only get the results which includes the letter before the answer and a C or W if right or wrong.
    Will Captivate 5 fix this issue? If so, then I will upgrade

  4. Initially we were able to use the alternate quiz reporting feature successfully. There is currently an error code that comes up when we try to post results after a quiz.. “Unknown Error’ is shown after the student name and email address are entered. Is there a way to trace back what this error message means?

  5. I have followed the instructions for the internal server and even though I publish to the local folder, I don’t see the “automatic folder” appearing for Captivate Results. Please advise!! I’m in a hurry! 206-992-4446 Thank you!!

  6. We are thinking of using the WAMP server for our internal training program which will need to process requests and store results from about 150 users. We would like to know whether or not the WAMP server with default configurations can handle such load and process the requests successfully. Also, can we rely on this opensource WAMP sever for our proffessional use?

    • @Rachel
      The WAMP(or XAMPP) suggestion is for a developer configured setup of a PHP/MySQL/Apache server. I wouldn’t advise using this outside of a secure internal network. I run a XAMPP server locally on my computer as well as on a test server in our companies network. If planning on deploying a production server (internal or external) with a PHP/MySQL/Apache setup I would consult an IT professional. Most web hosting packages are based on a PHP/MySQL setup the other being ASP/MSSQL.

      MySQL isn’t the end all be all for databases. My IT department uses Microsoft SQL. It all depends on the connection string given to PHP or ASP in which database the script talks to. Some commands within the script may have to change to accommodate the database of choice.

  7. I am new to Captivate 5 and still learning.
    While creating the Quiz was pretty easy, how do we also capture the learners name or id so we know “who” answered the quiz?

    • In Quiz Preferences, you are going to indicate wheter you will create results at Acrobat.com or and Internal server. Once the quiz is taken, you can view results utilizing the Quiz Results Analyzer. That will give you the information you are looking for.

      • I’m curious, how will it give information the quiz itself doesn’t ask for? If the user is taking this via a browser, I don’t understand how it’s going record any personal information about the taker. I need the user and department information on my quizzes. Previously I used Cap 3 and dumped results to a DB. In that case I used a pop up html page to have the user enter their information before hitting a submit button.

        • @Anthony, I wondered this as well. I published to acrobat.com at first to see what the output would be and it only assigned displayed the users by their adobeID. I don’t want my users to have to sign up for Adobe just to be able to post their results so I’ve decied to go the internal server route. What I ended up doing to identify the test taker was creating an ungraded question where the users could enter in their personal info. This would allow the responses to this question to be populated with the rest of the course test results. I hope this helps although I know I’m seeing this quite late!

  8. like so many, i have worked thru a couple of challenges to get Results to and from a local server. The results do post, and can be verified as on the server. However, when I attempt to retrieve them via the Quiz Analyzer, I get a ” Download could not be completed” error. Any ideas as to how to correct??

  9. Has anyone tried saving the quiz data via ColdFusion? Specifically, I’m wondering what are the Captivate quiz parameters that are passed out of Captivate to the cfc or cfm page.

      • Been trying using Coldfusion and cannot get it to post data. but I also cannot get it to work with the provided PHP example either. It just says “Connecting…” when trying use the PHP and No Connection when tryin to use the CFM file. ug… So frustrating, wish there was some help on this.

    • Hi Derek, what I’ve done is created an ungraded quiz question that prompts the user to enter in their personal information. This way it will populate their info with the rest of the quiz results.

      This is the only solution I’ve come up with so far…hope this helps!

  10. I have modified the interserverReporting.php script that ships with Captivate 5 to report the results to a MySQL database with some success. The problem I’m having has to do with the message that displays to the user when the click the Submit button. i would like to customize the text that appears in the popup and somehow disable the submit button after the user clicks it so that they don’t resubmit multiple times. Anyone have ideas on where to look to do this?

  11. I have used the Internal Server option and can see my results in the xml file. When the Post results option is selected, a popup comes up asking for the user id and email address. This information can be seen in the resulting xml too.
    But because this quiz will be made available through our internal website where the user would have to login – we already have the user information – and hence would not like him to enter the information twice.
    How do we disable the popup?

    Also the control from the Post Results button goes to Action Script? We have AS3 programming capability in the team – Is that something we can modify in a way that every quiz we publlish using Captivate has the same functionality behind the Post Results button? If yes, can I get some pointers on how to approach this?

    Sharad

  12. I have been trying to get the quiz results to post to my acrobat.com account with little success. When others post their quiz results they are requested to enter the email address and password to my account at acrobat.com. Is this how the reporting is suppose to work when using acrobat.com?

    • Hi Terra. When learners take the quiz the system asks them for ‘their’ Adobe ID to login to acrobat.com – not for yours. The system will post to your account, but asks them for their login info. You can use alternate reporting if you want to avoid forcing your learners to have Aadobe ID’s. In the alternate reporting paradigm, you put the php scripts provided on your own server, and the data is loaded to your custom server. Users are prompted in that model for a login email rather than an Adobe ID. Hope this helps, Allen.

      • Hi Allen. I thought there was a way for my acrobat.com account to be saved like a default. That way when individuals report they just hit the report button and it automatically goes to my acrobat.com account without them entering anything. Is there a way to do this? If so, can you please instruct me how to do it? I really don’t want a huge amount of individuals having to sign up for acrobat.com just for this. Thanks for your help. Terra

  13. I’ve set up a quiz in Captivate 5. I created a second adobe id so I could test the quiz. I take the quiz but when I try to post the results I get message “Network may not be available” any one have this same problem

  14. Im having a similar problem. I have chosen to report to an internal server, but when I click on post results it just reads “connecting…” with no other msgs.

    Any ideas how to fix this?

    • I am having this exact problem. It just hangs at “Connecting …” Is there something that is supposed to be customized in the internalServerReporting.php. Cannot find any examples of this.

    • Matt, if the hosted server has PHP you should be fine – though you may need to coordinate with the host to ensure everything is working. Just install the two php files into a directory on the server. (Make sure the permissions on the files and the directory are sufficient.)

  15. Is there a way to have the quiz analyzer show the time it took for a student to go through the quiz? I know this is stored in the XML but would like to be able to pull it from the analyzer

  16. I just want a way to insert the scores, time taken etc into a mysql database simple right? well there are just no examples of how to accomplish this around the forums

    This xml file it writes isn’t very helpful but then again i can’t even get that to work either. in Captivate 4 i used a hacked javascript file for sendmail() to post to a page and insert that into a database but that doenst’ work on 5 🙁

  17. After diging a lot, I get almost everything works. Now, my only problem is that Quiz Analyser (CS5) is connecting to my internal server, but instead of showing me the datat of the XML file, it just show dot (“.”) in the Organization/Dept/Course drop-down menu.

    No datas are retrieved.

    If I FTP the CaptivateResults directory on my computer and read the file with Quiz Analayser, everything work fine.

    I gave full permissio to all folders on my website.

    Any idea?

    Martin 🙂

  18. Having problems getting this to work myself. Each time I try posting it shows an error “No Connection” Any idea what that means? Ive tested the URL for my internal server directly and it works fine.

  19. Hi Allen

    Yes, I have tried the URL directly from my web browser and it resolves properly. I have even tested posting form results to the same URL and it works fine. Is there something else the Internal Server function needs to return in order for it to connect?

    • Here is the example quiz published as Flash Player 10:
      http://training.wonderware.com/quiz/test.htm

      and it should be posting results to a ColdFusion File here
      http://training.wonderware.com/quiz/test.cfm

      The cold fusion file just saves the posted form data to a file. You can go there directly to see that it resolves properly. I have triple checked the captivate file to make sure the URL is correct. Does this require us to use PHP? Is there something that must be returned back to the Quiz for it to say results posted successfully?

      s

      • I was getting this same error, and ended up doing a trace on the connection.

        Turns out JRun is returning a 501 error because of the following:

        “Corrupt form data: no leading boundary: != –3141592653 …”

        So far, I haven’t been able to resolve it.

        • Yeah I dont think its possible. There is something with the way Adobe created the posting application in the quiz that only sends to the php file from whati can gather. there are not supporting docs for it.

  20. If I’m getting to the post results stage and hanging on Connecting…. does anyone know where my problem might lay?
    Any help appreciated-confused learning designer working with IT person who is managing the script….

  21. I am trying to have captivate report quiz results to our internal server – SharePoint. Following all instructions I can find, we set up the server correctly and the settings on the quiz are correct. When submiting the results the returned message is successful. However, there are no new files created – no results anywhere. What am I missing???

    • Scott – it sounds like a permissions problem. If the permissions on the PHP scripts aren’t sufficient, then it won’t have permission to create new files on your server. Try expanding the perms on the PHP script.

  22. Since I was not able to use ColdFusion to process the results I am now using the provided PHP file on a PHP Server. Works fine when the quiz is located on the same domain as the php server. Is there a way to make this work though were the quiz is located on one server and the PHP file on another?

    • Stephen, this is an enhancement request. I’m forwarding it to wish-captivate. You can of course edit the PHP file(s) yourself as well, but i don’t know the issues involved. My guess is there may also be a need for a change in the published SWF, and of course you’d need a x-domain policy on the server.

  23. Using Adobe Captivate 5 with an internal reporting server which is configured properly for PHP using IIS 6. I can create the XML files all day long but the quiz results analyzer will not generate the report even though it does find the “Organization”, “Department”, and “Course” values from the directory structure. When I click “Generate Report”, I get the message saying “Data not found on the local file system” etc
    When I try and view the report using Source as “From this computer”, it will load the XML files data just fine.
    Any suggestions?
    Any help would be appreciated! Thanks

  24. Hi I am trying to use the Email as the reporting system, but unfortunately this doenst seem tobe working. I have downloaded Captivate 5 free trail and I have taken online training and its says its as easy as 1) enable reprting ) enter email address 3) chooses reporting options and ok but nothing comes through? Im not sure why this int working can anyone help. I have also tried Acrobat.com and this isnt working either.

  25. we are setting this up and need to have the full list of steps as in many of the blogs it is not straightforward. does anyone have steps to share when using the internal web server? if you have any tips on pitfalls, challenges this is most appreciated.

  26. what needs to be set up so that the module talks to the web server? how is the data put into the web server and in what format?
    has anyone successfully set this up?

  27. Can you do this in Captivate 4?
    I need to get test results into a spreadsheet. If possible point me to any “step by steps”

    Reason I’m having to do this – our current LMS doesn’t allow us to capture the level of detail we need – expecially for a group of people who do not have logins to our LMS right now.
    Yes, we will eventually be upgrading (to OracleLMS) but I need a robust interim solution,now.
    BTW – I’m not a techy and have never done JS so an a real novice
    Thanks
    Jenni_NT

  28. Is there a way to automatically post the results without the user having to explicitly post the results. I have a user account system already in place and have access to the userid and e-mail either through PHP from a database or javascript. I would like to submit the quiz results to a database after the user completes the entire presentation or when they close the windows.

  29. Is there a way to automatically post the results without the user having to click the X on the upper right hand corner….. currently I have an assessment posted on a site, when the assessment ends the use sees his/her score and if they DO NOT click the X the score doesn’t get posted to our spreadsheet….. Can anybody help with me this?

  30. Is there a way for this to just do generic HTTP post (standard parm names) without having to call specific php script to save the results? That would make things much easier.

  31. Hello,

    I just upgraded to Captivate 5.5 from Captivate 4.0. We embed our courses in our internal intranet and have set it up so that when the user clicks the submit e-mail button the score is posted to our intranet. Now that I have upgraded to 5.5 it makes the user click the “send e-mail” button twice in order for the score to post. Can you suggest how I might set up the configurations so that the user only needs to click the send e-mail button once.

    The intranet programmer at our company would not like to use the internal server option because this option just sends information to a page on a web server and our courses are embedded within the intranet using JavaScript.

    Any suggestions you can give so that the users don’t have to click the “send e-mail” button twice in order for the results to post would be much appreciated! Thank you!

  32. Does anyone know if there is a way to edit the 2 questions being asked in the Post Results prompt? Currently it asks for Name and Email Address. I’d like to ask for 2 different variables if possible, but cant find where the code files are for that specific prompt.

  33. This is my solution in VB.net . It uses three SQL tables (which is probably overkill) to store the results. One stores the post data Captivate sends on a single row, the other two “capHeaderData” and “capData” store the parsed out data from the XMLfile that gets sent. I’m supplying scripts to create all the tables at the end also.

    This is the code behind of a blank page I called captivateresults.aspx . I sent the Internal Reporting to this page which is hosted on the company Intranet. It collects the data captivate sends, then records it in capResults, then takes the XML file and parses it out into the other two tables, a header and a data table for the questions themselves.

    You will need to replace “incIntranet.pubConnStringIntranet” with a connection string to your database that works in your

    environment probably somethign like “Data Source=MYSQLINSTANCENAME;Initial Catalog=MYDATABASENAME;User Id=MYUSERNAME;

    Password=MYPASSWORD”

    *******************************************

    Imports System.Data
    Imports System.Data.SqlClient
    Imports System
    Imports System.Xml

    Partial Class captivateresults
    Inherits System.Web.UI.Page

    Public incIntranet As New classIntranet

    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

    ‘This page is called from Adobe Captivate. The quiz reults are sent in as a Post to this page.
    ‘This page then loops through the request.params and and stores the data which is several fields a
    ‘and a file which should be in XML. This data is inserted as a row in a capQuizResults table.

    Dim strListofVars As String = “”
    Dim strListofFormVars As String = “”
    Dim strCompanyName As String = “”
    Dim strDepartmentName As String = “”
    Dim strCourseName As String = “”
    Dim strFilename As String = “”
    Dim strFiledata As String = “”
    Dim strFileUpload As String = “”

    ‘Request.Params goes combines all variables, Querystring, Post, Server
    For Each strPost As String In Request.Params

    ‘If InStr(strPost, Request.ServerVariables()) = 0 Then

    ‘End If
    strListofVars = strListofVars & strPost & ” | ”
    Response.Write(“” & strPost & “:” & Request(strPost).ToString & “”)

    Select Case strPost

    Case “CompanyName”
    strCompanyName = Request(strPost).ToString
    Case “DepartmentName”
    strDepartmentName = Request(strPost).ToString
    Case “CourseName”
    strCourseName = Request(strPost).ToString
    Case “Filename”
    strFilename = Request(strPost).ToString
    Case “Filedata”
    strFiledata = Request(strPost).ToString
    Case “Upload”
    strFileUpload = Request(strPost).ToString
    End Select

    Next

    For Each strPost As String In Request.Form
    strListofFormVars = strListofFormVars & strPost & ” | ”
    Next

    ‘Insert into table and return the newly created ID

    Dim myConnection As New SqlConnection(incIntranet.pubConnStringIntranet)
    Dim strUpdateString As String = “INSERT INTO capResults (capResultsListOfVars, capResultsListOfFormVars,

    capResultsCompanyName, capResultsDepartmentName, capResultsCourseName, capResultsFileName, capResultsFileData,

    capResultsFileUpload) VALUES (@ListOfVars, @ListOfFormVars, @CompanyName, @DepartmentName, @CourseName, @FileName,

    @FileData, @FileUpload); SELECT SCOPE_IDENTITY() as NewID ”
    Dim da As SqlDataAdapter = New SqlDataAdapter(strUpdateString, myConnection)

    ‘Dim myCommand As New SqlCommand(strUpdateString, myConnection)
    da.SelectCommand.Parameters.Add(New SqlParameter(“@ListOfVars”, strListofVars))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@ListOfFormVars”, strListofFormVars))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@CompanyName”, strCompanyName))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@DepartmentName”, strDepartmentName))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@CourseName”, strCourseName))

    ‘da.SelectCommand.Parameters.Add(New SqlParameter(“@LearnerName”, strCourseName))
    ‘da.SelectCommand.Parameters.Add(New SqlParameter(“@LessonName”, strCourseName))

    da.SelectCommand.Parameters.Add(New SqlParameter(“@Filename”, strFilename))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@Filedata”, strFiledata))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@FileUpload”, strFileUpload))

    Dim dt As New DataTable
    da.Fill(dt)

    Dim intNewID As Int64 = dt.Rows(0).Item(“NewID”)

    ‘From the XML , insert records for each questions for this ResultsID

    Dim strXML As New XmlDocument
    ‘strXML.LoadXml(dt.Rows(0).Item(“capResultsFileData”))
    strXML.LoadXml(strFiledata)

    ‘Dim strXML As New XmlDocument
    ”strXML.LoadXml(dt.Rows(0).Item(“capResultsFileData”))
    ‘strXML.LoadXml(strFiledata)

    ‘Course
    Dim strXMLCompany As String = strXML.GetElementsByTagName(“CompanyName”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLDepartment As String =

    strXML.GetElementsByTagName(“DepartmentName”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLCourseName As String = strXML.GetElementsByTagName(“CourseName”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLLearnerName As String =

    strXML.GetElementsByTagName(“LearnerName”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLLearnerID As String = strXML.GetElementsByTagName(“LearnerID”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLLessonName As String = strXML.GetElementsByTagName(“LessonName”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLQuizAttempts As String =

    strXML.GetElementsByTagName(“QuizAttempts”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLTotalQuestions As String =

    strXML.GetElementsByTagName(“TotalQuestions”).Item(0).Attributes.ItemOf(“value”).Value

    ‘Core Data
    Dim strXMLStatus As String = strXML.GetElementsByTagName(“Status”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLLocation As String = strXML.GetElementsByTagName(“Location”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLRawScore As String = strXML.GetElementsByTagName(“RawScore”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLMaxScore As String = strXML.GetElementsByTagName(“MaxScore”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLMinScore As String = strXML.GetElementsByTagName(“MinScore”).Item(0).Attributes.ItemOf(“value”).Value
    Dim strXMLSessionTime As String =

    strXML.GetElementsByTagName(“SessionTime”).Item(0).Attributes.ItemOf(“value”).Value

    ‘Dim nInteractions As XmlNode = strXML.GetElementsByTagName(“InteractionData”)
    ‘Response.Write(nInteractions.Name & “”)

    strUpdateString = “INSERT INTO capDataHeader (capResultsID, capDataHeaderCompanyName, capDataHeaderDepartmentName,

    capDataHeaderCourseName, capDataHeaderLearnerName, capDataHeaderLearnerID, capDataHeaderLessonName,

    capDataHeaderQuizAttempts, capDataHeaderTotalQuestions, capDataHeaderStatus, capDataHeaderLocation, capDataHeaderRawScore,

    capDataHeaderMaxScore, capDataHeaderMinScore, capDataHeaderSessionTime) ” & _
    “VALUES (@capResultsID, @strXMLCompany, @strXMLDepartment, @strXMLCourseName, @strXMLLearnerName, @strXMLLearnerID,

    @strXMLLessonName, @strXMLQuizAttempts, @strXMLTotalQuestions, ” & _
    ” @strXMLStatus, @strXMLLocation, @strXMLRawScore, @strXMLMaxScore, @strXMLMinScore, @strXMLSessionTime); SELECT

    SCOPE_IDENTITY() as NewHeaderID ”
    da = New SqlDataAdapter(strUpdateString, myConnection)

    ‘Dim myCommand As New SqlCommand(strUpdateString, myConnection)
    da.SelectCommand.Parameters.Add(New SqlParameter(“@capResultsID”, intNewID))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLCompany”, strXMLCompany))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLDepartment”, strXMLDepartment))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLCourseName”, strXMLCourseName))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLLearnerName”, strXMLLearnerName))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLLearnerID”, strXMLLearnerID))

    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLLessonName”, strXMLLessonName))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLQuizAttempts”, strXMLQuizAttempts))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLTotalQuestions”, strXMLTotalQuestions))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLStatus”, strXMLStatus))

    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLLocation”, strXMLLocation))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLRawScore”, strXMLRawScore))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLMaxScore”, strXMLMaxScore))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLMinScore”, strXMLMinScore))
    da.SelectCommand.Parameters.Add(New SqlParameter(“@strXMLSessionTime”, strXMLSessionTime))

    dt = New DataTable
    da.Fill(dt)

    Dim intNewHeaderID As Int64 = dt.Rows(0).Item(“NewHeaderID”)

    Dim strXMLDate As String
    Dim strXMLInteractionTime As String
    Dim strXMLInteractionID As String
    Dim strXMLObjectiveID As String
    Dim strXMLInteractionType As String
    Dim strXMLCorrectResponse As String
    Dim strXMLStudentResponse As String
    Dim strXMLResult As String
    Dim strXMLWeight As String
    Dim strXMLLatency As String
    Dim strXMLAttempt As String

    myConnection.Open()

    For Each nNode As XmlNode In strXML.GetElementsByTagName(“Interactions”)

    strXMLDate = nNode.SelectSingleNode(“Date”).Attributes.ItemOf(“value”).Value.ToString
    strXMLInteractionTime = nNode.SelectSingleNode(“InteractionTime”).Attributes.ItemOf(“value”).Value.ToString
    strXMLInteractionID = nNode.SelectSingleNode(“InteractionID”).Attributes.ItemOf(“value”).Value
    strXMLObjectiveID = nNode.SelectSingleNode(“ObjectiveID”).Attributes.ItemOf(“value”).Value
    strXMLInteractionType = nNode.SelectSingleNode(“InteractionType”).Attributes.ItemOf(“value”).Value
    strXMLCorrectResponse = nNode.SelectSingleNode(“CorrectResponse”).Attributes.ItemOf(“value”).Value
    strXMLStudentResponse = nNode.SelectSingleNode(“StudentResponse”).Attributes.ItemOf(“value”).Value
    If Not nNode.SelectSingleNode(“Result”) Is Nothing Then
    strXMLResult = nNode.SelectSingleNode(“Result”).Attributes.ItemOf(“value”).Value
    Else
    strXMLResult = “”
    End If

    strXMLWeight = nNode.SelectSingleNode(“Weight”).Attributes.ItemOf(“value”).Value
    strXMLLatency = nNode.SelectSingleNode(“Latency”).Attributes.ItemOf(“value”).Value
    strXMLAttempt = nNode.SelectSingleNode(“Attempt”).Attributes.ItemOf(“value”).Value

    strUpdateString = “INSERT INTO capData (capDataHeaderID, capDataInteractionDateTime, capDataInteractionID,

    capDataObjectiveID, capDataInteractionType, capDataCorrectResponse, capDataStudentResponse, capDataResult, capDataWeight,

    capDataLatency, capDataAttempt) ” & _
    “VALUES (@capDataHeaderID, @capDataInteractionDateTime, @capDataInteractionID, @capDataObjectiveID,

    @capDataInteractionType, @capDataCorrectResponse, @capDataStudentResponse, @capDataResult, @capDataWeight, @capDataLatency,

    @capDataAttempt) ”
    Dim myCommand As SqlCommand = New SqlCommand(strUpdateString, myConnection)

    ‘Dim myCommand As New SqlCommand(strUpdateString, myConnection)
    myCommand.Parameters.Add(New SqlParameter(“@capDataHeaderID”, intNewHeaderID))
    myCommand.Parameters.Add(New SqlParameter(“@capDataInteractionDateTime”, CType(strXMLDate & ” ” &

    strXMLInteractionTime, Date)))
    myCommand.Parameters.Add(New SqlParameter(“@capDataInteractionID”, strXMLInteractionID))
    myCommand.Parameters.Add(New SqlParameter(“@capDataObjectiveID”, strXMLObjectiveID))
    myCommand.Parameters.Add(New SqlParameter(“@capDataInteractionType”, strXMLInteractionType))
    myCommand.Parameters.Add(New SqlParameter(“@capDataCorrectResponse”, strXMLCorrectResponse))
    myCommand.Parameters.Add(New SqlParameter(“@capDataStudentResponse”, strXMLStudentResponse))
    myCommand.Parameters.Add(New SqlParameter(“@capDataResult”, strXMLResult))
    myCommand.Parameters.Add(New SqlParameter(“@capDataWeight”, strXMLWeight))
    myCommand.Parameters.Add(New SqlParameter(“@capDataLatency”, strXMLLatency))
    myCommand.Parameters.Add(New SqlParameter(“@capDataAttempt”, strXMLAttempt))
    myCommand.ExecuteNonQuery()

    Next

    myConnection.Close()

    ‘ 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”)
    ‘ {
    ‘ If (get_magic_quotes_gpc()) Then
    ‘ $Filedata = stripslashes($v);
    ‘ Else
    ‘ $Filedata = $v;
    ‘ }
    ‘ }

    ‘$ResultFolder = “./”.”CaptivateResults”;
    ‘mkdir($ResultFolder);
    ‘$CompanyFolder = $ResultFolder.”//”.$CompanyName;
    ‘mkdir($CompanyFolder);
    ‘$DepartmentFolder = $CompanyFolder.”//”.$DepartmentName;
    ‘mkdir($DepartmentFolder);
    ‘$CourseFolder = $DepartmentFolder.”//”.$CourseName;
    ‘mkdir($CourseFolder);
    ‘$FilePath = $CourseFolder.”//”.$Filename;
    ‘$Handle = fopen($FilePath, ‘w’);
    ‘fwrite($Handle, $Filedata);
    ‘fclose($Handle);

    End Sub
    End Class

    ***************************************************

    This is the sql scripts I used to create the tables involved. You will have to change “IntranetWeb” to the name of your

    database:

    USE [IntranetWeb]
    GO

    /****** Object: Table [dbo].[capResults] Script Date: 05/08/2012 15:45:58 ******/
    SET ANSI_NULLS ON
    GO

    SET QUOTED_IDENTIFIER ON
    GO

    SET ANSI_PADDING ON
    GO

    CREATE TABLE [dbo].[capResults](
    [capResultsID] [int] IDENTITY(1,1) NOT NULL,
    [capResultsDate] [datetime] NOT NULL,
    [capResultsListOfVars] [varchar](5000) NULL,
    [capResultsListOfFormVars] [varchar](5000) NULL,
    [capResultsCompanyName] [varchar](50) NULL,
    [capResultsDepartmentName] [varchar](50) NULL,
    [capResultsCourseName] [varchar](50) NULL,
    [capResultsFileName] [varchar](50) NULL,
    [capResultsFileData] [varchar](max) NULL,
    [capResultsFileUpload] [varchar](max) NULL,
    CONSTRAINT [PK_capResults] PRIMARY KEY CLUSTERED
    (
    [capResultsID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS =

    ON) ON [PRIMARY]
    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF
    GO

    ALTER TABLE [dbo].[capResults] ADD CONSTRAINT [DF_capResults_capResultsDate] DEFAULT (getdate()) FOR [capResultsDate]
    GO

    USE [IntranetWeb]
    GO

    /****** Object: Table [dbo].[capDataHeader] Script Date: 05/08/2012 15:46:02 ******/
    SET ANSI_NULLS ON
    GO

    SET QUOTED_IDENTIFIER ON
    GO

    SET ANSI_PADDING ON
    GO

    CREATE TABLE [dbo].[capDataHeader](
    [capDataHeaderID] [int] IDENTITY(1,1) NOT NULL,
    [capResultsID] [int] NULL,
    [capDataHeaderCompanyName] [varchar](50) NULL,
    [capDataHeaderDepartmentName] [varchar](50) NULL,
    [capDataHeaderCourseName] [varchar](50) NULL,
    [capDataHeaderLearnerName] [varchar](50) NULL,
    [capDataHeaderLearnerID] [varchar](50) NULL,
    [capDataHeaderLessonName] [varchar](50) NULL,
    [capDataHeaderQuizAttempts] [int] NULL,
    [capDataHeaderTotalQuestions] [int] NULL,
    [capDataHeaderStatus] [varchar](50) NULL,
    [capDataHeaderLocation] [varchar](50) NULL,
    [capDataHeaderRawScore] [int] NULL,
    [capDataHeaderMaxScore] [int] NULL,
    [capDataHeaderMinScore] [int] NULL,
    [capDataHeaderSessionTime] [datetime] NULL,
    CONSTRAINT [PK_capDataHeader] PRIMARY KEY CLUSTERED
    (
    [capDataHeaderID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS =

    ON) ON [PRIMARY]
    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF
    GO

    USE [IntranetWeb]
    GO

    /****** Object: Table [dbo].[capData] Script Date: 05/08/2012 15:46:07 ******/
    SET ANSI_NULLS ON
    GO

    SET QUOTED_IDENTIFIER ON
    GO

    SET ANSI_PADDING ON
    GO

    CREATE TABLE [dbo].[capData](
    [capDataID] [bigint] IDENTITY(1,1) NOT NULL,
    [capDataHeaderID] [int] NOT NULL,
    [capDataInteractionDateTime] [datetime] NOT NULL,
    [capDataInteractionID] [int] NULL,
    [capDataObjectiveID] [varchar](50) NULL,
    [capDataInteractionType] [varchar](50) NULL,
    [capDataCorrectResponse] [varchar](50) NULL,
    [capDataStudentResponse] [varchar](50) NULL,
    [capDataResult] [varchar](50) NULL,
    [capDataWeight] [int] NULL,
    [capDataLatency] [datetime] NULL,
    [capDataAttempt] [int] NULL,
    CONSTRAINT [PK_capData] PRIMARY KEY CLUSTERED
    (
    [capDataID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS =

    ON) ON [PRIMARY]
    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF
    GO

  34. 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!

  35. Is there a way to avoid showing the user id and email prompt when sending the scores to a local server? I really don’t want this prompt to show since I already have the users login info in a session variable.

    • Did you ever find an anwer to this one?

      I am searching for the answer to this already for some weeks now,
      there are many posts but only few real answers so I hope you guys can
      help me.

      I am coding (in PHP) an internal LMS using Adobe Captivate 9 where
      the results of the quiz are posted to “Internal Server”. This works nice
      and I have changed the default InternalServerReporting script so it
      does push the results to our database so we can use them in our Admin
      console.
      Every user who take a course needs to login first so we do already know
      the name and email address of this user, but still at the end of each
      quiz, Captivate gives the popup where it asks to enter the name and
      email address of the user.

      Some months ago, when I was still using Captivate 8, I found a post
      somewhere (unfortunately I can’t remember where) that pointed out to 1
      setting that you can change (not in a menu, it was more in an ini file
      or regkey and as far as I remember even not in the project but more in
      the installed software) and that did the trick. Now I have upgraded to
      Captivate 9 and the same comes back but can’t find that fix anymore.

      Does anyone maybe know how to get rid of this popup in Captivate 9 or
      else know where to find that original answer that I found months ago?

      Thanks
      Micha

  36. I noticed that the CaptivateResults folder was not created. Is there a step missing, or is there a way to simply create a folder in a location where the php expects to find the CaptivateResults folder?

  37. I have a site that was using Captivate software and to my knowledge had been saving the test results and users information correctly for sometime. Just recently within a week or two the users have been reporting issues with the test not saving their information and getting error messages. Does anyone have a clue why this could be? Attached is an image of the error the users are getting

  38. Is there a way to capture or report the date the quiz was taken in the Quiz Analyzer? The only place I can find the date is in the XML file captivate creates in the “Captivate Results” folder. But, I can’t XML data into a usable/trackable format. I’d like to be able to generate a report in the Quiz Analyzer and then export it to excel where I can track it…but without the date I don’t know when they took the quiz and when my trainees need to renew/retake the course. Can anyone help?

  39. I am getting a couple of errors when running the internalserverreporting.php (Step II) … regardless whether I place the files into the root folder or any subdirectory… I’ve set all permissions to 777… 😐

    any ideas? 😐

    Warning: mkdir(): File exists in /www/htdocs/xxxxxxx/captivate/internalServerReporting.php on line 35

    Warning: mkdir(): File exists in /www/htdocs/xxxxxxx/captivate/internalServerReporting.php on line 37

    Warning: mkdir(): File exists in /www/htdocs/xxxxxxx/captivate/internalServerReporting.php on line 39

    Warning: mkdir(): File exists in /www/htdocs/xxxxxxx/captivate/internalServerReporting.php on line 41

    Warning: fopen(./CaptivateResults////////): failed to open stream: Is a directory in /www/htdocs/xxxxxxx/captivate/internalServerReporting.php on line 43

    Warning: fwrite() expects parameter 1 to be resource, boolean given in /www/htdocs/xxxxxxx/captivate/internalServerReporting.php on line 44

    Warning: fclose() expects parameter 1 to be resource, boolean given in /www/htdocs/xxxxxxx/captivate/internalServerReporting.php on line 45

Leave a reply

Related