{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template qformat/h5p

    Question text template.

    Context variables required for this template:
    * questiontext - The name of the site

    Example context (json):
    {
        "questiontext": "Does Moodle do H5P?",
        "media": {
            "type": {
                "file": {
                    "path": "content/image-3.jpg"
                },
                "alt": "Ilustration of H5p"
            }
         }
    }
}}
{{# media }}
    {{# type.params.file }}
    <img src="@@PLUGINFILE@@/{{ type.params.file.path }}" alt="{{ type.params.alt }}" class="img-responsive p-2">
    {{/ type.params.file }}
    {{# type.params }}
       {{# hasvideo }}
       <video controls>{{# type.params.sources }}
           <source src="@@PLUGINFILE@@/{{ path }}" alt="{{ type.params.alt }}" class="img-responsive p-2">
       {{/ type.params.sources }}</video>
       {{/ hasvideo }}
    {{/ type.params }}
{{/ media }}
{{# hasaudio }}<div><audio controls="true">
    {{# audio }}
    <source src="@@PLUGINFILE@@/{{ path }}">
    {{/ audio }}{{ path }}</audio></div>
{{/ hasaudio }}
<div class="h5p-questiontext">
    {{{ questiontext }}}
</div>
