Basic answering seems to lead to a compromised state
meelash opened this issue · comments
I'm using the algorithm as a backend to an application with about 5-6000 items in it. I've noticed on any item if I answer an item with values 5, then 0, then 5, the data in the algorithm gets into a state where any answer of 5 on any item results in a null value from OFM.of which then results in different NaN or null values and eventually results in the dueDate being "Invalid Date." There is seemingly no way to recover from this state.
Here is a video of my app showing the problem. In the lower right is the item.data() of the item being answered. "Remember" translates to an answer of 5 and "I don't know" translates to an answer of 0.
https://youtu.be/OdpKgqCOEFM
Here is the results of SM.data(), JSON.stringify-ed so you can try for yourself:
On first initializing the app, which just involves instantiation SM and adding each item using addItem. The value of the item is just an ID, since I'm just using sm.js as a backend: https://gist.github.com/meelash/7d9ef5c9cd5cf3743abcbc00ffbe0622
After answering with "5" to any random item (this is sm.data() but I deleted the .q array to make it more manageable): https://gist.github.com/meelash/119cf9deb2b33743ff0bb4d8742af1e3
After answering with "0" to that same item. At this point sm.js is in an unrecoverable broken state: https://gist.github.com/meelash/78189f7a9e26f632a11eabb3040716b7
Which becomes apparent after answering with "5" to that item or any other item: https://gist.github.com/meelash/df09618cdfebfa7623e106532f049a5e
I can supply these as the raw output as well, that has the quotation marks escaped.
Any help or any clue in what could be going wrong or if I'm missing something in my usage would be highly appreciated.
Meelash, were you able to resolve this issue? I am also looking to implement this algorithm as a backend to an application and wondered if it was a worthwhile investment of time. I appreciate any insight.
Nah, I don't think I ever went forward with that project for other reasons. Can't really remember, to be honest.