<commit_before>#surveyers
  h2 Ankiety
  table.table
    thead: tr
      th
      th 
      th.lead Ukończone
      th.lead Rozpoczęte
      th
    tbody
      tr.success
        td.toggle: input type='checkbox' name='display_all' checked=true
        td: span.lead: strong Wszystkie
        td
          - finished_sets_per_answer = @answers[:all].map { |e| e[:answer] && e[:answer].size }.compact
          - finished_sets = finished_sets_per_answer.inject(:+)
          - finished_stages = finished_sets_per_answer.map { |e| e / SurveyAnswer::QuestionsPerStage }.inject(:+)
          span.badge.badge-success: span.lead #{@answers[:finished].size} ankiet
          span.badge.badge-success: span.lead #{finished_stages} etapów
          span.badge.badge-success: span.lead #{finished_sets} zestawów
        td: span.badge: span.lead #{@answers[:all].size}
        td: .btn-group.pull-right
          a.download.btn href="/designer/#{@module}/answers-finished.csv"
            i.icon-download-alt
            '  Pobierz
          a.btn.dropdown-toggle data-toggle='dropdown'
            span.caret
          ul.dropdown-menu
            li: a.download href="/designer/#{@module}/answers-finished.csv"
              i.icon-ok
              '  Ukończone
            li: a.download href="/designer/#{@module}/answers-all.csv"
              i.icon-align-justify
              '  Wszystkie
      - @answers[:surveyers].each do |surveyer|
        tr
          td.toggle: input type='checkbox' name="display[#{surveyer[:name]}]" checked=true
          td: span.lead= surveyer[:name]
          td
            - finished_sets_per_answer = surveyer[:all].map { |e| e[:answer] && e[:answer].size }.compact
            - finished_sets = finished_sets_per_answer.inject(:+)
            - finished_stages = finished_sets_per_answer.map { |e| e / SurveyAnswer::QuestionsPerStage }.inject(:+)
            span.badge.badge-success: span.lead #{surveyer[:finished].size} ankiet
            span.badge.badge-success: span.lead #{finished_stages} etapów
            span.badge.badge-success: span.lead #{finished_sets} zestawów
          td: span.badge: span.lead #{surveyer[:all].size}
          td
  form.form.subset
    label.radio.inline: strong Wyświetlaj:
    label.radio.inline.toggle
      input type='radio' name='subset' checked=true value='finished'
      '  Tylko ukończone
    label.radio.inline.toggle
      input type='radio' name='subset' value='all'
      '  Ukończone oraz rozpoczęte
  javascript:
    function reload_results(event) {
      var surveyers = $('#results-pane #surveyers');
      $('#results-pane').load(
        "/designer/#{@module}/results-part?" +
          $('input[name^="display["]').serialize() + '&' +
          $('input[name="subset"]').serialize(),
        null,
        function() {
          $('#results-pane #surveyers').replaceWith(surveyers);
          $('#results-pane .context-loader').remove();
        });
    }
    $('input[name="subset"]').click(function(e) {<commit_msg>Improved figure surveys stats displaying<commit_after>#surveyers
  h2 Ankiety
  table.table
    thead: tr
      th
      th 
      th.lead Ukończone
      th.lead Rozpoczęte
      th
    tbody
      tr.success
        td.toggle: input type='checkbox' name='display_all' checked=true
        td: span.lead: strong Wszystkie
        td
          - finished_sets_per_answer = @answers[:all].map { |e| e[:answer] && e[:answer].size }.compact
          - finished_sets = finished_sets_per_answer.inject(:+) || 0
          - finished_stages = finished_sets_per_answer.map { |e| e / SurveyAnswer::QuestionsPerStage }.inject(:+) || 0
          span.badge.badge-success
            span.lead #{@answers[:finished].size} 
            ' ankiet
          span.badge.badge-success
            span.lead #{finished_stages} 
            ' etapów
          span.badge.badge-success
            span.lead #{finished_sets} 
            ' zestawów
        td: span.badge: span.lead #{@answers[:all].size}
        td: .btn-group.pull-right
          a.download.btn href="/designer/#{@module}/answers-finished.csv"
            i.icon-download-alt
            '  Pobierz
          a.btn.dropdown-toggle data-toggle='dropdown'
            span.caret
          ul.dropdown-menu
            li: a.download href="/designer/#{@module}/answers-finished.csv"
              i.icon-ok
              '  Ukończone
            li: a.download href="/designer/#{@module}/answers-all.csv"
              i.icon-align-justify
              '  Wszystkie
      - @answers[:surveyers].each do |surveyer|
        tr
          td.toggle: input type='checkbox' name="display[#{surveyer[:name]}]" checked=true
          td: span.lead= surveyer[:name]
          td
            - finished_sets_per_answer = surveyer[:all].map { |e| e[:answer] && e[:answer].size }.compact
            - finished_sets = finished_sets_per_answer.inject(:+) || 0
            - finished_stages = finished_sets_per_answer.map { |e| e / SurveyAnswer::QuestionsPerStage }.inject(:+) || 0
            span.badge.badge-success
              span.lead #{surveyer[:finished].size} 
              ' ankiet
            span.badge.badge-success
              span.lead #{finished_stages} 
              ' etapów
            span.badge.badge-success
              span.lead #{finished_sets} 
              ' zestawów
          td: span.badge: span.lead #{surveyer[:all].size}
          td
  form.form.subset
    label.radio.inline: strong Wyświetlaj:
    label.radio.inline.toggle
      input type='radio' name='subset' checked=true value='finished'
      '  Tylko ukończone
    label.radio.inline.toggle
      input type='radio' name='subset' value='all'
      '  Ukończone oraz rozpoczęte
  javascript:
    function reload_results(event) {
      var surveyers = $('#results-pane #surveyers');
      $('#results-pane').load(
        "/designer/#{@module}/results-part?" +
          $('input[name^="display["]').serialize() + '&' +
          $('input[name="subset"]').serialize(),
        null,
        function() {
          $('#results-pane #surveyers').replaceWith(surveyers);
          $('#results-pane .context-loader').remove();
        });
    }
    $('input[name="subset"]').click(function(e) {
{'fraction_non_alphanumeric': 0.14095360410980895, 'fraction_numerical': 0.0009632364745545031, 'mean_word_length': 2.1769505354411014, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4609519', 'n_tokens_mistral': 2018, 'n_tokens_neox': 1947, 'n_words': 322}