<commit_before>require 'zip/zip'

class SubmittedContentController < ApplicationController
  helper :wiki
  
  def edit
    @participant = AssignmentParticipant.find(params[:id])
    return unless current_user_id?(@participant.user_id)
    
    @assignment = @participant.assignment
  end
  
  def view
    @participant = AssignmentParticipant.find(params[:id])
    return unless current_user_id?(@participant.user_id)<commit_msg>Show an alert if a participant wants to submit work when he doesn't have a team and it is a team assignment<commit_after>require 'zip/zip'

class SubmittedContentController < ApplicationController
  helper :wiki
  
  def edit
    @participant = AssignmentParticipant.find(params[:id])
    return unless current_user_id?(@participant.user_id)
    
    @assignment = @participant.assignment
    
    if @assignment.team_assignment && @participant.team.nil?
      flash[:alert] = "This is a team assignment. Before submitting your work, you must <a style='color: blue;' href='../../student_team/view/#{params[:id]}'>create a team</a>, even if you will be the only member of the team"
      redirect_to :controller => 'student_task', :action => 'view', :id => params[:id]
    end
  end
  
  def view
    @participant = AssignmentParticipant.find(params[:id])
    return unless current_user_id?(@participant.user_id)
{'fraction_non_alphanumeric': 0.10365398956002983, 'fraction_numerical': 0.0, 'mean_word_length': 4.346613545816733, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '5518559', 'n_tokens_mistral': 410, 'n_tokens_neox': 390, 'n_words': 108}