Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            {
                //Serialize a cocdtype to a scorm API
                //create an object to handle the get set calls
                InMemoryScormSimulator2004 sim2004 = new InMemoryScormSimulator2004();
                InMemoryScormSimulator1_2 sim12 = new InMemoryScormSimulator1_2();

                Scorm1_2.DataModel model12 = ScormSerialization.ScormDatamodelCommandParser1_2.GetTestData1_2();
                ScormSerializer serialize12 = new ScormSerializer(model12);
                serialize12.Serialize(sim12);

                ScormVersionConversion.DataModel.Translate(new Scorm1_2.DataModel());
                ScormVersionConversion.DataModel.Translate(new Scorm2004.DataModel());

                Console.WriteLine("\n*****Translated to 2004*****\n");
                Scorm2004.DataModel model2004 = ScormVersionConversion.DataModel.Translate(model12);
                //create a serializer for the lr object
                ScormSerializer serialize2004 = new ScormSerializer(model2004);
                //serialize the lr object to the InMemoryScormSimulator
                serialize2004.Serialize(sim2004);

                Console.WriteLine("\n*****Translated Back to 12*****\n");

                model12 = ScormVersionConversion.DataModel.Translate(model2004);
                serialize12 = new ScormSerializer(model12);
                serialize12.Serialize(sim12);

            }
        }
Ejemplo n.º 2
0
    ///<summary>
    ///Internal communication with Javascript components
    ///</summary>
    ///<remarks>
    ///Serializes the entire SCORM datamodel object to the correct API calls, and sends to the 
    ///Javascript API
    ///</remarks> 
    private static void SubmitStudentData_imp( object b )
    {
        BroadcastDelegate broadcast = (BroadcastDelegate) b;

        try{
            if(!CheckThread())return;
            WaitForInitialize();
            if(ScormBridge.IsScorm2004)
            {
                ScormSerializer serializer = new ScormSerializer(StudentRecord);
                serializer.Serialize(ScormBridge);
                ScormBridge.Commit();
            }else
            {
                Scorm1_2.DataModel tempdata = ScormVersionConversion.DataModel.Translate(StudentRecord);
                ScormSerializer serializer = new ScormSerializer(tempdata);
                serializer.Serialize(ScormBridge);
                ScormBridge.Commit();
            }
        }catch(System.Exception e)
        {
            UnityEngine.Application.ExternalCall("DebugPrint", "***ERROR***" + e.Message +"<br/>"
                + e.StackTrace + "<br/>" + e.Source
            );
        }
        broadcast("Scorm_Commit_Complete", SendMessageOptions.RequireReceiver);
    }
Ejemplo n.º 3
0
 ///<summary>
 ///Internal communication with Javascript components
 ///</summary>
 ///<remarks>
 ///Serializes the entire SCORM datamodel object to the correct API calls, and sends to the 
 ///Javascript API
 ///</remarks> 
 private static void SubmitStudentData_imp()
 {
     try{
     if(!CheckThread())return;
     WaitForInitialize();
     if(ScormBridge.IsScorm2004)
     {
         ScormSerializer serializer = new ScormSerializer(StudentRecord);
         serializer.Serialize(ScormBridge);
         ScormBridge.Commit();
     }else
     {
         Scorm1_2.DataModel tempdata = ScormVersionConversion.DataModel.Translate(StudentRecord);
         ScormSerializer serializer = new ScormSerializer(tempdata);
         serializer.Serialize(ScormBridge);
         ScormBridge.Commit();
     }
     }catch(System.Exception e)
     {
             UnityEngine.Application.ExternalCall("DebugPrint", "***ERROR***" + e.Message +"<br/>" + e.StackTrace + "<br/>" + e.Source );
     }
     GameObject.Find(ObjectName).BroadcastMessage("Scorm_Commit_Complete");
 }