diff --git a/js/questionset.js b/js/questionset.js
index cd9727a..6a05ff6 100644
--- a/js/questionset.js
+++ b/js/questionset.js
@@ -20,6 +20,8 @@ H5P.QuestionSet = function (options, contentId, contentData) {
var self = this;
this.contentId = contentId;
+ H5P.Randomize(options, 'questions');
+
var texttemplate =
'<% if (introPage.showIntroPage) { %>' +
'
' +
diff --git a/library.json b/library.json
index 232a3be..23f96d6 100644
--- a/library.json
+++ b/library.json
@@ -38,6 +38,11 @@
"majorVersion": 4,
"minorVersion": 5
},
+ {
+ "machineName": "H5P.Randomize",
+ "majorVersion": 1,
+ "minorVersion": 0
+ },
{
"machineName": "H5P.Video",
"majorVersion": 1,
diff --git a/semantics.json b/semantics.json
index 91ab898..c58210e 100644
--- a/semantics.json
+++ b/semantics.json
@@ -119,6 +119,22 @@
]
}
},
+ {
+ "name": "randomizeQuestions",
+ "type": "boolean",
+ "label": "Randomize questions",
+ "description": "Show questions to the user in random order.",
+ "default": false
+ },
+ {
+ "name": "randomQuestionsAmount",
+ "type": "number",
+ "label": "Random questions amount",
+ "description": "Amount of questions that will be shown to the user in random order. If it is empty all questions will be shown.",
+ "min": 1,
+ "step": 1,
+ "optional": true
+ },
{
"name": "texts",
"type": "group",