Duo Strength Update - v1.2: Cracked Skills & Listen and Translate Exercises [Browser Extension]
Just a quick one to say that I have released v1.2.0 of Duo Strength, adding a couple of new features that I have been working on. It has been nearly a year since I first posted about Duo Strength, I just want to say thanks for the support, I'm very happy that people find my tool useful!
There are two main new features:
- List of cracked skills at the top of the tree so you don't have to hunt for the cracked skill icons in the tree.
- Optional hiding for the question text in translation questions from the target to the native language.
I think the question hiding is a really useful feature that is missing from duolingo. This turns translation questions into listening questions, which is harder and a possibly more useful skill. Now you will get questions where you have to listen to a sentence in the language you are learning, and type out a translation of this. If the question is ever too hard and you don't know what is being said, you can just click on the blurred out sentence to reveal the text.
This feature can also be turned on and off using the new button next to the question text. You can of course also toggle the feature on the options page, as well as turning on and off the enable/disable button itself.
You can see more details about the new features in the v1.2.0 Release Notes, or you can check out the full list of changes for all the past and future releases in the CHANGELOG. You can see the previous forum post for v1.1 here to read more about the other feautres in Duo Strength.
Here are a couple of screenshots of some of the new features:
Thanks again for all the support!
Duo Strength is open-source and released under an MIT license. If you are interested in helping develop the extension or are just interested in looking at the code, you can visit the project on GitHub; you can also open an issue there or comment on this post to report any problems.
From the tree.
It's not a lesson that's in the lists - it's the next one down for me, rather than a cracked (they're done) or a "strengthen".
(Chromium 79.0.3945.79 on Ubuntu 19.10, from the repo. uBlock Origin installed.)
If I turn the extension off, behaviour's back to normal. Do a lesson, back to the skill in the tree.
Turn it back on again, do a lesson, back to the top.
@AdrianC602 Hi again,
I am just about to push out a patch v1.2.1 which adds a new option to disable the focusing on the first skill in the lists. This stops the scrolling behaviour you were seeing.
I will need to put a bit more time into the updating of the cracked skills list after a lesson, so that will be in a patch soon. I hope this helps.
Yeah I have just tired it myself and it does jump back up to the top if there is something to be displayed there. I can see how that can be quite annoying.
Though not ideal, right now if you aren't interested in the needs strengthening or cracked skills lists, you can turn them off in the options menu. This will then give you a link at the top of the tree to the next skill to finish. Note however, this will only suggest the skill you want if you are doing them in order, top to bottom, left to right.
I will add this as a thing to look at. I think it is caused by the first link in the list being focused for mouse-less access, you can just hit enter and it will do the first skill in the list. Focusing it does seem to bring it back into view though, something I wasn't aware of.
I hope this is of some help,
NB to get to the options page, the easiest way is to right click on the duo strength icon in the top right of your browser and click options.
Dude this is super helpful. I have been closing my eyes for months to "hide the text" and now I have to break that habit. I don't really like all the red showing where I need to go practice but it is good information, even if I don't like seeing it. Well done. Thank you.
The text hiding feature is SO. GREAT. Not being able to read the question/sentence/clue is really improving my listening comprehension. It's slowing me down, too, since I now have to listen a couple of times to make sure I've really heard what is being said. Slowing down is also helping me avoid silly going-too-fast mistakes. Thank you for this extension. Excellent work!
How interesting! I'm doing exactly the same thing. If I can't read it, I automatically type what I've heard instead of the translation. What an odd response. I guess it's another excuse to slow down and take my time.
Seriously, @ToranSharma, this really is a great tool; thank you for providing it to this community (and for being so gracious about bug reports and fixes!).
In which languages are you doing Stories? And on what platform? I'm using the desktop version with Chrome as my browser, and I can't tell any difference with Spanish or German. Since I really like the text hiding feature, I'm eager to get it working with the Stories for better listening comprehension. Thanks.
Jinx! I was about to post a question about whatever "strength" on duome means, but did a search first and found your "duome strength" post of a year ago, read it, and was still at a lost, so was about to post a question on it when I saw this post fresh at the top! Naturally, I installed the Opera add on. Styly!
From your code on Github:
// Horrible hack but works...
// We insert the xhr code into the body so that it excecutes there.
// The response text is then inserted into another element in the body.
// Back in content script we wait until the data has been written to the body.
// We then send it off for processing and remove the inserted elements from the body.
Why do not want to use window.fetch function? It is based on Promises, so it is completely asynchronous.
In short CORS/CSRF issues. I tried for a long time to do it any other way but this is all that would work across chrome, firefox and opera.
The issue first showed itself after a firefox update, I can't remember exactly which version. But since then if a cookie has the sameSite flag set to lax or stricter, the jwt_token is not sent with the request to duolingo.com/users/USERNAME. This leads to a 401 Unauthorised error as we aren't authenticating the request as a logged in user.
I'm still not sure if this is a firefox bug or desired functionality, as it did work previously with normal XHR code executed by the script. But since that update it has to be executed in the page context for the cookie to be allowed to be sent.
If you think you know something I don't, which is very possible, feel free to submit a pull request and I'll change over to a different method.
Hope that made sense. Cheers,
EDIT: Curiously I have just noticed that the jwt_tocken cookie doesn't have SameSite set to lax on the forums, just on the main pages.
EDIT2: Actually it was a 401 unauthorised not a 403 forbidden, you can see it yourself if you go to duolingo.com/users/ToranSharma in incognito mode.
I should also say that if this is desired functionality by Firefox then it doesn't actually stop an extension from sending a request with that cookie, as demonstrated by the request method I use in the extension. I believe I remember seeing something about changes to how the SameSite flag is going to be treated in some recentish chrome release notes, so I would need to test, but the old, normal xhr or fetch, way may not work for chrome now, or soon, too.
Hmm. I have no problem with CORPS and fetch in FireFox on duolingo. I did not review your script carefully, so I might miss something. If you want you may have a look at my script that real works on duolingo and uses the request to /users/username: https://github.com/liuch/duolingo-scripts/blob/master/duolingo_profile.user.js in the function called
Hi again @FieryCat,
Just had a quick look at the code you linked to, I think I now understand what you were getting at about using fetch for asynchronous requests. It looks like your code injects all the functionality into the page itself to be executed there, I assume that is how it functions as a userscript. As Duo Strength is an extension its execution context is not exactly the same as the duolingo page. That is what is causing the CORS issues. I get around this by injecting just the userData request part of the script into the page so that is executed in the same context as the page itself. This avoids the authentication issues, but keeps the vast majority of the script running in the extension environment.
I should probably use a mutation observer to detect when the response text has been inserted into the second script element, currently I am using some sort of loop with a timeout to check check when it is there.
The last 2-3 (at least) versions do not work anymore with Firefox V52.9.0esr :-(
I know for sure that your "DuoProfile" worked before just fine.
There is a concrete error in the browser console still with the latest V1.2.4 update from December 2019:
"TypeError: Not enough arguments to CSSStyleSheet.insertRule" - add_css_rule"
I am not exactly sure what thread to put my report to.
Quote: I think the question hiding is a really useful feature that is missing from duolingo.
There were 1-2 userstyles projects which did this but which only supported forward trees.
One allowed you to even combine two techniques and to fully type out your listened sentence in a 2nd text box (which obviously only makes sense if you have the time and you use the "normal practice" exercises or you are working on a L1-L4 or new L0 lesson (and not timed practice).
I hope I find the forum links of those projects again.
Are you aware that Camilo's Tampermonkey / Violentmonkey userscript "Duolingo Tree Enhancer" does this for:
- L2 target text in forward trees
- L1 source/base text reverse trees
- multiple-choice challenges incl. M-C answer options
- all configurable in the settings (a special button on the Home/Learn page):
Being able to turn it ON or OFF (e.g timed practice) in the lesson itself - like your blue button - might be a good thing.
You can use the hotkey "Ctrl + Alt + H" to unhide the question and "Ctrl + Alt + K" or "Shift + Space" to replay the audio which Camilo's userscript additionally activates for my three Portuguese trees.
In one of the other userstyle projects I posted that I would find it beneficial (e.g timed practice) if the text would be unhiding itself after the audio was played with some delay.
But Camilo additionally supports Google translate TTS audio for my Portuguese language and I have no clue if you have information when the play action is finished.
With Camilo's userscript I sometimes I have to replay the audio 2-3 times to be able to understand longer and more difficult Portuguese sentences when I am hiding all texts.
Sometimes I have to use the unhide hotkeys after the 1st or 2nd time (timer is ticking), sometimes the Portuguese sentence just can stay hidden and I clearly know the answer / translation.
Hi again Thomas,
I was not aware of any of the userscripts you mention. I have plans to expand how the hiding feature works, similar to how you describe some of the userscripts working. For example I would like to add the option to have the feature automatically enabled or disabled depending on the crown level of the skill being practised, say L2/3. I also have had the issue that it does take longer to do these questions so it isn't best suited to timed practice; I would also like to add an option to automatically disable it in a timed practise mode.
The later of these shouldn't be too difficult to implement. As far as keyboard short cuts go, I hadn't considered adding that as a way of revealing the sentence, currently you have to click on the blurred out text, or disable the feature using the new blue button. I am all for mouseless functionality, so that will be one of the next things I look at adding.
Having an automatic timed reveal is also a good idea, I'll look into it.
I had not considered reverse trees, where I suppose the language you are learning is considered native to duolingo, so translation questions in that language will not have the audio element. Currently for these questions the question hiding will not be applied, as the speaker button is one of the requirements for the feature. I can look into implementing an external TTS engine for such situations.
I've just seen the new button right now (blurry the text) , and I'm delighted!
To be honest, I was ready to uninstall this extension, as it had no real benefit for me, but now, it's a huge benefit!
Please, make a way in your extension to remove the awful word tiles, and the rest of the awful kidlike features. I'm bored.
I glad you find that feature useful, I may look into converting the multiple choice questions into listening exercises too if I can work that out! As far as the word bank goes, if you are using duolingo in a browser, I think there is always the option to click the 'use keyboard' button at the bottom of the page. I think this is available for all langues, maybe except any that use a non latin script - though even then I think it still allows you to type with the correct keyboard input method.
I don't have this option. That's the problem. I have to wait until crown level 5 to get (a bit) harder content.
I need to write to memorize, so all the word bank questions are a loss in efficiency for me.
The multiple choice questions are also completely useless, as we guess the answer even without being to understand each word. I hate it. I don't like those new Duo improvements. I understand they are improvement for people who get discouraged easily, though.
Like ToranSharma said, if you're using it in a browser, everyone has that option, so you do have it. If you want to use your phone/tablet, just go to Duo on Chrome or whatever browser you use, instead of using the app, and that way you can use your phone/tablet while still having the option to turn off the word bank. Or just use your laptop, as I do. Plus I believe that some people - although maybe not all - can turn off the word bank on the Duo app....actually, I think I can, but I can't remember, as I always use my laptop for Duo these days. Well, point is that you do have the ability to turn off the word bank, and type the answers...I've been doing it for about the past year, and I love it; I'd really learn very little if I just had to use the word bank.
Hello, i have added this as per your advice on top for chrome, but when i go to my duolingo tree and click on a lesson when the page opens up i still see the text and no button for ''disable text hiding'' or anything like that is ... how do i get it on my duolingo then please? as i think that would be really useful for me and my learning? thank you :-)
thank you so much for getting back to me so quickly! :-)
you are right, i have two languages i am trying to learn, german and spanish ... so the trouble is with german one ... when i switched to spanish the bars show there and when i open an excersise it does show me the button for hiding it and text is blurred however not in the german one :-) ... as to the strenght bars, they do shows in both german and spanish under each skill however in german they all show 100% but in the spanish one - it does show me where i am week and different percentages which i find very useful to let me know where my weaknesses are ... really looking forward to the feature as i believe it will be most useful! :-) One more thing, this hiding thing - is it only for skills that i am learning or is it suppose to be able to hide the text also in ''practise'' ? when i finish the skill and then i can practise it - as in neither spanish or german the ''practise'' does not offer the ''hide text'' option
also really appreciate the speed with you answering to me, that is brilliant and very valued my end! thank you!
Hi again @EviMachova,
I will look into German not hiding the question text, I have not seen individual languages behaving differently before.
The text hiding should work for lessons and practices, I will check to see if I can see an issue that is causing it not to work in practices. Note that if the sentence contains a new word that is in yellow, the sentence is always shown so you can learn the new word.
great i will try the practise now and see how that goes :-) in my trea it works now :-) maybe it always did in case the hide text appears only with ''old'' sentences i should know already? :-) i did not know that so if i made a mistake i apologize ... will try the practice
Hi Toran, right, just tried the practise in german and the same thing - it appeared half way through so i suppose it is the case of the hide text button appears when there is something i should know about and it will dissapear when it is a new sentence / word ... which i appologise for i didnt know and thought that the button is there at all times , my mistake it looks like and hope i did not waste your time thank you for looking into it much appreciate it!!
Thanks good! I will look to see if I can find any issues that may have caused it. This feature currently only works with questions where you have to translate, either by typing or with the word bank, I will look into making it work with other question types, like multiple choice in the future.
Thanks again for the support, I hope you find Duo Strength useful. Let me know if you have any other issues and I will continue to try my best to solve them.
Great app, slows loading a bit and sometimes feels like it gets stuck on the last sentence and won't finish the lesson. It only got completely stuck once the first time I installed and when I went to check it counted like I finished it. I have had this problem once or twice even without the app but the app makes it happen more often.
As far as I know the delay at the end of a lesson is nothing to do with duo strength, it isn't doing any work at that time. The slower main page loading is unfortunately necessary to some extent as the tree itself needs to be fully loaded for Duo Strength to process some of the information. I'm sure some optimisations are possible but they won't be massive.
The question blurring would be massively more useful if there was a keyboard shortcut to reveal the question, rather than a mouse click being required.
I touch type, and having to reach for my mouse slows me down so much that I won't be able to use this feature as it stands. Sadly, because it's an awesome idea.
I am so going to try this! Thanks! Listening is my worst skill in my target language, so this will be fantastic. Since Duo is focused more so on reading skills, I try to balance things out by listening to music and watching interviews/news/etc on Youtube in my target language, but this sounds like another great way to help with my listening. I'm heading over to the Chrome store now.
I am using it on Chrome, for French mainly, and it's working perfectly. I took a peek at the other languages I dabble in a tiny bit - French is my only focus really for right now - and it also looks perfect on Spanish, Hungarian, and Vietnamese. Thanks again so much! Being able to blur out the sentences is such a great idea!
A prediction for finishing the tree, i.e getting all skills to at least crown 1, is given in the crowns popup box. It will say something like:
"At your current rate your tree will reach Level 1 in X days, on Y date"
This the tree level is given about the breakdown of how many skills are at each crown level. Level 1 means finishing the tree, Level 2 means every skill is at at least crown 2, and so forth.
Checkpoint reaching predictions shouldn't be too hard to add. I would need to find somewhere to put that info. I'll add it to my list of things to work on.
i've installed the extension and tried it with esperanto yesterday, but only few sentences got that blurred effect, and the rest were as usual.
however, when i tried it again today, it was perfectly fine, and all the "translate to english" exercises had the esperanto sentence blurred.
do you have any idea about the reason for it not functioning at first?
great extension, though.
Not exactly sure, another user seemed to report similar behaviour. If you see it again can you confirm that there are no new (yellow) words, as the hiding is disabled if there are, in order to let you learn the new word. Often Duolingo will get this wrong and you will have seen this word before though.
The add to desktop button installs it for your desktop computer, from your mobile device. I fortunately chrome for mobile devicws does not support extensions. However Firefox for Android does, so if you want to use it on your tablet, you have to use Firefox.
Hope this helps,
i installed it but when i do a skill that is not 100% it doesn't improve by practicing it.. besides i expected general practice to automatically take on skills that are not at 100% strength. i cannot remember the last time i got a vosotros type sentence (in spanish) though and a skill that was at 50% which i did because of this plugin was all using that.
There is a know Duolingo bug that, some skills that are at 25% are stuck there, that could be what you are referring to. Regardless, the percentages are calculated and updated on Duolingo's end, Duo Strength just displays these. So unfortunately I am at a loss about the unimproved skills, perhaps the skill was a 'dead/fixed' skill as mentioned previously, or you did not notice that it went from say 25%->50% or 50%->75%.
Sorry I can't be of more help, I hope that you still find it of some use to you.
no they didn't move.. but i assume 25, 50, 75 and 100 are the only possible percentages, as that's all the skills are at. i just keep doing the general practice as always i think.. i assumed that that would automaticall go to skills that have gone lower, but maybe that's not true.
It would be nice though if it wouldn't scroll back to the top every time you get back to the tree.. when you're doing lessons on a skill that's scrolled down a bit everytime you need to scroll back there.
The hiding of sentences is good, but i need to get used to it, cause for some reason i keep typing the spanish/latin sentence that i hear in stead of translating it.
I did download this extension. I'm using it and liking it. However, a website popped up in its own tab right after after I downloaded it that was some kind of pornography hook and I got a message from my security software program that an attack had been blocked. Don't know for sure that it was related, but the timing was very close.