diff --git a/TinCan/Context.cs b/TinCan/Context.cs index d41c73f..1091bd1 100644 --- a/TinCan/Context.cs +++ b/TinCan/Context.cs @@ -43,13 +43,25 @@ public Context(JObject jobj) } if (jobj["instructor"] != null) { - // TODO: can be Group? - instructor = (Agent)jobj.Value("instructor"); + if (jobj["instructor"]["objectType"] != null && (String)jobj["instructor"]["objectType"] == Group.OBJECT_TYPE) + { + instructor = (Group)jobj.Value("instructor"); + } + else + { + instructor = (Agent)jobj.Value("instructor"); + } } if (jobj["team"] != null) { - // TODO: can be Group? - team = (Agent)jobj.Value("team"); + if (jobj["team"]["objectType"] != null && (String)jobj["team"]["objectType"] == Group.OBJECT_TYPE) + { + team = (Group)jobj.Value("team"); + } + else + { + team = (Agent)jobj.Value("team"); + } } if (jobj["contextActivities"] != null) {