Work on Spaced Repetition System

618 views
Skip to first unread message

Diego Mesa

unread,
Feb 1, 2018, 4:58:04 PM2/1/18
to TiddlyWiki
Hey all,

I mentioned in other places that I would be working on something like this. Instead of polluting other threads, Ill post updates and misc in here (though specific questions related to other things will still leak outside of this thread!).

So far, I've been reading

https://apps.ankiweb.net/docs/manual.html

and

https://www.supermemo.com/english/ol/sm2.htm

And have come up with a basic design for now which will evolve. Right now, I have questions as cards tagged with "Flash Card", and when you input a new one, they begin with the following fields:

question: 3+1
answer: 4
repetition: 1

We then have two major parts:
  • Quizzer
    • Shows a question
    • Lets you rate its difficulty
    • Calculate the next minimum time this question should be shown
  • Selector
    • When you're ready to begin quizzing, get all questions whos time is up and are ready to be shown

So far I've worked on the quizzer (question/answering), and have a template with the following content:

\define againQuality() 0
\define hardQuality() 1
\define goodQuality() 2
\define easyQuality() 3
\define updateActions()
<!-- UPDATE question parameters -->
<$formula-vars eq="$(quality)$ + 1">
   
<$action-setfield $field="eq" $value=<<eq>>/>
    <$formula-vars repetition="{{!!repetition}} + 1">
        <$action-setfield $field="repetition" $value=<<repetition>>/
>
       
<$formula-vars due="<<repetition>> + 20">
           
<$action-setfield $field="due" $value=<<due>>/>
        </
$formula-vars>
   
</$formula-vars>
</
$formula-vars>

<!-- REMOVE Answer Button Row -->
<$action-sendmessage $message="tm-remove-field" $param="state"/>

<!-- CLOSE this question -->
<$action-sendmessage $message="tm-close-tiddler"/>
\end

<!-- ACTIVATE this template for all tiddlers tagged Flash Cards -->
<$list filter="[all[current]tag[Flash Card]]">
   
<$fieldmangler>
   
Question: {{!!question}}
   
   
<br/>

   
<!-- IF it does NOT have the field state: SHOW QUESTION -->
   
<$list filter="[all[current]!has:field[state]]">
       
<$button>
           
Show Answer
           
<!-- ADD the field state -->
           
<$action-sendmessage $message="tm-add-field" $param="state"/>
       
</$button>
    </
$list>

   
<!-- IF it DOES have the field state: SHOW ANSWER-->
   
<$list filter="[all[current]has:field[state]]">
       
Answer: {{!!answer}}
       
       
<!-- SHOW answer buttons -->
       
       
<br/>

       
<$button>
           
Again
           
<!-- Calculate New Parameters -->
           
<$action-setfield $field="quality" $value=<<againQuality>>/>
            <<updateActions>>
        </
$button>
       
       
<$button>
           
Hard
           
<!-- Calculate New Parameters -->
           
<$action-setfield $field="quality" $value=<<hardQuality>>/>
            <<updateActions>>
        </
$button>
       
       
<$button>
           
Good
           
<!-- Calculate New Parameters -->
           
<$action-setfield $field="quality" $value=<<goodQuality>>/>
            <<updateActions>>
        </
$button>
       
       
<$button>
           
Easy
           
<!-- Calculate New Parameters -->
           
<$action-setfield $field="quality" $value=<<easyQuality>>/>
            <<updateActions>>
        </
$button>
   
</$list>

    </
$fieldmangler>
</$list>

This will at least let you answer a question, and mark how hard/easy it was for you, and calculate the relevant fields for the next time it should be shown.

I still have to actually implement the correct calculations for due, eq, etc. These are just place holders for right now.

The next piece is the selector, which will be responsible for going through all questions "due" field and selecting the ones that are ready to be shown - this should very straight forward.

Any comments/feedback is very welcome!

Diego

BurningTreeC

unread,
Feb 2, 2018, 3:54:03 AM2/2/18
to TiddlyWiki
Hi Diego,

I like this, tried it on a wiki and it seems to work very good!
I'm looking forward to this!

Atm I don't have much to comment, I try to keep up to date on this

best wishes,
Simon

TonyM

unread,
Feb 2, 2018, 4:35:15 PM2/2/18
to TiddlyWiki
Diego,

Does sound a useful tool to put in tiddlywiki. I was interested in building something similar for review and study times rather than at the question level. Its more about scheduling study.

Once such a question answer solution exists it seems to me the next opportunity is how to populate it with questions. Imagin if you could dump a translation dictionary on it. Alternativly manual question creation needs to be quick and easy. Could questions even be created from marking up your study notes?

Regards
Tony

Diego Mesa

unread,
Feb 5, 2018, 6:00:56 PM2/5/18
to TiddlyWiki
Hey all,

I've put together a small demo of my current progress here:

http://anwiki.tiddlyspot.com/

As always, any and all feedback is welcome. And I mean on everything, from the way I coded it up, to the way its structured, styled, etc. Anything!

Best,
Diego

BurningTreeC

unread,
Feb 6, 2018, 11:23:56 AM2/6/18
to TiddlyWiki
@Diego Mesa,

this is awesome :)


I cannot say too much about how you coded it, but about the styling - I think the most important thing in your Anwiki are the functions, the styling for me would already be good as it is

I just like this!

keep going,

all the best, Simon

Krishaan Khubchand

