public SetResult Set(ScormSet set)
        {
            // strip off cmi. for test harness
            string element = set.GetIdentifier().Replace("cmi.", "");

            string commandstring = "Set " + element + " " + "\"" + set.GetValue() + "\"";

            parser.Process(commandstring);
            Console.WriteLine("API_1484_11.SetValue(\"" + set.GetIdentifier() + "\",\"" + set.GetValue() + "\");");
            return(SetResult.Ok);
        }
Esempio n. 2
0
 ///<summary>
 ///Set a value on the javascript API
 ///</summary>
 ///<remarks>
 ///Implements the interface in ScormWrapper, and looks syncronous to the caller.
 ///</remarks>
 ///<returns>
 ///A SetResult enum with the return value of the set command
 ///</returns>
 ///<param name="identifier">
 ///the dot notation identifier of the data model element to get
 ///does the 2004/1.2 conversion.
 ///</param>
 public SetResult Set(ScormSet set)
 {
     if (set.GetValue() != "not_set")
     {
         int key = SetupCallback();
         Log("Set  " + set.GetIdentifier() + " to " + set.GetValue());
         UnityEngine.Application.ExternalCall("doSetValue", new object[] { set.GetIdentifier(), set.GetValue(), CallbackObjectName, CallbackFunctionName, key });
         APICallResult returnval = WaitForReturn(key);
         if (returnval.ErrorCode == "")
         {
             Log("Got " + returnval.Result);
             return(SetResult.Ok);
         }
         else
         {
             Log("Error:" + returnval.ErrorCode.ToString() + " " + returnval.ErrorDescription);
             return(SetResult.Error);
         }
     }
     return(SetResult.Ok);
 }
        public SetResult Set(ScormSet set)
        {
            //  set = mConverter.Map2004_to_12(set);

            string commandstring = set.GetIdentifier() + " " + set.GetValue();

            commandstring = commandstring.Replace("._count", ".length");
            commandstring = commandstring.Substring(4);
            commandstring = "Set " + commandstring;
            parser.Process(commandstring);
            Console.WriteLine(commandstring);

            return(SetResult.Ok);
        }
 ///<summary>
 ///Set a value on the javascript API
 ///</summary>
 ///<remarks> 
 ///Implements the interface in ScormWrapper, and looks syncronous to the caller.
 ///</remarks>
 ///<returns>
 ///A SetResult enum with the return value of the set command
 ///</returns>
 ///<param name="identifier">
 ///the dot notation identifier of the data model element to get
 ///does the 2004/1.2 conversion.
 ///</param>
 public SetResult Set(ScormSet set)
 {
     if(set.GetValue() != "not_set")
     {
         int key = SetupCallback();
         Log( "Set  " + set.GetIdentifier() + " to " + set.GetValue());
         UnityEngine.Application.ExternalCall("doSetValue", new object[] { set.GetIdentifier(), set.GetValue(), CallbackObjectName, CallbackFunctionName, key });
         APICallResult returnval = WaitForReturn(key);
         if(returnval.ErrorCode == "")
         {
             Log("Got " + returnval.Result);
             return SetResult.Ok;
         }
         else
         {
             Log("Error:" + returnval.ErrorCode.ToString() + " " + returnval.ErrorDescription);
             return SetResult.Error;
         }
     }
     return SetResult.Ok;
 }
        public SetResult Set(ScormSet set)
        {
            //  set = mConverter.Map2004_to_12(set);

            string commandstring = set.GetIdentifier() + " " + set.GetValue();
            commandstring = commandstring.Replace("._count", ".length");
            commandstring = commandstring.Substring(4);
            commandstring = "Set " + commandstring;
            parser.Process(commandstring);
            Console.WriteLine(commandstring);

            return SetResult.Ok;
        }
        public SetResult Set(ScormSet set)
        {
            // strip off cmi. for test harness
            string element = set.GetIdentifier().Replace("cmi.", "");

            string commandstring = "Set " + element + " " + "\"" + set.GetValue() + "\"";
            parser.Process(commandstring);
            Console.WriteLine("API_1484_11.SetValue(\"" + set.GetIdentifier() + "\",\"" + set.GetValue() + "\");");
            return SetResult.Ok;
        }