From 5567c5e8333f3908f50beb7569587301937c82af Mon Sep 17 00:00:00 2001 From: Ferran Recio Date: Tue, 26 May 2020 17:25:28 +0200 Subject: [PATCH] MDL-68822 mod_h5pactivity: add description to view.php --- mod/h5pactivity/tests/behat/add_h5pactivity.feature | 7 ++++--- mod/h5pactivity/view.php | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mod/h5pactivity/tests/behat/add_h5pactivity.feature b/mod/h5pactivity/tests/behat/add_h5pactivity.feature index b5d05e06601..2e746f02957 100644 --- a/mod/h5pactivity/tests/behat/add_h5pactivity.feature +++ b/mod/h5pactivity/tests/behat/add_h5pactivity.feature @@ -24,12 +24,13 @@ Feature: Add H5P activity Scenario: Add a h5pactivity activity to a course When I add a "H5P" to section "1" And I set the following fields to these values: - | Name | Awesome H5P package | - | Description | Description | + | Name | Awesome H5P package | + | Description | H5P activity Description | And I upload "h5p/tests/fixtures/ipsums.h5p" file to "Package file" filemanager And I click on "Save and display" "button" And I wait until the page is ready - Then I switch to "h5p-player" class iframe + Then I should see "H5P activity Description" + And I switch to "h5p-player" class iframe And I switch to "h5p-iframe" class iframe And I should see "Lorum ipsum" And I should not see "Reuse" diff --git a/mod/h5pactivity/view.php b/mod/h5pactivity/view.php index 3378138406a..9feac0046c8 100644 --- a/mod/h5pactivity/view.php +++ b/mod/h5pactivity/view.php @@ -70,6 +70,11 @@ $PAGE->set_context($context); echo $OUTPUT->header(); echo $OUTPUT->heading(format_string($moduleinstance->name)); +$instance = $manager->get_instance(); +if (!empty($instance->intro)) { + echo $OUTPUT->box(format_module_intro('h5pactivity', $instance, $cm->id), 'generalbox', 'intro'); +} + // Attempts review. if ($manager->can_view_all_attempts()) { $reviewurl = new moodle_url('report.php', ['a' => $cm->instance]);