Added created_at and score to training docs
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
from datetime import datetime
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
@@ -35,6 +36,7 @@ class TrainingContentService:
|
|||||||
weak_areas["weak_areas"].append(area.dict())
|
weak_areas["weak_areas"].append(area.dict())
|
||||||
|
|
||||||
training_doc = {
|
training_doc = {
|
||||||
|
'created_at': int(datetime.now().timestamp() * 1000),
|
||||||
**exam_map,
|
**exam_map,
|
||||||
**usefull_tips.dict(),
|
**usefull_tips.dict(),
|
||||||
**weak_areas
|
**weak_areas
|
||||||
@@ -182,6 +184,7 @@ class TrainingContentService:
|
|||||||
exercises[module][exam_id]["exercises"].extend(self._get_writing_prompts_and_answers(stat, exam))
|
exercises[module][exam_id]["exercises"].extend(self._get_writing_prompts_and_answers(stat, exam))
|
||||||
|
|
||||||
exam_map[exam_id]["score"] = round((exam_total_correct / exam_total_questions) * 100)
|
exam_map[exam_id]["score"] = round((exam_total_correct / exam_total_questions) * 100)
|
||||||
|
exam_map[exam_id]["module"] = module
|
||||||
return exercises, exam_map
|
return exercises, exam_map
|
||||||
|
|
||||||
def _get_writing_prompts_and_answers(self, stat, exam):
|
def _get_writing_prompts_and_answers(self, stat, exam):
|
||||||
|
|||||||
Reference in New Issue
Block a user