<commit_before>h1 = t('.title')

- submissions = Submission.where(user: @user).in_study_group_of(current_user)
- exercises = Exercise.where(id: submissions.joins(:exercise).group(:exercise_id).select(:exercise_id).distinct)
- if !policy(exercises.first).detailed_statistics?
  - submissions = submissions.final

- if submissions.any?
  .table-responsive
    table.table.table-striped.sortable
      thead
        tr
          th.header = t('.exercise')
          th.header = t('.score')
          th.header = t('.deadline')
          th.header = t('.runs') if policy(exercises.first).detailed_statistics?
          th.header = t('.worktime') if policy(exercises.first).detailed_statistics?
      tbody
        - exercises.each do |exercise|<commit_msg>Check for first non-null exercise for permission<commit_after>h1 = t('.title')

- submissions = Submission.where(user: @user).in_study_group_of(current_user)
- exercises = Exercise.where(id: submissions.joins(:exercise).group(:exercise_id).select(:exercise_id).distinct)
- if !policy(exercises.reject(&:nil?).first).detailed_statistics?
  - submissions = submissions.final

- if submissions.any?
  .table-responsive
    table.table.table-striped.sortable
      thead
        tr
          th.header = t('.exercise')
          th.header = t('.score')
          th.header = t('.deadline')
          th.header = t('.runs') if policy(exercises.first).detailed_statistics?
          th.header = t('.worktime') if policy(exercises.first).detailed_statistics?
      tbody
        - exercises.each do |exercise|
{'fraction_non_alphanumeric': 0.14092664092664092, 'fraction_numerical': 0.001287001287001287, 'mean_word_length': 3.283746556473829, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '519093', 'n_tokens_mistral': 503, 'n_tokens_neox': 470, 'n_words': 77}