Skip to content

Commit

Permalink
feat: improve question search (#74)
Browse files Browse the repository at this point in the history
- Allows filtering by subject and los. 
- Improves search algorithm. 
- Defaults to list view of all questions.
- Implements UI similar to LO search which is prettier.
- merges 737 and a320 banks into type bank

closes #68
  • Loading branch information
PupoSDC authored Jan 18, 2024
1 parent f047ec7 commit bb08d09
Show file tree
Hide file tree
Showing 76 changed files with 1,719 additions and 1,679 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ can and will be introduced in patch releases.
| base-errors | Errors that can be handled in the front or in the backend |
| base-types | Base Business types used across the app |
| content-question-bank-prep | Content bank for the interview prep module |
| content-question-bank-b737 | Content bank for the 737 TR module |
| content-question-bank-a320 | Content bank for the A320 TR module |
| content-question-bank-type | Content bank for the Type Rating module |
| content-question-bank-atpl | Content bank for the ATPL theory module |
| core-analytics | Analytics provider (currently a custom solution) |
| core-app | Business logic blocks sharable between React SPA/SSR and RN |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@ With over 300 thoughtfully curated questions, this question bank is designed to
challenge and enhance your understanding of the 737's systems, procedures, and
aircraft limitations.

You can create a [new test here](/modules/b737/tests/create).
You can create a [new test here](/modules/type/tests/create).

export const InLocoTestMakeer = () => {
const router = useRouter();
const fallback = <Skeleton sx={{ height: 400, position: "initial" }} />

return (

<Sheet sx={{ p: 1, my: 2, height: 600 }}>
<NoSsr fallback={fallback}>
<Suspense fallback={fallback}>
<TestMaker
sx={{ height: "100%" }}
questionBank={"737"}
onSuccessfulTestCreation={(test) => {
router.push(`/modules/b737/tests/${test.id}/${test.mode}`);
}}
/>
</Suspense>
</NoSsr>
</Sheet>
); }
return (
<Sheet sx={{ p: 1, my: 2, height: 600 }}>
<NoSsr fallback={fallback}>
<Suspense fallback={fallback}>
<TestMaker
sx={{ height: "100%" }}
questionBank={"737"}
onSuccessfulTestCreation={(test) => {
router.push(`/modules/type/tests/${test.id}/${test.mode}`);
}}
/>
</Suspense>
</NoSsr>
</Sheet>
);
}

<InLocoTestMakeer />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ available for free to all our users.

<br />

You can get started here: [A320 Question Bank](/modules/a320)
You can get started here: [A320 Question Bank](/modules/type)

<br />

Expand Down
2 changes: 1 addition & 1 deletion apps/next-app/pages/modules/[questionBank]/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const getStaticProps = staticHandler<PageProps, PageParams>(
);

export const getStaticPaths: GetStaticPaths<PageParams> = async () => {
const banks: QuestionBankName[] = ["b737", "a320", "atpl", "prep"];
const banks: QuestionBankName[] = ["type", "atpl", "prep"];
const paths = banks.map((questionBank) => ({ params: { questionBank } }));
return { fallback: false, paths };
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const Page: NextPage<PageProps> = ({ questionBank }) => {
] as Breadcrumbs;

return (
<LayoutModule questionBank={questionBank} breadcrumbs={crumbs}>
<LayoutModule fixedHeight questionBank={questionBank} breadcrumbs={crumbs}>
<AppHead />
<QuestionSearch component="section" questionBank={questionBank} />
<QuestionSearch questionBank={questionBank} />
</LayoutModule>
);
};
Expand All @@ -38,7 +38,7 @@ export const getStaticProps = staticHandler<PageProps, PageParams>(
);

