Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target folder persists to be incorrect #99

Open
1 task done
nicolasmol opened this issue Sep 15, 2022 · 1 comment
Open
1 task done

Target folder persists to be incorrect #99

nicolasmol opened this issue Sep 15, 2022 · 1 comment

Comments

@nicolasmol
Copy link

nicolasmol commented Sep 15, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Defining my target folder like this
image
However persists to generate into /lib/data
image

Expected Behavior

No response

Steps To Reproduce

No response

Version

No response

Relevant JSON syntax

{
  "__className": "biology",
  "Description": "Basic Biology Multiple Choice Questions (MCQ) to practice basic Biology quiz answers",
  "id": "ppr004",
  "image_url": "",
  "questions": [
    {
      "__className": "question",
      "answers": [
        {
          "__className": "answer",
          "Answer": "Symbiosis",
          "identifier": "A"
        },
        {
          "__className": "answer",
          "Answer": "Mutualism",
          "identifier": "B"
        },
        {
          "__className": "answer",
          "Answer": "Parasitism",
          "identifier": "C"
        },
        {
          "__className": "answer",
          "Answer": "Predation",
          "identifier": "D"
        }
      ],
      "correct_answer": "D",
      "id": "ppr004q001",
      "question": "A relationship in which one animal hunts, kills and eats another"
    }
  ],
  "time_seconds": 900,
  "title": "Biology"
}

Anything else?

No response

@nicolasmol nicolasmol changed the title Target folder seems to be incorrect Target folder persists to be incorrect Sep 15, 2022
@iamarnas
Copy link
Collaborator

@nicolasmol Hi 👋
First, I see your JSON is not valid for this generator. JSON body is an unnamed object and therefore we need to add a class name to avoid typing it manually. So for each JSON body, you just need to add a __className and __path on the top JSON body. The rest objects will be named depending on the keys.

Example:

{
  "__className": "biology", // <- classname and path only paste here at the top of the body.
  "Description": "Basic Biology Multiple Choice Questions (MCQ) to practice basic Biology quiz answers",
  "id": "ppr004",
  "image_url": "",
  "questions": [ // <- this key is a class name and you don't need to add it manually.
    {
      "__className": "question", // <- remove this, generator handle it automatically.
      "answers": [ // <- here is a class name for list members.
        {
          "__className": "answer",  // <- don't do that, that's why you Answer class is not implemented. The generator already knows that this object is Answer object due to the list keeper key name.
          "Answer": "Symbiosis",
          "identifier": "A"
        }
      ],
      "correct_answer": "D",
      "id": "ppr004q001",
      "question": "A relationship in which one animal hunts, kills and eats another"
    }
  ],
  "time_seconds": 900,
  "title": "Biology"
}

This is how your JSON should look:

{
  "__className": "biology",
  "Description": "Basic Biology Multiple Choice Questions (MCQ) to practice basic Biology quiz answers",
  "id": "ppr004",
  "image_url": "",
  "questions": [
    {
      "answers": [ 
        {
          "Answer": "Symbiosis",
          "identifier": "A"
        }
      ],
      "correct_answer": "D",
      "id": "ppr004q001",
      "question": "A relationship in which one animal hunts, kills and eats another"
    }
  ],
  "time_seconds": 900,
  "title": "Biology"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants