-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Map adaptivity element in MBZ and integrate MoodlePluginModAdleradapt…
…ivity (#416) * Restructured ElementJson interface hierarchy * Adapted types of elements in ReadDsl.cs and XmlFactories to new type hierarchy * Renamed "DSL" to "ATF" in Generator * Implemented the logic for mapping the adaptivity elements to question.xml * Added new factory for adaptivity activity * Added generation of new section in Moodle for BaseLearningElements * Added new contextId for MBZ * Fixed format error that occurred when restoring moodle course * Fixed some typos in generation of ATF * Added, adjusted and fixed corresponding tests --------- Co-authored-by: Niklas Stich <[email protected]>
- Loading branch information
1 parent
d965553
commit b710d78
Showing
113 changed files
with
3,386 additions
and
1,507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Generator.ATF.AdaptivityElement; | ||
|
||
public class AdaptivityContentJson : IAdaptivityContentJson | ||
{ | ||
[JsonConstructor] | ||
public AdaptivityContentJson(string introText, List<IAdaptivityTaskJson> adaptivityTasks) | ||
{ | ||
IntroText = introText; | ||
AdaptivityTasks = adaptivityTasks; | ||
} | ||
|
||
public string IntroText { get; set; } | ||
public List<IAdaptivityTaskJson> AdaptivityTasks { get; set; } | ||
} |
2 changes: 1 addition & 1 deletion
2
...daptivityElement/AdaptivityElementJson.cs → ...daptivityElement/AdaptivityElementJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...L/AdaptivityElement/AdaptivityRuleJson.cs → ...F/AdaptivityElement/AdaptivityRuleJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rator/DSL/AdaptivityElement/ChoiceJson.cs → ...rator/ATF/AdaptivityElement/ChoiceJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...SL/AdaptivityElement/CommentActionJson.cs → ...TF/AdaptivityElement/CommentActionJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
Generator/ATF/AdaptivityElement/ContentReferenceActionJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Generator.ATF.AdaptivityElement; | ||
|
||
public class ContentReferenceActionJson : IAdaptivityActionJson | ||
{ | ||
public ContentReferenceActionJson(int elementId, string? hintText) | ||
{ | ||
ElementId = elementId; | ||
HintText = hintText; | ||
} | ||
|
||
public int ElementId { get; set; } | ||
|
||
public string? HintText { get; set; } | ||
} |
14 changes: 14 additions & 0 deletions
14
Generator/ATF/AdaptivityElement/ElementReferenceActionJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Generator.ATF.AdaptivityElement; | ||
|
||
public class ElementReferenceActionJson : IAdaptivityActionJson | ||
{ | ||
public ElementReferenceActionJson(int elementId, string? hintText) | ||
{ | ||
ElementId = elementId; | ||
HintText = hintText; | ||
} | ||
|
||
public int ElementId { get; set; } | ||
|
||
public string? HintText { get; set; } | ||
} |
2 changes: 1 addition & 1 deletion
2
...daptivityElement/IAdaptivityActionJson.cs → ...daptivityElement/IAdaptivityActionJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...aptivityElement/IAdaptivityContentJson.cs → ...aptivityElement/IAdaptivityContentJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Generator.DSL.AdaptivityElement; | ||
namespace Generator.ATF.AdaptivityElement; | ||
|
||
[JsonDerivedType(typeof(AdaptivityContentJson), typeDiscriminator: JsonTypes.AdaptivityContentType)] | ||
public interface IAdaptivityContentJson | ||
{ | ||
string IntroText { get; set; } | ||
bool ShuffleTasks { get; set; } | ||
List<IAdaptivityTaskJson> AdaptivityTask { get; set; } | ||
List<IAdaptivityTaskJson> AdaptivityTasks { get; set; } | ||
} |
2 changes: 1 addition & 1 deletion
2
...aptivityElement/IAdaptivityElementJson.cs → ...aptivityElement/IAdaptivityElementJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ptivityElement/IAdaptivityQuestionJson.cs → ...ptivityElement/IAdaptivityQuestionJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../AdaptivityElement/IAdaptivityRuleJson.cs → .../AdaptivityElement/IAdaptivityRuleJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ator/DSL/AdaptivityElement/IChoiceJson.cs → ...ator/ATF/AdaptivityElement/IChoiceJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Generator/DSL/BaseLearningElementJson.cs → Generator/ATF/BaseLearningElementJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.