<commit_before>class AssignmentController < ApplicationController
  auto_complete_for :user, :name
  before_filter :authorize

  # change access permission from public to private or vice versa
  def toggle_access
    assignment = Assignment.find(params[:id])
    assignment.private = !assignment.private
    assignment.save
    redirect_to :controller => 'tree_display', :action => 'list'
  end

  def new
    @assignment = Assignment.new
    @assignment.course = Course.find(params[:parent_id]) unless params[:parent_id].nil?

    if @assignment.course.nil?
      @assignment.instructor = session[:user]
    else
      @assignment.instructor = @assignment.course.instructor
    end

    @assignment.wiki_type_id = 1 #default no wiki type
  end

  def create
    @assignment = Assignment.new(params[:assignment])

    if @assignment.save
      @assignment.create_node
      flash[:note] = 'Assignment was successfully created.'
      flash[:alert] = "There is already an assignment named #{@assignment.name}" if @assignment.duplicate_name?
      redirect_to :action => 'edit', :id => @assignment.id
    else
      render :action => 'new'
    end
  end

  def edit
    @assignment = Assignment.find(params[:id])
    set_up
  end

  def delete_all_due_dates
    if params[:assignment_id].nil?
      return 
    end

    assignment = Assignment.find(params[:assignment_id])<commit_msg>The max team size defaults to 1 instead of 0<commit_after>class AssignmentController < ApplicationController
  auto_complete_for :user, :name
  before_filter :authorize

  # change access permission from public to private or vice versa
  def toggle_access
    assignment = Assignment.find(params[:id])
    assignment.private = !assignment.private
    assignment.save
    redirect_to :controller => 'tree_display', :action => 'list'
  end

  def new
    @assignment = Assignment.new
    @assignment.course = Course.find(params[:parent_id]) unless params[:parent_id].nil?

    if @assignment.course.nil?
      @assignment.instructor = session[:user]
    else
      @assignment.instructor = @assignment.course.instructor
    end

    @assignment.wiki_type_id = 1 #default no wiki type
  end

  def create
    params[:assignment][:max_team_size] ||= 1
    @assignment = Assignment.new(params[:assignment])

    if @assignment.save
      @assignment.create_node
      flash[:note] = 'Assignment was successfully created.'
      flash[:alert] = "There is already an assignment named #{@assignment.name}" if @assignment.duplicate_name?
      redirect_to :action => 'edit', :id => @assignment.id
    else
      render :action => 'new'
    end
  end

  def edit
    @assignment = Assignment.find(params[:id])
    set_up
  end

  def delete_all_due_dates
    if params[:assignment_id].nil?
      return 
    end

    assignment = Assignment.find(params[:assignment_id])
{'fraction_non_alphanumeric': 0.1003167898627244, 'fraction_numerical': 0.0017599436818021823, 'mean_word_length': 3.576489533011272, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '4998317', 'n_tokens_mistral': 862, 'n_tokens_neox': 842, 'n_words': 212}