コード例 #1
0
 /// <summary>
 /// Creates a Statement with the minimum suggested properties
 /// </summary>
 /// <param name="actor">The actor in this statement</param>
 /// <param name="verb">The verb in this statement</param>
 /// <param name="statementTarget">The target of this statement</param>
 public Statement(Actor actor, StatementVerb verb, StatementTarget statementTarget)
 {
     this.actor   = actor;
     this.verb    = verb;
     this._object = statementTarget;
 }
コード例 #2
0
 /// <summary>
 /// Creates a Statement with the minimum suggested properties
 /// </summary>
 /// <param name="actor">The actor in this statement</param>
 /// <param name="verb">The verb in this statement</param>
 /// <param name="statementTarget">The target of this statement</param>
 public Statement(Actor actor, StatementVerb verb, StatementTarget statementTarget)
 {
     this.actor = actor;
     this.verb = verb;
     this._object = statementTarget;
 }
コード例 #3
0
ファイル: TinCan.cs プロジェクト: jonesd52/cse498-desktop
        public static void SendStatement(string activity)
        {
            string email = "mailto:";
            email += username;

            Statement[] statements = new Statement[1];
            Activity newAct = new Activity("http://35.9.22.105/xapi");

            LanguageMap inter = new LanguageMap();
            inter.Add("en-US", "Interacted");
            System.Uri verbURI = new System.Uri("http://verbs/interaction/");
            StatementVerb interact = new StatementVerb(verbURI, inter);

            newAct.Definition = new ActivityDefinition();
            newAct.Definition.Name = new LanguageMap();
            newAct.Definition.Description = new LanguageMap();
            newAct.Definition.Description.Add("type", "Desktop Application Learning Activity");
            newAct.Definition.Name.Add("en-US", activity);
            Random rand = new Random();
            int random = rand.Next();
            newAct.Id = "http://" + random.ToString() + "/desktopapp/" + activity;

            statements[0] = new Statement(new Actor(username, email), interact, newAct);

            try
            {
                tincan.StoreStatements(statements);
            }
            catch (Exception e)
            {
                _offlineQueuedStatements.Enqueue(statements[0]);
            }
        }