From a6d22640145a49e7ca606027d2ebde63187f86a4 Mon Sep 17 00:00:00 2001 From: olivergurnell Date: Tue, 1 Dec 2015 10:28:37 +0000 Subject: [PATCH 1/8] ActivityDefinition InteractionType ActivityDefinition has been extended to include: interactionType correctResponsesPattern choices scale target step This as been based on the work carried out by Paul Carpenter and is my first GitHub submission. --- TinCan.sln | 4 +- TinCan/ActivityDefinition.cs | 129 +++++++++++++++++++++++++++++++-- TinCan/InteractionComponent.cs | 68 +++++++++++++++++ TinCan/InteractionType.cs | 76 +++++++++++++++++++ TinCan/TinCan.csproj | 2 + TinCanTests/Support.cs | 24 +++++- 6 files changed, 293 insertions(+), 10 deletions(-) create mode 100644 TinCan/InteractionComponent.cs create mode 100644 TinCan/InteractionType.cs diff --git a/TinCan.sln b/TinCan.sln index e8785c5..d0a2d97 100644 --- a/TinCan.sln +++ b/TinCan.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCan", "TinCan\TinCan.csproj", "{27D0FCA1-E869-440C-9D16-F62D7A068C53}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCanTests", "TinCanTests\TinCanTests.csproj", "{854413C2-2F81-4A82-9949-DE2868A10078}" diff --git a/TinCan/ActivityDefinition.cs b/TinCan/ActivityDefinition.cs index a9fe2af..07453ef 100644 --- a/TinCan/ActivityDefinition.cs +++ b/TinCan/ActivityDefinition.cs @@ -14,9 +14,13 @@ You may obtain a copy of the License at limitations under the License. */ using System; +using System.Linq; +using System.Collections.Generic; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using TinCan.Json; + namespace TinCan { public class ActivityDefinition : JsonModel @@ -26,13 +30,13 @@ public class ActivityDefinition : JsonModel public LanguageMap name { get; set; } public LanguageMap description { get; set; } public Extensions extensions { get; set; } - //public InteractionType interactionType { get; set; } - //public List correctResponsesPattern { get; set; } - //public List choices { get; set; } - //public List scale { get; set; } - //public List source { get; set; } - //public List target { get; set; } - //public List steps { get; set; } + public InteractionType interactionType { get; set; } + public List correctResponsesPattern { get; set; } + public List choices { get; set; } + public List scale { get; set; } + public List source { get; set; } + public List target { get; set; } + public List steps { get; set; } public ActivityDefinition() {} @@ -60,11 +64,62 @@ public ActivityDefinition(JObject jobj) { extensions = (Extensions)jobj.Value("extensions"); } + if (jobj["interactionType"] != null) + { + interactionType = InteractionType.FromValue(jobj.Value("interactionType")); + } + if (jobj["correctResponsesPattern"] != null) + { + correctResponsesPattern = ((JArray)jobj["correctResponsesPattern"]).Select(x => x.Value()).ToList(); + } + if (jobj["choices"] != null) + { + choices = new List(); + foreach (JObject jchoice in jobj["choices"]) + { + choices.Add(new InteractionComponent(jchoice)); + } + } + if (jobj["scale"] != null) + { + scale = new List(); + foreach (JObject jscale in jobj["scale"]) + { + scale.Add(new InteractionComponent(jscale)); + } + } + if (jobj["source"] != null) + { + source = new List(); + foreach (JObject jsource in jobj["source"]) + { + source.Add(new InteractionComponent(jsource)); + } + } + if (jobj["target"] != null) + { + target = new List(); + foreach (JObject jtarget in jobj["target"]) + { + target.Add(new InteractionComponent(jtarget)); + } + } + if (jobj["steps"] != null) + { + steps = new List(); + foreach (JObject jstep in jobj["steps"]) + { + steps.Add(new InteractionComponent(jstep)); + } + } + + + } public override JObject ToJObject(TCAPIVersion version) { JObject result = new JObject(); - + if (type != null) { result.Add("type", type.ToString()); @@ -85,6 +140,64 @@ public override JObject ToJObject(TCAPIVersion version) { { result.Add("extensions", extensions.ToJObject(version)); } + if (interactionType != null) + { + result.Add("interactionType", interactionType.Value); + } + if (correctResponsesPattern != null && correctResponsesPattern.Count > 0) + { + result.Add("correctResponsesPattern", JToken.FromObject(correctResponsesPattern)); + } + if (choices != null && choices.Count > 0) + { + var jchoices = new JArray(); + result.Add("choices", jchoices); + + foreach (InteractionComponent ichoice in choices) + { + jchoices.Add(ichoice.ToJObject(version)); + } + } + if (scale != null && scale.Count > 0) + { + var jscale = new JArray(); + result.Add("scale", jscale); + + foreach (InteractionComponent iscale in scale) + { + jscale.Add(iscale.ToJObject(version)); + } + } + if (source != null && source.Count > 0) + { + var jsource = new JArray(); + result.Add("source", jsource); + + foreach (InteractionComponent isource in source) + { + jsource.Add(isource.ToJObject(version)); + } + } + if (target != null && target.Count > 0) + { + var jtarget = new JArray(); + result.Add("target", jtarget); + + foreach (InteractionComponent itarget in target) + { + jtarget.Add(itarget.ToJObject(version)); + } + } + if (steps != null && steps.Count > 0) + { + var jsteps = new JArray(); + result.Add("steps", jsteps); + + foreach (InteractionComponent istep in steps) + { + jsteps.Add(istep.ToJObject(version)); + } + } return result; } diff --git a/TinCan/InteractionComponent.cs b/TinCan/InteractionComponent.cs new file mode 100644 index 0000000..1b0b324 --- /dev/null +++ b/TinCan/InteractionComponent.cs @@ -0,0 +1,68 @@ +/* + Copyright 2014 Rustici Software + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +using System; +using System.Collections.Generic; +using Newtonsoft.Json.Linq; +using TinCan.Json; + +namespace TinCan +{ + public class InteractionComponent : JsonModel + { + public String id; + public LanguageMap description { get; set; } + + public InteractionComponent() + { + + } + + public InteractionComponent(JObject jobj) + { + if (jobj["id"] != null) + { + id = jobj.Value("id"); + } + if (jobj["description"] != null) + { + description = (LanguageMap)jobj.Value("description"); + } + + } + + public override JObject ToJObject(TCAPIVersion version) { + JObject result = new JObject(); + + if (id != null) + { + result.Add("id", id); + } + if (description != null && !description.isEmpty()) + { + result.Add("description", description.ToJObject(version)); + } + + return result; + } + + public static explicit operator InteractionComponent(JObject jobj) + { + return new InteractionComponent(jobj); + } + + } + +} diff --git a/TinCan/InteractionType.cs b/TinCan/InteractionType.cs new file mode 100644 index 0000000..088f1db --- /dev/null +++ b/TinCan/InteractionType.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TinCan +{ + public sealed class InteractionType + { + private const string choice = "choice"; + private const string sequencing = "sequencing"; + private const string likert = "likert"; + private const string matching = "matching"; + private const string performance = "performance"; + private const string truefalse = "true-false"; + private const string fillin = "fill-in"; + private const string numeric = "numeric"; + private const string other = "other"; + + + public static readonly InteractionType Choice = new InteractionType("choice"); + public static readonly InteractionType Sequencing = new InteractionType("sequencing"); + public static readonly InteractionType Likert = new InteractionType("likert"); + public static readonly InteractionType Matching = new InteractionType("matching"); + public static readonly InteractionType Performance = new InteractionType("performance"); + public static readonly InteractionType TrueFalse = new InteractionType("true-false"); + public static readonly InteractionType FillIn = new InteractionType("fill-in"); + public static readonly InteractionType Numeric = new InteractionType("numeric"); + public static readonly InteractionType Other = new InteractionType("other"); + + + private InteractionType(string value) + { + Value = value; + } + + public static InteractionType FromValue(string value) + { + switch (value) + { + case choice: + return Choice; + + case sequencing: + return Sequencing; + + case likert: + return Likert; + + case matching: + return Matching; + + case performance: + return Performance; + + case truefalse: + return TrueFalse; + + case fillin: + return FillIn; + + case numeric: + return Numeric; + + case other: + return Other; + + default: + return null; + + } + } + + public string Value { get; private set; } + } +} diff --git a/TinCan/TinCan.csproj b/TinCan/TinCan.csproj index 1fe1a35..9479ab0 100644 --- a/TinCan/TinCan.csproj +++ b/TinCan/TinCan.csproj @@ -60,6 +60,8 @@ + + diff --git a/TinCanTests/Support.cs b/TinCanTests/Support.cs index 0c9e098..2b217bd 100644 --- a/TinCanTests/Support.cs +++ b/TinCanTests/Support.cs @@ -48,6 +48,27 @@ static Support () { activity.definition.description = new LanguageMap(); activity.definition.description.Add("en-US", "Unit test 0 in the test suite for the Tin Can C# library."); + activity.definition.interactionType = InteractionType.Choice; + activity.definition.choices = new List(); + + for (int i = 1; i <= 3; i++) + { + InteractionComponent interactionComponent = new InteractionComponent(); + + interactionComponent.id = "choice-" + i.ToString(); + interactionComponent.description = new LanguageMap(); + interactionComponent.description.Add("en-US", "Choice " + i.ToString()); + + activity.definition.choices.Add(interactionComponent); + } + + activity.definition.correctResponsesPattern = new List(); + + for (int i = 1; i <= 2; i++) + { + activity.definition.correctResponsesPattern.Add("choice-" + i.ToString()); + } + parent = new Activity(); parent.id = new Uri("http://tincanapi.com/TinCanCSharp/Test"); parent.definition = new ActivityDefinition(); @@ -65,7 +86,7 @@ static Support () { context.statement = statementRef; context.contextActivities = new ContextActivities(); context.contextActivities.parent = new List(); - context.contextActivities.parent.Add(parent); + context.contextActivities.parent.Add(parent); score = new Score(); score.raw = 97; @@ -78,6 +99,7 @@ static Support () { result.success = true; result.completion = true; result.duration = new TimeSpan(1, 2, 16, 43); + result.response = "choice-2"; subStatement = new SubStatement(); subStatement.actor = agent; From c09c088a58219b32434452b5eab146df44f0a0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9tur=20Ingi=20Egilsson?= Date: Wed, 20 Dec 2017 09:47:06 +0100 Subject: [PATCH 2/8] Ported version 1.1.0.0 from .NET 3.5 to .NET Core 2. --- Doc/Content/VersionHistory/VersionHistory.aml | 26 --- Doc/Content/VersionHistory/v0.0.1.0.aml | 28 ---- Doc/Content/Welcome.aml | 19 --- Doc/ContentLayout.content | 18 --- Doc/Doc.shfbproj | 94 ----------- Doc/icons/Help.png | Bin 3247 -> 0 bytes TinCan.sln | 73 ++++----- TinCan/Properties/AssemblyInfo.cs | 36 ----- TinCan/TinCan.csproj | 153 ++---------------- TinCan/TinCan.nuspec | 24 --- TinCanTests/README.md | 1 - TinCanTests/TinCanTests.csproj | 126 ++------------- TinCanTests/packages.config | 8 +- 13 files changed, 69 insertions(+), 537 deletions(-) delete mode 100644 Doc/Content/VersionHistory/VersionHistory.aml delete mode 100644 Doc/Content/VersionHistory/v0.0.1.0.aml delete mode 100644 Doc/Content/Welcome.aml delete mode 100644 Doc/ContentLayout.content delete mode 100644 Doc/Doc.shfbproj delete mode 100644 Doc/icons/Help.png delete mode 100644 TinCan/Properties/AssemblyInfo.cs delete mode 100644 TinCan/TinCan.nuspec delete mode 100644 TinCanTests/README.md diff --git a/Doc/Content/VersionHistory/VersionHistory.aml b/Doc/Content/VersionHistory/VersionHistory.aml deleted file mode 100644 index c4eb3e3..0000000 --- a/Doc/Content/VersionHistory/VersionHistory.aml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - The topics in this section describe the various changes made to the TinCan.NET over the life of the project. - - -
- Version History - - Select a version below to see a description of its changes. - - - - - - - -
- - - - - -
-
diff --git a/Doc/Content/VersionHistory/v0.0.1.0.aml b/Doc/Content/VersionHistory/v0.0.1.0.aml deleted file mode 100644 index 2c687cd..0000000 --- a/Doc/Content/VersionHistory/v0.0.1.0.aml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Version 0.0.1.0 was released on 2014-04-28. - - - -
- Changes in This Release - - - - - This is the initial release, basic implementation in place. - - - - - -
- - - - - -
-
diff --git a/Doc/Content/Welcome.aml b/Doc/Content/Welcome.aml deleted file mode 100644 index a6c52f5..0000000 --- a/Doc/Content/Welcome.aml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - This is the autogenerated API documentation for the TinCan.NET open source library. - - -
- Getting Started - - These documentation pages are a work in progress. Pull requests are accepted. - -
- - - - -
-
diff --git a/Doc/ContentLayout.content b/Doc/ContentLayout.content deleted file mode 100644 index f8001f2..0000000 --- a/Doc/ContentLayout.content +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Doc/Doc.shfbproj b/Doc/Doc.shfbproj deleted file mode 100644 index 6c875de..0000000 --- a/Doc/Doc.shfbproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - - Debug - AnyCPU - 2.0 - f8d803ad-a192-4f8c-a582-674b75e42995 - 1.9.9.0 - - Doc - Doc - Doc - - .NET Framework 3.5 - .\Help\ - Doc - en-US - - - - - - - - - - OnlyErrors - Website - False - True - False - False - True - - - - 2 - False - Standard - Blank - False - VS2005 - False - Guid - TinCan.NET API Documentation - AboveNamespaces - support%40tincanapi.com - support%40tincanapi.com - 2014 Rustici Software - AutoDocumentCtors, AutoDocumentDispose - - - - - - - - - - - - - - - - - - - - bin\Documentation\ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Doc/icons/Help.png b/Doc/icons/Help.png deleted file mode 100644 index fb4d1e44ddb7a6afa30bcf3d52aaffd616eee17f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3247 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 Ypv3K>T6C=M#^x`CwS^t74C8(JKlQ7Nga7~l diff --git a/TinCan.sln b/TinCan.sln index 9ffdbe2..cbfe57b 100644 --- a/TinCan.sln +++ b/TinCan.sln @@ -1,55 +1,56 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCan", "TinCan\TinCan.csproj", "{27D0FCA1-E869-440C-9D16-F62D7A068C53}" +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2010 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCanTests", "TinCanTests\TinCanTests.csproj", "{46CFCA33-BCF7-45E5-9D69-39E9FE620970}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCanTests", "TinCanTests\TinCanTests.csproj", "{854413C2-2F81-4A82-9949-DE2868A10078}" -EndProject -Project("{7CF6DF6D-3B04-46F8-A40B-537D21BCA0B4}") = "Doc", "Doc\Doc.shfbproj", "{F8D803AD-A192-4F8C-A582-674B75E42995}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCan", "TinCan\TinCan.csproj", "{963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Documentation|Any CPU = Documentation|Any CPU + Release|Any CPU = Release|Any CPU Release-net35|Any CPU = Release-net35|Any CPU Release-net40|Any CPU = Release-net40|Any CPU Release-net45|Any CPU = Release-net45|Any CPU Release-net45-signed|Any CPU = Release-net45-signed|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Debug|Any CPU.Build.0 = Debug|Any CPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Documentation|Any CPU.Build.0 = Documentation|Any CPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net35|Any CPU.Build.0 = Release-net35|Any CPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net40|Any CPU.ActiveCfg = Release-net40|Any CPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net45-signed|Any CPU.ActiveCfg = Release-net45-signed|Any CPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net45-signed|Any CPU.Build.0 = Release-net45-signed|Any CPU - {854413C2-2F81-4A82-9949-DE2868A10078}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {854413C2-2F81-4A82-9949-DE2868A10078}.Debug|Any CPU.Build.0 = Debug|Any CPU - {854413C2-2F81-4A82-9949-DE2868A10078}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU - {854413C2-2F81-4A82-9949-DE2868A10078}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU - {854413C2-2F81-4A82-9949-DE2868A10078}.Release-net35|Any CPU.Build.0 = Release-net35|Any CPU - {854413C2-2F81-4A82-9949-DE2868A10078}.Release-net40|Any CPU.ActiveCfg = Release-net40|Any CPU - {854413C2-2F81-4A82-9949-DE2868A10078}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU - {854413C2-2F81-4A82-9949-DE2868A10078}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU - {854413C2-2F81-4A82-9949-DE2868A10078}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU - {854413C2-2F81-4A82-9949-DE2868A10078}.Release-net45-signed|Any CPU.ActiveCfg = Release-net45-signed|Any CPU - {854413C2-2F81-4A82-9949-DE2868A10078}.Release-net45-signed|Any CPU.Build.0 = Release-net45-signed|Any CPU - {F8D803AD-A192-4F8C-A582-674B75E42995}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F8D803AD-A192-4F8C-A582-674B75E42995}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU - {F8D803AD-A192-4F8C-A582-674B75E42995}.Documentation|Any CPU.Build.0 = Documentation|Any CPU - {F8D803AD-A192-4F8C-A582-674B75E42995}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU - {F8D803AD-A192-4F8C-A582-674B75E42995}.Release-net35|Any CPU.Build.0 = Release-net35|Any CPU - {F8D803AD-A192-4F8C-A582-674B75E42995}.Release-net40|Any CPU.ActiveCfg = Release-net35|Any CPU - {F8D803AD-A192-4F8C-A582-674B75E42995}.Release-net45|Any CPU.ActiveCfg = Release-net35|Any CPU - {F8D803AD-A192-4F8C-A582-674B75E42995}.Release-net45-signed|Any CPU.ActiveCfg = Release-net35|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Debug|Any CPU.Build.0 = Debug|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Documentation|Any CPU.ActiveCfg = Debug|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Documentation|Any CPU.Build.0 = Debug|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Release|Any CPU.ActiveCfg = Release|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Release|Any CPU.Build.0 = Release|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Release-net35|Any CPU.ActiveCfg = Release|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Release-net35|Any CPU.Build.0 = Release|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Release-net40|Any CPU.ActiveCfg = Release|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Release-net40|Any CPU.Build.0 = Release|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Release-net45|Any CPU.ActiveCfg = Release|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Release-net45|Any CPU.Build.0 = Release|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Release-net45-signed|Any CPU.ActiveCfg = Release|Any CPU + {46CFCA33-BCF7-45E5-9D69-39E9FE620970}.Release-net45-signed|Any CPU.Build.0 = Release|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Documentation|Any CPU.ActiveCfg = Debug|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Documentation|Any CPU.Build.0 = Debug|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Release|Any CPU.Build.0 = Release|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Release-net35|Any CPU.ActiveCfg = Release|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Release-net35|Any CPU.Build.0 = Release|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Release-net40|Any CPU.ActiveCfg = Release|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Release-net40|Any CPU.Build.0 = Release|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Release-net45|Any CPU.ActiveCfg = Release|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Release-net45|Any CPU.Build.0 = Release|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Release-net45-signed|Any CPU.ActiveCfg = Release|Any CPU + {963DFA62-82A3-45BD-9CB0-D51B6B2E3B8F}.Release-net45-signed|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3C4F42BE-83A4-4816-BE3F-65C7B503C757} + EndGlobalSection EndGlobal diff --git a/TinCan/Properties/AssemblyInfo.cs b/TinCan/Properties/AssemblyInfo.cs deleted file mode 100644 index fc01ca1..0000000 --- a/TinCan/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TinCan")] -[assembly: AssemblyDescription("Library for implementing Tin Can API (Experience API)")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Rustici Software")] -[assembly: AssemblyProduct("TinCan.NET")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6b7c12d3-32ea-4cb2-9399-3004963d2340")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/TinCan/TinCan.csproj b/TinCan/TinCan.csproj index a4c09bf..dd9c11f 100644 --- a/TinCan/TinCan.csproj +++ b/TinCan/TinCan.csproj @@ -1,143 +1,18 @@ - - - + + - Debug - AnyCPU - {27D0FCA1-E869-440C-9D16-F62D7A068C53} - Library - Properties - TinCan - TinCan - v3.5 - 512 + netcoreapp2.0 + 1.1.0.0 + Pétur Ingi Egilsson + Ingi + TinCan (.NET Core 2 port) + TinCanNetCore2 + A .NET Core 2 port of the TinCanNet API (https://github.com/RusticiSoftware/TinCan.NET). + true - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\TinCan.XML - - - pdbonly - true - bin\Release\net35\ - TRACE - prompt - 4 - v3.5 - - - true - bin\Documentation\ - DEBUG;TRACE - bin\Debug\TinCan.XML - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - bin\Release\net40\ - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - v4.0 - - - bin\Release\net45\ - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - v4.5 - - - bin\Release\net45-signed - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - true - TinCan.NET.pfx - v4.5 - - - - ..\packages\Newtonsoft.Json.8.0.3\lib\net35\Newtonsoft.Json.dll - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - - - \ No newline at end of file + + diff --git a/TinCan/TinCan.nuspec b/TinCan/TinCan.nuspec deleted file mode 100644 index 9aa3d11..0000000 --- a/TinCan/TinCan.nuspec +++ /dev/null @@ -1,24 +0,0 @@ - - - - $id$ - $version$ - $title$ - $author$ - $author$ - https://github.com/RusticiSoftware/TinCan.NET/blob/master/LICENSE - https://rusticisoftware.github.io/TinCan.NET - http://tincanapi.com/wp-content/assets/icons/tincan-32x32.png - false - $description$ - See https://github.com/RusticiSoftware/TinCan.NET/releases - Copyright 2014 - TinCan TinCanAPI xAPI e-learning elearning SCORM - - - - - - - - diff --git a/TinCanTests/README.md b/TinCanTests/README.md deleted file mode 100644 index d23d8fb..0000000 --- a/TinCanTests/README.md +++ /dev/null @@ -1 +0,0 @@ -These tests are based on NUnit 3 which requires that you have a compatible test adapter to run them. For Visual Studio 2012+ you can install the "NUnit3 Test Adapter" available by going to "Tools" -> "Extensions and Updates" -> "Online" -> "Visual Studio Gallery" and searching for "nunit". diff --git a/TinCanTests/TinCanTests.csproj b/TinCanTests/TinCanTests.csproj index 863109d..0acdd14 100644 --- a/TinCanTests/TinCanTests.csproj +++ b/TinCanTests/TinCanTests.csproj @@ -1,120 +1,18 @@ - - - + + - Debug - AnyCPU - {854413C2-2F81-4A82-9949-DE2868A10078} - Library - Properties - TinCanTests - TinCanTests - v3.5 - 512 + netcoreapp2.0 - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - true - bin\Documentation\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - bin\Release-net40\ - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - v4.0 - - - bin\Release-net45\ - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - v4.5 - - - bin\Release-net45-signed\ - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - v4.5 - - - - ..\packages\Newtonsoft.Json.8.0.3\lib\net35\Newtonsoft.Json.dll - True - - - ..\packages\NUnit.3.2.0\lib\net20\nunit.framework.dll - True - - - - - - - - - - - - - - - - - - - {27d0fca1-e869-440c-9d16-f62d7a068c53} - TinCan - - + - + + + + + - + - - - \ No newline at end of file + + diff --git a/TinCanTests/packages.config b/TinCanTests/packages.config index e1f462b..6e2e518 100644 --- a/TinCanTests/packages.config +++ b/TinCanTests/packages.config @@ -1,5 +1,9 @@  - - + + + + + + \ No newline at end of file From c4f3a734c917341d3a4f6620c3c88bc11fc13135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9tur=20Ingi=20Egilsson?= Date: Wed, 20 Dec 2017 08:50:41 +0000 Subject: [PATCH 3/8] README.md edited online with Bitbucket --- README.md | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/README.md b/README.md index 39f1c48..d4ad4e9 100644 --- a/README.md +++ b/README.md @@ -1,15 +1 @@ -A C#/.NET library for implementing Tin Can API. - -For hosted API documentation, basic usage instructions, supported version listing, etc. visit the main project website at: - -http://rusticisoftware.github.io/TinCan.NET/ - -For more information about the Tin Can API visit: - -http://tincanapi.com/ - -Requires .NET 3.5 or later. - -### Installation - -Available via NuGet. +This is a .NET Core 2 port of the "C#/.NET library for implementing Tin Can API". Visit the main project website at: http://rusticisoftware.github.io/TinCan.NET/ \ No newline at end of file From 3910c267f3cede996d78bed8c614e07fb27fcb78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9tur=20Ingi=20Egilsson?= Date: Tue, 23 Jan 2018 07:22:48 +0100 Subject: [PATCH 4/8] Project file is not compatible with pre-port project file. --- .idea/.idea.TinCan/.idea/contentModel.xml | 94 +++++++++++ .idea/.idea.TinCan/.idea/indexLayout.xml | 7 + .idea/.idea.TinCan/.idea/modules.xml | 8 + .idea/.idea.TinCan/.idea/vcs.xml | 6 + .idea/.idea.TinCan/.idea/workspace.xml | 188 ++++++++++++++++++++++ .idea/.idea.TinCan/riderModule.iml | 10 ++ TinCan/TinCan.csproj | 13 +- 7 files changed, 321 insertions(+), 5 deletions(-) create mode 100644 .idea/.idea.TinCan/.idea/contentModel.xml create mode 100644 .idea/.idea.TinCan/.idea/indexLayout.xml create mode 100644 .idea/.idea.TinCan/.idea/modules.xml create mode 100644 .idea/.idea.TinCan/.idea/vcs.xml create mode 100644 .idea/.idea.TinCan/.idea/workspace.xml create mode 100644 .idea/.idea.TinCan/riderModule.iml diff --git a/.idea/.idea.TinCan/.idea/contentModel.xml b/.idea/.idea.TinCan/.idea/contentModel.xml new file mode 100644 index 0000000..4a71723 --- /dev/null +++ b/.idea/.idea.TinCan/.idea/contentModel.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.TinCan/.idea/indexLayout.xml b/.idea/.idea.TinCan/.idea/indexLayout.xml new file mode 100644 index 0000000..f1feadf --- /dev/null +++ b/.idea/.idea.TinCan/.idea/indexLayout.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.TinCan/.idea/modules.xml b/.idea/.idea.TinCan/.idea/modules.xml new file mode 100644 index 0000000..63008f9 --- /dev/null +++ b/.idea/.idea.TinCan/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.TinCan/.idea/vcs.xml b/.idea/.idea.TinCan/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.TinCan/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea.TinCan/.idea/workspace.xml b/.idea/.idea.TinCan/.idea/workspace.xml new file mode 100644 index 0000000..09dd13a --- /dev/null +++ b/.idea/.idea.TinCan/.idea/workspace.xml @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - 1514975985969 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/.idea.TinCan/riderModule.iml b/.idea/.idea.TinCan/riderModule.iml deleted file mode 100644 index 0199587..0000000 --- a/.idea/.idea.TinCan/riderModule.iml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file From e0f8fbbf87796848554f5b32826695faad5a1566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9tur=20Ingi=20Egilsson?= Date: Tue, 23 Jan 2018 07:26:46 +0100 Subject: [PATCH 6/8] Compatible with pre-port version. --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d4ad4e9..5ad4c79 100644 --- a/README.md +++ b/README.md @@ -1 +1,16 @@ -This is a .NET Core 2 port of the "C#/.NET library for implementing Tin Can API". Visit the main project website at: http://rusticisoftware.github.io/TinCan.NET/ \ No newline at end of file +A C#/.NET library for implementing Tin Can API. + +For hosted API documentation, basic usage instructions, supported version listing, etc. visit the main project website at: + +http://rusticisoftware.github.io/TinCan.NET/ + +For more information about the Tin Can API visit: + +http://tincanapi.com/ + +Requires .NET Core 2. + +### Installation + +Available via NuGet. + From 556d39cdbd338b7a5ac00ad20189feb2b9848b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9tur=20Ingi=20Egilsson?= Date: Tue, 23 Jan 2018 07:28:26 +0100 Subject: [PATCH 7/8] Ignoring Rider (C# IDE) files. --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index abf0bc2..fa1d839 100644 --- a/.gitignore +++ b/.gitignore @@ -117,3 +117,10 @@ Doc/Help/ .DS_Store *.swp tmp/ +.idea/.idea.TinCan/riderModule.iml +.idea/.idea.TinCan/.idea/.name +.idea/.idea.TinCan/.idea/contentModel.xml +.idea/.idea.TinCan/.idea/indexLayout.xml +.idea/.idea.TinCan/.idea/modules.xml +.idea/.idea.TinCan/.idea/vcs.xml +.idea/.idea.TinCan/.idea/workspace.xml From 603a702516d7cbf86b7c2386e6f84647c4f8f612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pe=CC=81tur=20Ingi=20Egilsson?= Date: Tue, 23 Jan 2018 08:38:02 +0100 Subject: [PATCH 8/8] Conforming with changes requsted after a pull request review. See https://github.com/RusticiSoftware/TinCan.NET/pull/17 --- TinCan.sln | 3 -- TinCan/ActivityDefinition.cs | 2 +- TinCan/InteractionComponent.cs | 2 +- TinCan/InteractionType.cs | 70 +++++++++++++++++----------------- TinCanTests/Support.cs | 2 +- 5 files changed, 38 insertions(+), 41 deletions(-) diff --git a/TinCan.sln b/TinCan.sln index d0a2d97..5eaccba 100644 --- a/TinCan.sln +++ b/TinCan.sln @@ -1,8 +1,5 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 -MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCan", "TinCan\TinCan.csproj", "{27D0FCA1-E869-440C-9D16-F62D7A068C53}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCanTests", "TinCanTests\TinCanTests.csproj", "{854413C2-2F81-4A82-9949-DE2868A10078}" diff --git a/TinCan/ActivityDefinition.cs b/TinCan/ActivityDefinition.cs index 07453ef..62ce7d4 100644 --- a/TinCan/ActivityDefinition.cs +++ b/TinCan/ActivityDefinition.cs @@ -119,7 +119,7 @@ public ActivityDefinition(JObject jobj) public override JObject ToJObject(TCAPIVersion version) { JObject result = new JObject(); - + if (type != null) { result.Add("type", type.ToString()); diff --git a/TinCan/InteractionComponent.cs b/TinCan/InteractionComponent.cs index 1b0b324..bf62c31 100644 --- a/TinCan/InteractionComponent.cs +++ b/TinCan/InteractionComponent.cs @@ -1,5 +1,5 @@ /* - Copyright 2014 Rustici Software + Copyright 2015 Rustici Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/TinCan/InteractionType.cs b/TinCan/InteractionType.cs index 088f1db..21d7fc6 100644 --- a/TinCan/InteractionType.cs +++ b/TinCan/InteractionType.cs @@ -1,33 +1,30 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace TinCan { public sealed class InteractionType { - private const string choice = "choice"; - private const string sequencing = "sequencing"; - private const string likert = "likert"; - private const string matching = "matching"; - private const string performance = "performance"; - private const string truefalse = "true-false"; - private const string fillin = "fill-in"; - private const string numeric = "numeric"; - private const string other = "other"; - - - public static readonly InteractionType Choice = new InteractionType("choice"); - public static readonly InteractionType Sequencing = new InteractionType("sequencing"); - public static readonly InteractionType Likert = new InteractionType("likert"); - public static readonly InteractionType Matching = new InteractionType("matching"); - public static readonly InteractionType Performance = new InteractionType("performance"); - public static readonly InteractionType TrueFalse = new InteractionType("true-false"); - public static readonly InteractionType FillIn = new InteractionType("fill-in"); - public static readonly InteractionType Numeric = new InteractionType("numeric"); - public static readonly InteractionType Other = new InteractionType("other"); - + private const string CHOICE = "choice"; + private const string SEQUENCING = "sequencing"; + private const string LIKERT = "likert"; + private const string MATCHING = "matching"; + private const string PERFORMANCE = "performance"; + private const string TRUEFALSE = "true-false"; + private const string FILLIN = "fill-in"; + private const string LONGFILLIN = "long-fill-in"; + private const string NUMERIC = "numeric"; + private const string OTHER = "other"; + + public static readonly InteractionType Choice = new InteractionType(CHOICE); + public static readonly InteractionType Sequencing = new InteractionType(SEQUENCING); + public static readonly InteractionType Likert = new InteractionType(LIKERT); + public static readonly InteractionType Matching = new InteractionType(MATCHING); + public static readonly InteractionType Performance = new InteractionType(PERFORMANCE); + public static readonly InteractionType TrueFalse = new InteractionType(TRUEFALSE); + public static readonly InteractionType FillIn = new InteractionType(FILLIN); + public static readonly InteractionType LongFillIn = new InteractionType(LONGFILLIN); + public static readonly InteractionType Numeric = new InteractionType(NUMERIC); + public static readonly InteractionType Other = new InteractionType(OTHER); private InteractionType(string value) { @@ -38,36 +35,39 @@ public static InteractionType FromValue(string value) { switch (value) { - case choice: + case CHOICE: return Choice; - case sequencing: + case SEQUENCING: return Sequencing; - case likert: + case LIKERT: return Likert; - case matching: + case MATCHING: return Matching; - case performance: + case PERFORMANCE: return Performance; - case truefalse: + case TRUEFALSE: return TrueFalse; - case fillin: + case FILLIN: return FillIn; + + case LONGFILLIN: + return LongFillIn; - case numeric: + case NUMERIC: return Numeric; - case other: + case OTHER: return Other; default: - return null; - + throw new ArgumentOutOfRangeException(nameof(value), + $"'{value}' is not a valid interactionType."); } } diff --git a/TinCanTests/Support.cs b/TinCanTests/Support.cs index 2b217bd..d7c229f 100644 --- a/TinCanTests/Support.cs +++ b/TinCanTests/Support.cs @@ -86,7 +86,7 @@ static Support () { context.statement = statementRef; context.contextActivities = new ContextActivities(); context.contextActivities.parent = new List(); - context.contextActivities.parent.Add(parent); + context.contextActivities.parent.Add(parent); score = new Score(); score.raw = 97;