<%inherit file="/main.html" />
<%block name="bodyclass">${course.css_class}</%block>
<%namespace name='static' file='/static_content.html'/>

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

<%block name="title"><title>${course.number} Flagged Open Ended Problems</title></%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 are 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>