<commit_before>class ConsultationFormsController < ApplicationController
  before_filter :require_current_school
 # GET /consultation_forms/1
 # GET /consultation_forms/1.xml
  def show
    @consultation_form = ConsultationForm.find(params[:id])
    @consultation_form = nil unless @consultation_form.district == current_district

    respond_to do |format|
      format.js
      format.html # show.html.erb
      format.xml  { render :xml => @consultation_form }
    end
  end

  # GET /consultation_forms/new
  # GET /consultation_forms/new.xml
  def new
    @consultation_form = current_student.team_consultations.find(params[:team_consultation_id]).consultation_forms.build

    respond_to do |format|
      format.js
      format.html # new.html.erb
      format.xml  { render :xml => @consultation_form }
    end
  end

  def edit
    @consultation_form = ConsultationForm.find_by_user_id_and_id(current_user,params[:id])
    respond_to do |format|
      format.js
      format.html # show.html.erb
      format.xml  { render :xml => @consultation_form }
    end
 
  end

  def update
    @consultation_form = ConsultationForm.find_by_user_id_and_id(current_user,params[:id])

    respond_to do |format|
      if @consultation_form.update_attributes(params[:consultation_form])
        msg= 'ConsultationForm was updated.'
        format.html { flash[:notice]=msg; redirect_to(current_student) }
        format.js { flash.now[:notice] = msg; responds_to_parent {render}}
        format.xml  { render :xml => @consultation_form, :status => :created, :location => @consultation_form }
      else
        format.js  {responds_to_parnt {render}}
        format.html { render :action => "edit" }
        format.xml  { render :xml => @consultation_form.errors, :status => :unprocessable_entity }<commit_msg>typo in responds to parnt [#604]<commit_after>class ConsultationFormsController < ApplicationController
  before_filter :require_current_school
 # GET /consultation_forms/1
 # GET /consultation_forms/1.xml
  def show
    @consultation_form = ConsultationForm.find(params[:id])
    @consultation_form = nil unless @consultation_form.district == current_district

    respond_to do |format|
      format.js
      format.html # show.html.erb
      format.xml  { render :xml => @consultation_form }
    end
  end

  # GET /consultation_forms/new
  # GET /consultation_forms/new.xml
  def new
    @consultation_form = current_student.team_consultations.find(params[:team_consultation_id]).consultation_forms.build

    respond_to do |format|
      format.js
      format.html # new.html.erb
      format.xml  { render :xml => @consultation_form }
    end
  end

  def edit
    @consultation_form = ConsultationForm.find_by_user_id_and_id(current_user,params[:id])
    respond_to do |format|
      format.js
      format.html # show.html.erb
      format.xml  { render :xml => @consultation_form }
    end
 
  end

  def update
    @consultation_form = ConsultationForm.find_by_user_id_and_id(current_user,params[:id])

    respond_to do |format|
      if @consultation_form.update_attributes(params[:consultation_form])
        msg= 'ConsultationForm was updated.'
        format.html { flash[:notice]=msg; redirect_to(current_student) }
        format.js { flash.now[:notice] = msg; responds_to_parent {render}}
        format.xml  { render :xml => @consultation_form, :status => :created, :location => @consultation_form }
      else
        format.js  {responds_to_parent {render}}
        format.html { render :action => "edit" }
        format.xml  { render :xml => @consultation_form.errors, :status => :unprocessable_entity }
{'fraction_non_alphanumeric': 0.10044028618602091, 'fraction_numerical': 0.001926252063841497, 'mean_word_length': 3.555137844611529, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 24}, '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': '2395005', 'n_tokens_mistral': 1182, 'n_tokens_neox': 1155, 'n_words': 223}