From d4c4c257b49fce8ca9d5c809b23f305c8f69cdcd Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 6 Feb 2013 09:39:59 -0500 Subject: [PATCH] answerdb: Timestamp answers This may provide insight into the learning process (e.g. after I reviewed the Git index, everyone started doing better). --- quizzer/answerdb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quizzer/answerdb.py b/quizzer/answerdb.py index 81af17c..c8c802f 100644 --- a/quizzer/answerdb.py +++ b/quizzer/answerdb.py @@ -15,6 +15,7 @@ # quizzer. If not, see . import codecs as _codecs +import datetime as _datetime import json as _json from . import __version__ @@ -55,9 +56,12 @@ class AnswerDatabase (dict): def add(self, question, answer, correct): if question.id not in self: self[question.id] = [] + timezone = _datetime.timezone.utc + timestamp = _datetime.datetime.now(tz=timezone).isoformat() self[question.id].append({ 'answer': answer, 'correct': correct, + 'timestamp': timestamp, }) def get_answered(self, questions): -- 2.26.2