Browse Source

fix exam questions extraction

master
Dslak 6 years ago
parent
commit
df80bdfdc1
  1. 1
      vds-app/.expo-shared/assets.json
  2. 5
      vds-app/App/components/ExamQuestions.js

1
vds-app/.expo-shared/assets.json

@ -1 +0,0 @@
{}

5
vds-app/App/components/ExamQuestions.js

@ -29,10 +29,9 @@ const generateQuestions = () => {
examScheme.forEach( (elem) => { examScheme.forEach( (elem) => {
let currentSection = allQuestions[elem.section] let currentSection = allQuestions[elem.section]
for(let i=0; i<elem.questions; i++) { for(let i=0; i<elem.questions; i++) {
const currentIndex = Math.floor(Math.random() * elem.questions)
//currentSection[currentIndex].question = elem.section + currentSection[currentIndex].question
tmpQuestions.push(currentSection[currentIndex])
const currentIndex = Math.floor(Math.random() * currentSection.length)
currentSection = currentSection.filter( (item, index) => index != currentIndex) currentSection = currentSection.filter( (item, index) => index != currentIndex)
tmpQuestions.push(currentSection[currentIndex])
} }
}) })
} }

Loading…
Cancel
Save