<commit_before><% jammit_js :select_content_dialog %>
<% jammit_css :select_content_dialog %>
<% cache([@context, 'select_context_content_dialog']) do %>
  <div id="select_context_content_dialog" style="display: none;">
    <div>
      Add  
      <select id="add_module_item_select">
        <option value="assignment">Assignment</option>
        <option value="quiz">Quiz</option>
        <option value="attachment">File</option>
        <option value="wiki_page">Content Page</option>
        <option value="discussion_topic">Discussion</option>
        <option value="context_module_sub_header" class="context_module_content">Text Header</option>
        <option value="external_url" class="context_module_content">External URL</option>
        <option value="context_external_tool" class="context_module_content">External Tool</option>
      </select>
      to <span class="holder_name">module</span>
    </div>
    <div style="margin: 10px 20px;">
      <div id="context_module_sub_headers_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          Type the text you'd like to add as a <span class="holder_type">module</span> sub-header
        </div>
        <table>
          <tr>
            <td><label for="sub_header_title">Header:</label></td>
            <td><input type="text" name="title" id="sub_header_title" style="width: 200px;"/></td>
          </tr>
        </table>
      </div>
      <div id="external_urls_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "link.png", :alt => "external_url" %> Enter a URL and page name
          to add a link to any website URL to this <span class="holder_type">module</span>.
        </div>
        <table>
          <tr>
            <td><label for="content_tag_create_url">URL:</label></td>
            <td>
              <input type="text" name="url" id="content_tag_create_url" style="width: 200px;"/>
              <div id="content_tag_services">
              
              </div>
            </td>
          </tr>
          <tr>
            <td><label for="content_tag_create_title">Page Name:</label></td>
            <td><input type="text" name="title" id="content_tag_create_title" style="width: 120px;"/></td>
          </tr>
        </table>
      </div>
      <div id="context_external_tools_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "link.png", :alt => "external_tool" %> Select a tool from the list below,
          or enter a URL for an external tool you already know is configured with Basic LTI
          to add a link to it to this <span class="holder_type">module</span>.
        </div>
        <a href="<%= context_url(@context, :context_external_tools_url, :include_parents => '1') %>" class="external_tools_url" style="display: none;">&nbsp;</a>
        <table>
          <tr>
            <td colspan="2" class="tools">
              <div class="message" style="margin: 10px 0;">Loading...</div>
              <div class="tool" style="display: none;">
                <div class="name"></div>
                <div class="description"></div>
              </div>
            </td>
          </tr>
          <tr>
            <td><label for="external_tool_create_url">URL:</label></td>
            <td>
              <input type="text" name="url" id="external_tool_create_url" style="width: 200px;"/>
              <div class="domain_message" style="font-size: 0.8em; display: none;">
                to use this tool the domain must match <span class="domain">&nbsp;</span>
              </div>
            </td>
          </tr>
          <tr>
            <td><label for="external_tool_create_title">Page Name:</label></td>
            <td><input type="text" name="title" id="external_tool_create_title" style="width: 120px;"/></td>
          </tr>
        </table>
      </div>
      <div id="wiki_pages_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "file.png", :alt => "wiki_page" %> Select the wiki page you want to associate with this <span class="holder_type">module</span>, or
          add a new page by selecting "New Page".
        </div>
        <div style="margin-top: 5px;">
        <select class="module_item_select" multiple>
          <%# cache on the context.wiki instead of just the context because even though it will require a db query, we will get a much better cache hit rate %>
          <% cache([@context.wiki, '100_active_wiki_pages']) do  %>
            <% @context.wiki.wiki_pages.active.scoped({:select => "id, title", :limit => 100}).each do |page| %>
              <% if page && !page.new_record? %>
                <option value="<%= page.id %>"><%= page.title %></option>
              <% end %>
            <% end %>
          <% end %>
          <option value="new">[ New Page ]</option>
        </select>
        </div>
        <div class="new" style="margin-top: 5px;">
          Page Name: <input type="text" name="wiki_page[title]" class="item_title"/>
          <a href="<%= context_url(@context, :context_wiki_pages_url) %>" style="display: none;" class="add_item_url">&nbsp;</a>
        </div>
      </div>
      <div id="attachments_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "file_download.png" %> Select the file you want to associate with this <span class="holder_type">module</span>, or
          add a file by selecting "New File".
        </div>
        <div style="margin-top: 5px;">
        <select class="module_item_select" multiple>
          <% @context.folders.active.scoped({:limit => 100}).sort_by{|f| f.full_name}.each do |folder| %>
            <optgroup label="<%= folder.full_name %>">
              <% 
              attachments = if @context.grants_right?(@current_user, session, :manage_files)
                              folder.active_file_attachments
                            else
                              folder.visible_file_attachments
                            end
              %>
              <% attachments.each do |file| %>
                <option value="<%= file.id %>"><%= file.display_name %></option>
              <% end %>
            </optgroup>
          <% end %>
          <option value="new">[ New File ]</option>
        </select>
        </div>
        <div class="new" style="margin-top: 5px;">
          <table>
            <tr>
              <td>File:</td>
              <td><input id="module_attachment_uploaded_data" type="file" name="attachment[uploaded_data]" class="item_title"/></td>
            </tr><tr>
              <td>
                <a href="<%= context_url(@context, :context_files_url, :format => :text) %>" style="display: none;" class="add_item_url">&nbsp;</a>
                Folder: 
              </td><td>
                <% Folder.root_folders(@context) %>
                <% folders = @context.active_folders_with_sub_folders %>
                <% root_folders = folders.select{|f| f.parent_folder_id == nil} %>
                <select name="attachment[folder_id]" id="attachment_folder_id">
                  <%= folders_as_options(root_folders, :all_folders => folders, :max_depth => 1) %>
                </select>
              </td>
            </tr>
          </table>
        </div>
      </div>
      <div id="quizs_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "quiz.png", :alt => "quiz" %> Select the  quiz you want to associate with this <span class="holder_type">module</span>, or
          add a new one by selecting "New Quiz".
        </div>
        <div style="margin-top: 5px;">
        <select class="module_item_select" multiple>
          <% @context.quizzes.active.scoped({:limit => 100}).each do |quiz| %>
            <option value="<%= quiz.id %>"><%= quiz.title %></option>
          <% end %>
          <option value="new">[ New Quiz] </option>
        </select>
        </div>
        <div class="new" style="margin-top: 5px;">
          Quiz Name: <input type="text" name="quiz[title]" class="item_title"/>
          <a href="<%= context_url(@context, :context_quizzes_url) %>" style="display: none;" class="add_item_url">&nbsp;</a>
        </div>
      </div>
      <div id="assignments_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "grading_icon.png", :alt => "assignment" %> Select the assignment you want to associate with this <span class="holder_type">module</span>, or
          add an assignment by selecting "New Assignment".
        </div>
        <div style="margin-top: 5px;">
        <select class="module_item_select" multiple>
          <% @context.assignment_groups.active.include_active_assignments.each do |group| %>
            <optgroup label="<%= group.name %>">
            <% group.active_assignments.no_graded_quizzes_or_topics.scoped({:limit => 100}).each do |assignment| %>
              <option value="<%= assignment.id %>"><%= assignment.title %></option>
            <% end %>
            </optgroup>
          <% end %>
          <option value="new">[ New Assignment] </option>
        </select>
        </div>
        <div class="new" style="margin-top: 5px;">
          Assignment Name: <input type="text" name="assignment[title]" class="item_title"/>
          <a href="<%= context_url(@context, :context_assignments_url) %>" style="display: none;" class="add_item_url">&nbsp;</a>
        </div>
      </div>
      <div id="discussion_topics_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "word_bubble.png", :alt => "topic" %> Select the topic you want to associate with this <span class="holder_type">module</span>, or
          add a topic by selecting "New Topic".
        </div>
        <div style="margin-top: 5px;">
        <select class="module_item_select" multiple>
          <% @context.discussion_topics.active.only_discussion_topics.scoped({:limit => 100}).each do |topic| %>
            <option value="<%= topic.id %>"><%= topic.title %></option>
          <% end %>
          <option value="new">[ New Topic] </option>
        </select>
        </div>
        <div class="new" style="margin-top: 5px;">
          Topic Name: <input type="text" name="discussion_topic[title]" class="item_title"/>
          <a href="<%= context_url(@context, :context_discussion_topics_url) %>" style="display: none;" class="add_item_url">&nbsp;</a>
        </div>
      </div>
      <div style="margin: 0px 20px 5px;" class="context_module_content">
        Indentation:
        <select name="content_tag[indent]" id="content_tag_indent">
          <option value="0">Don't Indent</option><commit_msg>dont limit quizzes to 100 on modules page, fixes #4771<commit_after><% jammit_js :select_content_dialog %>
