From b6886181a5ae4f9b453ecfc658e92bb0f0513652 Mon Sep 17 00:00:00 2001
From: Frode Petterson <frode.andre.petterson@gmail.com>
Date: Thu, 22 Sep 2016 11:01:50 +0200
Subject: [PATCH] Restrict LRS dependent content types by default

HFJ-2184
---
 editor          | 2 +-
 lang/en/hvp.php | 2 ++
 settings.php    | 6 ++++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/editor b/editor
index 4a4f69d..79adb41 160000
--- a/editor
+++ b/editor
@@ -1 +1 @@
-Subproject commit 4a4f69dfb3edf6548df848bb3eca0d1c4136f2d7
+Subproject commit 79adb413b81f3c6836b631c949db50e85bfa9f6d
diff --git a/lang/en/hvp.php b/lang/en/hvp.php
index 0f34e64..6ce52c8 100644
--- a/lang/en/hvp.php
+++ b/lang/en/hvp.php
@@ -83,6 +83,8 @@ $string['enablesavecontentstate'] = 'Save content state';
 $string['enablesavecontentstate_help'] = 'Automatically save the current state of interactive content for each user. This means that the user may pick up where he left off.';
 $string['contentstatefrequency'] = 'Save content state frequency';
 $string['contentstatefrequency_help'] = 'In seconds, how often do you wish the user to auto save their progress. Increase this number if you\'re having issues with many ajax requests';
+$string['enabledlrscontenttypes'] = 'Enable LRS dependent content types';
+$string['enabledlrscontenttypes_help'] = 'Makes it possible to use content types that rely upon a Learning Record Store to function properly, like the Questionnaire content type.';
 
 // Admin menu.
 $string['settings'] = 'H5P Settings';
diff --git a/settings.php b/settings.php
index 3f92538..d4902d0 100644
--- a/settings.php
+++ b/settings.php
@@ -56,6 +56,12 @@ if ($ADMIN->fulltree) {
                     get_string('contentstatefrequency', 'hvp'),
                     get_string('contentstatefrequency_help', 'hvp'), 30, PARAM_INT));
 
+    // Content state.
+    $settings->add(
+            new admin_setting_configcheckbox('mod_hvp/enable_lrs_content_types',
+                    get_string('enabledlrscontenttypes', 'hvp'),
+                    get_string('enabledlrscontenttypes_help', 'hvp'), 0));
+
     // Display options for H5P frame.
     $settings->add(new admin_setting_heading('mod_hvp/display_options', get_string('displayoptions', 'hvp'), ''));
     $settings->add(new admin_setting_configcheckbox('mod_hvp/frame', get_string('enableframe', 'hvp'), '', 1));
-- 
GitLab