diff --git a/modules/h5p/show.php b/modules/h5p/show.php
index 99e2607a95..2c61e1dae3 100644
--- a/modules/h5p/show.php
+++ b/modules/h5p/show.php
@@ -23,8 +23,16 @@
require_once '../../include/baseTheme.php';
+$unit = isset($_GET['unit'])? intval($_GET['unit']): null;
+$res_type = isset($_GET['res_type']);
+
$content_id = $_GET['id'];
-$backUrl = $urlAppend . 'modules/h5p/?course=' . $course_code;
+if (!$res_type) {
+ $backUrl = $urlAppend . 'modules/h5p/?course=' . $course_code;
+} else {
+ $backUrl = $urlAppend . 'modules/units/?course=' . $course_code . '&id=' . $_REQUEST['unit'];
+}
+
$toolName = $langImport;
$navigation[] = ['url' => $backUrl, 'name' => $langH5p];
diff --git a/modules/h5p/view.php b/modules/h5p/view.php
index 50365ad534..08e9e69d76 100644
--- a/modules/h5p/view.php
+++ b/modules/h5p/view.php
@@ -22,10 +22,22 @@
$require_current_course = true;
require_once '../../include/baseTheme.php';
+$unit = isset($_GET['unit'])? intval($_GET['unit']): null;
+$res_type = isset($_GET['res_type']);
+
if (showContent($_GET['id'])) {
- redirect($urlAppend . 'modules/h5p/show.php?course=' . $course_code . '&id=' . intval($_GET['id']));
+ if (isset($unit)) {
+ redirect($urlServer . 'modules/units/view.php?course=' . $course_code . '&res_type=h5p_show&unit=' . $unit . '&id=' . intval($_GET['id']));;
+ } else {
+ redirect($urlAppend . 'modules/h5p/show.php?course=' . $course_code . '&id=' . intval($_GET['id']));
+ }
}
+/**
+ * @brief show h5p content
+ * @param $contentId
+ * @return bool
+ */
function showContent($contentId): bool {
global $course_code, $webDir;
@@ -55,4 +67,4 @@ function showContent($contentId): bool {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/modules/units/functions.php b/modules/units/functions.php
index 959231fd2c..d1ed506bad 100644
--- a/modules/units/functions.php
+++ b/modules/units/functions.php
@@ -1279,8 +1279,8 @@ function show_h5p($title, $comments, $resource_id, $h5p_id, $visibility) {
$h5plink = "$title ($langWasDeleted)";
}
} else {
- //$link = "";
- $link = "";
+ $link = "";
+ //$link = "";
$h5plink = $link . "$title";
$imagelink = $link . "" .icon('fa-tablet') . "";
}
diff --git a/modules/units/view.php b/modules/units/view.php
index 9cde539e4f..90084bcf7e 100644
--- a/modules/units/view.php
+++ b/modules/units/view.php
@@ -39,18 +39,24 @@
case 'questionnaire_results':
require_once "../questionnaire/pollresults.php";
exit;
- case 'forum';
+ case 'forum':
require_once "../forum/viewforum.php";
exit;
- case 'forum_topic';
+ case 'forum_topic':
require_once "../forum/viewtopic.php";
exit;
- case 'forum_new_topic';
+ case 'forum_new_topic':
require_once "../forum/newtopic.php";
exit;
- case 'forum_topic_reply';
+ case 'forum_topic_reply':
require_once "../forum/reply.php";
exit;
+ case 'h5p':
+ require_once "../h5p/view.php";
+ exit;
+ case 'h5p_show':
+ require_once "../h5p/show.php";
+ exit;
default:
break;
}