<commit_before>%div{:id => dom_id_for(report_context, :report), :class => 'item', :style => 'page-break-after: always;'}
  - @filtered = offering.report_embeddable_filter && offering.report_embeddable_filter.embeddables.size > 0
  - form_for :report_embeddable_filter, :url => report_embeddable_filter_portal_offering_url(offering) do |filter_form|
    %h3{:class => 'inline_block'}
      %span= yield :report_title
    - if show_selection_controls
      %div{:class => 'inline_block', :style => 'position: relative; top: -3px; left: 15px;'}
        = filter_form.submit "Show all", :disabled => !@filtered, :class => 'filter_selection_control'
        = filter_form.submit "Show selected", :class => 'filter_selection_control'
    - if show_print_controls
      %div{:style => 'float: right;'}
        %a{:href => 'javascript:window.print();', :style => 'font-size: 1em;'}= 'print this'
        = " | "
        = link_to "print all users", separated_report_portal_offering_url(offering)
    %div{:id => dom_id_for(offering, :details), :class => 'content'}
      %div{:style => 'font-weight: bold'}
        = yield :report_summary
      %div
        - page_elements.keys.sort_by{|a| a.position}.each do |activity|
          - sections = page_elements[activity]
          %div{:id => dom_id_for(activity)}
            %div
              %span{:style => 'font-weight: bold;'}= "Activity"
              - if show_selection_controls
                = selectAllNone(dom_id_for(activity))
              = " &ndash; #{activity.name}"
            %div{:style => 'padding-left: 10px;'}
              - sections.keys.sort_by{|a| a.position}.each do |section|
                - pages = sections[section]
                %div{:id => dom_id_for(section)}
                  %div
                    %span{:style => 'font-weight: bold;'}= "Section"
                    - if show_selection_controls
                      = selectAllNone(dom_id_for(section))
                    = " &ndash; #{section.name}"
                  %div{:style => 'padding-left: 20px;'}
                    - pages.keys.sort_by{|a| a.position}.each do |page|
                      - page_embeddables = pages[page]
                      %div{:id => dom_id_for(page)}
                        %div
                          %span{:style => 'font-weight: bold;'}= "Page"
                          - if show_selection_controls
                            = selectAllNone(dom_id_for(page))
                          = " &ndash; #{page.name}"
                        %div{:style => 'padding-left: 30px;'}
                          - page_embeddables.map{ |pe| pe[:embeddable] }.each do |embeddable|
                            %div{:id => dom_id_for(embeddable, :content), :style => 'position: relative;', :class => 'report_embeddable'}
                              - if show_selection_controls
                                %div{:style => 'position: absolute; left: -20px; top: 50%;'}
                                  = check_box_tag "filter[#{embeddable.class}][]", embeddable.id, @filtered, :class => "filter_checkbox"
                              - report_type = "offerings"
                              - locals = {:embeddable => embeddable, :offering => offering }
                              - if learners.kind_of?(Array)
                                - locals[:learners] = learners
                              - else
                                - report_type = "learners"
                                - locals[:learner] = learners
                              - if embeddable.kind_of? Embeddable::MultipleChoice
                                = render :partial => "portal/#{report_type}/embeddable_multiple_choice", :locals => locals
                              - elsif embeddable.kind_of? Embeddable::OpenResponse
                                = render :partial => "portal/#{report_type}/embeddable_open_response", :locals => locals
                              - elsif embeddable.kind_of? Embeddable::ImageQuestion
                                = render :partial => "portal/#{report_type}/embeddable_image_question", :locals => locals
                              - else
                                = "Unknown type of embeddable: #{embeddable.class}"<commit_msg>Set default visibility for reports.<commit_after>- show_selection_controls = true if local_assigns[:show_selection_controls].nil?
- show_print_controls = true if local_assigns[:show_print_controls].nil?
%div{:id => dom_id_for(report_context, :report), :class => 'item', :style => 'page-break-after: always;'}
  - @filtered = offering.report_embeddable_filter && offering.report_embeddable_filter.embeddables.size > 0
  - form_for :report_embeddable_filter, :url => report_embeddable_filter_portal_offering_url(offering) do |filter_form|
    %h3{:class => 'inline_block'}
      %span= yield :report_title
    - if show_selection_controls
      %div{:class => 'inline_block', :style => 'position: relative; top: -3px; left: 15px;'}
        = filter_form.submit "Show all", :disabled => !@filtered, :class => 'filter_selection_control'
        = filter_form.submit "Show selected", :class => 'filter_selection_control'
    - if show_print_controls
      %div{:style => 'float: right;'}
        %a{:href => 'javascript:window.print();', :style => 'font-size: 1em;'}= 'print this'
        = " | "
        = link_to "print all users", separated_report_portal_offering_url(offering)
    %div{:id => dom_id_for(offering, :details), :class => 'content'}
      %div{:style => 'font-weight: bold'}
        = yield :report_summary
      %div
        - page_elements.keys.sort_by{|a| a.position}.each do |activity|
          - sections = page_elements[activity]
          %div{:id => dom_id_for(activity)}
            %div
              %span{:style => 'font-weight: bold;'}= "Activity"
              - if show_selection_controls
                = selectAllNone(dom_id_for(activity))
              = " &ndash; #{activity.name}"
            %div{:style => 'padding-left: 10px;'}
              - sections.keys.sort_by{|a| a.position}.each do |section|
                - pages = sections[section]
                %div{:id => dom_id_for(section)}
                  %div
                    %span{:style => 'font-weight: bold;'}= "Section"
                    - if show_selection_controls
                      = selectAllNone(dom_id_for(section))
                    = " &ndash; #{section.name}"
                  %div{:style => 'padding-left: 20px;'}
                    - pages.keys.sort_by{|a| a.position}.each do |page|
                      - page_embeddables = pages[page]
                      %div{:id => dom_id_for(page)}
                        %div
                          %span{:style => 'font-weight: bold;'}= "Page"
                          - if show_selection_controls
                            = selectAllNone(dom_id_for(page))
                          = " &ndash; #{page.name}"
                        %div{:style => 'padding-left: 30px;'}
                          - page_embeddables.map{ |pe| pe[:embeddable] }.each do |embeddable|
                            %div{:id => dom_id_for(embeddable, :content), :style => 'position: relative;', :class => 'report_embeddable'}
                              - if show_selection_controls
                                %div{:style => 'position: absolute; left: -20px; top: 50%;'}
                                  = check_box_tag "filter[#{embeddable.class}][]", embeddable.id, @filtered, :class => "filter_checkbox"
                              - report_type = "offerings"
                              - locals = {:embeddable => embeddable, :offering => offering }
                              - if learners.kind_of?(Array)
                                - locals[:learners] = learners
                              - else
                                - report_type = "learners"
                                - locals[:learner] = learners
                              - if embeddable.kind_of? Embeddable::MultipleChoice
                                = render :partial => "portal/#{report_type}/embeddable_multiple_choice", :locals => locals
                              - elsif embeddable.kind_of? Embeddable::OpenResponse
                                = render :partial => "portal/#{report_type}/embeddable_open_response", :locals => locals
                              - elsif embeddable.kind_of? Embeddable::ImageQuestion
                                = render :partial => "portal/#{report_type}/embeddable_image_question", :locals => locals
                              - else
                                = "Unknown type of embeddable: #{embeddable.class}"
{'fraction_non_alphanumeric': 0.12896916705016107, 'fraction_numerical': 0.0036815462494247586, 'mean_word_length': 1.7182614133833647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3820986', 'n_tokens_mistral': 2478, 'n_tokens_neox': 2401, 'n_words': 436}