Commit c9a9bb46 authored by randi480's avatar randi480

Add mental chronometry dashboard score route

parent b5c9d309
......@@ -432,6 +432,8 @@ def predictArithmetic():
return jsonify({'error: Error during pipeline execution'})
return jsonify({'result: test'})
# Mental Chronometry data management
@app.route('/mentalChromScores', methods=['POST'])
@cross_origin()
......@@ -446,7 +448,7 @@ def mentalChromScores():
totalTime = body['totalTime']
candidateID = body['candidateID']
answerImage = body['answerImage']
# db.users.insert_one({
db.db['mentalChronomrtryScore'].insert_one({
"activityName": activityName,
"score": score,
......@@ -461,6 +463,38 @@ def mentalChromScores():
'status': 'MentalCrom scores are added to the system successfully!',
})
@app.route('/mentalChronometryScores/', methods=['GET'])
@cross_origin()
def getMentalChromScores():
allData = db.db['mentalChronomrtryScore'].find()
dataJson = []
for data in allData:
id = data['_id']
activityName = data['activityName']
score = data['score']
actualResult = data['actualResult']
predResult = data['predResult']
createdTime = data['createdTime']
totalTime = data['totalTime']
candidateID = data['candidateID']
answerImage = data['answerImage']
dataDict = {
'id': str(id),
'activityName': activityName,
'score': score,
'actualResult': actualResult,
'predResult': predResult,
'createdTime': createdTime,
'totalTime': totalTime,
'candidateID': candidateID,
'answerImage': answerImage
}
dataJson.append(dataDict)
return jsonify(dataJson)
# Knowledge IQ evaluation
@app.route('/predictKnowledgeIq', methods=['POST', 'GET'])
@cross_origin()
......
......@@ -190,7 +190,7 @@ const PairCancerlationContainer = () => {
{" "}
<div>
{" "}
<img src={Pair[activityIndex]} alt="description" />{" "}
<img src={Pair[activityIndex]}/>{" "}
</div>
</div>
<div className="grid grid-cols-1 h-fit m-10">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment