ファブリス
Administrator
From: Belgium
Registered: 2006-06-14
Posts: 3699
Website
I'm looking at the flashcard review code and I don't understand why I programmed it the way I did. Maybe you can think of reason why I did?
I could have loaded all the flashcard data at once when the user starts a review. Even if it weighed 200-300 kb that page is loaded just once at the beginning of the review. All answers could have been stored locally as well in a javascript array, and sent to the server only when the review ends.
This means the user could open up the review page on their mobile device / tablet at home in the morning, get onto their bus or train, and review for half an hour, say, and when they get to a wi-fi spot, end the review or click "reconnect" to sync with the website. It's a bit crude but it would have provided some offline functionality, plus made reviews faster when the mobile network is weak.
The only downside to this, is that the user can lose the whole review session if they mistakenly close the page in their mobile browser, or the app is cleared from memory for some reason. The more you review at once the more could be lost.
On a desktop the user would be warned by the javascript dialog if closing the page before the review ends. The user could also get into a habit of ending the review earlier, to split it in two sessions, to avoid the risk of losing many reviews if they are taking a break away from the computer or someone else needs to use it. You just click "End" and click the orange stack again later.
So I'm quite puzzled really as to why I didn't just load all the flashcards into the page and let the user review with connecting to the server until the end of the review.
Do you see any reason not to do it that way?
Daichi
Member
From: Washington
Registered: 2009-02-04
Posts: 382
Can't save any of this data locally as cookies or something just in case the session dies? For each question, shouldn't you just need the answers and an ID hook to the questions they belong to?
Edit: I also will note, I think it's common for a programmer to look at his old code and wonder who the hell wrote it. I know it happens to me, lol.
Last edited by Daichi (2012 May 07, 5:53 pm)
ファブリス
Administrator
From: Belgium
Registered: 2006-06-14
Posts: 3699
Website
Yes, certainly the answers could be saved locally although it wouldn't help restoring the review page if it's closed when offline.
A new offline mode is a whole different ballpark. What I'm wondering is why I made it so that the server has to be contacted between the start and end of the review, seeing as there is so little data.
Reviews take time, so potentially there was a possibility to do reviews while on the bus or train, without wi-fi. I mean SRS reviews here, of course it's always possible to create a standalone page that works completely offline without the SRS.
Stories is one issue. Although all stories could possibly be downloaded with the page, 500 bytes x 2000 stories that'd be potentially 1MB data in the html page for a 2000 card review.
But what's the typical scenario? Typically the user will review less than 100 cards at once. So I could easily load the first 100 stories, giving access to the Story Edit dialog, even when offline.
Yuta73
New member
From: Argentina
Registered: 2009-10-07
Posts: 8
Actually, I'd prefer the new way.
I usually connect through and EDGE network when off the office, and it's so slow that have to push "Reconnect" many several times a session. But from times to times, I loose the RECONNECT button and also the END button, having no choice but to leave the page and restart the review. When this happens, normally I lose the last or so 15 reviewed cards, the rest was remembered. Some bad days the whole thing can happen 3 or 4 times.
So for guy with slow connections like me, It'd be great to have that functionality.