Пример #1
0
 /// <summary>
 /// Send the given statement to the configured LRS.
 /// </summary>
 /// <param name="statements">Statement to send.</param>
 /// <param name="callback">Optional callback for once this operation ends.</param>
 public static void SendStatement(Statement statement, Action <StatementStoredResponse> callback = null)
 {
     // Make sure we have a messenger.  Each overload of this function eventually
     // uses this version, so we only need to check for a messenger here.
     //
     XAPIWrapper.CheckMessenger();
     XAPIMessenger.SendStatement(statement, callback);
 }
Пример #2
0
        /// <summary>
        /// Assign an LRS configuration to this wrapper.  This configuration will be used for
        /// all statements sent after assignment.
        /// </summary>
        /// <param name="config"></param>
        public static void AssignConfig(Config config)
        {
            // Make sure our messenger exists
            XAPIWrapper.CheckMessenger();

            // Relay this to it
            XAPIMessenger.AssignConfig(config);
        }
Пример #3
0
        /// <summary>
        /// Retrieves a single statement from the configured LRS.
        ///
        /// As you can't overload a function with identical argument types, this is private with
        /// a slightly different name.
        /// </summary>
        /// <param name="url"></param>
        /// <param name="callback"></param>
        private static void GetStatement(StatementQuery query, Action <Statement, UnityWebRequest> callback)
        {
            // Make sure we have a messenger
            XAPIWrapper.CheckMessenger();

            // Build the fully qualified URL
            string url = XAPIMessenger.Config.StatementEndpoint + query.BuildQueryString();;

            XAPIMessenger.GetStatement(url, callback);
        }
Пример #4
0
 /// <summary>
 /// Send an array of statements to the configured LRS.
 /// </summary>
 /// <param name="statements">Statements to send.</param>
 /// <param name="callback">Optional callback for once this operation ends.</param>
 public static void SendStatements(Statement[] statements, Action <MultiStatementStoredResponse> callback = null)
 {
     XAPIWrapper.CheckMessenger();
     XAPIMessenger.SendStatements(statements, callback);
 }
Пример #5
0
 /// <summary>
 /// Retrieves statements from a fully-qualified URL pointing to the configured LRS.
 ///
 /// This is the most granular version of the call and should only be made by the wrapper itself.
 /// </summary>
 /// <param name="url"></param>
 /// <param name="callback"></param>
 public static void GetStatements(string url, Action <StatementResult, UnityWebRequest> callback)
 {
     // Make sure we have a messenger
     XAPIWrapper.CheckMessenger();
     XAPIMessenger.GetStatements(url, callback);
 }