@vue-skuilder/db 0.1.33 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.js +26 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +26 -6
- package/dist/core/index.mjs.map +1 -1
- package/dist/impl/couch/index.js +26 -6
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +26 -6
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.js +26 -6
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +26 -6
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +62 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/navigators/generators/srs.ts +23 -1
- package/src/impl/common/BaseUserDB.ts +9 -6
- package/src/study/SessionController.ts +50 -20
- package/src/study/services/ResponseProcessor.ts +5 -1
|
@@ -2188,7 +2188,26 @@ var init_srs = __esm({
|
|
|
2188
2188
|
const courseId = this.course.getCourseID();
|
|
2189
2189
|
const reviews = await this.user.getPendingReviews(courseId);
|
|
2190
2190
|
const now = moment3.utc();
|
|
2191
|
-
|
|
2191
|
+
let dueReviews = reviews.filter((r) => now.isAfter(moment3.utc(r.reviewTime)));
|
|
2192
|
+
if (dueReviews.length > 0) {
|
|
2193
|
+
const dueCardIds = [...new Set(dueReviews.map((r) => r.cardId))];
|
|
2194
|
+
const tagsByCard = await this.course.getAppliedTagsBatch(dueCardIds);
|
|
2195
|
+
const skippedReviewIds = [];
|
|
2196
|
+
dueReviews = dueReviews.filter((r) => {
|
|
2197
|
+
const tags = tagsByCard.get(r.cardId) ?? [];
|
|
2198
|
+
if (tags.includes("srs:skip")) {
|
|
2199
|
+
skippedReviewIds.push(r._id);
|
|
2200
|
+
return false;
|
|
2201
|
+
}
|
|
2202
|
+
return true;
|
|
2203
|
+
});
|
|
2204
|
+
if (skippedReviewIds.length > 0) {
|
|
2205
|
+
logger.info(`[SRS] Removing ${skippedReviewIds.length} scheduled reviews for srs:skip cards`);
|
|
2206
|
+
for (const id of skippedReviewIds) {
|
|
2207
|
+
void this.user.removeScheduledCardReview(id);
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2192
2211
|
const backlogPressure = this.computeBacklogPressure(dueReviews.length);
|
|
2193
2212
|
if (dueReviews.length > 0) {
|
|
2194
2213
|
const pressureNote = backlogPressure > 0 ? ` [backlog pressure: +${backlogPressure.toFixed(2)}]` : ` [healthy backlog]`;
|
|
@@ -5592,17 +5611,18 @@ Currently logged-in as ${this._username}.`
|
|
|
5592
5611
|
* @param course_id optional specification of individual course
|
|
5593
5612
|
*/
|
|
5594
5613
|
async getSeenCards(course_id) {
|
|
5595
|
-
|
|
5614
|
+
const basePrefix = DocTypePrefixes["CARDRECORD" /* CARDRECORD */];
|
|
5615
|
+
let filterPrefix = basePrefix;
|
|
5596
5616
|
if (course_id) {
|
|
5597
|
-
|
|
5617
|
+
filterPrefix += `-${course_id}-`;
|
|
5598
5618
|
}
|
|
5599
|
-
const docs = await filterAllDocsByPrefix(this.localDB,
|
|
5619
|
+
const docs = await filterAllDocsByPrefix(this.localDB, filterPrefix, {
|
|
5600
5620
|
include_docs: false
|
|
5601
5621
|
});
|
|
5602
5622
|
const ret = [];
|
|
5603
5623
|
docs.rows.forEach((row) => {
|
|
5604
|
-
if (row.id.startsWith(
|
|
5605
|
-
ret.push(row.id.substr(
|
|
5624
|
+
if (row.id.startsWith(filterPrefix)) {
|
|
5625
|
+
ret.push(row.id.substr(filterPrefix.length));
|
|
5606
5626
|
}
|
|
5607
5627
|
});
|
|
5608
5628
|
return ret;
|