unread,
Feb 9, 2018, 3:33:31 PM2/9/18
to TiddlyWiki
It looks really cool man, is there any way to use the spaced repetition system as a plugin? 

Diego Mesa

unread,
Feb 9, 2018, 4:24:26 PM2/9/18
to TiddlyWiki
Thanks Kirshaan,

Thats the plan! For right now Im sitll testing it, but I hope to release it as a plugin soon.

Best,
Diego

Diego Mesa

unread,
Feb 12, 2018, 12:57:25 PM2/12/18
to TiddlyWiki
Hey all,

With Evan's fix of the formula plugin today, I released an updated version of Anwiki:

http://anwiki.tiddlyspot.com/

You can now quiz in 1 of 2 ways:
  • Quiz by due date, regardless of deck
  • Quiz by deck, regardless of due date
Any feedback is welcome.

Diego

Alex May

unread,
Apr 3, 2018, 6:58:56 PM4/3/18
to TiddlyWiki
Hi Diego, 

Just wanted to lend an encouraging word, as I would find such a plug-in super useful! Good luck!

Cheers, 
Alex

Diego Mesa

unread,
Apr 3, 2018, 10:07:24 PM4/3/18
to TiddlyWiki
Thanks Alex!

I had kind of given up. I'll continue after I get some more time at work.

Best,
Diego

JD

unread,
Apr 5, 2018, 10:23:03 AM4/5/18
to TiddlyWiki
Hey man, this is amazing work. Is there documentation for creating a new card (besides cloning existing ones)? 

This is really helpful to my Nihongo studies!

Diego Mesa

unread,
Apr 5, 2018, 12:17:58 PM4/5/18
to TiddlyWiki
Hey thanks JD,

You bring up a great missing feature right now. Cards are just tiddlers that are tagged "flash card", with a question and answer field. 

The other fields are (should be) automatically created, and in the final plugin version would be hidden from the view template. 

Diego Mesa

unread,
Apr 5, 2018, 12:50:29 PM4/5/18
to TiddlyWiki
Forgot to actually answer - All you have to do is make a new tiddler, tag it with the name of the "Deck" it belongs to (it can belong to multiple decks), tag it with "Flash Card", and give it a question and answer field. 

When I finish up some stuff at work, you guys have inspired me to come back and work on this again! 

Best,
Diego

BurningTreeC

unread,
Apr 6, 2018, 9:18:30 AM4/6/18
to TiddlyWiki
Hi Diego, I think AnWiki is a crucial plugin for tiddlywiki
I was very interested in following your development, because I think it can be done better in tiddlywiki than in the native anki program itself
especially the handling of media and re-using of text chunks is a real plus for tw

I would try picking up your work if at one point you loose interest. I think it's a feature that should make it to a plugin library, if not the tw library...

all the best,
Simon

Diego Mesa

unread,
Apr 6, 2018, 9:42:41 AM4/6/18
to TiddlyWiki
Hey Simon,

I agree with you! I would love to work on this with you! Im still very new to TW plugin development. All of Anwiki right now is just a set of simple macros. If you're interested, let me know and we can coordinate in private emails to continue working on this!

Diego

BurningTreeC

unread,
Apr 6, 2018, 11:29:58 AM4/6/18
to TiddlyWiki

I agree with you! I would love to work on this with you! Im still very new to TW plugin development. All of Anwiki right now is just a set of simple macros. If you're interested, let me know and we can coordinate in private emails to continue working on this!

 
Yes, I'd like to do that!
I'd like to get your macros and build a little prototyping-interface around them to make the direction clear where the content and results should go,
Do you already have ideas on that, which I could use to build on? If else, I'd prototype something that can be changed anytime we have something better


Simon

JD

unread,
Apr 6, 2018, 11:45:28 AM4/6/18
to TiddlyWiki
Oh, right, only the Question and Answer fields (plus the tags) are really needed. 

I imagine something like the sample custom NewJournalButton on the main TiddlyWiki site could make card creation fast and simple. Although it would be great if we could quickly create by deck too, not just by card... like in Quizlet.com 

Something like a "New Deck" tiddler that will ask for a Deck Name, then have a table with rows for cards, and within each row: input area for card Question and Answer, something like that? 

ilya.kh...@gmail.com

unread,
Sep 6, 2018, 4:17:58 PM9/6/18
to TiddlyWiki
This is a great work!!

I am interested in a slightly different feature compared to flashcard use case which I hope would be possible to implement.
Human brain forget the information it doesn't use, so I wanted a simple mechanism which would prompt me to work on the tiddler.
I wanted to use SR algorithm to schedule review of tiddler (every tiddler in wiki except pluggins and assets) so I can recall the information, refactor the tiddler and do maintenance if needed.
The interface would be a simple list filter which would show list of tiddler titles (or captures) scheduled for review.
By clicking on the item in the list the tiddler opens in view mode. I would click ok if I don't want to refactor it.
Otherwise I would click edit icon in the toolbar. Does anyone know if such plugin exists or can provide some ideas how to implement it?

Best regards,
ILYA

Diego Mesa

unread,
Sep 6, 2018, 6:10:17 PM9/6/18
to TiddlyWiki
Hello ILYA,

I think it would be straightforward to use the macros this project provides to accomplish that. You'd have to modify the SR algorithm slightly though, as there is no clear notion of question difficulty to effect when to next review the tiddler in your case. 
Reply all
Reply to author
Forward
0 new messages