obsidian-spaced-repetition icon indicating copy to clipboard operation
obsidian-spaced-repetition copied to clipboard

[BUG] Obsidian SRS ignores more than one tag

Open putzwasser opened this issue 3 years ago • 7 comments

Describe the bug Obsidian SRS ignores more than one tag. It seems as if the algorithm stops assigning a card/note to decks after it matched the first tag it knows.

To Reproduce

  1. Create this flashcard:
---
tags:
  - flashcard
  - flashcard/test
  - flashcard/test2
  - otherFlashcardTag
---
**Spaced repetition** is an **evidence-based** learning technique that is usually performed with **flashcards**.

Newly introduced and more difficult flashcards are shown **more frequently**.

  1. Add #otherFlashcardTag to the list of flashcard tags.
  2. Open the review modal.
  3. The card will be filed under flashcard only.

Expected behavior The card should be IMHO filed under

  • flashcard
  • flashcard/test
  • flashcard/test2 and
  • otherFlashcardTag

I would at least expect the card to filed under flashcard and otherFlashcardTag. It would be best if it belonged to all three decks.

Use case: A flashcard for marketing that is about market research and customer behaviour. I'd file the card under #marketing/marketResearch and #marketing/customerBehaviour and maybe cognitiveBias. So, I'd like to study the card if I study the marketing/marketResearch or the marketing/customerBehaviour deck or the whole marketing deck if got a lot of time. Furthermore I'd like to see the card if I study cognitiveBiases.

Screenshots image Shows the file and that it only belongs to the flashcard deck. image List of tags

Versions (please complete the following information):

  • OS: Manjaro Linux
  • Obsidian version: v0.15.9
  • Plugin version: v1.8.0
  • If on desktop, Installer version: 5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) obsidian/0.15.9 Chrome/100.0.4896.160 Electron/18.3.5 Safari/537.36

putzwasser avatar Sep 08 '22 12:09 putzwasser

Hi @putzwasser @pikatwinky @MostlyArmless

I might be able to look at the merge conflict https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/506, but first have a note regarding functionality.

#flashcards/tag1 
#flashcards/tag2 
#flashcards/tag3
question1::answer1

#flashcards/tag4 
#flashcards/tag5
question2::answer2

From a look at the PR, all questions will be included in the complete set of decks #flashcards/tag1... #flashcards/tag5.

There would be an argument for the following deck assignment: question1 - #flashcards/tag1, #flashcards/tag2, #flashcards/tag3 question2 - #flashcards/tag4, #flashcards/tag5

However, this would be different to what is in the PR, (and harder to implement).

Also, not sure if the PR handles multiple inline tags within a question, such as:

#flashcards/tag6 #flashcards/tag7 #flashcards/tag8 question3::answer3

Cheers Ronny

ronzulu avatar Dec 18 '23 23:12 ronzulu

Hi Ronny! Yes, i think the design you described here would be the ideal case, and i understand it could be more complex to implement this:

There would be an argument for the following deck assignment: question1 - #flashcards/tag1, #flashcards/tag2, #flashcards/tag3 question2 - #flashcards/tag4, #flashcards/tag5

In my humble opinion, I see the usefulness of this PR, for the time being, as long as (following your example) once you review question1 in any of the decks #flashcards/tag1... #flashcards/tag5 it dissapears from the rest of them as well. I don't know if this is the actual behaviour of this PR?

pikatwinky avatar Dec 20 '23 04:12 pikatwinky

Hi @putzwasser, I agree about...

In my humble opinion, I see the usefulness of this PR, for the time being, as long as (following your example) once you review question1 in any of the decks #flashcards/tag1... #flashcards/tag5 it dissapears from the rest of them as well. I don't know if this is the actual behaviour of this PR?

Regarding counting, I suggest that the card is included in each deck in which it is tagged.

However it should only be counted once for any decks that are common ancestors. For example:

#flashcards/subject1/topic1
#flashcards/subject1/topic2
#flashcards/subject2/topic3
question1::answer1

I.e. question1 would be counted once in each of the following decks:

#flashcards/subject1/topic1
#flashcards/subject1/topic2
#flashcards/subject2/topic3
#flashcards/subject1
#flashcards/subject2
#flashcards

Specifically, not counted twice for #flashcards/subject1, even though it appears in two subdecks.

@MostlyArmless how is pull request https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/506 going? I might be able to work on this if you are too busy

Regards Ronny

ronzulu avatar Dec 27 '23 12:12 ronzulu

Hi @MostlyArmless. Are you ok with @ronzulu solving the #506 merge conflicts?

Thanks for your kindly help Ronny, i think this overlapping functionality is gonna be an amazing addition to this fantastic plugin

pikatwinky avatar Jan 02 '24 03:01 pikatwinky

@pikatwinky @ronzulu yes, if you have time to resolve the merge conflicts please go ahead I haven't had time to fix them myself due to the holidays.

MostlyArmless avatar Jan 02 '24 18:01 MostlyArmless

Actually, it's a little more involved than we thought, because questions can have their own question specific tags.

So for example:

#flashcards/tag1 
#flashcards/tag2 
#flashcards/tag3
question1::answer1
question2::answer2

#flashcards/tag4 question3::answer3

question4::answer4

The existing functionality would have:

  • question1, question2, question4 within deck #flashcards/tag1 (ignoring tag2 and tag3)
  • question3, within deck #flashcards/tag4

But if we simply look for all tags in the note then question1, question2, question4 will be assigned to:

  • decks #flashcards/tag1, #flashcards/tag2, #flashcards/tag3
  • and unintentionally #flashcards/tag4

This means that we can't use the obsidian function getAllTags that is currently used as it doesn't give any info about where in the note the tag is located: export function getAllTags(cache: CachedMetadata): string[] | null;

Fortunately there appears to be richer tag info available from: CachedMetadata tags?: TagCache[];

The location info within TagCache will need to be compared with info from the parser to determine if a tag is question specific or not.

This will take more time to implement...

Cheers Ronny

ronzulu avatar Jan 04 '24 10:01 ronzulu

Hi all, I have completed the update but would appreciate beta testing and feedback before I finalise the PR.

The draft PR together with the updated code is available at: https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/834

Cheers Ronny

ronzulu avatar Jan 12 '24 00:01 ronzulu

Released into 1.12.0

ronzulu avatar Mar 19 '24 11:03 ronzulu

Now, unrelated tags are shown as well, which makes the whole appearance a bit messy. E.g. my tag for marking flashcards is "#flashcard", but sometimes there are a couple other unrelated tags added to the note, like date tags and so on. Now the UI is clustered with all unrelated tags as well, not only the #flashcard tag and its sub-tags (#flashcard/sub1).

ikelos555 avatar Mar 19 '24 15:03 ikelos555

Thanks for reporting this, but I can't reproduce the problem.

Please open a new issue and post your markdown file (attachment, not copy/paste), as well as a screenshot of the card selection modal. I assume when you say "Now the UI is clustered..." the card selection modal is what you mean.

Also please post your settings file, e.g.: D:\Obsidian\Obsidian\.obsidian\plugins\obsidian-spaced-repetition\data.json

Cheers Ronny

ronzulu avatar Mar 19 '24 21:03 ronzulu