<% jammit_css :select_content_dialog %>
<% cache([@context, 'select_context_content_dialog']) do %>
  <div id="select_context_content_dialog" style="display: none;">
    <div>
      Add  
      <select id="add_module_item_select">
        <option value="assignment">Assignment</option>
        <option value="quiz">Quiz</option>
        <option value="attachment">File</option>
        <option value="wiki_page">Content Page</option>
        <option value="discussion_topic">Discussion</option>
        <option value="context_module_sub_header" class="context_module_content">Text Header</option>
        <option value="external_url" class="context_module_content">External URL</option>
        <option value="context_external_tool" class="context_module_content">External Tool</option>
      </select>
      to <span class="holder_name">module</span>
    </div>
    <div style="margin: 10px 20px;">
      <div id="context_module_sub_headers_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          Type the text you'd like to add as a <span class="holder_type">module</span> sub-header
        </div>
        <table>
          <tr>
            <td><label for="sub_header_title">Header:</label></td>
            <td><input type="text" name="title" id="sub_header_title" style="width: 200px;"/></td>
          </tr>
        </table>
      </div>
      <div id="external_urls_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "link.png", :alt => "external_url" %> Enter a URL and page name
          to add a link to any website URL to this <span class="holder_type">module</span>.
        </div>
        <table>
          <tr>
            <td><label for="content_tag_create_url">URL:</label></td>
            <td>
              <input type="text" name="url" id="content_tag_create_url" style="width: 200px;"/>
              <div id="content_tag_services">
              
              </div>
            </td>
          </tr>
          <tr>
            <td><label for="content_tag_create_title">Page Name:</label></td>
            <td><input type="text" name="title" id="content_tag_create_title" style="width: 120px;"/></td>
          </tr>
        </table>
      </div>
      <div id="context_external_tools_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "link.png", :alt => "external_tool" %> Select a tool from the list below,
          or enter a URL for an external tool you already know is configured with Basic LTI
          to add a link to it to this <span class="holder_type">module</span>.
        </div>
        <a href="<%= context_url(@context, :context_external_tools_url, :include_parents => '1') %>" class="external_tools_url" style="display: none;">&nbsp;</a>
        <table>
          <tr>
            <td colspan="2" class="tools">
              <div class="message" style="margin: 10px 0;">Loading...</div>
              <div class="tool" style="display: none;">
                <div class="name"></div>
                <div class="description"></div>
              </div>
            </td>
          </tr>
          <tr>
            <td><label for="external_tool_create_url">URL:</label></td>
            <td>
              <input type="text" name="url" id="external_tool_create_url" style="width: 200px;"/>
              <div class="domain_message" style="font-size: 0.8em; display: none;">
                to use this tool the domain must match <span class="domain">&nbsp;</span>
              </div>
            </td>
          </tr>
          <tr>
            <td><label for="external_tool_create_title">Page Name:</label></td>
            <td><input type="text" name="title" id="external_tool_create_title" style="width: 120px;"/></td>
          </tr>
        </table>
      </div>
      <div id="wiki_pages_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "file.png", :alt => "wiki_page" %> Select the wiki page you want to associate with this <span class="holder_type">module</span>, or
          add a new page by selecting "New Page".
        </div>
        <div style="margin-top: 5px;">
        <select class="module_item_select" multiple>
          <%# cache on the context.wiki instead of just the context because even though it will require a db query, we will get a much better cache hit rate %>
          <% cache([@context.wiki, '200_active_wiki_pages']) do  %>
            <% @context.wiki.wiki_pages.active.scoped({:select => "id, title", :limit => 200}).each do |page| %>
              <% if page && !page.new_record? %>
                <option value="<%= page.id %>"><%= page.title %></option>
              <% end %>
            <% end %>
          <% end %>
          <option value="new">[ New Page ]</option>
        </select>
        </div>
        <div class="new" style="margin-top: 5px;">
          Page Name: <input type="text" name="wiki_page[title]" class="item_title"/>
          <a href="<%= context_url(@context, :context_wiki_pages_url) %>" style="display: none;" class="add_item_url">&nbsp;</a>
        </div>
      </div>
      <div id="attachments_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "file_download.png" %> Select the file you want to associate with this <span class="holder_type">module</span>, or
          add a file by selecting "New File".
        </div>
        <div style="margin-top: 5px;">
        <select class="module_item_select" multiple>
          <% @context.folders.active.scoped({:limit => 200}).sort_by{|f| f.full_name}.each do |folder| %>
            <optgroup label="<%= folder.full_name %>">
              <% 
              attachments = if @context.grants_right?(@current_user, session, :manage_files)
                              folder.active_file_attachments
                            else
                              folder.visible_file_attachments
                            end
              %>
              <% attachments.each do |file| %>
                <option value="<%= file.id %>"><%= file.display_name %></option>
              <% end %>
            </optgroup>
          <% end %>
          <option value="new">[ New File ]</option>
        </select>
        </div>
        <div class="new" style="margin-top: 5px;">
          <table>
            <tr>
              <td>File:</td>
              <td><input id="module_attachment_uploaded_data" type="file" name="attachment[uploaded_data]" class="item_title"/></td>
            </tr><tr>
              <td>
                <a href="<%= context_url(@context, :context_files_url, :format => :text) %>" style="display: none;" class="add_item_url">&nbsp;</a>
                Folder: 
              </td><td>
                <% Folder.root_folders(@context) %>
                <% folders = @context.active_folders_with_sub_folders %>
                <% root_folders = folders.select{|f| f.parent_folder_id == nil} %>
                <select name="attachment[folder_id]" id="attachment_folder_id">
                  <%= folders_as_options(root_folders, :all_folders => folders, :max_depth => 1) %>
                </select>
              </td>
            </tr>
          </table>
        </div>
      </div>
      <div id="quizs_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "quiz.png", :alt => "quiz" %> Select the  quiz you want to associate with this <span class="holder_type">module</span>, or
          add a new one by selecting "New Quiz".
        </div>
        <div style="margin-top: 5px;">
        <select class="module_item_select" multiple>
          <% @context.quizzes.active.scoped({:limit => 400}).each do |quiz| %>
            <option value="<%= quiz.id %>"><%= quiz.title %></option>
          <% end %>
          <option value="new">[ New Quiz] </option>
        </select>
        </div>
        <div class="new" style="margin-top: 5px;">
          Quiz Name: <input type="text" name="quiz[title]" class="item_title"/>
          <a href="<%= context_url(@context, :context_quizzes_url) %>" style="display: none;" class="add_item_url">&nbsp;</a>
        </div>
      </div>
      <div id="assignments_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "grading_icon.png", :alt => "assignment" %> Select the assignment you want to associate with this <span class="holder_type">module</span>, or
          add an assignment by selecting "New Assignment".
        </div>
        <div style="margin-top: 5px;">
        <select class="module_item_select" multiple>
          <% @context.assignment_groups.active.include_active_assignments.each do |group| %>
            <optgroup label="<%= group.name %>">
            <% group.active_assignments.no_graded_quizzes_or_topics.scoped({:limit => 200}).each do |assignment| %>
              <option value="<%= assignment.id %>"><%= assignment.title %></option>
            <% end %>
            </optgroup>
          <% end %>
          <option value="new">[ New Assignment] </option>
        </select>
        </div>
        <div class="new" style="margin-top: 5px;">
          Assignment Name: <input type="text" name="assignment[title]" class="item_title"/>
          <a href="<%= context_url(@context, :context_assignments_url) %>" style="display: none;" class="add_item_url">&nbsp;</a>
        </div>
      </div>
      <div id="discussion_topics_select" class="module_item_option" style="margin: 5px 20px;">
        <div style="font-size: 0.8em;">
          <%= image_tag "word_bubble.png", :alt => "topic" %> Select the topic you want to associate with this <span class="holder_type">module</span>, or
          add a topic by selecting "New Topic".
        </div>
        <div style="margin-top: 5px;">
        <select class="module_item_select" multiple>
          <% @context.discussion_topics.active.only_discussion_topics.scoped({:limit => 200}).each do |topic| %>
            <option value="<%= topic.id %>"><%= topic.title %></option>
          <% end %>
          <option value="new">[ New Topic] </option>
        </select>
        </div>
        <div class="new" style="margin-top: 5px;">
          Topic Name: <input type="text" name="discussion_topic[title]" class="item_title"/>
          <a href="<%= context_url(@context, :context_discussion_topics_url) %>" style="display: none;" class="add_item_url">&nbsp;</a>
        </div>
      </div>
      <div style="margin: 0px 20px 5px;" class="context_module_content">
        Indentation:
        <select name="content_tag[indent]" id="content_tag_indent">
          <option value="0">Don't Indent</option>
{'fraction_non_alphanumeric': 0.16209827719441794, 'fraction_numerical': 0.009409518614482476, 'mean_word_length': 2.398208217485326, 'pattern_counts': {'":': 0, '<': 571, '<?xml version=': 0, '>': 603, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2551820', 'n_tokens_mistral': 6967, 'n_tokens_neox': 6460, 'n_words': 1494}