<commit_before><% topic_type ||= "discussion_topic"
  brief ||= false
  single_topic ||= false
  is_announcement = (topic_type == 'announcement')
 %>
<div style="display:none;" id="topic_urls">
  <a href="<%= context_url(@context, :context_discussion_topics_url) %>" class="add_topic_url">&nbsp;</a>
  <%= image_tag "announcement.png", :class => "announcement_image" %>
  <%= image_tag "discussion_topic.png", :class => "discussion_topic_image" %>
</div>
<div id="topic_list" class="communication_messages_list">
  <% if can_do((@context.send(topic_type.pluralize).new rescue nil), @current_user, :create) %>
    <div id="no_topics_message" style="<%= topics && topics.length > 0 ? 'display: none;' : '' %>">
      <% if is_announcement %>
        <%= t 'no_announcements_admin', 'There are no announcements, sad to say.  Would you like to create one?' %>
      <% else %>
        <%= t 'no_discussions_admin', 'There are no discussions, sad to say.  Would you like to start one?' %>
      <% end %>
      <div class="button-container">
        <button type="button" class="add_topic_link button"><%= image_tag "add.png" %>
          <%= is_announcement ? t('new_announcement', 'Make a New Announcement') : t('new_topic', 'Make a New Discussion') %>
        </button>
      </div>
    </div>
  <% else %>
    <div id="no_topics_message" style="<%= topics && topics.length > 0 ? 'display: none;' : '' %>">
      <% if is_announcement %>
        <%= t 'no_announcements', 'There are no announcements, sad to say.' %>
      <% else %>
        <%= t 'no_discussions', 'There are no discussions, sad to say.' %>
      <% end %>
    </div>
  <% end %>
  <% topics.each do |topic| %>
    <% if can_do(topic, @current_user, :read) %>
      <% if topic.is_a?(DiscussionTopic) %>
        <%= render :partial => "shared/topic", :object => topic, :locals => {:topic_type => topic_type, :is_announcement => is_announcement, :single_topic => single_topic, :brief => brief } %>
      <% elsif topic.is_a?(WebConference) %>
      <% elsif topic.is_a?(Collaboration) %>
        <%= render :partial => "collaborations/collaboration", :object => topic %>
      <% end %>
    <% end %>
  <% end %>
