Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Obsidian SRS ignores more than one tag #495

Closed
putzwasser opened this issue Sep 8, 2022 · 10 comments
Closed

[BUG] Obsidian SRS ignores more than one tag #495

putzwasser opened this issue Sep 8, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@putzwasser
Copy link

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
@ronzulu
Copy link
Collaborator

ronzulu commented Dec 18, 2023

Hi @putzwasser @pikatwinky @MostlyArmless

I might be able to look at the merge conflict #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

@pikatwinky
Copy link

pikatwinky commented Dec 20, 2023

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?

@ronzulu
Copy link
Collaborator

ronzulu commented Dec 27, 2023

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 #506 going? I might be able to work on this if you are too busy

Regards
Ronny

@pikatwinky
Copy link

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

@MostlyArmless
Copy link
Contributor

@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.

@ronzulu
Copy link
Collaborator

ronzulu commented Jan 4, 2024

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
Copy link
Collaborator

ronzulu commented Jan 12, 2024

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:
#834

Cheers
Ronny

@st3v3nmw st3v3nmw added this to To do in Roadmap via automation Jan 16, 2024
@st3v3nmw st3v3nmw moved this from To do to In progress in Roadmap Jan 16, 2024
st3v3nmw added a commit that referenced this issue Mar 9, 2024
… (#834)

* First bit of implementation

* Slight refactor of parse()

* Enhanced parser to return first and last line numbers

* Finished impl for enhanced parsing for multiple topics per note, updated existing test cases (haven't fixed main.js or added all needed test cases)

* Implementation & testing continuing

* Comment change

* pnpm format; updated changelog.md

* pnpm lint

* Need to rerun lint after format, and rerun format after lint

* Updated flashcard user documentation

* Added code to access the frontmatter tags

* Fixed test cases after merging with #815

* lint & format

* Fixed unit test case

* Minor

* Minor post merge fix

* Lint

* Fixed test case

---------

Co-authored-by: Stephen Mwangi <mail@stephenmwangi.com>
@st3v3nmw st3v3nmw moved this from In progress to Done (available in next release) in Roadmap Mar 9, 2024
ronzulu added a commit to ronzulu/obsidian-spaced-repetition that referenced this issue Mar 12, 2024
@ronzulu
Copy link
Collaborator

ronzulu commented Mar 19, 2024

Released into 1.12.0

@ronzulu ronzulu closed this as completed Mar 19, 2024
@ikelos555
Copy link

ikelos555 commented Mar 19, 2024

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).

@ronzulu
Copy link
Collaborator

ronzulu commented Mar 19, 2024

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

@st3v3nmw st3v3nmw moved this from Done (available in next release) to Shipped! in Roadmap Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Roadmap
Shipped!
Roadmap
To do
5 participants