From c67abcb8b9afb02db95d68588e55392c56cd638b Mon Sep 17 00:00:00 2001 From: marcel Date: Fri, 9 Feb 2024 09:53:16 +0100 Subject: [PATCH] release notes --- .../30/ResponseProcessing/sum_item.xml | 113 ++++++++++++++++++ .../30/ResponseProcessing/sum_result.xml | 74 ++++++++++++ .../30/ResponseProcessing/sum_result_2.xml | 68 +++++++++++ .../ResponseProcessingTests/GeneralTests.cs | 58 +++++++++ .../ItemTypes/MatchInteractionTests.cs | 2 +- Scoring.Tests/ScoringEngine.Tests.csproj | 78 ++++++------ Scoring/ScoringEngine.csproj | 2 +- release_notes.md | 9 ++ 8 files changed, 358 insertions(+), 46 deletions(-) create mode 100644 Scoring.Tests/Resources/30/ResponseProcessing/sum_item.xml create mode 100644 Scoring.Tests/Resources/30/ResponseProcessing/sum_result.xml create mode 100644 Scoring.Tests/Resources/30/ResponseProcessing/sum_result_2.xml diff --git a/Scoring.Tests/Resources/30/ResponseProcessing/sum_item.xml b/Scoring.Tests/Resources/30/ResponseProcessing/sum_item.xml new file mode 100644 index 0000000..55ba66d --- /dev/null +++ b/Scoring.Tests/Resources/30/ResponseProcessing/sum_item.xml @@ -0,0 +1,113 @@ + + + + + IC1_D + + + + + IC2_C + + + + + IC3_A + + + + + IC4_B + + + + + + + + + + + + + + + + + + 4 + + + + + + + IC1_D + + + + + + 1 + + + + + + + + IC2_C + + + + + + 1 + + + + + + + + IC3_A + + + + + + 1 + + + + + + + + IC4_B + + + + + + 1 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Scoring.Tests/Resources/30/ResponseProcessing/sum_result.xml b/Scoring.Tests/Resources/30/ResponseProcessing/sum_result.xml new file mode 100644 index 0000000..a1169f9 --- /dev/null +++ b/Scoring.Tests/Resources/30/ResponseProcessing/sum_result.xml @@ -0,0 +1,74 @@ + + + + + + + + + 36 + + + 231 + + + + + + 1 + + + + 1 + + + 1 + + + 1 + + + 1 + + + 4 + + + 1 + + + + 132.387 + + + + + IC3_A + + + + + IC2_C + + + + + IC4_B + + + + completed + + + + IC1_D + + + + \ No newline at end of file diff --git a/Scoring.Tests/Resources/30/ResponseProcessing/sum_result_2.xml b/Scoring.Tests/Resources/30/ResponseProcessing/sum_result_2.xml new file mode 100644 index 0000000..f3fa46f --- /dev/null +++ b/Scoring.Tests/Resources/30/ResponseProcessing/sum_result_2.xml @@ -0,0 +1,68 @@ + + + + + + + + + 34 + + + 231 + + + + + + 2 + + + + 1 + + + 0 + + + 0 + + + 2 + + + 4 + + + 1 + + + + 197.048 + + + + + IC3_B + + + + + IC2_C + + + + + IC4_A + + + + completed + + + + IC1_D + + + + \ No newline at end of file diff --git a/Scoring.Tests/ResponseProcessingTests/GeneralTests.cs b/Scoring.Tests/ResponseProcessingTests/GeneralTests.cs index b96cdb1..84fb3a8 100644 --- a/Scoring.Tests/ResponseProcessingTests/GeneralTests.cs +++ b/Scoring.Tests/ResponseProcessingTests/GeneralTests.cs @@ -247,6 +247,64 @@ public void ResponseProcessing_DOE_gapMatch_fout() Assert.Equal("0", rawScore); } + [Fact] + public void ResponseProcessing_DOE_sum_all_correct() + { + var mockLogger = new Mock(); + + var assessmentResult = new AssessmentResult(mockLogger.Object, XDocument.Load(File.OpenRead("Resources/30/ResponseProcessing/sum_result.xml"))); + var assessmentItem = new AssessmentItem(mockLogger.Object, XDocument.Load(File.OpenRead("Resources/30/ResponseProcessing/sum_item.xml")), TestHelper.GetExpressionFactory()); + + ResponseProcessor.Process(assessmentItem, assessmentResult, mockLogger.Object); + + var scoreValue = assessmentResult.GetScoreForItem("_sum", "SCORE"); + Assert.Equal("1", scoreValue); + } + [Fact] + public void ResponseProcessing_DOE_sum_3_correct() + { + var mockLogger = new Mock(); + + var assessmentResult = new AssessmentResult(mockLogger.Object, XDocument.Load(File.OpenRead("Resources/30/ResponseProcessing/sum_result.xml"))); + var assessmentItem = new AssessmentItem(mockLogger.Object, XDocument.Load(File.OpenRead("Resources/30/ResponseProcessing/sum_item.xml")), TestHelper.GetExpressionFactory()); + + assessmentResult.ChangeResponse("_sum", "RESPONSE_1", "fout"); + + ResponseProcessor.Process(assessmentItem, assessmentResult, mockLogger.Object); + + var scoreValue = assessmentResult.GetScoreForItem("_sum", "SCORE"); + Assert.Equal("0", scoreValue); + } + [Fact] + public void ResponseProcessing_DOE_sum_2_correct_different_result_file() + { + var mockLogger = new Mock(); + + var assessmentResult = new AssessmentResult(mockLogger.Object, XDocument.Load(File.OpenRead("Resources/30/ResponseProcessing/sum_result_2.xml"))); + var assessmentItem = new AssessmentItem(mockLogger.Object, XDocument.Load(File.OpenRead("Resources/30/ResponseProcessing/sum_item.xml")), TestHelper.GetExpressionFactory()); + + ResponseProcessor.Process(assessmentItem, assessmentResult, mockLogger.Object); + + var scoreValue = assessmentResult.GetScoreForItem("_sum", "SCORE"); + Assert.Equal("0", scoreValue); + } + [Fact] + public void ResponseProcessing_DOE_sum_0_correct() + { + var mockLogger = new Mock(); + + var assessmentResult = new AssessmentResult(mockLogger.Object, XDocument.Load(File.OpenRead("Resources/30/ResponseProcessing/sum_result.xml"))); + var assessmentItem = new AssessmentItem(mockLogger.Object, XDocument.Load(File.OpenRead("Resources/30/ResponseProcessing/sum_item.xml")), TestHelper.GetExpressionFactory()); + assessmentResult.ChangeResponse("_sum", "RESPONSE_1", "fout"); + assessmentResult.ChangeResponse("_sum", "RESPONSE_2", "fout"); + assessmentResult.ChangeResponse("_sum", "RESPONSE_3", "fout"); + assessmentResult.ChangeResponse("_sum", "RESPONSE_4", "fout"); + ResponseProcessor.Process(assessmentItem, assessmentResult, mockLogger.Object); + + var scoreValue = assessmentResult.GetScoreForItem("_sum", "SCORE"); + Assert.Equal("0", scoreValue); + } + [Fact] public void ResponseProcessing_DOE_numeric_correct() { diff --git a/Scoring.Tests/ResponseProcessingTests/ItemTypes/MatchInteractionTests.cs b/Scoring.Tests/ResponseProcessingTests/ItemTypes/MatchInteractionTests.cs index d7757da..47be23b 100644 --- a/Scoring.Tests/ResponseProcessingTests/ItemTypes/MatchInteractionTests.cs +++ b/Scoring.Tests/ResponseProcessingTests/ItemTypes/MatchInteractionTests.cs @@ -61,7 +61,7 @@ public void IMS_ExampleMatchInteractionResponseProcessing_Incorrect() var assessmentResult = TestHelper.GetBasicAssessmentResult(); assessmentResult.AddCandidateResponses (assessmentItem.Identifier, "RESPONSE", new List{ - "R C", + "P R", "D M", "L M", "P T" diff --git a/Scoring.Tests/ScoringEngine.Tests.csproj b/Scoring.Tests/ScoringEngine.Tests.csproj index 509f014..b09a2a8 100644 --- a/Scoring.Tests/ScoringEngine.Tests.csproj +++ b/Scoring.Tests/ScoringEngine.Tests.csproj @@ -13,8 +13,7 @@ - + @@ -29,8 +28,7 @@ - + @@ -43,8 +41,7 @@ - + @@ -61,12 +58,12 @@ - - - + + + + + + @@ -82,8 +79,7 @@ - + Always @@ -99,15 +95,13 @@ Always - + Always Always - + Always @@ -152,8 +146,7 @@ Always - + Always @@ -171,8 +164,7 @@ Always - + Always @@ -181,20 +173,16 @@ Always - + Always - + Always - + Always - + Always @@ -221,8 +209,7 @@ Always - + Always @@ -234,30 +221,34 @@ Always - + Always Always - + Always Always - + Always - + Always - + + Always + + + Always + + + Always + + Always @@ -291,8 +282,7 @@ Always - + Always diff --git a/Scoring/ScoringEngine.csproj b/Scoring/ScoringEngine.csproj index 45073ba..18d6612 100644 --- a/Scoring/ScoringEngine.csproj +++ b/Scoring/ScoringEngine.csproj @@ -5,7 +5,7 @@ Citolab.QTI.ScoringEngine {2A7091CD-6A49-4B7B-85BB-A140C8B5397C} Citolab.QTI.ScoringEngine - 1.2.5 + 1.3.0-beta1 Cito Stichting Cito Instituut voor Toetsontwikkeling, Arnhem (2023) Citolab diff --git a/release_notes.md b/release_notes.md index dcbd38c..d98bedb 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,3 +1,12 @@ +## 1.3.0-beta1 + ++ support for qti-subtract + +#### added work-arounds. ++ added optional parameter: stripAlphanumericsFromNumericResponses to strip alphanumeric values in reponse variables of type int and float, before comparing with the correct response. +- multiple values of correct responses will be loaded despite of cardinatity, so even if it's declared as single. +- directedPair is sorted before comparing too. Because it has a source and a target it should not be sorted (only a normal pair) but to support a error in a delivery engine this is supported only in this version. Probably won't effect other scoring because in general target and sources will have different ids. + ## 1.2.5 - null ref fix ToBaseValue