Skip to content

Commit

Permalink
refactor: improve arrange script (#170)
Browse files Browse the repository at this point in the history
Re-writes the arranger script to polish off some inconsistencies with
the QBs:

- Removes all redundant values from the QB. All redundant values are
inferred at
"compile" time. Example, "questionBank" field from questions. 
- Removes all boilerplate files. If a given LO has no `annexes`, there
won't be
an `annex.json` and empty `annex` folder. These will be created if
needed.
- Add subjects as an LO. A subject now points to an LO as entry point.
  • Loading branch information
PupoSDC authored Feb 15, 2024
1 parent df24403 commit 6999855
Show file tree
Hide file tree
Showing 5,256 changed files with 40,396 additions and 188,625 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Empty file removed apps/next-app/public/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions libs/base/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export * from "./js/deep-clone";
export * from "./js/make-map";
export * from "./js/noop";
export * from "./random/random";
export * from "./js/keep-unique";
3 changes: 3 additions & 0 deletions libs/base/utils/src/js/keep-unique.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const keepUnique = <T>(arr: T[]): T[] => {
return [...new Set(arr)];
};

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
{
"id": "QDFBOVPN",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["ATPLGS-103761", "ATPLGS-118704"],
"annexes": [],
Expand Down Expand Up @@ -36,14 +35,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QHMWBCYB",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["ATPLGS-103763"],
"annexes": [],
Expand Down Expand Up @@ -78,14 +73,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QEGZNNKW",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["ATPLGS-103753"],
"annexes": [],
Expand Down Expand Up @@ -120,14 +111,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QYOGZJOT",
"questionBank": "atpl",
"relatedQuestions": ["QOMXIUVQ"],
"externalIds": ["AVEXAM-1644"],
"annexes": [],
Expand Down Expand Up @@ -162,14 +149,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QOMXIUVQ",
"questionBank": "atpl",
"relatedQuestions": ["QYOGZJOT"],
"externalIds": ["ATPLGS-103725", "BGS-100007"],
"annexes": [],
Expand Down Expand Up @@ -204,14 +187,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QAORDWHO",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["ATPLGS-103755"],
"annexes": [],
Expand Down Expand Up @@ -246,14 +225,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QZMRLCWT",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["ATPLGS-111546", "ATPLQ-108644", "BGS-100005"],
"annexes": [],
Expand Down Expand Up @@ -288,14 +263,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QKUYKZOX",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["ATPLGS-103754"],
"annexes": [],
Expand Down Expand Up @@ -330,14 +301,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QYZVIIIC",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["ATPLGS-103743"],
"annexes": [],
Expand Down Expand Up @@ -372,14 +339,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QTDRCKEN",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["AVEXAM-45311"],
"annexes": [],
Expand Down Expand Up @@ -414,14 +377,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QUBVEWSD",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["ATPLGS-118705"],
"annexes": [],
Expand Down Expand Up @@ -456,14 +415,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QUFCNRYT",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["ATPLGS-103708"],
"annexes": [],
Expand Down Expand Up @@ -498,14 +453,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QIJTZTYB",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["ATPLGS-103749", "ATPLQ-106886", "BGS-100560"],
"annexes": [],
Expand Down Expand Up @@ -540,14 +491,10 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
},
{
"id": "QJHEAKMK",
"questionBank": "atpl",
"relatedQuestions": [],
"externalIds": ["ATPLGS-118692", "ATPLQ-106915", "BGS-100013"],
"annexes": [],
Expand Down Expand Up @@ -582,9 +529,6 @@
"why": ""
}
]
},
"doc": "010.01.01.01",
"subjects": ["010"],
"srcLocation": "libs/content/question-bank-atpl/content/010/010.01/010.01.01/010.01.01.01/questions.json"
}
}
]

This file was deleted.

Empty file.
Loading

0 comments on commit 6999855

Please sign in to comment.