<commit_before>- title "#{@group.name} | #{@assignment.name}"
.row
  #content.col-md-9
    %h1.page-header
      = @group.course.code + ": " + @group.name
      .menu-icon-container.hidden
        %span.glyphicon.glyphicon-tasks.menu-icon
    
    %p Viewing submissions for "#{@assignment.name}" from group "#{@group.name}"
    
    %h3 Submissions
    %table.table.table-hover.table-striped
      - if @group.users.empty?
        %p No students are currently enrolled in this group.
      - else
        %tr
          %th Name
          %th Student ID
          %th Submissions
          %th Comment
        - @group.users.each do |s|
          %tr
            %td= link_to s.full_name, user_path(s)
            %td= link_to s.uid, user_path(s)
            %td
              - user_submission = @submissions.select{ |x| x.user == s}.last
              - if user_submission && user_submission.finalised
                = link_to submission_path(user_submission), class: "good" do
                  %span.glyphicon.glyphicon-thumbs-up
                  = user_submission.created_at.strftime('%d/%m/%Y %I:%M%p')
              - elsif user_submission
                = link_to submission_path(user_submission) do
                  = user_submission.created_at.strftime('%d/%m/%Y %I:%M%p')
            %td
              .comment-form
              - if user_submission && user_submission.comments_by(current_user).empty?
                = form_for @comment do |f|
                  = f.text_field :no_redirect, value: "true", class: "hidden"
                  = f.text_field :submission_id, value: user_submission.id, class: "hidden"
                  = f.text_field :user_id, value: current_user.id, class: "hidden"
                  = f.text_area :text, placeholder: "Comment", class: "form-control"
                  = f.file_field :attachment
                  - if current_user.is_staff?
                    .hide-comment
                      %label
                        = f.check_box :hidden, id: "hidden_comment_#{s.uid}"
                        Hide comment
                  = f.submit "Add comment", class: "btn btn-xs btn-primary"
              - elsif user_submission && !user_submission.comments_by(current_user).empty?
                %span.good
                  Commented
              - else
                %span.warn
                  No Submission
  = render 'sidebar_show_group'<commit_msg>add comment preview in group_assignments<commit_after>- title "#{@group.name} | #{@assignment.name}"
.row
  #content.col-md-9
    %h1.page-header
      = @group.course.code + ": " + @group.name
      .menu-icon-container.hidden
        %span.glyphicon.glyphicon-tasks.menu-icon
    
    %p Viewing submissions for "#{@assignment.name}" from group "#{@group.name}"
    
    %h3 Submissions
    %table.table.table-hover.table-striped
      - if @group.users.empty?
        %p No students are currently enrolled in this group.
      - else
        %tr
          %th Name
          %th Student ID
          %th Submissions
          %th Comment
        - @group.users.each do |s|
          %tr
            %td= link_to s.full_name, user_path(s)
            %td= link_to s.uid, user_path(s)
            %td
              - user_submission = @submissions.select{ |x| x.user == s}.last
              - if user_submission && user_submission.finalised
                = link_to submission_path(user_submission), class: "good" do
                  %span.glyphicon.glyphicon-thumbs-up
                  = user_submission.created_at.strftime('%d/%m/%Y %I:%M%p')
              - elsif user_submission
                = link_to submission_path(user_submission) do
                  = user_submission.created_at.strftime('%d/%m/%Y %I:%M%p')
            %td
              .comment-users
                - user_submission && user_submission.comments.order(created_at: :asc).each do |c|
                  .bold{ style: "padding: 0px 10px 10px 0px;"}
                    = c.user.full_name
                    - if c.visible && c.user.is_staff_for_course?(@assignment.course)
                      %span.glyphicon.glyphicon-eye-close
                    - elsif !c.visible && c.user.is_staff_for_course?(@assignment.course)
                      %span.glyphicon.glyphicon-eye-open
              .comment-form
                - if user_submission && user_submission.comments_by(current_user).empty?
                  = form_for @comment do |f|
                    = f.text_field :no_redirect, value: "true", class: "hidden"
                    = f.text_field :submission_id, value: user_submission.id, class: "hidden"
                    = f.text_field :user_id, value: current_user.id, class: "hidden"
                    = f.text_area :text, placeholder: "Comment", class: "form-control"
                    = f.file_field :attachment
                    - if current_user.is_staff?
                      .hide-comment
                        %label
                          = f.check_box :hidden, id: "hidden_comment_#{s.uid}"
                          Hide comment
                    = f.submit "Add comment", class: "btn btn-xs btn-primary"
                - elsif user_submission && !user_submission.comments_by(current_user).empty?
                  %span.good
                    Commented
                - else
                  %span.warn
                    No Submission
  = render 'sidebar_show_group'
{'fraction_non_alphanumeric': 0.11055647994083934, 'fraction_numerical': 0.0022185246810870773, 'mean_word_length': 1.5651967757230916, 'pattern_counts': {'":': 2, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6639508', 'n_tokens_mistral': 1641, 'n_tokens_neox': 1559, 'n_words': 311}