<%! from django.utils.translation import ugettext as _ %>
<%inherit file="/main.html" />
<%block name="bodyclass">${course.css_class}</%block>
<%namespace name='static' file='/static_content.html'/>

<%block name="headextra">
<%static:css group='style-course-vendor'/>
<%static:css group='style-course'/>
</%block>

<%block name="pagetitle">${_("{course_number} Flagged Open Ended Problems").format(course_number=course.display_number_with_default)}</%block>

<%include file="/courseware/course_navigation.html" args="active_page='open_ended_flagged_problems'" />

<%block name="js_extra">
    <%static:js group='open_ended'/>
</%block>

<section class="container">
    <div class="open-ended-problems" data-ajax_url="${ajax_url}">
        <div class="error-container">${error_text}</div>

        <h1>${_("Flagged Open Ended Problems")}</h1>
        <h2>${_("Instructions")}</h2>
        <p>${_("Here is a list of open ended problems for this course that have been flagged by students as potentially inappropriate.")}</p>
        % if success:
        % if len(problem_list) == 0:
        <div class="message-container">
          ${_("No flagged problems exist.")}
        </div>
        %else:
        <table class="problem-list">
            <tr>
                <th>${_("Name")}</th>
                <th>${_("Response")}</th>
                <th></th>
                <th></th>
            </tr>
            %for problem in problem_list:
            <tr data-submission-id="${problem['submission_id']}" data-student-id="${problem['student_id']}">
                <td>
                    ${problem['problem_name']}
                </td>
                <td>
                    ${problem['student_response']}
                </td>
                <td>
                    <a href="#unflag" class="unflag-button action-button" data-action-type="unflag">${_("Unflag")}</a>
                </td>
                <td>
                    <a href="#ban" class="ban-button action-button" data-action-type="ban">${_("Ban")}</a>
                </td>
                <td>
                    <div class="action-taken"></div>
                </td>
            </tr>
            %endfor
        </table>
        %endif
        %endif
    </div>
</section>
