Skip to Main Content
Return to Navigation

Sending Data from AICC-Compliant Content

This topic provides recommended solutions to one of the more common issues encountered by PeopleSoft Enterprise Learning Management (ELM) customers.

Note: Do not construe the information provided here as consulting or implementation advice for your specific industry or your individual organization. You should adapt or disregard this information based on the needs of your organization. Oracle does not guarantee that the information included here will work as intended within your customized environment.

Some customers have had issues with AICC-compliant content that does not send data correctly to ELM. If you encounter similar issues, first check with your content vendor to see what kind of logging functionality that it provides. Some content vendors include logging utilities with their content that will capture AICC transactions. A number of vendors use Java for communication with learning management systems. Using Java Console in the browser may reveal the AICC data that is being passed. If no logging utility is available and the Java Console does not reveal the AICC data, you can add the following code to ELM to output statuses and scores into a flat file.

For AICC, open record WEBLIB_LM_ELM, field LM_ISCRIPT, FieldFormula PeopleCode event and add the following (there are two distinct places where you must place this code):

/**
*IScript which will be called for AICC-HACP communication
*/
Function IScript_HACP_COMM()
   <****Testing code *****/*
   &sep = Char(13) | Char(10);
   Local string &s = "error=0" | &sep | "version=1.2" | &sep | "aicc_data=[core]" | &sep | "student_ID=aicc-user01" | &sep | "student_name=PS,TB" | &sep | "Output_file=" | &sep | "credit=C" | &sep | "lesson_location=" | &sep | "lesson_mode=sequential" | &sep | "lesson_status=Not Attempted" | &sep | "path=" | &sep | "score=" | &sep | "time=00:23:15";
  
   %Response.SetContentType("text/plain");
   %Response.WriteLine(&s);
   Return;
    /*****End of Testing code **************/*>
  
   /******New Code For Capture**********/
   Local File &DummyFile = GetFile("c:\\temp\\output.txt", "A", %FilePath_Absolute);
   &DateTime = %Datetime;
   &DummyFile.WriteLine(&DateTime);
   &DummyFile.WriteLine("-----------Begin Request Param List----------");
   &parameter_array = %Request.GetParameterNames();
   For &i = 1 To &parameter_array.len
      &parameter_name = &parameter_array [&i];
      &parameter_value = %Request.GetParameter(&parameter_name);
      &DummyFile.WriteLine(&parameter_name | " = " | &parameter_value);
   End-For;
   &DummyFile.WriteLine("-----------End Request Param List------------");
  
  
   /*Get the command , session id and the AICC_Data from the input and pass it for processing */
   Local string &str_Command = %Request.GetParameter("command");
   Local string &str_SessionId = %Request.GetParameter("session_id");
   Local string &str_AiccData = Unencode(%Request.GetParameter("AICC_Data"));
  
   /*Extract the Enrollment Id , LC id and the AU Id */
   Local LEM_UTILITIES:Utility &hacpCommUtil = create LEM_UTILITIES:Utility();
   Local array of string &ar_SplitArr = &hacpCommUtil.SplitString(&str_SessionId, ":", 0, 0);
   Local number &nbr_EnrollmentId;
   Local number &nbr_LCId;
   Local string &str_AUId;
   If (&ar_SplitArr.Len <> 3) Then
      &nbr_EnrollmentId = &hacpCommUtil.TEST_ENROLLMENT_ID;
      &nbr_LCId = 1;
      &str_AUId = "1";
   Else
      &nbr_EnrollmentId = Value(&ar_SplitArr [1]);
      &nbr_LCId = Value(&ar_SplitArr [2]);
      &str_AUId = &ar_SplitArr [3];
   End-If;
   Local LEM_COMM:CommHandler &aiccObj = create LEM_COMM:CommHandler(&hacpCommUtil, &hacpCommUtil.AHACP, &nbr_EnrollmentId, &nbr_LCId, &str_AUId);
   Local LEM_UTILITIES:StringHashtable &hsh_TrackHash = Null;
   Local string &str_HACPResponse = "";
   /*Depending on the command, call the appropriate methods */
   Evaluate Upper(&str_Command)
   When "GETPARAM"
      /*For query, get the Tracking data for the given SCO and enrollment id */
      &hsh_TrackHash = &aiccObj.GetTrackingData();
      /*If no tracking data was found, return a 'invalid sessionid error */
      If (&hsh_TrackHash = Null) Then
         &str_HACPResponse = &aiccObj.FormHACPResponse("3", "");
      Else
         /*Form the Response String */
         &str_HACPResponse = &aiccObj.FormHACPResponse("0", &aiccObj.FormAiccData(&hsh_TrackHash));
      End-If;
      Break;
     
   When "PUTPARAM"
      /*For update, Update the existing tracking data for the given SCO and enrollment id and write out
           errorcode of 0
          */
      If (&nbr_EnrollmentId <> &hacpCommUtil.TEST_ENROLLMENT_ID) Then
         /*Populate a hashtable with the new data */
         Local LEM_UTILITIES:StringHashtable &hsh_NewTrackHash = &aiccObj.ParseAiccData(&str_AiccData);
         If (&hsh_NewTrackHash <> Null) Then
            /*Calculate total time and populate that value also */
            &hsh_TrackHash = &aiccObj.GetTrackingData();
            Local string &str_TotalTime;
            try
               &str_TotalTime = &hacpCommUtil.AddTime(&hsh_NewTrackHash.Get("cmi.core.session_time"), &hsh_TrackHash.Get("cmi.core.total_time"));
            catch Exception &ex
               &str_TotalTime = &hsh_NewTrackHash.Get("cmi.core.session_time");
            end-try;
            &hsh_NewTrackHash.Put("cmi.core.total_time", &str_TotalTime);
            &hsh_TrackHash = &aiccObj.UpdateTrackingData(&hsh_NewTrackHash);
         End-If;
      End-If;
      /*Form the response string */
      &str_HACPResponse = &aiccObj.FormHACPResponse("0", "");
      Break;
     
   When "EXITAU"
      Local LEM_DB:DBManager &dbObj = create LEM_DB:DBManager(create LEM_UTILITIES:Utility());
      Local string &str_ScoId = &str_AUId;
      Local LEM_UTILITIES:Utility &dispMenuUtilObj = create LEM_UTILITIES:Utility();
      If &dispMenuUtilObj.LOGOUT Then
         If &dbObj.DidLessonLogOut(&nbr_EnrollmentId, &nbr_LCId, &str_ScoId) Then
            &dbObj.UpdateLessonLogOut(&nbr_EnrollmentId, &nbr_LCId, &str_ScoId);
         End-If;
      End-If;
      /*Form the response string */
      &str_HACPResponse = &aiccObj.FormHACPResponse("0", "");
      Break;
     
   When-Other /*Invalid command */
      &str_HACPResponse = &aiccObj.FormHACPResponse("1", "");
      Break;
     
   End-Evaluate;
  
   /*********New Code for Capture**********/
   &DummyFile.WriteLine("-----------Begin HACP Response---------------");
   &DummyFile.WriteLine(&str_HACPResponse);
   &DummyFile.WriteLine("-----------End HACP Response-----------------");
   &DummyFile.WriteLine("");
   &DummyFile.WriteLine("");
   &DummyFile.WriteLine("");
   &DummyFile.Close();
  
   %Response.SetContentType("text/plain");
   %Response.Write(&str_HACPResponse);
  
  
End-Function;

The file output.txt captures statuses and scores that the content passes into the LM_TRACK_STUDNT record. Please note that the system creates this file on the application server machine. You should adjust the path if you are running the application server on UNIX. If this approach works with your content, but you'd like a bit more information coming back, ask your global support center analyst for the extended version of the code.

For Sharable Content Object Reference Model (SCORM) data, you can enable JavaScript pop-ups that give you detailed information about communication between ELM and the content. To enable pop-ups, go to the Application Designer and open HTML object LM_SCORM_API_JS_1. On line 6, set var debug = 5, and save. You do not need to restart the application or web server. You will need to navigate away from the launch page and come back to it and relaunch the content for the pop-ups to begin appearing. Once you complete troubleshooting, set the debug variable back to 0 in the LM_SCORM_API_JS_1 object.