Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

{{!
    This file is part of Moodle - https://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 <https://www.gnu.org/licenses/>.
}}
{{!
    @template mod_subcourse/subcourseinfo

    Displays percentage progress and the current grade in the subcourse.

    Classes required for JS:
    * none

    Data attributes required for JS:
    * none

    Context variables required for this template:
    * haspercentage (bool)
    * hasstrgrade (bool)
    * percentage (int)
    * strgrade (string)

    Example context (json):
    {
        "haspercentage" : true,
        "hasstrgrade" : true,
        "percentage" : 42,
        "strgrade" : 12.00
    }
}}
<div class="row">
    {{#haspercentage}}
    <div class="col-md">
        <div class="subcourseinfo subcourseinfo-progress mb-3">
            <div class="infotext">{{#str}} currentprogress, mod_subcourse, {{percentage}} {{/str}}</div>
            <div class="subcourse-progress-bar">
                <div style="width: {{percentage}}%"></div>
            </div>
        </div>
    </div>
    {{/haspercentage}}

    {{#hasstrgrade}}
    <div class="col-md">
        <div class="subcourseinfo subcourseinfo-grade mb-3">
            <div  class="infotext">{{#str}} currentgrade, mod_subcourse, {{strgrade}} {{/str}}</div>
        </div>
    </div>
    {{/hasstrgrade}}
</div>