Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
329b502159
14 changed files with 115 additions and 32 deletions
|
@ -1,4 +1,9 @@
|
||||||
{
|
{
|
||||||
|
"reviewMode": "Review mode",
|
||||||
|
"reviewModeTip": "Select the order in which new and old cards appear during review",
|
||||||
|
"reviewMode0": "New and old mix",
|
||||||
|
"reviewMode1": "New first",
|
||||||
|
"reviewMode2": "Old first",
|
||||||
"fileAnnoRefPlaceholder": "Please enter block ID",
|
"fileAnnoRefPlaceholder": "Please enter block ID",
|
||||||
"addToDatabase": "Add to Database",
|
"addToDatabase": "Add to Database",
|
||||||
"clearContext": "Clear context",
|
"clearContext": "Clear context",
|
||||||
|
@ -214,7 +219,7 @@
|
||||||
"confirmUninstall": "Are you sure you want to uninstall ${name}?",
|
"confirmUninstall": "Are you sure you want to uninstall ${name}?",
|
||||||
"scrollGetMore": "Don't panic... scroll up and down to load more",
|
"scrollGetMore": "Don't panic... scroll up and down to load more",
|
||||||
"flashcardNewCard": "New",
|
"flashcardNewCard": "New",
|
||||||
"flashcardReviewCard": "Review",
|
"flashcardReviewCard": "Old",
|
||||||
"flashcardDueCard": "Due",
|
"flashcardDueCard": "Due",
|
||||||
"flashcardCard": "Total",
|
"flashcardCard": "Total",
|
||||||
"plugin": "Plugin",
|
"plugin": "Plugin",
|
||||||
|
@ -243,8 +248,8 @@
|
||||||
"nextDue": "Next Due",
|
"nextDue": "Next Due",
|
||||||
"flashcardNewCardLimit": "New Card Limit",
|
"flashcardNewCardLimit": "New Card Limit",
|
||||||
"flashcardNewCardLimitTip": "If there are many new cards, you can set the number of new cards to review through this item",
|
"flashcardNewCardLimitTip": "If there are many new cards, you can set the number of new cards to review through this item",
|
||||||
"flashcardReviewCardLimit": "Review Card Limit",
|
"flashcardReviewCardLimit": "Old Card Limit",
|
||||||
"flashcardReviewCardLimitTip": "If there are many review cards, you can set the number of review through this item",
|
"flashcardReviewCardLimitTip": "If there are many old cards, you can set the number of old cards to review through this item",
|
||||||
"flashcardMark": "Mark Carding",
|
"flashcardMark": "Mark Carding",
|
||||||
"flashcardMarkTip": "After enabling, the mark is recognized as fill in the blank",
|
"flashcardMarkTip": "After enabling, the mark is recognized as fill in the blank",
|
||||||
"flashcardList": "List Carding",
|
"flashcardList": "List Carding",
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{
|
{
|
||||||
|
"reviewMode": "Modo de revisión",
|
||||||
|
"reviewModeTip": "Seleccione el orden en que aparecen las tarjetas nuevas y antiguas durante la revisión",
|
||||||
|
"reviewMode0": "Nuevo y viejo mezclado",
|
||||||
|
"reviewMode1": "Nuevo primero",
|
||||||
|
"reviewMode2": "Viejo primero",
|
||||||
"fileAnnoRefPlaceholder": "Ingrese el ID del bloque",
|
"fileAnnoRefPlaceholder": "Ingrese el ID del bloque",
|
||||||
"addToDatabase": "Agregar a la base de datos",
|
"addToDatabase": "Agregar a la base de datos",
|
||||||
"clearContext": "Borrar contexto",
|
"clearContext": "Borrar contexto",
|
||||||
|
@ -214,7 +219,7 @@
|
||||||
"confirmUninstall": "¿Está seguro de que desea desinstalar ${name}?",
|
"confirmUninstall": "¿Está seguro de que desea desinstalar ${name}?",
|
||||||
"scrollGetMore": "No se asuste... desplácese hacia arriba y hacia abajo para cargar más",
|
"scrollGetMore": "No se asuste... desplácese hacia arriba y hacia abajo para cargar más",
|
||||||
"flashcardNewCard": "Nueva Tarjeta",
|
"flashcardNewCard": "Nueva Tarjeta",
|
||||||
"flashcardReviewCard": "Revisar Tarjeta",
|
"flashcardReviewCard": "Vieja Tarjeta",
|
||||||
"flashcardDueCard": "Tarjeta debida",
|
"flashcardDueCard": "Tarjeta debida",
|
||||||
"flashcardCard": "Todos",
|
"flashcardCard": "Todos",
|
||||||
"plugin": "Complemento",
|
"plugin": "Complemento",
|
||||||
|
@ -243,8 +248,8 @@
|
||||||
"nextDue": "Revisa la próxima vez",
|
"nextDue": "Revisa la próxima vez",
|
||||||
"flashcardNewCardLimit": "Límite de tarjeta nueva",
|
"flashcardNewCardLimit": "Límite de tarjeta nueva",
|
||||||
"flashcardNewCardLimitTip": "Si hay muchas tarjetas nuevas, puede establecer la cantidad de tarjetas nuevas para revisar a través de este elemento",
|
"flashcardNewCardLimitTip": "Si hay muchas tarjetas nuevas, puede establecer la cantidad de tarjetas nuevas para revisar a través de este elemento",
|
||||||
"flashcardReviewCardLimit": "Revisar límite de tarjeta",
|
"flashcardReviewCardLimit": "Límite de tarjeta antigua",
|
||||||
"flashcardReviewCardLimitTip": "Si hay muchas tarjetas de revisión, puede establecer el número de revisión a través de este elemento",
|
"flashcardReviewCardLimitTip": "Si hay muchas tarjetas antiguas, puede configurar la cantidad de tarjetas antiguas para revisar a través de este elemento",
|
||||||
"flashcardMark": "Marcar cardado",
|
"flashcardMark": "Marcar cardado",
|
||||||
"flashcardMarkTip": "Después de habilitar, la marca se reconoce como un espacio en blanco",
|
"flashcardMarkTip": "Después de habilitar, la marca se reconoce como un espacio en blanco",
|
||||||
"flashcardList": "Lista de tarjetas",
|
"flashcardList": "Lista de tarjetas",
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{
|
{
|
||||||
|
"reviewMode": "Mode de révision",
|
||||||
|
"reviewModeTip": "Sélectionnez l'ordre dans lequel les nouvelles et anciennes cartes apparaissent lors de la révision",
|
||||||
|
"reviewMode0": "Nouveau et ancien mélange",
|
||||||
|
"reviewMode1": "Nouveau d'abord",
|
||||||
|
"reviewMode2": "Ancien d'abord",
|
||||||
"fileAnnoRefPlaceholder": "Veuillez saisir l'ID de bloc",
|
"fileAnnoRefPlaceholder": "Veuillez saisir l'ID de bloc",
|
||||||
"addToDatabase": "Ajouter à la base de données",
|
"addToDatabase": "Ajouter à la base de données",
|
||||||
"clearContext": "Effacer le contexte",
|
"clearContext": "Effacer le contexte",
|
||||||
|
@ -214,7 +219,7 @@
|
||||||
"confirmUninstall": "Êtes-vous sûr de vouloir désinstaller ${name} ?",
|
"confirmUninstall": "Êtes-vous sûr de vouloir désinstaller ${name} ?",
|
||||||
"scrollGetMore": "Ne paniquez pas... faites défiler de haut en bas pour en charger plus",
|
"scrollGetMore": "Ne paniquez pas... faites défiler de haut en bas pour en charger plus",
|
||||||
"flashcardNewCard": "Nouvelle carte",
|
"flashcardNewCard": "Nouvelle carte",
|
||||||
"flashcardReviewCard": "Revoir la carte",
|
"flashcardReviewCard": "Ancienne carte",
|
||||||
"flashcardDueCard": "Carte due",
|
"flashcardDueCard": "Carte due",
|
||||||
"flashcardCard": "Tous",
|
"flashcardCard": "Tous",
|
||||||
"plugin": "Plugin",
|
"plugin": "Plugin",
|
||||||
|
@ -243,8 +248,8 @@
|
||||||
"nextDue": "Revoir la prochaine fois",
|
"nextDue": "Revoir la prochaine fois",
|
||||||
"flashcardNewCardLimit": "Nouvelle limite de carte",
|
"flashcardNewCardLimit": "Nouvelle limite de carte",
|
||||||
"flashcardNewCardLimitTip": "S'il y a beaucoup de nouvelles cartes, vous pouvez définir le nombre de nouvelles cartes à examiner via cet élément",
|
"flashcardNewCardLimitTip": "S'il y a beaucoup de nouvelles cartes, vous pouvez définir le nombre de nouvelles cartes à examiner via cet élément",
|
||||||
"flashcardReviewCardLimit": "Revoir la limite de la carte",
|
"flashcardReviewCardLimit": "Ancienne limite de carte",
|
||||||
"flashcardReviewCardLimitTip": "S'il y a plusieurs cartes d'avis, vous pouvez définir le nombre d'avis via cet élément",
|
"flashcardReviewCardLimitTip": "S'il y a beaucoup d'anciennes cartes, vous pouvez définir le nombre d'anciennes cartes à examiner via cet élément",
|
||||||
"flashcardMark": "Carte de marque",
|
"flashcardMark": "Carte de marque",
|
||||||
"flashcardMarkTip": "Après l'activation, la marque est reconnue comme remplissant le blanc",
|
"flashcardMarkTip": "Après l'activation, la marque est reconnue comme remplissant le blanc",
|
||||||
"flashcardList": "Fiche de liste",
|
"flashcardList": "Fiche de liste",
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{
|
{
|
||||||
|
"reviewMode": "複習模式",
|
||||||
|
"reviewModeTip": "選擇複習時新卡和舊卡出現的順序",
|
||||||
|
"reviewMode0": "新舊混合",
|
||||||
|
"reviewMode1": "新卡優先",
|
||||||
|
"reviewMode2": "舊卡優先",
|
||||||
"fileAnnoRefPlaceholder": "請輸入區塊 ID",
|
"fileAnnoRefPlaceholder": "請輸入區塊 ID",
|
||||||
"addToDatabase": "新增至資料庫",
|
"addToDatabase": "新增至資料庫",
|
||||||
"clearContext": "清空上下文",
|
"clearContext": "清空上下文",
|
||||||
|
@ -214,7 +219,7 @@
|
||||||
"confirmUninstall": "確定卸載 ${name} ?",
|
"confirmUninstall": "確定卸載 ${name} ?",
|
||||||
"scrollGetMore": "不要驚慌...上下滾動即可加載更多內容",
|
"scrollGetMore": "不要驚慌...上下滾動即可加載更多內容",
|
||||||
"flashcardNewCard": "新卡",
|
"flashcardNewCard": "新卡",
|
||||||
"flashcardReviewCard": "複習卡",
|
"flashcardReviewCard": "舊卡",
|
||||||
"flashcardDueCard": "到期卡",
|
"flashcardDueCard": "到期卡",
|
||||||
"flashcardCard": "所有",
|
"flashcardCard": "所有",
|
||||||
"plugin": "插件",
|
"plugin": "插件",
|
||||||
|
@ -243,8 +248,8 @@
|
||||||
"nextDue": "下次複習",
|
"nextDue": "下次複習",
|
||||||
"flashcardNewCardLimit": "新卡上限",
|
"flashcardNewCardLimit": "新卡上限",
|
||||||
"flashcardNewCardLimitTip": "如果新卡較多,可以通過該項設置新卡複習的數量",
|
"flashcardNewCardLimitTip": "如果新卡較多,可以通過該項設置新卡複習的數量",
|
||||||
"flashcardReviewCardLimit": "復習卡上限",
|
"flashcardReviewCardLimit": "舊卡上限",
|
||||||
"flashcardReviewCardLimitTip": "如果復習卡較多,可以通過該項設置復習的數量",
|
"flashcardReviewCardLimitTip": "如果舊卡較多,可以通過該項設置舊卡復習的數量",
|
||||||
"flashcardMark": "標記制卡",
|
"flashcardMark": "標記制卡",
|
||||||
"flashcardMarkTip": "啟用後支持標記制卡,標記的文字被識別為挖空填空",
|
"flashcardMarkTip": "啟用後支持標記制卡,標記的文字被識別為挖空填空",
|
||||||
"flashcardList": "列表塊制卡",
|
"flashcardList": "列表塊制卡",
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{
|
{
|
||||||
|
"reviewMode": "复习模式",
|
||||||
|
"reviewModeTip": "选择复习时新卡和旧卡出现的顺序",
|
||||||
|
"reviewMode0": "新旧混合",
|
||||||
|
"reviewMode1": "新卡优先",
|
||||||
|
"reviewMode2": "旧卡优先",
|
||||||
"fileAnnoRefPlaceholder": "请输入块 ID",
|
"fileAnnoRefPlaceholder": "请输入块 ID",
|
||||||
"addToDatabase": "添加到数据库",
|
"addToDatabase": "添加到数据库",
|
||||||
"clearContext": "清空上下文",
|
"clearContext": "清空上下文",
|
||||||
|
@ -214,7 +219,7 @@
|
||||||
"confirmUninstall": "确定卸载 ${name} ?",
|
"confirmUninstall": "确定卸载 ${name} ?",
|
||||||
"scrollGetMore": "不要惊慌...上下滚动即可加载更多内容",
|
"scrollGetMore": "不要惊慌...上下滚动即可加载更多内容",
|
||||||
"flashcardNewCard": "新卡",
|
"flashcardNewCard": "新卡",
|
||||||
"flashcardReviewCard": "复习卡",
|
"flashcardReviewCard": "旧卡",
|
||||||
"flashcardDueCard": "到期卡",
|
"flashcardDueCard": "到期卡",
|
||||||
"flashcardCard": "所有",
|
"flashcardCard": "所有",
|
||||||
"plugin": "插件",
|
"plugin": "插件",
|
||||||
|
@ -243,8 +248,8 @@
|
||||||
"nextDue": "下次复习",
|
"nextDue": "下次复习",
|
||||||
"flashcardNewCardLimit": "新卡上限",
|
"flashcardNewCardLimit": "新卡上限",
|
||||||
"flashcardNewCardLimitTip": "如果新卡较多,可以通过该项设置新卡复习的数量",
|
"flashcardNewCardLimitTip": "如果新卡较多,可以通过该项设置新卡复习的数量",
|
||||||
"flashcardReviewCardLimit": "复习卡上限",
|
"flashcardReviewCardLimit": "旧卡上限",
|
||||||
"flashcardReviewCardLimitTip": "如果复习卡较多,可以通过该项设置复习的数量",
|
"flashcardReviewCardLimitTip": "如果旧卡较多,可以通过该项设置旧卡复习的数量",
|
||||||
"flashcardMark": "标记制卡",
|
"flashcardMark": "标记制卡",
|
||||||
"flashcardMarkTip": "启用后支持标记制卡,标记的文本被识别为挖空填空",
|
"flashcardMarkTip": "启用后支持标记制卡,标记的文本被识别为挖空填空",
|
||||||
"flashcardList": "列表块制卡",
|
"flashcardList": "列表块制卡",
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"icon": "1f4f8",
|
"icon": "1f4f8",
|
||||||
"id": "20221223221636-ms2b4w9",
|
"id": "20221223221636-ms2b4w9",
|
||||||
"title": "Flashcards",
|
"title": "Flashcards",
|
||||||
"updated": "20240128113415"
|
"updated": "20240224103857"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
@ -539,7 +539,7 @@
|
||||||
"Type": "NodeParagraph",
|
"Type": "NodeParagraph",
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"id": "20240128112016-je04b7i",
|
"id": "20240128112016-je04b7i",
|
||||||
"updated": "20240128112236"
|
"updated": "20240224103857"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
@ -576,7 +576,7 @@
|
||||||
{
|
{
|
||||||
"Type": "NodeTextMark",
|
"Type": "NodeTextMark",
|
||||||
"TextMarkType": "kbd",
|
"TextMarkType": "kbd",
|
||||||
"TextMarkTextContent": "Review Card Limit"
|
"TextMarkTextContent": "Old Card Limit"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Type": "NodeText",
|
"Type": "NodeText",
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"icon": "1f4f8",
|
"icon": "1f4f8",
|
||||||
"id": "20221223215557-o6gfsoy",
|
"id": "20221223215557-o6gfsoy",
|
||||||
"title": "闪卡",
|
"title": "闪卡",
|
||||||
"updated": "20240128112938"
|
"updated": "20240224103816"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
@ -535,7 +535,7 @@
|
||||||
"Type": "NodeParagraph",
|
"Type": "NodeParagraph",
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"id": "20240128110950-exhbssa",
|
"id": "20240128110950-exhbssa",
|
||||||
"updated": "20240128111232"
|
"updated": "20240224103816"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
@ -572,7 +572,7 @@
|
||||||
{
|
{
|
||||||
"Type": "NodeTextMark",
|
"Type": "NodeTextMark",
|
||||||
"TextMarkType": "kbd",
|
"TextMarkType": "kbd",
|
||||||
"TextMarkTextContent": "复习卡上限"
|
"TextMarkTextContent": "旧卡上限"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Type": "NodeText",
|
"Type": "NodeText",
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"icon": "1f4f8",
|
"icon": "1f4f8",
|
||||||
"id": "20221223221501-mops33i",
|
"id": "20221223221501-mops33i",
|
||||||
"title": "閃卡",
|
"title": "閃卡",
|
||||||
"updated": "20240128113519"
|
"updated": "20240224103933"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
@ -535,7 +535,7 @@
|
||||||
"Type": "NodeParagraph",
|
"Type": "NodeParagraph",
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"id": "20240128111910-2n2j702",
|
"id": "20240128111910-2n2j702",
|
||||||
"updated": "20240128111941"
|
"updated": "20240224103933"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
@ -572,7 +572,7 @@
|
||||||
{
|
{
|
||||||
"Type": "NodeTextMark",
|
"Type": "NodeTextMark",
|
||||||
"TextMarkType": "kbd",
|
"TextMarkType": "kbd",
|
||||||
"TextMarkTextContent": "複習卡上限"
|
"TextMarkTextContent": "舊卡上限"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Type": "NodeText",
|
"Type": "NodeText",
|
||||||
|
|
|
@ -42,7 +42,19 @@ export const flashcard = {
|
||||||
</div>
|
</div>
|
||||||
<span class="fn__space"></span>
|
<span class="fn__space"></span>
|
||||||
<input class="b3-switch fn__flex-center" id="deck" type="checkbox"${window.siyuan.config.flashcard.deck ? " checked" : ""}/>
|
<input class="b3-switch fn__flex-center" id="deck" type="checkbox"${window.siyuan.config.flashcard.deck ? " checked" : ""}/>
|
||||||
</label>`;
|
</label>
|
||||||
|
<div class="fn__flex b3-label config__item">
|
||||||
|
<div class="fn__flex-1">
|
||||||
|
${window.siyuan.languages.reviewMode}
|
||||||
|
<div class="b3-label__text">${window.siyuan.languages.reviewModeTip}</div>
|
||||||
|
</div>
|
||||||
|
<span class="fn__space"></span>
|
||||||
|
<select class="b3-select fn__flex-center fn__size200" id="reviewMode">
|
||||||
|
<option value="0" ${window.siyuan.config.flashcard.reviewMode === 0 ? "selected" : ""}>${window.siyuan.languages.reviewMode0}</option>
|
||||||
|
<option value="1" ${window.siyuan.config.flashcard.reviewMode === 1 ? "selected" : ""}>${window.siyuan.languages.reviewMode1}</option>
|
||||||
|
<option value="2" ${window.siyuan.config.flashcard.reviewMode === 2 ? "selected" : ""}>${window.siyuan.languages.reviewMode2}</option>
|
||||||
|
</select>
|
||||||
|
</div>`;
|
||||||
/// #if MOBILE
|
/// #if MOBILE
|
||||||
responsiveHTML = `${responsiveHTML}<div class="b3-label">
|
responsiveHTML = `${responsiveHTML}<div class="b3-label">
|
||||||
${window.siyuan.languages.flashcardNewCardLimit}
|
${window.siyuan.languages.flashcardNewCardLimit}
|
||||||
|
@ -119,9 +131,10 @@ export const flashcard = {
|
||||||
return responsiveHTML;
|
return responsiveHTML;
|
||||||
},
|
},
|
||||||
bindEvent: () => {
|
bindEvent: () => {
|
||||||
flashcard.element.querySelectorAll("input").forEach((item) => {
|
flashcard.element.querySelectorAll("input, select.b3-select").forEach((item) => {
|
||||||
item.addEventListener("change", () => {
|
item.addEventListener("change", () => {
|
||||||
fetchPost("/api/setting/setFlashcard", {
|
fetchPost("/api/setting/setFlashcard", {
|
||||||
|
reviewMode: parseInt((flashcard.element.querySelector("#reviewMode") as HTMLSelectElement).value),
|
||||||
newCardLimit: parseInt((flashcard.element.querySelector("#newCardLimit") as HTMLInputElement).value),
|
newCardLimit: parseInt((flashcard.element.querySelector("#newCardLimit") as HTMLInputElement).value),
|
||||||
reviewCardLimit: parseInt((flashcard.element.querySelector("#reviewCardLimit") as HTMLInputElement).value),
|
reviewCardLimit: parseInt((flashcard.element.querySelector("#reviewCardLimit") as HTMLInputElement).value),
|
||||||
mark: (flashcard.element.querySelector("#mark") as HTMLInputElement).checked,
|
mark: (flashcard.element.querySelector("#mark") as HTMLInputElement).checked,
|
||||||
|
|
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
@ -716,6 +716,7 @@ interface IConfig {
|
||||||
superBlock: boolean
|
superBlock: boolean
|
||||||
heading: boolean
|
heading: boolean
|
||||||
deck: boolean
|
deck: boolean
|
||||||
|
reviewMode: number
|
||||||
requestRetention: number
|
requestRetention: number
|
||||||
maximumInterval: number
|
maximumInterval: number
|
||||||
weights: string
|
weights: string
|
||||||
|
|
|
@ -305,6 +305,27 @@ func SaveAttributeView(av *AttributeView) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 数据订正
|
// 数据订正
|
||||||
|
|
||||||
|
// 值去重
|
||||||
|
blockValues := av.GetBlockKeyValues()
|
||||||
|
blockIDs := map[string]bool{}
|
||||||
|
var duplicatedValueIDs []string
|
||||||
|
for _, blockValue := range blockValues.Values {
|
||||||
|
if !blockIDs[blockValue.BlockID] {
|
||||||
|
blockIDs[blockValue.BlockID] = true
|
||||||
|
} else {
|
||||||
|
duplicatedValueIDs = append(duplicatedValueIDs, blockValue.ID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var tmp []*Value
|
||||||
|
for _, blockValue := range blockValues.Values {
|
||||||
|
if !gulu.Str.Contains(blockValue.ID, duplicatedValueIDs) {
|
||||||
|
tmp = append(tmp, blockValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
blockValues.Values = tmp
|
||||||
|
|
||||||
|
// 视图值去重
|
||||||
for _, view := range av.Views {
|
for _, view := range av.Views {
|
||||||
if nil != view.Table {
|
if nil != view.Table {
|
||||||
// 行去重
|
// 行去重
|
||||||
|
|
|
@ -30,6 +30,7 @@ type Flashcard struct {
|
||||||
SuperBlock bool `json:"superBlock"` // 是否启用超级块制卡 https://github.com/siyuan-note/siyuan/issues/7702
|
SuperBlock bool `json:"superBlock"` // 是否启用超级块制卡 https://github.com/siyuan-note/siyuan/issues/7702
|
||||||
Heading bool `json:"heading"` // 是否启用标题块制卡 https://github.com/siyuan-note/siyuan/issues/9005
|
Heading bool `json:"heading"` // 是否启用标题块制卡 https://github.com/siyuan-note/siyuan/issues/9005
|
||||||
Deck bool `json:"deck"` // 是否启用卡包制卡 https://github.com/siyuan-note/siyuan/issues/7724
|
Deck bool `json:"deck"` // 是否启用卡包制卡 https://github.com/siyuan-note/siyuan/issues/7724
|
||||||
|
ReviewMode int `json:"reviewMode"` // 复习模式,0:新旧混合,1:新卡优先,2:旧卡优先 https://github.com/siyuan-note/siyuan/issues/10303
|
||||||
|
|
||||||
// Apply result optimized by FSRS optimizer https://github.com/siyuan-note/siyuan/issues/9309
|
// Apply result optimized by FSRS optimizer https://github.com/siyuan-note/siyuan/issues/9309
|
||||||
RequestRetention float64 `json:"requestRetention"`
|
RequestRetention float64 `json:"requestRetention"`
|
||||||
|
@ -55,6 +56,7 @@ func NewFlashcard() *Flashcard {
|
||||||
SuperBlock: true,
|
SuperBlock: true,
|
||||||
Heading: true,
|
Heading: true,
|
||||||
Deck: false,
|
Deck: false,
|
||||||
|
ReviewMode: 0,
|
||||||
RequestRetention: param.RequestRetention,
|
RequestRetention: param.RequestRetention,
|
||||||
MaximumInterval: int(param.MaximumInterval),
|
MaximumInterval: int(param.MaximumInterval),
|
||||||
Weights: weightsBuilder.String(),
|
Weights: weightsBuilder.String(),
|
||||||
|
|
|
@ -49,12 +49,18 @@ func GetAttributeViewPrimaryKeyValues(avID string, page, pageSize int) (attribut
|
||||||
attributeViewName = attrView.Name
|
attributeViewName = attrView.Name
|
||||||
|
|
||||||
keyValues = attrView.GetBlockKeyValues()
|
keyValues = attrView.GetBlockKeyValues()
|
||||||
// 不在视图中的值要过滤掉
|
// 过滤掉不在视图中的值
|
||||||
tmp := map[string]*av.Value{}
|
tmp := map[string]*av.Value{}
|
||||||
for _, kv := range keyValues.Values {
|
for _, kv := range keyValues.Values {
|
||||||
for _, view := range attrView.Views {
|
for _, view := range attrView.Views {
|
||||||
switch view.LayoutType {
|
switch view.LayoutType {
|
||||||
case av.LayoutTypeTable:
|
case av.LayoutTypeTable:
|
||||||
|
if !kv.IsDetached {
|
||||||
|
if nil == treenode.GetBlockTree(kv.BlockID) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if gulu.Str.Contains(kv.Block.ID, view.Table.RowIDs) {
|
if gulu.Str.Contains(kv.Block.ID, view.Table.RowIDs) {
|
||||||
tmp[kv.Block.ID] = kv
|
tmp[kv.Block.ID] = kv
|
||||||
}
|
}
|
||||||
|
|
|
@ -490,7 +490,7 @@ func GetNotebookDueFlashcards(boxID string, reviewedCardIDs []string) (ret []*Fl
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cards, unreviewedCnt, unreviewedNewCardCnt, unreviewedOldCardCnt := getDeckDueCards(deck, reviewedCardIDs, treeBlockIDs, Conf.Flashcard.NewCardLimit, Conf.Flashcard.ReviewCardLimit)
|
cards, unreviewedCnt, unreviewedNewCardCnt, unreviewedOldCardCnt := getDeckDueCards(deck, reviewedCardIDs, treeBlockIDs, Conf.Flashcard.NewCardLimit, Conf.Flashcard.ReviewCardLimit, Conf.Flashcard.ReviewMode)
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
for _, card := range cards {
|
for _, card := range cards {
|
||||||
ret = append(ret, newFlashcard(card, card.BlockID(), builtinDeckID, now))
|
ret = append(ret, newFlashcard(card, card.BlockID(), builtinDeckID, now))
|
||||||
|
@ -535,7 +535,7 @@ func GetTreeDueFlashcards(rootID string, reviewedCardIDs []string) (ret []*Flash
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cards, unreviewedCnt, unreviewedNewCardCnt, unreviewedOldCardCnt := getDeckDueCards(deck, reviewedCardIDs, treeBlockIDs, newCardLimit, reviewCardLimit)
|
cards, unreviewedCnt, unreviewedNewCardCnt, unreviewedOldCardCnt := getDeckDueCards(deck, reviewedCardIDs, treeBlockIDs, newCardLimit, reviewCardLimit, Conf.Flashcard.ReviewMode)
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
for _, card := range cards {
|
for _, card := range cards {
|
||||||
ret = append(ret, newFlashcard(card, card.BlockID(), builtinDeckID, now))
|
ret = append(ret, newFlashcard(card, card.BlockID(), builtinDeckID, now))
|
||||||
|
@ -606,7 +606,7 @@ func getDueFlashcards(deckID string, reviewedCardIDs []string) (ret []*Flashcard
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cards, unreviewedCnt, unreviewedNewCardCnt, unreviewedOldCardCnt := getDeckDueCards(deck, reviewedCardIDs, nil, Conf.Flashcard.NewCardLimit, Conf.Flashcard.ReviewCardLimit)
|
cards, unreviewedCnt, unreviewedNewCardCnt, unreviewedOldCardCnt := getDeckDueCards(deck, reviewedCardIDs, nil, Conf.Flashcard.NewCardLimit, Conf.Flashcard.ReviewCardLimit, Conf.Flashcard.ReviewMode)
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
for _, card := range cards {
|
for _, card := range cards {
|
||||||
ret = append(ret, newFlashcard(card, card.BlockID(), deckID, now))
|
ret = append(ret, newFlashcard(card, card.BlockID(), deckID, now))
|
||||||
|
@ -623,7 +623,7 @@ func getDueFlashcards(deckID string, reviewedCardIDs []string) (ret []*Flashcard
|
||||||
func getAllDueFlashcards(reviewedCardIDs []string) (ret []*Flashcard, unreviewedCount, unreviewedNewCardCount, unreviewedOldCardCount int) {
|
func getAllDueFlashcards(reviewedCardIDs []string) (ret []*Flashcard, unreviewedCount, unreviewedNewCardCount, unreviewedOldCardCount int) {
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
for _, deck := range Decks {
|
for _, deck := range Decks {
|
||||||
cards, unreviewedCnt, unreviewedNewCardCnt, unreviewedOldCardCnt := getDeckDueCards(deck, reviewedCardIDs, nil, Conf.Flashcard.NewCardLimit, Conf.Flashcard.ReviewCardLimit)
|
cards, unreviewedCnt, unreviewedNewCardCnt, unreviewedOldCardCnt := getDeckDueCards(deck, reviewedCardIDs, nil, Conf.Flashcard.NewCardLimit, Conf.Flashcard.ReviewCardLimit, Conf.Flashcard.ReviewMode)
|
||||||
unreviewedCount += unreviewedCnt
|
unreviewedCount += unreviewedCnt
|
||||||
unreviewedNewCardCount += unreviewedNewCardCnt
|
unreviewedNewCardCount += unreviewedNewCardCnt
|
||||||
unreviewedOldCardCount += unreviewedOldCardCnt
|
unreviewedOldCardCount += unreviewedOldCardCnt
|
||||||
|
@ -988,8 +988,10 @@ func getDeckIDs() (deckIDs []string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func getDeckDueCards(deck *riff.Deck, reviewedCardIDs, blockIDs []string, newCardLimit, reviewCardLimit int) (ret []riff.Card, unreviewedCount, unreviewedNewCardCountInRound, unreviewedOldCardCountInRound int) {
|
func getDeckDueCards(deck *riff.Deck, reviewedCardIDs, blockIDs []string, newCardLimit, reviewCardLimit, reviewMode int) (ret []riff.Card, unreviewedCount, unreviewedNewCardCountInRound, unreviewedOldCardCountInRound int) {
|
||||||
ret = []riff.Card{}
|
ret = []riff.Card{}
|
||||||
|
var retNew, retOld []riff.Card
|
||||||
|
|
||||||
dues := deck.Dues()
|
dues := deck.Dues()
|
||||||
|
|
||||||
var tmp []riff.Card
|
var tmp []riff.Card
|
||||||
|
@ -1060,15 +1062,28 @@ func getDeckDueCards(deck *riff.Deck, reviewedCardIDs, blockIDs []string, newCar
|
||||||
}
|
}
|
||||||
|
|
||||||
newCount++
|
newCount++
|
||||||
|
retNew = append(retNew, c)
|
||||||
} else {
|
} else {
|
||||||
if reviewCount >= reviewCardLimit {
|
if reviewCount >= reviewCardLimit {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
reviewCount++
|
reviewCount++
|
||||||
|
retOld = append(retOld, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = append(ret, c)
|
ret = append(ret, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch reviewMode {
|
||||||
|
case 1: // 优先复习新卡
|
||||||
|
ret = nil
|
||||||
|
ret = append(ret, retNew...)
|
||||||
|
ret = append(ret, retOld...)
|
||||||
|
case 2: // 优先复习旧卡
|
||||||
|
ret = nil
|
||||||
|
ret = append(ret, retOld...)
|
||||||
|
ret = append(ret, retNew...)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue