diff --git a/vds-app/App/components/ExamQuestions.js b/vds-app/App/components/ExamQuestions.js new file mode 100644 index 0000000..2f2ab63 --- /dev/null +++ b/vds-app/App/components/ExamQuestions.js @@ -0,0 +1,43 @@ +import testQuestions from "../data/test" +import aerodynamicsQuestions from "../data/aerodynamics" +import firstAidQuestions from "../data/firstAid" +import flightSafetyQuestions from "../data/flightSafety" +import instrumentsQuestions from "../data/instruments" +import legislationQuestions from "../data/legislation" +import materialsQuestions from "../data/materials" +import meteorologyQuestions from "../data/meteorology" +import physiopathologyQuestions from "../data/physiopathology" +import pilotingTechniquesQuestions from "../data/pilotingTechniques" + +import { examScheme } from "../components/Variables" + +let tmpQuestions = [] + +const allQuestions = { + aerodynamics: aerodynamicsQuestions, + firstAid: firstAidQuestions, + flightSafety: flightSafetyQuestions, + instruments: instrumentsQuestions, + legislation: legislationQuestions, + materials: materialsQuestions, + meteorology: meteorologyQuestions, + physiopathology: physiopathologyQuestions, + pilotingTechniques: pilotingTechniquesQuestions +} + +const generateQuestions = () => { + + examScheme.forEach( (elem) => { + let currentSection = allQuestions[elem.section] + for(let i=0; i index != currentIndex) + } + }) +} + +generateQuestions() + +export const examQuestions = tmpQuestions diff --git a/vds-app/App/screens/QuizIndex.js b/vds-app/App/screens/QuizIndex.js index 719371c..131d7f8 100644 --- a/vds-app/App/screens/QuizIndex.js +++ b/vds-app/App/screens/QuizIndex.js @@ -13,34 +13,8 @@ import physiopathologyQuestions from "../data/physiopathology" import pilotingTechniquesQuestions from "../data/pilotingTechniques" import { RowItem } from "../components/RowItem" -import { colors, texts, examScheme } from "../components/Variables" - -let examQuestions = [] -const allQuestions = { - aerodynamics: aerodynamicsQuestions, - firstAid: firstAidQuestions, - flightSafety: flightSafetyQuestions, - instruments: instrumentsQuestions, - legislation: legislationQuestions, - materials: materialsQuestions, - meteorology: meteorologyQuestions, - physiopathology: physiopathologyQuestions, - pilotingTechniques: pilotingTechniquesQuestions -} - -const composeExamQuestions = () => { - examScheme.forEach( (elem) => { - let currentSection = allQuestions[elem.section] - for(let i=0; i index != currentIndex) - } - }) -} - -composeExamQuestions() +import { colors, texts} from "../components/Variables" +import { examQuestions } from "../components/ExamQuestions" export default ({ navigation }) => (