<commit_before>.row
  .col-md-12
    .page-header
      - if @survey_question.new_record?
        %h1
          New Survey Question
      - else
        %h1
          Edit Survey Question
        .text-muted
          = @survey_question.title

  .col-md-6
    = form_for @survey_question, url: @url do |f|
      .form-group
        = f.text_field :title, autofocus: true, class: 'form-control'
        .checkbox
          %label
            = f.check_box :mandatory
            Mandatory?
      .survey-possible-answers{ class: @survey_question.choice? ? '' : 'hidden' }
        .form-group
          = f.text_area :possible_answers, rows: 3, class: 'form-control'
          %span.help-block
            Comma separated
        .form-group
          = f.label :min_choices
          = f.number_field :min_choices, class: 'form-control'
        .form-group
          = f.label :max_choices
          = f.number_field :max_choices, class: 'form-control'
      .form-group
        %label{ required: 'required' }
          Type of Question:
        .form-group
          %select.selectpicker.form-control{ id: 'survey_question_kind', name: 'survey_question[kind]' }
            - SurveyQuestion.kinds.each do |kind|
              %option{ id: "#{kind.second}", 'data-icon' => "fa fa-#{SurveyQuestion::ICONS[kind.first.to_sym]}", selected: @survey_question.kind == kind.first }
                = kind.first
        = f.submit nil, class: 'btn btn-primary'
  .col-md-6
    %label
      Preview:
    %span.help-block
      This is how you visitors will see the question in the survey.
    .panel.panel-default
      .panel-body{ id: 'survey_question_preview' }
        %p{ id: 'title', style: 'word-wrap: break-word' }
          = @survey_question.title.blank? ? 'What is your answer?' : @survey_question.title
        .kinds.boolean{ class: @survey_question.boolean? ? '' : 'hidden' }
          %input{ type: 'radio', name: 'radio' } Yes
          %br
          %input{ type: 'radio', name: 'radio' } No
        .kinds.choice{ class: @survey_question.choice? ? '' : 'hidden' }
          - if @survey_question.possible_answers.blank?
            - if @survey_question.single_choice?
              .radio
                %label
                  %input{ type: 'radio' }<commit_msg>Associate form label with its control<commit_after>.row
  .col-md-12
    .page-header
      - if @survey_question.new_record?
        %h1
          New Survey Question
      - else
        %h1
          Edit Survey Question
        .text-muted
          = @survey_question.title

  .col-md-6
    = form_for @survey_question, url: @url do |f|
      .form-group
        = f.text_field :title, autofocus: true, class: 'form-control'
        .checkbox
          %label
            = f.check_box :mandatory
            Mandatory?
      .survey-possible-answers{ class: @survey_question.choice? ? '' : 'hidden' }
        .form-group
          = f.text_area :possible_answers, rows: 3, class: 'form-control'
          %span.help-block
            Comma separated
        .form-group
          = f.label :min_choices
          = f.number_field :min_choices, class: 'form-control'
        .form-group
          = f.label :max_choices
          = f.number_field :max_choices, class: 'form-control'
      .form-group
        %label{ for: 'survey_question_kind', required: 'required' }
          Type of Question:
        .form-group
          %select.selectpicker.form-control{ id: 'survey_question_kind', name: 'survey_question[kind]' }
            - SurveyQuestion.kinds.each do |kind|
              %option{ id: "#{kind.second}", 'data-icon' => "fa fa-#{SurveyQuestion::ICONS[kind.first.to_sym]}", selected: @survey_question.kind == kind.first }
                = kind.first
        = f.submit nil, class: 'btn btn-primary'
  .col-md-6
    %label
      Preview:
    %span.help-block
      This is how you visitors will see the question in the survey.
    .panel.panel-default
      .panel-body{ id: 'survey_question_preview' }
        %p{ id: 'title', style: 'word-wrap: break-word' }
          = @survey_question.title.blank? ? 'What is your answer?' : @survey_question.title
        .kinds.boolean{ class: @survey_question.boolean? ? '' : 'hidden' }
          %input{ type: 'radio', name: 'radio' } Yes
          %br
          %input{ type: 'radio', name: 'radio' } No
        .kinds.choice{ class: @survey_question.choice? ? '' : 'hidden' }
          - if @survey_question.possible_answers.blank?
            - if @survey_question.single_choice?
              .radio
                %label
                  %input{ type: 'radio' }
{'fraction_non_alphanumeric': 0.12698412698412698, 'fraction_numerical': 0.0030441400304414, 'mean_word_length': 1.933673469387755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4035568', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1446, 'n_words': 319}