Skip to main content
Participating Frequently
December 8, 2009
Answered

Quiz results to a database using asp.net

  • December 8, 2009
  • 2 replies
  • 4221 views

Hi

Has anyone there attempted to send Captivate 4 quiz results to a database using asp.net technology?

I will really appreciate any guidance.

This topic has been closed for replies.
Correct answer Jim Leichliter

Try this article: Storing Adobe Captivate 4 Quiz Results using ASP.NET

The sample files in the article show how to store quiz results and interaction data in a SQL database using ASP.NET web services.  It also shows how to save suspend data (aka resume data) so the Learner can resume the course where she left off.  After the quiz is taken and the results stored in the database, an html email is sent (server side) with the quiz results in the body of the email and also as a Tab separated text file attachment.  All the code is there, you just have to set it up to work in your environment.  Good luck!

Jim Leichliter

http://JimLeichliter.blogspot.com

2 replies

Jim LeichliterCorrect answer
Legend
December 21, 2009

Try this article: Storing Adobe Captivate 4 Quiz Results using ASP.NET

The sample files in the article show how to store quiz results and interaction data in a SQL database using ASP.NET web services.  It also shows how to save suspend data (aka resume data) so the Learner can resume the course where she left off.  After the quiz is taken and the results stored in the database, an html email is sent (server side) with the quiz results in the body of the email and also as a Tab separated text file attachment.  All the code is there, you just have to set it up to work in your environment.  Good luck!

Jim Leichliter

http://JimLeichliter.blogspot.com

kwame_zaAuthor
Participating Frequently
December 21, 2009

Hi

I have insatlled the sample files, but cannot find how to wire the connection string to the Access database as the webconfig uses sql server database. Please help.

Legend
December 21, 2009

Hi Kwame_za,

If you're using an MS Access backend, you don't need a connection string in the web.config file.  The code behind file wsCaptivate.asmx.vb has the following method:

    Private Sub SendResultsToMsAccess()
        Dim sb As New StringBuilder
        Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data" + _
            " Source=c:\CaptivateLMSData.mdb;User Id=admin;Password=;")
        Dim cmd As New OleDbCommand

        'Build Insert Command
        sb.Append("INSERT INTO tblCaptivateLMSData " + _
         "(courseID,courseTitle,scoID,scoTitle,Email,RawScore,MaxScore,MinScore,LMSStatus," + _
         "LMSLocation,LMSTime,LMSSuspendData,LMSInteractions) " + _
        "VALUES (@courseID,@courseTitle,@scoID,@scoTitle,@Email,@RawScore,@MaxScore,@MinScore,@LMSStatus," + _
        "@LMSLocation,@LMSTime,@LMSSuspendData,@LMSInteractions)")

        With cmd
            .Parameters.AddWithValue("courseID", _courseID)
            .Parameters.AddWithValue("courseTitle", _courseTitle)
            .Parameters.AddWithValue("scoID", _scoID)
            .Parameters.AddWithValue("scoTitle", _scoTitle)
            .Parameters.AddWithValue("Email", _Email)
            .Parameters.AddWithValue("RawScore", _RawScore)
            .Parameters.AddWithValue("MaxScore", _MaxScore)
            .Parameters.AddWithValue("MinScore", _MinScore)
            .Parameters.AddWithValue("LMSStatus", _LMSStatus)
            .Parameters.AddWithValue("LMSLocation", _LMSLocation)
            .Parameters.AddWithValue("LMSTime", _LMSTime)
            .Parameters.AddWithValue("LMSSuspendData", _LMSSuspendData)
            .Parameters.AddWithValue("LMSInteractions", _LMSInteractions)
            .CommandText = sb.ToString
            .Connection = cn
            .Connection.Open()
            .ExecuteNonQuery()
            .Connection.Close()
            .Dispose()
        End With

        cn.Dispose()

    End Sub

The cn object is your connection object wich is eventually disposed of.  However, you do need impersonation cut on in your web.config file with the credentials of a user that has read/write to the folder where the MS Access db is located.  Impersonation is already cut on in the web.config file, but you need to supply the credentials of an account with those rights.  Web.config Example:

    <!-- JBL: Cut on Impersonation so you can save Results to the MS Access DB in a
           Folder other than your web root for security reasons-->
        <identity impersonate="true" userName="YourDomain\YourUserName" password="YouPasswordHere"/>

Jim Leichliter

Captiv8r
Legend
December 8, 2009

Hi there

See if the article linked below helps you wade through it.

Click here to view

Cheers... Rick

Helpful and Handy Links

Captivate Wish Form/Bug Reporting Form

Adobe Certified Captivate Training

SorcerStone Blog

Captivate eBooks

kwame_zaAuthor
Participating Frequently
December 8, 2009

Tim's article uses CF or PHP which my IIS7 has problems with.

Captiv8r
Legend
December 8, 2009

Hi there

Indeed I understood that when I provided the link. The hope was that by reviewing what was presented, you might deduce the steps needed to accomplish your goal. So where you see the reference to CF, you use the equivalent feature in asp.net.

To my knowledge there is no step-by-step tutorial for all the different database possibilities.

Cheers... Rick

Helpful and Handy Links

Captivate Wish Form/Bug Reporting Form

Adobe Certified Captivate Training

SorcerStone Blog

Captivate eBooks