Giter Site home page Giter Site logo

Comments (10)

orgtre avatar orgtre commented on June 20, 2024 3

@doolio You're right, it's not so surprising. And yes, I'm also running Anki 2.1.54.

@f-dangel There is no built in note type with only one field/side but you can easily create one yourself within Anki (the desktop app). See this section in the manual. You'd go to Tools - Manage Note Types - Add - Add: Basic - OK. Then input a new name. Highlight the note type you just created and press Fields, highlight "Back" and press delete and save. You might then also want to click Cards and adjust the back template.

from anki-editor.

f-dangel avatar f-dangel commented on June 20, 2024 1

Hi,

thanks for the suggestion, indeed I installed via melpa. I just installed from develop (ff3230f) and checked again. Sadly, the problem persists and I get the same error message.

from anki-editor.

doolio avatar doolio commented on June 20, 2024

I presume you have installed via melpa? If you can check using the develop branch which introduces changes to the API it may resolve your issues. I can't say it will for sure as I'm still using Anki v2.1.15. See also #101.

from anki-editor.

orgtre avatar orgtre commented on June 20, 2024

I was receiving the same error message and believe the problem lies with Anki. When I got this message I also got the message "Cloze deletion can only be used on cloze notetypes" in the editor when trying to add a new note of type "Cloze" in Anki. The message appeared only after writing something like {{c1::test}} in the Text field and prevented me from adding the note. Do you see the same behavior?

After going to "Tools - Manage Note Types", deleting the "Cloze" note type (you could switch cards of this type to another type temporarily to avoid deleting them), and adding it back via the "Add" button and "Add: Cloze", I am not having this problem anymore. I can again create "Cloze" cards both within Anki and by pushing from anki-editor.

Maybe it was just a bug or the problem might have been related to this fact from the Anki manual:

The cloze note type is treated specially by Anki, and cannot be created based on a regular note type. If you wish to customize it, please make sure to clone the existing Cloze type instead of another type of note.

from anki-editor.

f-dangel avatar f-dangel commented on June 20, 2024

Hi, and thanks for the suggestions!

Since my workflow is completely based on anki-editor, and I have never used the {{...}} syntax before in my notes, I cannot confirm that using the syntax from within Anki causes the problem I have with creating Clozes.

I followed your suggestion to delete and add the Close note type. However, this did not solve my issue and I keep seeing the :ANKI_FAILURE_REASON: cannot create note for unknown reason.

from anki-editor.

orgtre avatar orgtre commented on June 20, 2024

Too bad, if the problem persists I'd suggest trying to create some cloze cards within Anki to see if it works as expected there. If not you might have more luck asking for help on the Anki Forums.

I tried to reproduce your example:

* Test cloze
:PROPERTIES:
:ANKI_DECK: Default
:ANKI_NOTE_TYPE: Cloze
:END:
** Text
Some note

And indeed I also get cannot create note for unknown reason. The issue then seems to be that Anki expects Cloze cards to actually contain some cloze syntax, so instead of just writing "Some note" try "Some {{c1::note}}":

* Test cloze
:PROPERTIES:
:ANKI_DECK: Default
:ANKI_NOTE_TYPE: Cloze
:END:
** Text
Some {{c1::note}}

This note then pushes successfully for me. So the issue seems to be mainly the very uninformative error message (which we can't easily fix as anki-editor just passes on error messages from Anki/AnkiConnect). Does this solve your issue?

from anki-editor.

doolio avatar doolio commented on June 20, 2024

The issue then seems to be that Anki expects Cloze cards to actually contain some cloze syntax

But is that really surprising? I haven't used Cloze cards as yet so never fell victim to this issue.

In any case, to add a data point to support this. I'm running:

Version 2.1.15 (442df9d6)
Qt 5.15.2 PyQt 5.15.2

And this version creates the card for the test case suggested by OP but when viewing the card instead of displaying the content it displays the following message to include some cloze deletions and a link to help on the subject.

Please edit this note and add some cloze deletions. (help)

If I view the card in the Anki browser I see the card content given in the test case.

I presume both of you are running a newer version of Anki and so the card is simply not produced if cloze deletions do not exist for a Cloze note type.

@f-dangel why do you consider the test case you provided a Cloze card if it doesn't contain any close deletions?

from anki-editor.

f-dangel avatar f-dangel commented on June 20, 2024

Hey (btw thanks a lot for your help, I really appreciate it),

in fact I am 'abusing' cloze cards as one-sided cards without hidden information (like a fact I want to be reminded of every now and then). So chances are I am using the wrong card type to achieve what I want.

Is there a card type that reflects what I am trying to achieve?

Best

from anki-editor.

f-dangel avatar f-dangel commented on June 20, 2024

Hi again,

thank you for the description; this solves my problem:

  • I opened the Anki desktop app, navigated to Tools -> Manage Note Types, and created a new note named One side by clicking on Add, entering the name, and confirming by clicking OK.
  • Then, I configured the note type by clicking onto One side, then Fields. I removed the 2: Back field, and renamed 1: Front into 1: Text. Then, I can push notes that look as follows and do what I am trying to achieve:
* Test one side
:PROPERTIES:
:ANKI_DECK: Default
:ANKI_NOTE_TYPE: One side
:END:
** Text
Some note

Thank you very much for the quick responses.

I am not sure how relevant my use case is for others, and how to rename the issue such that it will be helpful for others in the future. Feel free to go ahead.

Best,
Felix

from anki-editor.

doolio avatar doolio commented on June 20, 2024

Glad you found a solution. I would have made the same suggestion as orgtre. I'm curious though about your rationale. I don't understand how you are testing anything with a one sided card that isn't a cloze card. That is when the card appears you see all its content.

FYI, you can also specify :ANKI_DECK: Default as a file property by placing the following somewhere at the top of your file:

#+property: ANKI_DECK Default

This can be used when all the cards in a single file will be added to the same deck. I just use one deck but separate my cards by subject area in different org files. It avoids the need for subdecks (which at one time was recommended by the Anki maintainers) but still provides a level of organisation. This line just means I don't repeat myself in every headline property drawer. I do the same for the ANKI_TAGS property. So within each headline drawer I only have the Anki related properties ANKI_NOTE_TYPE and ANKI_NOTE_ID which are generally unique for each card. You can still override individual cards at the heading level if necessary. Be sure to hit C-c C-c somewhere on this line to refresh the local contents.

I also keep anki-editor-org-tags-as-anki-tags set to nil and have a file property for org tags with at least one tag namely #+tags: fc. With this I'm experimenting using org-fc to also have my SRS fully within Emacs, yay! This works using the same cards as anki-editor and org-fc use different headline properties. I will still use Anki has it offers excellent mobile support which I think is important so I can still do my reviews when away from my computer.

from anki-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.