</div>
<% if !single_topic && !brief %>
<%= render :partial => "shared/topic", :object => nil, :locals => {:topic_type => topic_type, :is_announcement => is_announcement} %>
<% end %>
<% form_for(:discussion_topic, :url => context_url(@context, :context_discussion_topics_url), :html => {:id => 'add_topic_form', :style => 'display: none; padding: 5px;'}) do |f| %>
  <div class="details_box" style="margin-bottom: 5px;">
    <div style="float: left">
      <%= before_label('title', %{Title}) %> <%= f.text_field :title, :class => 'topic_title', :style => 'font-size: 1.2em;' %>
    </div>
    <div style="float: right; padding-top: 0.7em;"><a href="#" class="switch_topic_views_link" style="font-size: 0.8em;"><%= t('#links.switch_views', %{Switch Views}) %></a></div>
    <div class="clear"></div>
  </div>
  <div class="content_box" style="margin-bottom: 5px; margin-left: 5px; margin-right: 5px; width: auto;">
    <%= f.text_area :message, :class => 'topic_content', :style => 'width: 100%; height: 200px;' %>
  </div>
  <% if can_do(@context.discussion_topics.new, @current_user, :attach) %>
  <div>
    <div class="no_attachment" style="float: right;">
      <a href="#" class="add add_attachment_link"><%= t('links.attach_file', %{Attach File}) %></a>
    </div>
    <div class="current_attachment" style="display: none; text-align: left;">
      <div>
        <input type="hidden" name="discussion_topic[remove_attachment]" value="0" class="discussion_remove_attachment"/>          
        <span style="font-size: 0.8em;"><%= before_label('files_attached', %{File Attached}) %> </span>
        <span class="attachment_name" style="font-weight: bold;">&nbsp;</span>
        <a href="#" class="delete_attachment_link no-hover"><%= image_tag "delete_circle.png" %></a>
      </div>
      <a href="#" class="replace_attachment_link" style="font-size: 0.8em; padding-left: 20px;"><%= t('links.replace_file', %{Replace File}) %></a>
    </div>
    <div style="display: none;" class="upload_attachment">
      <%= before_label('file_attach', %{File}) %> <input type="file" name="attachment[uploaded_data]" class="attachment_uploaded_data"/>
      <a href="#" class="cancel_attachment_link no-hover" style="padding-left: 10px;"><%= image_tag "delete_circle.png" %></a>
    </div>
  </div>
  <% end %>
  <% if can_do(@context.announcements.new, @current_user, :create) %>
  <div class="announcement_option" style="<%= is_announcement ? 'display: none;' : '' %>">
    <%= check_box :discussion_topic, :is_announcement, :checked => (is_announcement ? 'checked' : ''), :class => "is_announcement" %>
    <%= label :discussion_topic, :is_announcement, :en => "Make this post an announcement" %>
  </div>
  <% end %>
  <% if can_do(@context, @current_user, :manage_content) %>
    <div style="margin-left: 20px;">
      <a href="#" class="more_options_link"><%= t('#links.more_options', %{more options}) %></a>
    </div>
    <div class="more_options_holder">
      <div style="float: left;">
        <%= check_box :discussion_topic, :delay_posting, :class => "delay_posting" %>
        <%= label :discussion_topic, :delay_posting, :en => "Delay posting this message" %>
      </div>
      <div class="delay_posting_option" style="display: none; float: left;">
        &nbsp;<%= t('delay_until', %{until}) %> 
        <%= text_field :discussion_topic, :delayed_post_at, :style => "width: 100px;", :class => 'datetime_field delayed_post_at_value' %>
      </div>
      <div class="clear"></div>
      <div>
        <%= f.check_box :require_initial_post %>
        <%= f.label :require_initial_post, :en => "Replies are not visible until after users post" %>
      </div>
      <% if can_do(@context, @current_user, :moderate_forum) %>
        <div class="podcast_options">
          <%= f.check_box :podcast_enabled, :class => 'podcast_enabled_checkbox' %>
          <%= f.label :podcast_enabled, :en => "Enable Podcast Feed for this Topic" %>
          <div class="podcast_sub_options" style="display: none; margin-left: 30px;">
            <%= f.check_box :podcast_has_student_posts %>
            <%= f.label :podcast_has_student_post, :en => "Include Student Comments in the Feed" %>
          </div>
        </div>
      <% end %>
      <% if @context.respond_to?(:assignments) %>
        <% f.fields_for(:assignment) do |a| -%>
        <div class="assignment_options">
          <div>
            <%= a.check_box :set_assignment, :class => "set_assignment" %>
            <%= a.label :set_assignment, :en => "Use for grading" %>
          </div>
          <div class="set_assignment_option" style="display: none; margin-left: 30px;">
            <table>
              <tr>
                <td><%= a.blabel :points_possible, :en => "Points" %></td>
                <td><%= a.text_field :points_possible, :style => "width: 50px;" %></td>
              </tr><tr>
                <td><label for="topic_assignment_group_id"><%= before_label 'assignment_group', 'Group' %></label></td>
                <td>
                  <select name="discussion_topic[assignment][assignment_group_id]" id="topic_assignment_group_id">
                    <% @context.assignment_groups.each do |group| %>
                      <option value="<%= group.id %>"><%= group.name %></option>
                    <% end %>
                  </select>
                </td>
              </tr><tr>
                <td style="vertical-align: top;"><%= a.blabel :due_at, :en => "Due" %></td>
                <td><%= a.text_field :due_at, :style => "width: 152px;", :class => "datetime_field" %></td>
              </tr>
            </table>
          </div>
        </div>
        <% end -%>
      <% end %>
    </div>
  <% end %>
  <div class="clear"></div>
  <div class="button-container">
    <button type="submit" class="button submit_button">&nbsp;</button>
    <button type="button" class="button-secondary cancel_button"><%= t('#buttons.cancel', %{Cancel}) %></button>
  </div>
<% end %>
<% if @context.respond_to?(:assignments) %>
  <%= render :partial => "shared/add_assignment" %>
<% end %>
<commit_msg>don't show deleted assignment groups in the new graded discussion page<commit_after><% topic_type ||= "discussion_topic"
  brief ||= false
  single_topic ||= false
  is_announcement = (topic_type == 'announcement')
 %>
