.
This commit is contained in:
+6
-3
@@ -63,7 +63,7 @@ db.version(1).stores({
|
|||||||
flags: "[aid+cid+eid+qid+qidn], [aid+cid+eid], qid",
|
flags: "[aid+cid+eid+qid+qidn], [aid+cid+eid], qid",
|
||||||
user_answers: "[qid+type+ans], [qid+type]",
|
user_answers: "[qid+type+ans], [qid+type]",
|
||||||
session:
|
session:
|
||||||
"[packet+aid], packet, aid, status, date, score, max_score, exam_time, time_left, question_order, questions_answered, total_questions",
|
"[eid+aid], eid, packet, aid, status, date, score, max_score, exam_time, time_left, question_order, questions_answered, total_questions",
|
||||||
});
|
});
|
||||||
|
|
||||||
const question_db = new Dexie("question_database");
|
const question_db = new Dexie("question_database");
|
||||||
@@ -524,6 +524,8 @@ function setUpPacket(data, path) {
|
|||||||
|
|
||||||
if (data.hasOwnProperty("eid")) {
|
if (data.hasOwnProperty("eid")) {
|
||||||
exam_details.eid = data.eid;
|
exam_details.eid = data.eid;
|
||||||
|
} else {
|
||||||
|
exam_details.eid = packet_name
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.hasOwnProperty("exam_type")) {
|
if (data.hasOwnProperty("exam_type")) {
|
||||||
@@ -686,8 +688,8 @@ function loadSession() {
|
|||||||
db.session
|
db.session
|
||||||
// .where("status")
|
// .where("status")
|
||||||
// .equals("active")
|
// .equals("active")
|
||||||
.where("[packet+aid]")
|
.where("[eid+aid]")
|
||||||
.between([packet_name, Dexie.minKey], [packet_name, Dexie.maxKey])
|
.between([exam_details.eid, Dexie.minKey], [exam_details.eid, Dexie.maxKey])
|
||||||
.toArray()
|
.toArray()
|
||||||
.then((sessions) => {
|
.then((sessions) => {
|
||||||
//console.log("sessions", sessions);
|
//console.log("sessions", sessions);
|
||||||
@@ -2467,6 +2469,7 @@ function saveSession(start_review) {
|
|||||||
time_values.seconds;
|
time_values.seconds;
|
||||||
db.session.put({
|
db.session.put({
|
||||||
packet: packet_name,
|
packet: packet_name,
|
||||||
|
eid: exam_details.eid,
|
||||||
aid: exam_details.aid,
|
aid: exam_details.aid,
|
||||||
cid: exam_details.cid,
|
cid: exam_details.cid,
|
||||||
status: status,
|
status: status,
|
||||||
|
|||||||
Reference in New Issue
Block a user