<commit_before>Feature: Survey export
  As an api consumer
  I want to represent a survey in JSON
  So that I can use it offline

  Scenario: Exporting basic questions
    Given I parse
    """
      survey "Simple json" do
        section "Basic questions" do
          label "These questions are examples of the basic supported input types"

          question_1 "What is your favorite color?", :pick => :one
          answer "red"
          answer "blue"
          answer "green"
          answer :other

          q_2b "Choose the colors you don't like", :pick => :any
          a_1 "orange"
          a_2 "purple"
          a_3 "brown"
          a :omit
        end
      end
    """
    Then the json for "Simple json" should be
    """
    {
      "title": "Simple json",
      "uuid": "*",
      "sections": [{
        "title": "Basic questions",
        "display_order":0,
        "questions_and_groups": [
          { "uuid": "*", "type": "label", "text": "These questions are examples of the basic supported input types" },
          { "uuid": "*", "reference": "1", "pick": "one", "text": "What is your favorite color?", "answers": [{"text": "red"}, {"text": "blue"}, {"text": "green"}, {"text": "Other"}]},
          { "uuid": "*", "reference": "2b", "pick": "any", "text": "Choose the colors you don't like", "answers": [{"text": "orange"},{"text": "purple"},{"text": "brown"},{"text": "Omit", "exclusive": "true"}]}]
        }]
      }
    """
  
#   Scenario: Exporting response sets
#   Given I parse
#   """
#     survey "Simple json response sets" do
#       section "Colors" do
# 
#         question_1 "What is your favorite color?", :pick => :one
#         answer "red"
#         answer "blue"
#         answer "green"
#         answer :other
# 
#         q_2b "What color don't you like?"
#         a_1 "color", :string
#       end
#     end
#   """
# When I start the "Simple json" survey
# And I choose "red"<commit_msg>fixing json export feature<commit_after>Feature: Survey export
  As an api consumer
  I want to represent a survey in JSON
  So that I can use it offline

  Scenario: Exporting basic questions
    Given I parse
    """
      survey "Simple json" do
        section "Basic questions" do
          label "These questions are examples of the basic supported input types"

          question_1 "What is your favorite color?", :pick => :one
          answer "red"
          answer "blue"
          answer "green"
          answer :other

          q_2b "Choose the colors you don't like", :pick => :any
          a_1 "orange"
          a_2 "purple"
          a_3 "brown"
          a :omit
        end
      end
    """
    Then the json for "Simple json" should be
    """
    {
      "title": "Simple json",
      "uuid": "*",
      "sections": [{
        "title": "Basic questions",
        "display_order":0,
        "questions_and_groups": [
          { "uuid": "*", "type": "label", "text": "These questions are examples of the basic supported input types" },
          { "uuid": "*", "reference_identifier": "1", "pick": "one", "text": "What is your favorite color?", "answers": [{"text": "red", "uuid": "*"}, {"text": "blue", "uuid": "*"}, {"text": "green", "uuid": "*"}, {"text": "Other", "uuid": "*"}]},
          { "uuid": "*", "reference_identifier": "2b", "pick": "any", "text": "Choose the colors you don't like", "answers": [{"text": "orange", "uuid": "*"},{"text": "purple", "uuid": "*"},{"text": "brown", "uuid": "*"},{"text": "Omit", "exclusive": "true", "uuid": "*"}]}]
        }]
      }
    """
  
#   Scenario: Exporting response sets
#   Given I parse
#   """
#     survey "Simple json response sets" do
#       section "Colors" do
# 
#         question_1 "What is your favorite color?", :pick => :one
#         answer "red"
#         answer "blue"
#         answer "green"
#         answer :other
# 
#         q_2b "What color don't you like?"
#         a_1 "color", :string
#       end
#     end
#   """
# When I start the "Simple json" survey
# And I choose "red"
{'fraction_non_alphanumeric': 0.1653836602930221, 'fraction_numerical': 0.005463123913583313, 'mean_word_length': 2.2962356792144027, 'pattern_counts': {'":': 64, '<': 3, '<?xml version=': 0, '>': 9, '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': '4204572', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1202, 'n_words': 431}