Ejemplo n.º 1
0
        public void SaveActivityProgress(LearningActivity activity, ICollection <AppTask> progress, string enteredUsername)
        {
            List <AppTask> trimmed = progress.Where(t => t != null).ToList();

            ActivityProgress latestProg = new ActivityProgress
            {
                ActivityId      = activity.Id,
                ActivityVersion = activity.ActivityVersionNumber,
                EnteredUsername = enteredUsername,
                JsonData        = JsonConvert.SerializeObject(activity,
                                                              new JsonSerializerSettings
                {
                    TypeNameHandling      = TypeNameHandling.Objects,
                    ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
                    MaxDepth = 5
                }),
                AppTaskJson = JsonConvert.SerializeObject(trimmed,
                                                          new JsonSerializerSettings
                {
                    TypeNameHandling      = TypeNameHandling.Objects,
                    ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
                    MaxDepth = 5
                }),
            };

            AddProgress(latestProg);
            ShouldRefreshFeed = true;
        }
Ejemplo n.º 2
0
 public void DeleteProgress(ActivityProgress data)
 {
     connection.Delete <ActivityProgress>(data.ActivityId);
 }
Ejemplo n.º 3
0
 public void AddProgress(ActivityProgress data)
 {
     connection.InsertOrReplace(data);
 }