<commit_before>{% extends 'maps/base.html' %}

{% block background-color %}
    purple
{% endblock %}

{% block content %}

    <div class="fixed-action-btn">
        <a class="btn-floating btn-large red raised">
            <i class="large material-icons">add</i>
        </a>
        <ul>
            <li><a href="#add_question_set" class="btn-floating yellow darken-1"><i class="material-icons">question_answer</i></a>
            </li>
            <li><a href="add_question" class="btn-floating blue"><i class="material-icons">chat_bubble</i></a></li>
            <li><a href="add_map" class="btn-floating green"><i class="material-icons">room</i></a></li>
        </ul>
    </div>

    <div class="row">
        <div class="main-panel">
            <h2 style="color: white">Edit Tests</h2>
        </div>
    </div>

    {% if sets %}
        {% for set in sets %}
            <div class="card">
                <div class="row card-content control-content">
                    <h4 class="text-black control-task-title">{{ set.title }}</h4>

                    <div class="col s5">
                        <p class="flow-text text-black font-md task-desc">
                            <i class="material-icons choose-icon">schedule</i> {{ set.duration }}
                        </p>
                    </div>
                    <div class="col s5">
                        <p class="flow-text text-black font-md task-desc">
                            <i class="material-icons choose-icon">supervisor_account</i> {{ set.creator }}
                        </p>
                    </div>
                </div>

                <div class="card-action control-controls">
                    <a onclick="unimpl()" class="waves-effect btn-flat orange-text edit-btn">Edit</a>
                    <a onclick="unimpl()" class="waves-effect btn-flat red-text">Remove</a>
                </div>
                <script>
                    function unimpl() {
                        alert("Not implemented yet");
                    }
                </script>
            </div>
        {% endfor %}
    {% else %}
        <p class="flow-text" style="text-align: center; color: white">No tests added yet.</p>
    {% endif %}

    <div class="row">
        <div class="main-panel">
            <h2 style="color: white">Edit Questions</h2>
        </div>
    </div>
    {% if questions %}
        {% for question in questions %}
            <div class="col s4">
                <div class="card yellow lighten-4">
                    <div class="card-content">
                        {#                        <span class="card-title">question.title</span>#}
                        <p>{{ question.statement_data.name }}</p>
                        <p class="flow-text">
                            {{ question.map_area|safe }}
                        </p>
                        <p style="margin-top: 10px">
                            Duration: {{ question.duration }}<br>
                            Creator: {{ question.creator }}
                        </p>
                    </div>
                    <div class="card-action">
                        <a href="">Edit</a>
                        <a href="">Remove</a>
                    </div>
                </div>
            </div>
        {% endfor %}
    {% else %}
        <p class="flow-text" style="text-align: center; color: white">No questions added yet.</p>
    {% endif %}

    <script>
        $(document).ready(function () {
            $('.modal').modal();
        });

        function submitQS() {
            var title = $('#qs-title').val();
            var duration = $('#qs-duration').val();
            var question_ids = "";
            $('#qs-in').children().each(function (idx, item) {
                question_ids = question_ids.concat(item.id.substr(3) + ",");
            });
            if (question_ids.length == 0) {
                alert("Please add at least one question");
                return;
            }

            question_ids = '[' + question_ids.substr(0, question_ids.length - 1) + ']';
            $.post("/control/api/create_question_set/", {<commit_msg>Fix control index page UI<commit_after>{% extends 'maps/base.html' %}

{% block background-color %}
    purple
{% endblock %}

{% block content %}

    <div class="fixed-action-btn">
        <a class="btn-floating btn-large red raised">
            <i class="large material-icons">add</i>
        </a>
        <ul>
            <li><a href="#add_question_set" class="btn-floating yellow darken-1"><i class="material-icons">question_answer</i></a>
            </li>
            <li><a href="add_question" class="btn-floating blue"><i class="material-icons">chat_bubble</i></a></li>
            <li><a href="add_map" class="btn-floating green"><i class="material-icons">room</i></a></li>
        </ul>
    </div>

    <div class="row">
        <div class="main-panel">
            <h2 style="color: white">Edit Tests</h2>
        </div>
    </div>

    {% if sets %}
        {% for set in sets %}
            <div class="card">
                <div class="row card-content control-content">
                    <h4 class="text-black control-task-title">{{ set.title }}</h4>

                    <div class="col s5">
                        <p class="flow-text text-black font-md task-desc">
                            <i class="material-icons choose-icon">schedule</i> {{ set.duration }}
                        </p>
                    </div>
                    <div class="col s5">
                        <p class="flow-text text-black font-md task-desc">
                            <i class="material-icons choose-icon">supervisor_account</i> {{ set.creator }}
                        </p>
                    </div>
                </div>

                <div class="card-action control-controls">
                    <a onclick="unimpl()" class="waves-effect btn-flat orange-text edit-btn">Edit</a>
                    <a onclick="unimpl()" class="waves-effect btn-flat red-text">Remove</a>
                </div>
                <script>
                    function unimpl() {
                        alert("Not implemented yet");
                    }
                </script>
            </div>
        {% endfor %}
    {% else %}
        <p class="flow-text" style="text-align: center; color: white">No tests added yet.</p>
    {% endif %}

    <div class="row">
        <div class="main-panel">
            <h2 style="color: white">Edit Questions</h2>
        </div>
    </div>
    {% if questions %}
        <div class="row">
            {% for question in questions %}
                <div class="col s4">
                    <div class="card yellow lighten-4">
                        <div class="card-content">
                            {#                        <span class="card-title">question.title</span>#}
                            <p>{{ question.statement_data.name }}</p>
                            <p class="flow-text">
                                {{ question.map_area|safe }}
                            </p>
                            <p style="margin-top: 10px">
                                Duration: {{ question.duration }}<br>
                                Creator: {{ question.creator }}
                            </p>
                        </div>
                        <div class="card-action">
                            <a href="">Edit</a>
                            <a href="">Remove</a>
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>
    {% else %}
        <p class="flow-text" style="text-align: center; color: white">No questions added yet.</p>
    {% endif %}

    <script>
        $(document).ready(function () {
            $('.modal').modal();
        });

        function submitQS() {
            var title = $('#qs-title').val();
            var duration = $('#qs-duration').val();
            var question_ids = "";
            $('#qs-in').children().each(function (idx, item) {
                question_ids = question_ids.concat(item.id.substr(3) + ",");
            });
            if (question_ids.length == 0) {
                alert("Please add at least one question");
                return;
            }

            question_ids = '[' + question_ids.substr(0, question_ids.length - 1) + ']';
            $.post("/control/api/create_question_set/", {
{'fraction_non_alphanumeric': 0.15814941579133718, 'fraction_numerical': 0.004012746370824973, 'mean_word_length': 1.3020918228742189, 'pattern_counts': {'":': 0, '<': 185, '<?xml version=': 0, '>': 185, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7043888', 'n_tokens_mistral': 2389, 'n_tokens_neox': 2209, 'n_words': 465}