<commit_before>- if @survey.errors.any?
  - flash.now[:alert] = @survey.errors.full_messages.join(', ').to_s

= form_for @survey, html: {class: "form-horizontal"} do |f|

  .page-header
    %h5
      = f.object.project.organization.name + ": "
      %i= f.object.project.name
      |
      Mode:
      %i= yield :survey_form_state
    %h1= f.object.survey_template.name
    
  = f.hidden_field :project_id
  = f.hidden_field :survey_template_id

  -# loop through survey questions and display
  - @survey.observations.each_with_index do |observation, index|
    = f.fields_for :observations, observation do |ff|
      = ff.hidden_field :survey_question_id
      
      = render "hanuman/shared/field_" + ff.object.survey_question.question.answer_type.name, ff: ff, index: index rescue render "hanuman/shared/rescue_field_notsupported", ff: ff, index: index
      
  .form-group
    .col-sm-offset-5.col-sm-7
      = f.submit "Save", class: "btn btn-primary"
      = link_to "Cancel", surveys_path, data: {confirm: "Are you sure you want to Cancel?"}, class: "btn btn-default"<commit_msg>change save to next on new page<commit_after>- if @survey.errors.any?
  - flash.now[:alert] = @survey.errors.full_messages.join(', ').to_s

= form_for @survey, html: {class: "form-horizontal"} do |f|

  .page-header
    %h5
      = f.object.project.organization.name + ": "
      %i= f.object.project.name
      |
      Mode:
      %i= yield :survey_form_state
    %h1= f.object.survey_template.name
    
  = f.hidden_field :project_id
  = f.hidden_field :survey_template_id

  -# loop through survey questions and display
  - @survey.observations.each_with_index do |observation, index|
    = f.fields_for :observations, observation do |ff|
      = ff.hidden_field :survey_question_id
      
      = render "hanuman/shared/field_" + ff.object.survey_question.question.answer_type.name, ff: ff, index: index rescue render "hanuman/shared/rescue_field_notsupported", ff: ff, index: index
      
  .form-group
    .col-sm-offset-5.col-sm-7
      = f.submit "Next", class: "btn btn-primary"
      = link_to "Cancel", surveys_path, data: {confirm: "Are you sure you want to Cancel?"}, class: "btn btn-default"
{'fraction_non_alphanumeric': 0.1322992700729927, 'fraction_numerical': 0.0036496350364963502, 'mean_word_length': 3.241779497098646, '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': '4029592', 'n_tokens_mistral': 781, 'n_tokens_neox': 758, 'n_words': 167}