Esempio n. 1
0
        /// <summary>
        /// Coroutine for sending an xAPI Statement.
        ///
        /// This version requires a constructed Statement object.
        /// </summary>
        /// <param name="statement"></param>
        /// <param name="callback"></param>
        /// <returns></returns>
        public static IEnumerator SendStatementRoutine(Statement statement, Action <StatementStoredResponse> callback = null)
        {
            var outboundArray = new Statement[] { statement };

            yield return(XAPIMessenger.SendMultiStatementRoutine(outboundArray, res =>
            {
                if (callback != null)
                {
                    callback(new StatementStoredResponse {
                        Request = res.Request,
                        Statement = res.Statements == null ? null : res.Statements[0],
                        StatementID = res.StatementIDs == null ? null : res.StatementIDs[0]
                    });
                }
            }));
        }
Esempio n. 2
0
 /// <summary>
 /// Sends an xAPI statement.  This accepts a full statement as an argument.
 /// </summary>
 /// <param name="statement"></param>
 /// <param name="callback"></param>
 public static void SendStatements(Statement[] statements, Action <MultiStatementStoredResponse> callback = null)
 {
     XAPIMessenger.instance.StartCoroutine(XAPIMessenger.SendMultiStatementRoutine(statements, callback));
 }