diff --git a/src/utils/actions.js b/src/utils/actions.js index 2836a9c..796c4c2 100755 --- a/src/utils/actions.js +++ b/src/utils/actions.js @@ -32,6 +32,7 @@ const utils = require('../utils/utils.js') const { addQuestion, getSubjNameWithoutYear } = require('./classes.js') // if a recievend question doesnt match at least this % to any other question in the db it gets // added to db +const minMatchToAmmountToAdd = 90 const writeAfter = 1 // write after # of adds FIXME: set reasonable save rate var currWrites = 0 @@ -96,7 +97,10 @@ function ProcessIncomingRequest(recievedData, qdb, infos, dryRun, user) { .then((results) => { const allQuestions = [] // all new questions here that do not have result results.forEach((result, i) => { - if (result.length === 0) { + let add = result.every((res) => { + return res.match < minMatchToAmmountToAdd + }) + if (add) { allQuestions.push(recievedQuestions[i]) } }) diff --git a/submodules/qmining-page b/submodules/qmining-page index e21f281..9aa0c11 160000 --- a/submodules/qmining-page +++ b/submodules/qmining-page @@ -1 +1 @@ -Subproject commit e21f281dc5301020de8c7f9dfe654281e36e9e5d +Subproject commit 9aa0c111ce056d5309a8fc095ccb3745bc03f77f