<div style="display:none;" id="topic_urls">
  <a href="<%= context_url(@context, :context_discussion_topics_url) %>" class="add_topic_url">&nbsp;</a>
  <%= image_tag "announcement.png", :class => "announcement_image" %>
  <%= image_tag "discussion_topic.png", :class => "discussion_topic_image" %>
</div>
<div id="topic_list" class="communication_messages_list">
  <% if can_do((@context.send(topic_type.pluralize).new rescue nil), @current_user, :create) %>
    <div id="no_topics_message" style="<%= topics && topics.length > 0 ? 'display: none;' : '' %>">
      <% if is_announcement %>
        <%= t 'no_announcements_admin', 'There are no announcements, sad to say.  Would you like to create one?' %>
      <% else %>
        <%= t 'no_discussions_admin', 'There are no discussions, sad to say.  Would you like to start one?' %>
      <% end %>
      <div class="button-container">
        <button type="button" class="add_topic_link button"><%= image_tag "add.png" %>
          <%= is_announcement ? t('new_announcement', 'Make a New Announcement') : t('new_topic', 'Make a New Discussion') %>
        </button>
      </div>
    </div>
  <% else %>
    <div id="no_topics_message" style="<%= topics && topics.length > 0 ? 'display: none;' : '' %>">
      <% if is_announcement %>
        <%= t 'no_announcements', 'There are no announcements, sad to say.' %>
      <% else %>
        <%= t 'no_discussions', 'There are no discussions, sad to say.' %>
      <% end %>
    </div>
  <% end %>
  <% topics.each do |topic| %>
    <% if can_do(topic, @current_user, :read) %>
      <% if topic.is_a?(DiscussionTopic) %>
        <%= render :partial => "shared/topic", :object => topic, :locals => {:topic_type => topic_type, :is_announcement => is_announcement, :single_topic => single_topic, :brief => brief } %>
      <% elsif topic.is_a?(WebConference) %>
      <% elsif topic.is_a?(Collaboration) %>
        <%= render :partial => "collaborations/collaboration", :object => topic %>
      <% end %>
    <% end %>
  <% end %>
