Ejemplo n.º 1
0
 public ActivityDefinition(JObject jobj)
 {
     if (jobj["type"] != null)
     {
         type = new Uri(jobj.Value <String>("type"));
     }
     if (jobj["moreInfo"] != null)
     {
         moreInfo = new Uri(jobj.Value <String>("moreInfo"));
     }
     if (jobj["name"] != null)
     {
         name = (LanguageMap)jobj.Value <JObject>("name");
     }
     if (jobj["description"] != null)
     {
         description = (LanguageMap)jobj.Value <JObject>("description");
     }
     if (jobj["extensions"] != null)
     {
         extensions = (Extensions)jobj.Value <JObject>("extensions");
     }
     if (jobj["interactionType"] != null)
     {
         interactionType = InteractionType.FromValue(jobj.Value <String>("interactionType"));
     }
     if (jobj["correctResponsesPattern"] != null)
     {
         correctResponsesPattern = ((JArray)jobj["correctResponsesPattern"]).Select(x => x.Value <String>()).ToList <String>();
     }
     if (jobj["choices"] != null)
     {
         choices = new List <InteractionComponent>();
         foreach (JObject jchoice in jobj["choices"])
         {
             choices.Add(new InteractionComponent(jchoice));
         }
     }
     if (jobj["scale"] != null)
     {
         scale = new List <InteractionComponent>();
         foreach (JObject jscale in jobj["scale"])
         {
             scale.Add(new InteractionComponent(jscale));
         }
     }
     if (jobj["source"] != null)
     {
         source = new List <InteractionComponent>();
         foreach (JObject jsource in jobj["source"])
         {
             source.Add(new InteractionComponent(jsource));
         }
     }
     if (jobj["target"] != null)
     {
         target = new List <InteractionComponent>();
         foreach (JObject jtarget in jobj["target"])
         {
             target.Add(new InteractionComponent(jtarget));
         }
     }
     if (jobj["steps"] != null)
     {
         steps = new List <InteractionComponent>();
         foreach (JObject jstep in jobj["steps"])
         {
             steps.Add(new InteractionComponent(jstep));
         }
     }
 }
Ejemplo n.º 2
0
 public ActivityDefinition(JObject jobj)
 {
     if (jobj["type"] != null)
     {
         type = new Uri(jobj.Value <string>("type"));
     }
     if (jobj["moreInfo"] != null)
     {
         moreInfo = new Uri(jobj.Value <string>("moreInfo"));
     }
     if (jobj["name"] != null)
     {
         name = (LanguageMap)jobj.Value <JObject>("name");
     }
     if (jobj["description"] != null)
     {
         description = (LanguageMap)jobj.Value <JObject>("description");
     }
     if (jobj["extensions"] != null)
     {
         extensions = (Extensions)jobj.Value <JObject>("extensions");
     }
     /* CAW 8-10-2017: Added from here... */
     if (jobj["interactionType"] != null)
     {
         interactionType = InteractionType.FromValue(jobj.Value <string>("interactionType"));
     }
     if (jobj["correctResponsesPattern"] != null)
     {
         correctResponsesPattern = ((JArray)jobj["correctResponsesPattern"]).Select(x => x.Value <string>()).ToList();
     }
     if (jobj["choices"] != null)
     {
         choices = new List <InteractionComponent>();
         foreach (var jToken in jobj["choices"])
         {
             var jchoice = (JObject)jToken;
             choices.Add(new InteractionComponent(jchoice));
         }
     }
     if (jobj["scale"] != null)
     {
         scale = new List <InteractionComponent>();
         foreach (var jToken in jobj["scale"])
         {
             var jscale = (JObject)jToken;
             scale.Add(new InteractionComponent(jscale));
         }
     }
     if (jobj["source"] != null)
     {
         source = new List <InteractionComponent>();
         foreach (var jToken in jobj["source"])
         {
             var jsource = (JObject)jToken;
             source.Add(new InteractionComponent(jsource));
         }
     }
     if (jobj["target"] != null)
     {
         target = new List <InteractionComponent>();
         foreach (var jToken in jobj["target"])
         {
             var jtarget = (JObject)jToken;
             target.Add(new InteractionComponent(jtarget));
         }
     }
     if (jobj["steps"] != null)
     {
         steps = new List <InteractionComponent>();
         foreach (var jToken in jobj["steps"])
         {
             var jstep = (JObject)jToken;
             steps.Add(new InteractionComponent(jstep));
         }
     }
     /* CAW 8-10-2017: To Here */
 }