Open nicolasmol opened 2 years ago
@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.
{
"__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"
}
Is there an existing issue for this?
Current Behavior
Defining my target folder like this However persists to generate into /lib/data
Expected Behavior
No response
Steps To Reproduce
No response
Version
No response
Relevant JSON syntax
Anything else?
No response