{{!
    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 local_aiquestions/success

    Template which defines the data shown when question are ready.

    Classes required for JS:
    * none

    Data attributes required for JS:
    * none

    Example context (json):
    {
        "success": '[{"id": 2, "questiontext": "what is your name?"}, {"id": 3, "questiontext": "what is your age?"}]';
        "wwwroot": "https://moodle.example.com",
        "error": 4
    }
}}
{{#error}}
    <div class="local_aiquestions_error">
        {{#str}}errornotcreated, local_aiquestions{{/str}}
    </div>
{{/error}}

{{^error}}
    {{^single}}
        <div class="local_aiquestions_created">
            {{#str}}createdquestionssuccess, local_aiquestions{{/str}}.
        </div>
    {{/single}}

    {{#single}}
        <div class="local_aiquestions_created">
            {{#str}}createdquestionsuccess, local_aiquestions{{/str}}.
        </div>
    {{/single}}

    {{#success}}
        <div class="local_aiquestions_questiontext">
            <i>{{{questiontext}}}</i>
            <a href="{{wwwroot}}/question/bank/previewquestion/preview.php?id={{id}}"
                title="{{#str}}preview, local_aiquestions{{/str}}" target="_blank">
                <i class="icon fa fa-search-plus fa-fw " aria-hidden="true"></i>
            </a>
        </div>
    {{/success}}

{{/error}}