</div>
<% if !single_topic && !brief %>
<%= render :partial => "shared/topic", :object => nil, :locals => {:topic_type => topic_type, :is_announcement => is_announcement} %>
<% end %>
<% form_for(:discussion_topic, :url => context_url(@context, :context_discussion_topics_url), :html => {:id => 'add_topic_form', :style => 'display: none; padding: 5px;'}) do |f| %>
  <div class="details_box" style="margin-bottom: 5px;">
    <div style="float: left">
      <%= before_label('title', %{Title}) %> <%= f.text_field :title, :class => 'topic_title', :style => 'font-size: 1.2em;' %>
    </div>
    <div style="float: right; padding-top: 0.7em;"><a href="#" class="switch_topic_views_link" style="font-size: 0.8em;"><%= t('#links.switch_views', %{Switch Views}) %></a></div>
    <div class="clear"></div>
  </div>
  <div class="content_box" style="margin-bottom: 5px; margin-left: 5px; margin-right: 5px; width: auto;">
    <%= f.text_area :message, :class => 'topic_content', :style => 'width: 100%; height: 200px;' %>
  </div>
  <% if can_do(@context.discussion_topics.new, @current_user, :attach) %>
  <div>
    <div class="no_attachment" style="float: right;">
      <a href="#" class="add add_attachment_link"><%= t('links.attach_file', %{Attach File}) %></a>
    </div>
    <div class="current_attachment" style="display: none; text-align: left;">
      <div>
        <input type="hidden" name="discussion_topic[remove_attachment]" value="0" class="discussion_remove_attachment"/>          
        <span style="font-size: 0.8em;"><%= before_label('files_attached', %{File Attached}) %> </span>
        <span class="attachment_name" style="font-weight: bold;">&nbsp;</span>
        <a href="#" class="delete_attachment_link no-hover"><%= image_tag "delete_circle.png" %></a>
      </div>
      <a href="#" class="replace_attachment_link" style="font-size: 0.8em; padding-left: 20px;"><%= t('links.replace_file', %{Replace File}) %></a>
    </div>
    <div style="display: none;" class="upload_attachment">
      <%= before_label('file_attach', %{File}) %> <input type="file" name="attachment[uploaded_data]" class="attachment_uploaded_data"/>
      <a href="#" class="cancel_attachment_link no-hover" style="padding-left: 10px;"><%= image_tag "delete_circle.png" %></a>
    </div>
  </div>
  <% end %>
  <% if can_do(@context.announcements.new, @current_user, :create) %>
  <div class="announcement_option" style="<%= is_announcement ? 'display: none;' : '' %>">
    <%= check_box :discussion_topic, :is_announcement, :checked => (is_announcement ? 'checked' : ''), :class => "is_announcement" %>
    <%= label :discussion_topic, :is_announcement, :en => "Make this post an announcement" %>
  </div>
  <% end %>
  <% if can_do(@context, @current_user, :manage_content) %>
    <div style="margin-left: 20px;">
      <a href="#" class="more_options_link"><%= t('#links.more_options', %{more options}) %></a>
    </div>
    <div class="more_options_holder">
      <div style="float: left;">
        <%= check_box :discussion_topic, :delay_posting, :class => "delay_posting" %>
        <%= label :discussion_topic, :delay_posting, :en => "Delay posting this message" %>
      </div>
      <div class="delay_posting_option" style="display: none; float: left;">
        &nbsp;<%= t('delay_until', %{until}) %> 
        <%= text_field :discussion_topic, :delayed_post_at, :style => "width: 100px;", :class => 'datetime_field delayed_post_at_value' %>
      </div>
      <div class="clear"></div>
      <div>
        <%= f.check_box :require_initial_post %>
        <%= f.label :require_initial_post, :en => "Replies are not visible until after users post" %>
      </div>
      <% if can_do(@context, @current_user, :moderate_forum) %>
        <div class="podcast_options">
          <%= f.check_box :podcast_enabled, :class => 'podcast_enabled_checkbox' %>
          <%= f.label :podcast_enabled, :en => "Enable Podcast Feed for this Topic" %>
          <div class="podcast_sub_options" style="display: none; margin-left: 30px;">
            <%= f.check_box :podcast_has_student_posts %>
            <%= f.label :podcast_has_student_post, :en => "Include Student Comments in the Feed" %>
          </div>
        </div>
      <% end %>
      <% if @context.respond_to?(:assignments) %>
        <% f.fields_for(:assignment) do |a| -%>
        <div class="assignment_options">
          <div>
            <%= a.check_box :set_assignment, :class => "set_assignment" %>
            <%= a.label :set_assignment, :en => "Use for grading" %>
          </div>
          <div class="set_assignment_option" style="display: none; margin-left: 30px;">
            <table>
              <tr>
                <td><%= a.blabel :points_possible, :en => "Points" %></td>
                <td><%= a.text_field :points_possible, :style => "width: 50px;" %></td>
              </tr><tr>
                <td><label for="topic_assignment_group_id"><%= before_label 'assignment_group', 'Group' %></label></td>
                <td>
                  <select name="discussion_topic[assignment][assignment_group_id]" id="topic_assignment_group_id">
                    <% @context.assignment_groups.active.each do |group| %>
                      <option value="<%= group.id %>"><%= group.name %></option>
                    <% end %>
                  </select>
                </td>
              </tr><tr>
                <td style="vertical-align: top;"><%= a.blabel :due_at, :en => "Due" %></td>
                <td><%= a.text_field :due_at, :style => "width: 152px;", :class => "datetime_field" %></td>
              </tr>
            </table>
          </div>
        </div>
        <% end -%>
      <% end %>
    </div>
  <% end %>
  <div class="clear"></div>
  <div class="button-container">
    <button type="submit" class="button submit_button">&nbsp;</button>
    <button type="button" class="button-secondary cancel_button"><%= t('#buttons.cancel', %{Cancel}) %></button>
  </div>
<% end %>
<% if @context.respond_to?(:assignments) %>
  <%= render :partial => "shared/add_assignment" %>
<% end %>

{'fraction_non_alphanumeric': 0.1951778179626281, 'fraction_numerical': 0.005063291139240506, 'mean_word_length': 3.343193717277487, 'pattern_counts': {'":': 0, '<': 397, '<?xml version=': 0, '>': 487, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4101952', 'n_tokens_mistral': 5874, 'n_tokens_neox': 5347, 'n_words': 1174}