mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
data uploader, handling extra data part of questions
This commit is contained in:
parent
127575afd5
commit
bb23853043
3 changed files with 417 additions and 13 deletions
|
@ -55,7 +55,7 @@ function ProcessIncomingRequest (data) {
|
|||
var d = JSON.parse(data)
|
||||
var allQuestions = []
|
||||
for (let i = 0; i < d.allData.length; i++) {
|
||||
allQuestions.push(new classes.Question(d.allData[i].Q, d.allData[i].A, d.allData[i].I))
|
||||
allQuestions.push(new classes.Question(d.allData[i].Q, d.allData[i].A, d.allData[i].data))
|
||||
}
|
||||
|
||||
let color = logger.GetColor('green')
|
||||
|
@ -69,7 +69,7 @@ function ProcessIncomingRequest (data) {
|
|||
if (d.data.length > 0) {
|
||||
let qdb = LoadJSON(utils.ReadFile(dataFile))
|
||||
d.data.forEach((x) => {
|
||||
let q = new classes.Question(x.Q, x.A, x.I)
|
||||
let q = new classes.Question(x.Q, x.A, x.data)
|
||||
questions.push(q)
|
||||
qdb.AddQuestion(d.subj, q)
|
||||
})
|
||||
|
@ -116,7 +116,7 @@ function LoadJSON (resource) {
|
|||
var j = 0
|
||||
for (j = 0; j < d.Subjects[i].Questions.length; j++) {
|
||||
var currQ = d.Subjects[i].Questions[j]
|
||||
s.AddQuestion(new classes.Question(currQ.Q, currQ.A, currQ.I))
|
||||
s.AddQuestion(new classes.Question(currQ.Q, currQ.A, currQ.data))
|
||||
}
|
||||
rt.push({
|
||||
name: d.Subjects[i].Name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue