<%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas 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 Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<% question_teaser ||= nil %>
<% data = question_teaser %>
<div class="quiz_sortable question_holder question_teaser" id="question_teaser_<%= question_teaser ? question_teaser[:id] : "blank" %>" style="<%= hidden unless question_teaser %>">
  <div class="display_question question" id="question_<%= question_teaser ? question_teaser[:id] : "blank" %>">
    <%= render partial: "quizzes/quizzes/move_handle" %>

    <div class="header">
      <a href="#" class="question_name name question_teaser_link" title="<%= t('titles.click_to_show_details', "Click to show full question details") %>"><%= hash_get(data, :question_name) %></a>
    </div>
    <div class="links">
      <a href="#" class="edit_teaser_link no-hover" title="<%= t('titles.edit_this_question', "Edit this Question") %>"><%= image_tag "edit.png", :alt => t('Edit this Question') %></a>
      <a href="#" class="delete_question_link no-hover" title="<%= t('titles.delete_this_question', "Delete this Question") %>"><%= image_tag "delete.png", :alt => t('Delete this Question') %></a>
      <a href="<%= context_url(@context, :context_quiz_quiz_question_url, @quiz.id, question_teaser ? question_teaser[:id] : "{{ id }}") %>" class="update_question_url" tabindex="-1" aria-hidden="true">&nbsp;</a>
    </div>
    <div class="text">
      <div class="teaser question_text user_content">
        <%= user_content(hash_get(data, :question_text)) %>
      </div>
    </div>
    <div class="bottom_links">
      <span class="id" style="display: none;"><%= question_teaser && question_teaser[:id] %></span>
      <div class="question_points hidden" style="display: none;"><%= render_score(hash_get(question_teaser, :points_possible, "0")) %></div>
    </div>
    <div class="clear"></div>
  </div>
</div>
