Skip to content

Questions JSON Editor

The Forms module — used for forms, questionnaires, quizzes, evaluations, and polls — now includes a Questions JSON editor. It is built to work with AI models: ask any AI model to generate a full set of questions in the Gohorto structure, then insert them into the form with one click on Apply and save.

You can also use it to edit every question on a form — titles, help text, choices, scoring, and every language — in one structured view.

Navigation: Admin → Forms → open a form → Actions → JSON

The visual builder is still the place to add a single field, drag a section, or change one choice. Use JSON when you need to generate a form with AI, translate a long form, reorder many questions, or update labels and points across the whole form at once. Both views edit the same questions.

JSON drawer with a bilingual question

1. Open the editor

JSON is available on an existing form (edit mode).

  1. Open the form in the form editor.
  2. In the header, open Actions.
  3. Choose JSON.

A side drawer opens with:

  • Short editing rules
  • A code editor (line numbers, bracket matching, folding, and JSON lint). The editor stays left-to-right even when the admin UI is Arabic.
  • Structure — downloads the field reference for the current admin language (Arabic or English)
  • Apply and save — validates the JSON, then saves through the same path as the visual builder
  • Close

Nothing is written until Apply and save succeeds.

2. Generate questions with AI

The structure file is written so AI models can follow it. Use any model you already work with (for example ChatGPT, Claude, Gemini, or DeepSeek).

  1. In the JSON drawer, click Structure to download questions-json-structure.md.
  2. Attach the file to the AI model and describe the form you need: audience, number of questions, question types, languages, and scoring.
  3. Copy the JSON array the model returns.
  4. Paste it into the JSON editor, replacing the content or adding to it, then click Apply and save.

The questions appear in the builder in order, in every language the model filled in.

Prompt to an AI model with the Gohorto structure file attached

AI model output: bilingual questions as a JSON array

Example prompt:

Create a pre-incubation test for startups participating in an entrepreneurship
competition. There will be a post-incubation test later to measure improvement
in knowledge. Arabic and English. Use the attached reference.

Tips for good results:

  • Ask for new questions without "id" so Gohorto creates them as new rows.
  • For a quiz, ask for radio and checkbox questions with points on the correct choices. Put case-study text in a section.
  • For a pre/post pair, ask for the same structure in both, so scores can be compared.
  • Read the questions before you publish. Apply validates the JSON structure, not the content the model wrote.

3. Add, update, delete, reorder

The editor shows a JSON array. Array order is the order of questions on the form.

Goal What to do
Update a question, choice, or matrix column Keep its "id"
Add a question, choice, or column Omit "id" so the platform creates a new row
Add a choice Omit that choice’s "id". Do not copy another choice’s id
Delete a question Remove its object from the array
Reorder Move objects in the array

The same questions on the visual canvas

4. Languages

title, help, and choice labels are objects keyed by language code:

"title": {
  "ar": "ما الخبرات الأساسية؟",
  "en": "What are the core skills?"
}

A choice needs at least one non-empty label. Empty strings are allowed for a language you are not using yet.

5. Quizzes and forms

Quizzes are auto-scored. The score is the sum of points on selected choices.

  • A quiz accepts only "radio" and "checkbox" in JSON
  • Paragraph, text, file, and matrix questions are rejected on apply
  • Reading text (a case study or instructions) belongs on a section: title is the heading, help is the subtitle

Forms (surveys, evaluations, polls) can use every type: radio, checkbox, textbox, textarea, file, matrix, and section.

6. Structure reference

Structure in the drawer header downloads questions-json-structure.md in Arabic or English, matching the admin language. It lists every field, validation rule, and example. Attach it to an AI model when generating questions.

The same English reference is published here: Question JSON schema.

7. Examples

Update an existing single-choice question and add a new option:

[
  {
    "id": "12",
    "type": "radio",
    "title": {
      "ar": "ما الخبرات الأساسية؟",
      "en": "What are the core skills?"
    },
    "help": {
      "ar": "",
      "en": ""
    },
    "required": true,
    "choices": [
      {
        "id": "40",
        "labels": { "ar": "خيار 1", "en": "Choice 1" },
        "points": 1
      },
      {
        "labels": { "ar": "خيار جديد", "en": "New choice" },
        "points": 0
      }
    ]
  }
]

Section used as quiz reading text:

{
  "type": "section",
  "title": {
    "ar": "دراسة حالة: مشروع سلة",
    "en": "Case study: Salla project"
  },
  "help": {
    "ar": "نص الدراسة يظهر هنا كعنوان فرعي.",
    "en": "The case-study narrative goes here as the subtitle."
  }
}

8. Troubleshooting

Apply and save stops and shows an error when:

Message Fix
The JSON could not be parsed Add the missing comma, quote, or bracket
The JSON must be an array of questions The root value must be [ ... ], not a single object
Question is missing a type Set "type" (radio, checkbox, textbox, textarea, file, matrix, or section)
Unknown type Use one of the names above. Numeric type ids are accepted, names are easier to share
Needs a title object with language keys title must be { "ar": "...", "en": "..." }, not a plain string
Needs a choices array with labels radio and checkbox need choices, each with labels
Quizzes only allow radio and checkbox Move reading text into a section, or change the form type if this is not a quiz

Fix the highlighted issue and apply again. Invalid JSON is not saved.

JSON does not change form settings (name, visibility, notifications). Use Actions → Form Settings for those.

Next Steps