export const getStaticPaths: GetStaticPaths<PageParams> = async () => {
const banks: QuestionBankName[] = ["b737", "a320", "atpl"];
const banks: QuestionBankName[] = ["type", "atpl"];
const paths = banks.map((questionBank) => ({ params: { questionBank } }));
return { fallback: false, paths };
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const getStaticProps = staticHandler<PageProps, PageParams>(
);

export const getStaticPaths: GetStaticPaths<PageParams> = async () => {
const banks: QuestionBankName[] = ["b737", "a320", "atpl", "prep"];
const banks: QuestionBankName[] = ["type", "atpl", "prep"];
const paths = banks.map((questionBank) => ({ params: { questionBank } }));
return { fallback: false, paths };
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const getStaticProps = staticHandler<PageProps, PageParams>(
);

export const getStaticPaths: GetStaticPaths<PageParams> = async () => {
const banks: QuestionBankName[] = ["b737", "a320", "atpl"];
const banks: QuestionBankName[] = ["type", "atpl"];
const paths = banks.map((questionBank) => ({ params: { questionBank } }));
return { fallback: false, paths };
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const getStaticProps = staticHandler<PageProps, PageParams>(
);

export const getStaticPaths: GetStaticPaths<PageParams> = async () => {
const banks: QuestionBankName[] = ["b737", "a320", "atpl", "prep"];
const banks: QuestionBankName[] = ["type", "atpl", "prep"];
const paths = banks.map((questionBank) => ({ params: { questionBank } }));
return { fallback: false, paths };
};
Expand Down
2 changes: 1 addition & 1 deletion libs/base/types/src/lib/question-bank.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type QuestionBankName = "b737" | "atpl" | "a320" | "prep";
export type QuestionBankName = "type" | "atpl" | "prep";
2 changes: 1 addition & 1 deletion libs/content/question-bank-atpl/media/media.json
Original file line number Diff line number Diff line change
Expand Up @@ -2700,7 +2700,7 @@
"description": ""
},
{
"id": "737064a8c0d90e759d704784ae89d742",
"id": "B737064a8c0d90e759d704784ae89d742",
"description": ""
},
{
Expand Down
4 changes: 2 additions & 2 deletions libs/content/question-bank-atpl/questions/010/010.01.json
Original file line number Diff line number Diff line change
Expand Up @@ -7796,12 +7796,12 @@
{
"id": "Q67P1OPODY",
"explanation": "",
"learningObjectives": ["010.01.04.01.01"],
"learningObjectives": ["010.06.09.03.01"],
"variants": {
"pQ3hr7YN": {
"id": "pQ3hr7YN",
"type": "simple",
"question": "EASA AIR OPS Annex V refers to:\nECQB 2020 Example Question - Learning Objective 010.06.09.03.01",
"question": "EASA AIR OPS Annex V refers to:",
"options": [
{
"id": "AC87E7UDQI",
Expand Down
99 changes: 0 additions & 99 deletions libs/content/question-bank-atpl/subjects/subjects.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,104 +89,5 @@
"shortName": "Coms",
"numberOfExamQuestions": 34,
"numberOfExamMinutes": 45
},
{
"id": "737",
"longName": "Type Rating review questions",
"shortName": "Type Rating review questions",
"numberOfExamQuestions": 40,
"numberOfExamMinutes": 40,
"children": [
{
"id": "737.01",
"text": "Aircraft General",
"numberOfQuestions": 27,
"numberOfLearningObjectives": 1
},
{
"id": "737.02",
"text": "Air Systems",
"numberOfQuestions": 19,
"numberOfLearningObjectives": 1
},
{
"id": "737.03",
"text": "Ice and Rain Protection",
"numberOfQuestions": 7,
"numberOfLearningObjectives": 1
},
{
"id": "737.04",
"text": "Automatic Flight",
"numberOfQuestions": 31,
"numberOfLearningObjectives": 1
},
{
"id": "737.05",
"text": "Communications",
"numberOfQuestions": 9,
"numberOfLearningObjectives": 1
},
{
"id": "737.06",
"text": "Electrical",
"numberOfQuestions": 36,
"numberOfLearningObjectives": 1
},
{
"id": "737.07",
"text": "Engines, APU",
"numberOfQuestions": 41,
"numberOfLearningObjectives": 1
},
{
"id": "737.08",
"text": "Fire Protection",
"numberOfQuestions": 12,
"numberOfLearningObjectives": 1
},
{
"id": "737.09",
"text": "Flight Controls",
"numberOfQuestions": 13,
"numberOfLearningObjectives": 1
},
{
"id": "737.10",
"text": "Flight Instruments",
"numberOfQuestions": 8,
"numberOfLearningObjectives": 1
},
{
"id": "737.11",
"text": "Flight Management & Navigation Systems",
"numberOfQuestions": 30,
"numberOfLearningObjectives": 1
},
{
"id": "737.12",
"text": "Fuel",
"numberOfQuestions": 25,
"numberOfLearningObjectives": 1
},
{
"id": "737.13",
"text": "Hydraulics",
"numberOfQuestions": 21,
"numberOfLearningObjectives": 1
},
{
"id": "737.14",
"text": "Landing Gear",
"numberOfQuestions": 10,
"numberOfLearningObjectives": 1
},
{
"id": "737.15",
"text": "Warning Systems",
"numberOfQuestions": 36,
"numberOfLearningObjectives": 1
}
]
}
]
Empty file.
1 change: 0 additions & 1 deletion libs/content/question-bank-b737/media/media.json

This file was deleted.

11 changes: 0 additions & 11 deletions libs/content/question-bank-b737/project.json

This file was deleted.

71 changes: 0 additions & 71 deletions libs/content/question-bank-b737/subjects/subjects.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "content-question-bank-a320",
"name": "content-question-bank-type",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"targets": {
Expand Down
Loading

1 comment on commit bb08d09

@vercel
Copy link

@vercel vercel bot commented on bb08d09 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.