{% load i18n %}
{% load tz %}
{% spaceless %}
<div
    id="openassessment-editor"
    class="editor-with-buttons editor-with-tabs"
    data-is-released="{{ is_released|lower }}"
>
    <div class="openassessment_editor_content_and_tabs">

        <div id="openassessment_editor_header">
            <h6 id="oa_editor_window_title" class="title modal_window_title" >{% trans "Open Response Assessment" %}</h6>
            <ul class="editor_modes action_list action_modes editor_tabs">
                <li class="view-button oa_editor_tab"><a href="#oa_settings_editor_wrapper">{% trans "Settings" %}</a></li>
                <li class="view-button oa_editor_tab"><a href="#oa_rubric_editor_wrapper">{% trans "Rubric" %}</a></li>
                <li class="view-button oa_editor_tab"><a href="#oa_prompt_editor_wrapper">{% trans "Prompt" %}</a></li>
            </ul>
        </div>

        <div id="openassessment_validation_alert" class="covered">
            <span class="openassessment_alert_icon" aria-hidden="true"></span>
            <div class="openassessment_alert_header">
                <h2 class="openassessment_alert_title">{% trans "Rubric Change Impacts Settings Section" %}</h2>
                <p class="openassessment_alert_message">{% trans "A change that you made to this assessment's rubric has an impact on some examples laid out in the settings tab. For more information, go to the Settings section and fix the areas highlighted in red." %}</p>
            </div>
            <a href="" rel="view" class="action openassessment_alert_close">
                <span class="icon fa fa-times-circle" aria-hidden="true"></span>
                <span class="label is--hidden">{% trans "close alert" %}</span>
            </a>
        </div>

        {% include "openassessmentblock/edit/oa_edit_prompts.html"  %}

        {% include "openassessmentblock/edit/oa_edit_rubric.html"  %}

        <div id="oa_settings_editor_wrapper" class="oa_editor_content_wrapper wrapper-comp-settings">

            <ul id="oa_basic_settings_editor" class="list-input settings-list">
                <li id="openassessment_title_editor_wrapper" class="field comp-setting-entry">
                    <div class="wrapper-comp-setting">
                        <label for="openassessment_title_editor" class="setting-label">{% trans "Display Name "%}</label>
                        <input type="text" id="openassessment_title_editor" class="input setting-input" value="{{ title }}">
                    </div>
                    <p class="setting-help">{% trans "The display name for this component." %}</p>
                </li>
                <li class="openassessment_date_editor field comp-setting-entry">
                    <div class="wrapper-comp-setting">
                        <label
                            for="openassessment_submission_start_date"
                            class="setting-label">
                            {% trans "Response Start Date" %}
                        </label>
                        <input
                            type="text"
                            class="input setting-input"
                            id="openassessment_submission_start_date"
                            value="{{ submission_start|utc|date:"Y-m-d" }}"
                        >
                    </div>
                    <div class="wrapper-comp-setting">
                        <label
                            for="openassessment_submission_start_time"
                            class="setting-label">
                            {% trans "Response Start Time" %}
                        </label>
                        <input
                            type="text"
                            class="input setting-input"
                            id="openassessment_submission_start_time"
                            value="{{ submission_start|utc|date:"H:i" }}"
                        >
                    </div>
                    <p class="setting-help">{% trans "The date and time when learners can begin submitting responses." %}</p>
                </li>
                <li class="openassessment_date_editor field comp-setting-entry">
                    <div class="wrapper-comp-setting">
                        <label
                            for="openassessment_submission_due_date"
                            class="setting-label">
                            {% trans "Response Due Date" %}
                        </label>
                        <input
                            type="text"
                            class="input setting-input"
                            id="openassessment_submission_due_date"
                            value="{{ submission_due|utc|date:"Y-m-d" }}"
                        >
                    </div>
                    <div class="wrapper-comp-setting">
                        <label
                            for="openassessment_submission_due_time"
                            class="setting-label">
                            {% trans "Response Due Time" %}
                        </label>
                        <input
                            type="text"
                            class="input setting-input"
                            id="openassessment_submission_due_time"
                            value="{{ submission_due|utc|date:"H:i" }}"
                        >
                    </div>
                    <p class="setting-help">{% trans "The date and time when learners can no longer submit responses." %}</p>
                </li>
                <li id="openassessment_submission_text_response_wrapper" class="field comp-setting-entry">
                    <div class="wrapper-comp-setting">
                        <label for="openassessment_submission_text_response" class="setting-label">{% trans "Text Response"%}</label>
                        <select id="openassessment_submission_text_response" class="input setting-input" name="text response">
                            {% for option_key, option_name in necessity_options.items %}
                            <option value="{{ option_key }}" {% if option_key == text_response %} selected="true" {% endif %}>{{ option_name }}</option>
                            {% endfor %}
                        </select>
                    </div>
                    <p class="setting-help">
                        {% trans "Specify whether learners must include a text based response to this problem's prompt." %}
                    </p>
                </li>
                <li id="openassessment_submission_file_wrapper" class="field comp-setting-entry">
                    <div class="wrapper-comp-setting">
                        <label for="openassessment_submission_file_upload_response" class="setting-label">{% trans "File Uploads Response"%}</label>
                        <select id="openassessment_submission_file_upload_response" class="input setting-input" name="text response">
                            {% for option_key, option_name in necessity_options.items %}
                            <option value="{{ option_key }}" {% if option_key == file_upload_response %} selected="true" {% endif %}>{{ option_name }}</option>
                            {% endfor %}
                        </select>
                    </div>
                    <p class="setting-help">
                        {% trans "Specify whether learners are able to upload files as a part of their response." %}
                    </p>
                    <div id="openassessment_submission_file_upload_type_wrapper" class="{% if not file_upload_response %}is--hidden{% endif %}">
                        <div class="wrapper-comp-setting">
                            <label for="openassessment_submission_upload_selector" class="setting-label">{% trans "File Upload Types"%}</label>
                            <select id="openassessment_submission_upload_selector" class="input setting-input" name="upload submission">
                                <option value="pdf-and-image" {% if file_upload_type == "pdf-and-image" %} selected="true" {% endif %}>{% trans "PDF or Image Files"%}</option>
                                <option value="image" {% if file_upload_type == "image" %} selected="true" {% endif %}>{% trans "Image Files"%}</option>
                                <option value="custom" {% if file_upload_type == "custom" %} selected="true" {% endif %}>{% trans "Custom File Types"%}</option>
                            </select>
                        </div>
                        <p class="setting-help">
                            {% trans "Specify whether learners can submit files along with their text responses. Select Images to allow JPG, GIF, or PNG files. Select PDF or Images to allow PDF files and images. Select Custom File Types to allow files with extensions that you specify below. (Use the Select Custom File Types option with caution.)" %}
                        </p>
                        <div id="openassessment_submission_white_listed_file_types_wrapper" class="{% if file_upload_type != "custom" %}is--hidden{% endif %}">
                            <div class="wrapper-comp-setting">
                                <label for="openassessment_submission_white_listed_file_types" class="setting-label">{% trans "File Types" %}</label>
                                <input id="openassessment_submission_white_listed_file_types"
                                       class="input setting-input"
                                       type="text"
                                       value="{{ white_listed_file_types }}"
                                        />
                            </div>
                            <p class="setting-help">
                                {% trans "Enter the file extensions, separated by commas, that you want learners to be able to upload. For example: pdf,doc,docx." %}
                            </p>&nbsp;
                            <p class="setting-help message-status error"></p>
                        </div>
                    </div>
                </li>
                <li id="openassessment_submission_latex_wrapper" class="field comp-setting-entry">
                    <div class="wrapper-comp-setting">
                        <label for="openassessment_submission_latex_editor" class="setting-label">{% trans "Allow LaTeX Responses"%}</label>
                        <select id="openassessment_submission_latex_editor" class="input setting-input" name="latex submission">
                            <option value="0">{% trans "False"%}</option>
                            <option value="1" {% if allow_latex %} selected="true" {% endif %}>{% trans "True"%}</option>
                        </select>
                    </div>
                    <p class="setting-help">{% trans "Specify whether learners can write LaTeX formatted strings"%}</p>
                </li>
                <li id="openassessment_leaderboard_wrapper" class="field comp-setting-entry">
                    <div class="wrapper-comp-setting">
                        <label for="openassessment_leaderboard_editor" class="setting-label">{% trans "Top Responses" %}</label>
                        <input
                            id="openassessment_leaderboard_editor"
                            class="input setting-input"
                            type="number"
                            value="{{ leaderboard_show }}"
                            min="0" max="99"
                        />
                    </div>
                    <p class="setting-help">{% trans "Specify the number of top scoring responses to display. Valid numbers are 0 to 99. If the number is 0, the Top Responses section does not appear to learners." %}</p>
                </li>
                <li>
            </ul>

            <p class="openassessment_description" id="openassessment_step_select_description">
                {% trans "In this assignment, you can include learner training, peer assessment, self assessment, and staff assessment steps. Select the steps that you want below, and then drag them into the order you want. If you include a learner training step, it must precede all other steps. If you include a staff assessment step, it must be the final step. After you release an ORA assignment, you cannot change the type and number of assessment steps." %}
            </p>
            <ol id="openassessment_assessment_module_settings_editors">
                {% for assessment in editor_assessments_order %}
                    {% with "openassessmentblock/edit/oa_edit_"|add:assessment|add:".html" as template %}
                        {% include template %}
                    {% endwith %}
                {% endfor %}
            </ol>
        </div>
    </div>

    <div class="openassessment_editor_buttons xblock-actions">
        <h3 class="sr">Actions</h3>
        <ul>
            <li class="action-item">
                <a href="#" class="button action-primary openassessment_save_button">{% trans "Save" %}</a>
            </li>

            <li class="action-item">
                <a href="#" class="button openassessment_cancel_button">{% trans "Cancel" %}</a>
            </li>
        </ul>
    </div>

</div>
{% endspaceless %}
