public TrackingEvent(int desId, List <int> desTriggerEvents, int desCount, objectiveType desObjectiveType, string unfin, string fin, bool tut = false) { id = desId; triggerEvents = desTriggerEvents; desiredCount = desCount; typeOfEvent = desObjectiveType; unfinishedString = unfin; finishedString = fin; tutorialPopup = tut; if (id == 0) { active = true; } }
public void objectiveTest() { LETSIRTE_Service client = getClient(); string obj1ID = "test_obj_1"; string obj2ID = "TeSt_obj_1"; cocdType cocd = client.Get(); objectiveType obj = cocd.GetObjective(obj1ID, true); obj.description = new objectiveTypeDescription(); obj.description.Value = "test 1"; obj.successStatus = successStatusType.passed; obj.successStatusSpecified = true; obj = cocd.GetObjective(obj2ID, true); obj.description = new objectiveTypeDescription(); obj.description.Value = "really objective 2"; obj.successStatusSpecified = false; //cocd.AddObjective(new objectiveType()); //TODO: test creating and then doing nothing else with an objective -- doesn't work cocd.exit = exit.suspend; cocd.exitSpecified = true; client.Set(cocd); cocd = client.Get(); obj = cocd.GetObjective(obj2ID, false); Assert.IsNotNull(obj, obj2ID); Assert.AreEqual(obj2ID, obj.identifier); Assert.AreEqual(obj.description.Value, "really objective 2"); Assert.AreEqual(successStatusType.unknown, obj.successStatus, obj.identifier + "success status "); obj = cocd.GetObjective(obj1ID, false); Assert.IsNotNull(obj, obj1ID); Assert.AreEqual(obj1ID, obj.identifier); Assert.AreEqual(obj.description.Value, "test 1"); Assert.AreEqual(successStatusType.passed, obj.successStatus); Assert.AreEqual(true, obj.successStatusSpecified, obj.identifier + "success status specified"); }
///<summary> ///Add an objective to the course data. ///</summary> ///<returns> ///A new objective object. ///</returns> ///<remarks> ///The new objective object created is added into the array, it is not necessary to add it ///again manually. The identifier is generated automatically, as is the timestamp. ///The new objective defaults to not-attempted, and the sucess is unknown. ///</remarks> public static objectiveType AddObjective() { objectiveType obj = new objectiveType(); obj.id = "urn:ADL:objective-id-" + GetLearnerRecord().objectives.Count.ToString(); obj.completion_status = completionStatusType.not_attempted; obj.description.Value = "This is objective description"; obj.description.lang = "en-US"; obj.progress_measure = (decimal)0; obj.score.min = (decimal)0; obj.score.max = (decimal)100; obj.score.raw = (decimal)0; obj.score.scaled = (decimal)0; obj.success_status = successStatusType.unknown; GetLearnerRecord().objectives.Add(obj); return(obj); }