Userscript: Review Lessons in Duolingo
Last September, at the Duolingo Hackathon (http://blog.duolingo.com/post/62723181502/duolingos-inaugural-hackathon), a feature that would allow us to review lessons was demoed.
Well, the (entirely awesome) Duolingo team is really busy, and they haven't gotten to this yet, and I'm rather impatient (sorry), so as a late New Years gift I present...
The Duolingo Lesson Review (userscript)
Basically, it saves every problem so that you can come back to it later; either during or after the lesson. It highlights in red the problems you missed, and you can click on each individual cell to go back and review that lesson. There are also arrows for navigating forward and back.
At the end of the lesson, there's a "Review" button that takes you back to the last problem:
And there's a "Resume" button when reviewing lessons, which takes you back to the current problem or to the end.
The script is available on my GitHub page (https://github.com/HodofHod/Userscripts).
There are also instructions on how to install it there.
Notes and Warnings
- This has not been developed by Duolingo staff. It may not behave properly, and there will be bugs. It might do all kinds of nasty things, like mess up your perfect streak, ruin your speed record, or eat your goldfish.
- UPDATE: With the exception of reporting, all features should be available on reviewed lessons, including commenting, voting, audio, hints, verb conjugations etc.
- UPDATE: Discussions are now loaded on demand instead of preloading.
You can have my goldfish. It's the streak that I'm most attached to. Is my streak really at risk when I use a user script like yours or were you kidding? Thanks for coding this.
As @Eey91 says, It shouldn't affect your streak at all. You can always confirm this from the Duolingo homepage, which shows you your daily activity.
Good catch! Here have a lingot, and be sure to let me know if you have any more feedback!
The effect of the script is that I'm using timed practice most of the time now :) It helps to feel more confident and not to miss anything important in a rush. Though I've noticed it doesn't work while practicing words from Vocabulary section (may be useful for revising verbs, for example). Can anything be done about it?
Whoops, can't believe I missed that! Should be fixed now; have a lingot! I'm thrilled to hear it's helping you learn with Duolingo! :D
Excellent extension, works as advertised, at least in Firefox, and in Google chrome too (just made a mistake when I downloaded it).
Luckily for software developers, being fluent in one programming language, and being able to think logically can help you learn many languages with moderate difficulty. So, hopefully I can re-learn it once I get off my lazy bum.
Anyway, scripting languages are really simpler than 'real programming languages' in my opinion. Probably much simpler than learning a different romance language, if one is known already.
Somehow this makes me suspect you've never tried to do much with Bash scripting... and maybe not Perl, either....
IME, the real difference between languages, scripted, interpreted, or compiled, is how much thought has gone into its usability from a programmer's standpoint -- for instance, Python -- and how easy it is to test the individual expressions or small chunks of code as you work, which is often more a function of your programming environment, and how you've set things up for yourself.
Well, I can't say much about scripting languages though, I was mostly taught using C++, and Visual Basic. Java I learnt just a bit in my final undergraduate year.
I've wasted my spare time on:
and probably some others...
Thanks! I'm very self-conscious about my code, because it's all self-taught, and I haven't yet picked up on the coding standards, etc.. I'm getting it slowly but surely, though.
Thanks for the feedback, have a lingot! Let me know if there's any features you want to see, or something that needs fixing!
It seems, I hit the reply chain limit, so I'll respond here. I like the new changes, they are quite intuitive and easy to understand.
Regarding "beautiful" code, I remembered a quote I shared in a previous discussion that is perfect for this occasion:
“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live” (Martin Golding, n.d.).
How about, as if the person maintaining it will be yourself, when you have entirely forgotten what the hell you did that for, and also any of the logic of the code; and you will be trying to fix it under insane conditions, and the survival of A) your company or B) your client's company and C) in either case your job, will depend on getting it fixed yesterday.
This is IME quite as motivating, and also likely to be true.
So, you know more than I in terms of web-based development, most likely.
Don't worry too much about coding standards, there aren't many grammar nazis in the IT world, everybody dislikes seeing messy code, but IT people are generally more oriented towards functionality rather than beautiful code. Or at least that's my view, my code tends to be a complete mess, I randomly create variables with odd names, change them, and never comment things properly.
Anyway, I think it would be nice to :
- Keep track of the current lesson, maybe a border or something;
- Put a border or sign on the last lesson, so we know how to get back to it; and
- Perhaps some sort of counter or wrong / total answers;
That said, I think it is quite a nice attempt, even if duolingo implements it officially, I believe you should still try to make another one. :)
Thanks, I appreciate that a lot!
As to your suggestions;
- On my TODO list (in the code, even).
- Hmm, there's already a "Resume" button, but I can do this too. Any idea what that might look like?
- Good idea! I think I'll put that to the right of the progress bar. I have to think where to put it on the final page, though.
- Yes, I saw it no.1 there, just reinforcing that it is a good idea;
- Simply a golden border around the lesson the user is currently looking at; and maybe another border on the last lesson; and
- Glad to see you're adding that;
- So, last update added navigational arrows and a styling for the selected lesson that makes it look like it's depressed.
- I'm not sure how to style the current lesson, since it's sometimes colored and sometimes blank, and making it look unpressed hasn't worked so well yet. Borders also look pretty off.
I think maybe I'll just stick a ->> arrow next to the ->. That plus the "Resume" button ought to be enough, I hope.
- Still working on this.
That's why the code is weird! I had to make it cross-browser which means hijacking a lot of Duo's site js. I want to talk to whomever it is that wrote that. :D
Well, you have a list of staff members, I think the software engineer is probably the culprit. Although it is likely that it was a team effort, so it'll take more time to find whodunit.
I didn't mean that they did it badly! :D Once it's unminified, it's not terribly hard to read. But it is a rather large web app, so there are some parts I'm still not clear on that I'd like to be.
I see, I doubt he/she/they will say anything. I'm not sure if it is a rule in the company or a personal preference. But staff members don't mingle too much with users, they will generally answer a short question, or request more information/provide information, but not much beyond that.
In a way, it prevents them from saying something that they may have to take back, or perhaps, prevents them from getting involved in many controversial and lengthy discussions around here.
Anyway, software development is an adventure, if they told you, it would not be as fun to unravel the puzzle. :)
Are you updating the design soon to reflect the new design? (which isn't a big deal)
I updated it so that it works properly on the new design a while ago. Are you saying I should change the UI? I think it still matches pretty well. (Or do you have the new one, and you're experiencing bugs?)
Either way, if your browser doesn't auto update your scripts (like Firefox with GreaseMonkey), you may want to check out my latest script, Duolingo - All Scripts. It automatically loads the latest versions of all my scripts, plus any new scripts I might add later. If you only want some of the scripts/mods, you can enable or disable individual features in Duolingo's Settings page.
I think you probably use Duolingo Mods, which I posted about last week (https://www.duolingo.com/comment/1607651$comment_id=1617620).
Duolingo All Scripts takes it another step by just loading the latest version of Duolingo Mods. That way, I can update Duolingo Mods to add more mods, or new scripts, and you don't have to update anything at all. It seems a bit convoluted, but it works very well for me, and I hope it makes it more convenient for anyone to use.
Btw, I didn't document the enable/disable settings before. Did you happen to notice them?
I saw "Duolingo Mods" and my first thought was "Wait, there's a script for mods?? What have I completely missed here!!" lol
HodOfHod, you should make a guide for how to make DL Userscripts and stick it on the Duolingo Wikia. (This from someone who knows nothing about what a userscript is, how it works, etc. I'm still at that stage where I thoroughly believe that you can and are doing real magic. ;)
lolz. I'm content at the moment with what I've got on screen. And if anyone else wants a mod screen, they'll have to work really hard, be on all day, and cross their fingers when Staff starts inviting more people. It'll be tough competition though, there are just so many awesome and helpful Duolingoers to pick from. :D
Edit @856pm, yeah it just took my brain a moment to click into gear. ;)
Oh, I don't actually want to be a mod, I've done that sort of thing before, and it requires a lot more time than I currently have for it. :D Not to mention I'm not on Duolingo nearly enough in the first place.
Shucks, I forgot to reply to your guide suggestion.
- I didn't even know there was a Duolingo Wikia!
- I'd probably be terrible at writing a guide :( On the bright side, there are probably a million userscript guides out there that can be adapted for Duolingo.
I hope that makes some sense, otherwise, you can just fall back on the "magic" thing. Sounds cooler, too. :D
I just now discovered your script and it is so awesome. Thanks a million for that.
Really nice work, actually. So, as we used to say when code was still punched on rectangular cards, "dude this is freakin' awesome".
:D Back in the days when bugs were real, and weren't the programmer's (seg)fault. ;-)
Little glitch: Yesterday when I finished "Lesson practice" the continue button became unresponsive. Thankfully word strength was updated.
Hmm. I haven't been able to duplicate this. Does it happen every time for you? Did you review the problems before trying to continue?
I think I have found how to replicate this. You see, DL displays at least two screens after you finish a lessen: first, you have finished blabla; second, you strengthened these words blabla. If you click "review" button before DL finishes displaying these screens, the "continue" button will become unresponsive. I hope that helps.
Ok, I've pushed an update that, I hope, fixes this. Let me know if you still see problems! :)
Yep, I'm seeing it now, thanks for figuring that out! Now I'm trying to figure out how to fix it without changing the UX too much. The simplest would simply be to disable the Review button until everything is loaded, but I'd like to find a better solution. Here, you both deserve a lingot!
Yes, I don't think the review button is really necessary, since we can always use the back and forth arrows to navigate the previous questions.
After a successful lesson; Duolingo removes the header with the arrows, cells and hearts. I could (in theory) also show the header on the end view, but I don't think that would solve this particular problem.
It only happened once. Yes, I reviewed the problems before trying to continue. Also I was reviewing them before I was finished with all 20 sentences. I am using firefox 26.0
Just two requests:
Add the review button to the successful end view.
Get rid of the (css?) gloss to fit the new design.
Sorry for the delay:
If the review button isn't showing on a successful end view, that's a big bug, it should.
I'm not exactly sure what you're referring to :(. The gloss on what?
That was when I was still on the old design. There were a few bugs with the old design+new version, but now we're all on the new design, so that's fixed.
I have couple of ideas regarding your userscript. Btw it think it's great. It helps a lot.
Could something like this be done?
Could the progress bar show the number of comments in the discussion ?
That way when you're finished with practice you don't have to go through all of the exercises in order to check those with comments.
Also since it doesn't look very appealing I was thinking it could be switched on/off.
Another idea is to have clickable arrows on each side of the sentence discussion in order to view only sentence discussions when the user is finished. Instead of clicking several times to view the discussion this could reduce it to only one click.
I think it would work even better if we could go forward and back by pressing right and left on our keyboard.
After the last update which included the removal of the hearth system, the exercises layout was changed a little bit as well.
Even though the script stills works fine, I wonder if it could be possible to tweak it a little bit to fit the new update since it has some graphical bugs. Here are two pictures, one with the script activated and how the interface looks when I disable it. Since I know nothing about programming I guess this is the only way I can help.
Thanks so much for letting me know! I'm not sure exactly when I'll have time for this, nor am I sure exactly how to update the script to suit the new interface, since it doesn't have a set number of lessons nor a position indicator like the old one. I'm thinking maybe something like "← current lesson / total lessons →" centered above the strength bar.
If you have any input/ideas, let me know :)
The script still works as it should, even though the bar is different it keeps track of every individual exercise including those sentences in which you don't answer correctly, you can go back in the same order of exercises (I just tested it). The only difference is that the new bar does not move but that's not an issue.
My suggestion is only about the layout itself, changing the positioning of the arrows since one gets covered by the bar itself and the lesson icon doesn't match its correct position, I don't know if that would be difficult to change, either way it is not something crucial, my intention was to let you know so if you have time you could check it, it would be nice to have your script up to date =).
Sorry for the delay. I've now fixed this and uploaded the new version. Please give it a try and let me know if it works for you!
Hello! I was recently updated to the new DuoLingo website.
Unfortunately DuoLingo has taken away the Review button that used to be present at the end of lessons.
Because this has happened, I was wondering if you would consider revising your old script to work again in the new site, so that we could get this function back.
I really miss this capability, and would be so grateful if you could make this happen.
This is a great hack, but when the Duolingo people do it officially, I think it would be improved by giving actual links to the lessons which help with the issue causing the error. This could be done by creating an association between words and the lessons they appear in, so that when you choose an incorrect word, Duolingo can take the correct word, lookup which lessons that word appeared in, and then shoot those links back at the user. This will eliminate the need for users to track down those lessons themselves and thereby make it easier to correct issues and misunderstandings. (I just want to add this here, in the hope that such a feature is not overlooked by the duolingo people. Apart from that, this hack is very useful. Thank-you!)
So I've had a look at Duos code, and it looks like they've made a huge change to how they compile and shrink it. A lot of the objects in the code no longer have meaningful and easily accessible names (like duo.TimedSessionView.timer_view) but instead nonsensical names that aren't easily accessible the way the older ones were.
I'm going to have to keep looking, and see if I can figure out a way to work around this.