For more info, see: https://roamresearch.com/#/app/roam-depot-developers/page/uQSCwVKx0
- Contact me on Twitter: https://twitter.com/adam_krivka or email [email protected].
- Create issues and pull requests in this repository.
Spaced Repetition in Roam Research
Home Page: https://roamresearch.com/#/app/roam-depot-developers/page/uQSCwVKx0
For more info, see: https://roamresearch.com/#/app/roam-depot-developers/page/uQSCwVKx0
Studying for different courses, I'd like to repeat a specific deck at a time when necessary.
I'd like to have to offline variant in my graph, so I can be assured I can repeat when I'm not connected to the internet.
I'm not sure which pieces to add from the repo. Can you update the page on Roam Depot, please?
Am using roam/sr plugin, which does spaced repetition of blocks that contains the tag #sr (customizable).
The problem am facing now, whenever i do reviews of my #sr blocks then a reference gets built up internally. Over the period, looks like, the blocks in my roam graph is having more references of this sr plugin that of my own. Whenever i see a reference in the side, it is always related to sr plugin and it is kind of annoying. Any ways to over come this ?
Am sorry, if i had poorly explained.. may be you can understand it quicker by viewing this https://snipboard.io/d9DCLq.jpg
Just want to say this is not a criticism of the code! It's not unmanageable. Mostly I think it's a fun example for a more functional/reactive style.
First: defining the state
{
inSession: boolean
cardsToReview: Card[], // current card at 0
answerRevealed: boolean
}
a sketch of the main loop
state.cardsToReview = loadCards();
while (state.inSession && state.cardsToReview.length) {
await render(state);
const card = state.cardsToReview[0];
let [answerRevealed, signal] = await showAnswerOrSkip(card);
if (answerRevealed !== state.answerRevealed) {
state.answerRevealed = answerRevealed
await render(state);
}
signal ||= await getResponse(card);
updateHistory(card, signal);
state.cardsToReview.splice(0, 1); // or pass cardsToReview to updateHistory
state.answerRevealed = false;
}
render(state);
Let me know what you think. My customization stuff coming soon may help motivate the changes.
TL;DR: if possible switch the hiding method from "display:none" to "visibility: hidden", because otherwise code-blocks are rendered wrong
Hi!
First of all, thanks for your plugin. I really want to use it, but I stumbled upon a bug with displaying an answer that includes code.
I did a little digging in your code-base and I found the problem.
In "roamsr.showAnswerAndCloze" you use "display:none" to hide the answer-block.
This is not possible with a code-block because CodeMirror (the editor that Roam uses) does need the elements width, height etc. to properly display the editor.
See: codemirror/codemirror5#61
There is two solutions to this problem:
All the best,
Lucca
Sidebar opens automatically when a review session begins
In my review session today, after grading a card the same card would then be shown again. I had to show the answer and grade the card a second time to get to the next card. This happened about 3 times in the spaces of only 25 reviews.
It seems that it's simply the display that wasn't updated, while roam/sr correctly moved to the next card under the hood. When I finished the review session and checked my daily notes I see that there were 3 cards I didn't see during the session, but had been counted as reviewed.
I'm on Firefox. Will try test on Chrome during my next next review session.
I can't tell what's causing this. It doesn't happen every time, but about half the time.
There are two ways this issue happens, after I click the rating for the card:
During review only one of the block's clozes should be hidden (or more if merged). Each cloze deletion in the block should have its own SR stats.
After "show answer", I sometimes have many blocks, which extend to the bottom of the page. In this case, I can't click the blocks where they intersect with the button area. Could possibly be fixed by adding some margin at the bottom of the appropriate div.
I generally rely on the breadcrumbs to form the context for the "question" and have nested #sr blocks under it.
Example
* Topic #sr
** One line definition of the topic
** Theorem #sr
*** Theorem statement in latex
*** Derivation #sr
**** The derivation in latex
In the above case, when the topic card answer is shown, I want it's children to be collapsed, so that I don't peek into the cards in it's children. I can restructure the cards such that the definition has a separate title and card is added there instead of on the Topic line, but I feel that's redundant as the breadcrumbs by themselves provide the context for me.
I think this would involve just calling a roam api to collapse the children when the answer card is shown? I would be willing to give a pull request if someone points to the roam api and appropriate place to call it in the current codebase. (been long since I worked on javascript projects).
Hi @aidam38 ,
Thanks for the amazing plugin.
For some reason the left side bar is not showing despite the sr
questions show on my daily notes.
The error message is:
Uncaught (in promise) TypeError: block.page is undefined
reviewBlockToHistoryUnit https://serene-williams-db0c75.netlify.app/js/stable.js:671
extractHistoryFromQueryResult https://serene-williams-db0c75.netlify.app/js/stable.js:682
queryDueCards https://serene-williams-db0c75.netlify.app/js/stable.js:735
queryDueCards https://serene-williams-db0c75.netlify.app/js/stable.js:727
loadCards https://serene-williams-db0c75.netlify.app/js/stable.js:878
loadState https://serene-williams-db0c75.netlify.app/js/stable.js:1572
init https://serene-williams-db0c75.netlify.app/js/stable.js:1714
epB2 https://serene-williams-db0c75.netlify.app/js/stable.js:1722
newRequire https://serene-williams-db0c75.netlify.app/js/stable.js:47
parcelRequire https://serene-williams-db0c75.netlify.app/js/stable.js:81
<anonymous> https://serene-williams-db0c75.netlify.app/js/stable.js:120
What could be happening ?
Thanks,
Bruno
I had a question about the block references. How far back does the algorithm pull data from to determine the next review session for a block?
I would like to delete some of my older daily note pages without breaking the review schedule.
Thank you for the help!
Looks like it's trying to create a page that already exists:
When pressing "Again":
stable.js:1051 Uncaught (in promise)
message: "Error in create-page: Page with title 'October 2nd, 2022' already exists"
When pressing "Good":
stable.js:1297 Uncaught (in promise)
message: "Error in create-page: Page with title 'October 2nd, 2022' already exists"
No idea why this behaviour changed; Maybe there are some updates to the roamAPI?
This seems to only happen with the key, not clicking the button.
I didn't see the block ref under #roam/sr/reviews
, so I'm not sure what actually happens to the card. However the count does go down.
roam/sr was working amazingly for me this morning until at some point I refreshed my Roam and I noticed that roam/sr wasn't loading anymore. There is no "Review" element in the sidebar, and in my console I'm getting the following error message:
error as plaintext:
stable.js:201 Uncaught (in promise) TypeError: Cannot read property 'uid' of undefined
at stable.js:201
at Array.some (<anonymous>)
at isNew (stable.js:200)
at stable.js:247
at Array.map (<anonymous>)
at Object.roamsr.loadCards (stable.js:243)
at async Object.roamsr.loadState (stable.js:607)
It's almost certainly due to some new card block I introduced somewhere, but sadly I don't know exactly how or which one in order to narrow it down.
Thanks for this amazing extension!
I have a few dozen cards created using roamsr. The first two days I used the system, it worked as expected. Starting yesterday or the day before, I've noticed the following erroneous behavior:
When I click on either clickable portion of the roamsr UI ("start review" or the blue and green numbers), nothing happens. Both the blue and green numbers are 0 and have been for a few days. Today, that's because the [[roam/sr/review]] block in my daily notes is empty, and it's empty because I wasn't able to review yesterday or the day before.
Yesterday (Feb 17)'s [[roam/sr/review]] block has several items in it, all with #sr as a suffix. For Feb 16's [[roam/sr/review]] block, I see a mix of #sr and #sr #r/3, indicating that some review items were processed and others weren't.
The above behavior is on up to date Firefox (84.0.2) running on Mac OS 10.15.5. On Chrome (88.0.4324.150), everything works as expected. I do not see any JS console errors or warnings when trying to use Roam or roamsr.
This plugin has been working great so far but yesterday that changed. I haven't created new prompts in a while, but I have a stack of older ones I still want to review:
But when I click review, it loads for a moment and returns this outcome:
I haven't made any changes to the settings, script, etc. The only change I've done is to my roam theme, but the problem persists when I disable it and use the default theme.
Hi Aidam38
Just wondering if there's another way to activate SRS review--maybe through a hyperlink I can insert on the daily page. I ask for this because I tend to forget to do my daily SRS practice when cards or the link to it doesn't show up on my daily page. I understand that going through your flashcards in a deck like form ala Anki is popular but implementing it this way in Roam leaves the experience feeling less integrated or not affording engagement as it's segregated in its own dedicated view. Hopefully you can consider adding something similar to Roam toolkits implementation (but with your feature set)
Thanks
Currently, roamsr hides the left sidebar during a review session but does not restore it when the session is complete.
Suggestion: restore the left sidebar after a review session by default + add an option to preserve the current behavior if the user desires
Wondering how others feel about this. I don't like having to use both my deck tag and #sr to cards.
Hi Adam, I hope all is well.
I was using the image occlusion js with roam/sr; I would occlude the image and then nest the correct answer beneath.
However, recently I believe a Roam update may have caused the image occlusion js to not function—when you have the opportunity can you check if it's working on your end? (It's also possible that something in my graph is not playing nicely with it)
Thanks—take care!
Cesar
Would be good to have a deck level option for q/a cards that would retain the answer block in place in daily reviews.
This would allow q/a style prompts where the answer is actively developed over time, while retaining the historical record of previous iterations of the answer.
the option to do review cards before new cards would be a nice feature
Using the online variant. If I enter one of the key binds in the search bar it triggers that response for the current card and moves to the next one.
Add code below to hide toolbar when not in use, really useful when using roam/sr
(source: made modifications to original railcast theme from jmharris903)
/*RR change: SEARCH/TOOLBAR - Uncomment the following section to hide the tool bar when not in use. A great idea from @devon. Source: https://gist.github.com/devonzuegel/f54de76cbf0c0355d93e721c89f45787;
*/
#roam-right-sidebar-content > div {
border-bottom: none !important;
}
.check-container {
padding-right: 4px;
}
.roam-body-main {
height: 100% !important;
top: 0 !important;
}
.rm-topbar {
opacity: 0;
transition: opacity 200ms;
z-index: 1;
background: none;
/width: calc(100% - 40px);/
/padding: 5;/
}
.rm-topbar:hover, .roam-topbar:focus-within {
opacity: 1;
transition: opacity 200ms;
}
#right-sidebar button {
z-index: 100;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.