Userscript: Tree Enhancer
UPDATE: Still working as 2019/08
User script for a better experience when using Duolingo, forked from the now defunct Reverse Tree Enhancer.
What does it do?
The following options are available:
- Keep per-tree settings for listening/speaking exercises.
- Make all the exercises listening exercises (hide the question). Text can be revealed hoovering the mouse over it.
- Read answers aloud.
- Hide clues (e.g pictures).
- Make Duo better for reverse trees.
Where does it work?
Desktop version: It has been tested with Firefox and Chrome.
Mobile version: It has been also tested on Android with Firefox+Violentmonkey.
Please let me know if it works with other setup.
Follow the instructions in github.
After installation, a new button will appear on top of your tree. Clicking on it will display a configuration dialog.
Most options are
allegedly self explanatory, and the top button will provide some configuration templates.
- Version 1.1.0 New keyboard shortcuts
- Version 1.0.32: Update to allow hiding new words.
Now we finally have Japanese and Korean, and the userscript is not working again. Thankfully the design has not changed, so I'll update the script in two stages:
- An update today for Translate and Judge (select right translation) Challenges as they are the majority of challenges.
- An update for Name the Picture and other challenges as soon as I have time.
Excellent work! Thanks for this.
Include a brief description of the tree types. (What does "Laddering" do? What does "hide pics" hide?)
A little problem with the script reading the answer to the previous question while I'm answering the next one. Needs to be either cut off (when you ((Continue)), or an option to disable it.
do you have any double-loading problems on the "Home" (tree) page with activated ads and NULL (tree) exceptions error message in the browser console?
I have described my problem in more detail here: https://forum.duolingo.com/comment/29195158$comment_id=29196125
I definitely could see the initial loading log message twice!
Thankfully with "uBlock Origin" activated (with or without enabled rules) everything works fine.
As usual, the main problem is lack of time.
Firefox V52.9.0esr behaves weird in the console anyways, e.g:
"XML-Verarbeitungsfehler: Syntax-Fehler Adresse: https://excess.duolingo.com/batch Zeile Nr. 1, Spalte 1:"
I don't think it's worth to waste time here....maybe I will try on another (not mine) computer with Firefox Quantum.
great, I found you script thread again. Hurra!
Thanks for offering your hard work to us.
What I am looking for:
- reverse tree (e.g EN-DE):
- turn off L2 target German select the right word from box question
- auto change settings to speaker OFF (let not Duo prompt for L2 German "type what you hear" questions (as native German speaker, you do not want L2 German target questions)
- all the rest from the old reverse tree enhancer script (specifically TTS for EVERY question, no matter if multiple-choice, choose-the-right-word, translations where some have no sound on DuoLingo.
- forward tree (e.g EN-PT):
- TTS read answer for EVERY question, no matter if multiple-choice, choose-the-right-word, translations where some have no sound on DuoLingo, after you have successfully entered the answer (after check, before continue)
ALWAYS play the audio for L2 target Portuguese (DuoLingo only plays audio when the PT sentence is on the left side, not when the L2 PT sentence/word is entered on the right side)
use the speaker settings with default ON (auto-play left side sentences, either PT or EN/DE)
What really sucks with the normal script is, that I have to manually adjust the audio settings ON/OFF when I am doing 3-4 courses (OFF for reverse tree).
- setting per course if I want to hide the left side sentence and/or multiple-choice answers, like in reverse tree enhancer:
For reverse courses like PT-EN/DE, which I may do in parallel, I do not want to hide the left side L1 Portuguese sentence. For laddering courses Spanish-Portuguese, Portuguese-Spanish, etc. I also do NOT want to hide any given text (too difficult for me to listen at this stage).
I will try it out, thanks again!
- You can't disable listening questions per-language. No script can do that, sorry.
- If you are doing the reverse tree (EN-DE) it won't read aloud questions in English, but will read all translations and multiple selection questions in English.
- It is not easy to use TTS for the answers in multiple selection. I have tried to make it work with no good results so far.
- "Select the right word"-questions don't have a way to read them.
- You can decide what text to hide in the configuration box, as you can see from the picture. It has also some pre-sets that will help you to configure it for the type of three you are studying (reverse, enhanced-forward or laddering).
Thanks for your script code updates to be working for the new DuoLingo (2017) portal code, announced by DuoLingo team about migration/rollout threads earlier.
My user account got migrated some days ago.
It is soo sad to loose all the old DuoLingo portal + 12 user script functionality all at the same time :-(
I successfully tested your script in my EN->PT forward tree course and playing Portuguese audio from answers on right hand side EN-PT questions.
I will gladly take a look at my PT->DE and PT->EN reverse tree courses and test your script for the reverse functionality on the new DuoLingo portal.
Thanks for your hard work Camilo!
I definitely could NOT live without your very great script!!!
Good to know it is working! This is the current status:
- Sentence translation is working; it can read text and hide the challenges according to configuration.
- Multiple selection is working. It can also read the right answers (that's new).
- "Name the picture" could be working.
- Other challenges are not working.
The biggest problem I have now is that challenges involving pictures only appear in the very early stages of the tree, and just now I all my trees either completed or quite advanced. So I simply have no way to test what do they look like in the new site.
Please let me know if something is not working as expected.
I am somehow concentrating on my forward EN-PT tree for the past weeks.
Reverse trees PT to EN/DE are still in the very beginning of the skills and I do not do them in parallel anymore at the moment (and I probably won't in the near future with the loss of the "DuoLingo course switcher" user script).
So I may be in fact able to test a little bit your script updates...
Quote Camilo: Sentence translation is working; it can read text and hide the challenges according to configuration.
Multiple selection is working. It can also read the right answers (that's new).
Other challenges are not working.
I noticed that : -)
THAT is good news. Much appreciated!
Quote Camilo: "It is not easy to use TTS for the answers in multiple selection. I have tried to make it work with no good results so far."
You are my hero :-)
I believe I am remembering that it was working for the original reverse tree script) per my above request, so yeah, really good news for me:
" What I am looking for:
- TTS read answer for EVERY question, no matter if multiple-choice, choose-the-right-word
- ALWAYS play the audio for L2 target Portuguese (DuoLingo only plays audio when the PT sentence is on the left side, not when the L2 PT sentence/word is entered on the right side)."
As described far above, right hand answers in PT already works with YOUR script for the forward tree settings.
This was NOT working with the original reverse tree script before (of course).
The "choose the right word" challenges very often do use quite short sentences.
I guess I have no need at the moment to find a workaround to play Portuguese answer audio for those challenges.
(Longer) L1 (source)-L2 (target) (e.g EN-PT) sentence translations and multiple-choice (again quite often longer sentences) are much more important to us.
I am excited about this, but it doesn't seem to be working for me. Actually, none of my scripts running through Tampermonkey are working with the site anymore... does anyone know if there's any way to fix this? I was working on my English from Spanish reverse tree, but now that doesn't work. So it's really slowed my progress and tamped down my motivation.
I assume this could be a result of something like the new site, but I don't know for sure. It's just that this script isn't giving me the button. And the old script's button is gone. The easy accent script isn't working either...
Hopefully this can get figured out so I can try this script!
I am using Camilo's script successfully with Firefox V50.1.0 and the Greasemonkey plugin.
Are you using the Chrome browser because you installed Tampermonkey?
Have you even enabled his script? (just a question in case that your system might have got it wrong after installing it) :-) :-)
Are you using his latest version?
You can manually install the latest version going to the github.com repository and clicking on the raw link.
Sometimes you have to manually click on "check for updates" with those plugins, as the auto updates fails (or is not triggered).
One more adding request for you (maybe you have already thought about it or checked if this workaround is possible somehow):
Turn off multiple-choice questions for forward courses and/or (better) turn those into "full typing" excercises.
As you know, "multiple-choice" is ONLY about remembering and guessing, but not RECALLING.
Cooljingle's "all typing" user script on Memrise helped me to get into L2 Portuguese typing on the web when I have to do reviews.
Multiple-choice and "learning-mode" either with L1 or L2 translations for a new/unfinished lesson is okay for me.
This would be a great enhancement, even we still would have to type too much in our L1 native (source/base) language.
But it is much more difficult to translate all the L2 words (e.g Portuguese) AND correct grammar if you can NOT simply select from a list of 3-4 options where most of the time you can eliminate 1-2 wrong options and guess the right answer from the rest of 1-2 answers.
This can not be effective in learning a new language from scratch.
I want to do my own (typing) errors - and of course learn from those done errors (checking discussions, seeing one the suggested solution, etc.)!
I tested your user script for EN-CZ (right hand side answers) for the new Czech beta course. Works.
Many guys seem to have problems with audio (left hand CZ side - standard default DuoLingo Czech audio) not playing on Apple devices and Safari browser: https://www.duolingo.com/comment/24322144
Do you know of any workaround that you might be able to help those learners for the new BETA Czech course?
I would think to test your user script and enable audio auto-play (including the blue button or Ctrl + Space) even on left side Czech L2 translation questions (Google TTS, Yandex) when e.g the speaker is turned OFF in the settings (or ON, does not matter).
Could your script and your default (3) TTS settings get audio working for left side Czech questions even that default DuoLingo and TTS libraries are not able to do so on Safari?
If you have any idea please reply in the above linked Czech-audio thread 24322144.
With best regards
would you mind explaining to us what your "Other options: Check spelling" feature exactly does? Is it still working for the new Scala 2017 portal?
Can you show me a screenshot?
I have it activated...but I do NOT use accent typing with Portuguese for myself (no interest to switch keyboards back and forth, no interest to use DuoLingo's mouse keyboard for special characters).
I just get the green warning from DuoLingo in the answer, when I have left off accents - and I am not sure if this might be one cause why my skills decay faster?!
Is there any chance for you to further improve your very great script for features like we have on Memrise with user scripts like "Memrise auto correct", "Memrise Turbo"?
I do not want to have to type Portuguese accents (e.g ção, éàô, etc.) but I still want to view the corrected letter and auto-completed accent marks before I hit submit.
I rather want to view the auto-added accents in my own answer, NOT in the DuoLingo solution below the page.
The spell checking option just activate the buidl-in spell checker in your browser. It is not different to right-clicking on the input box and enabling spell checking. You have to install the language for your browser, otherwise it is not going to do anything.
Autocorrect is not something you get from the browser, so I can't really use it in the script.
Thanks Camilo for your explanation on "spell checking".
No, "Autocorrect" has nothing to do with the browser by itself.
The user script "DuoLingo easy accents" e.g was able to directly modify the typed text in the text box when you hit a hotkey to create the diacritics.
But I believe Memrise in contrast may provide the accessible solution data with the question prompt, which Cooljingle could be verifying the typed letters / typed sentence against, where probably DuoLingo is just evaluation the whole answer after pressing the submit button (alternative answers)??? Actually, I have no idea how his script really works at the end! :-) :-)
Have a look, here is his Memrise script: https://github.com/cooljingle/memrise-autocorrect/blob/master/Memrise_Autocorrect.user.js
Hopefully you have nevertheless an idea :-)
Good luck Camilo!
is there any workaround to double support Vietnamese audio by 3rd-party TTS providers (left hand translation side) if no audio was added (missing) or auto-played by Duo for L2->L1 sentence translations?
Vietnamese not-complete audio support: https://www.duolingo.com/comment/25147880
Does google TTS support Vietnamese? I have tried with Esperanto, and it adds sound to the sentences without it, so I see no reason why it would'nt work with Vietnamese. On the other hand, google's voice for Esperanto is really bad, and I'm afraid is the same for many smaller languages.
Yes! I got it working. I had to enable spell checking for English (US) and Swedish separately in my browser's settings. I tried typing answers without the script but somehow answers were not spell checked in Swedish. On the other hand if I tried typing Swedish and English outside Duolingo then they were both spell checked. I would really just want spell checking enabled only in Duolingo.
In addition I had this other problem:
When I get my answer correctly, this blue circle appears. I don't want that to appear.
Hi, I just found your script and love it, but can I make a request?
I need to play the audio several times to understand what it's said but every time I hover over the audio button, the text shows up. Is it possible to make the text only shows up when you hover over the text and not the audio button? Thank you so much.
(Firefox) hardware hotkeys:
Ctrl + Space: Repeat the left side translation audio
Ctrl + Shift + Space: Replay slower audio / Replay the right hand side target audio (from Camilo's script)
but every time I hover over the audio button, the text shows up. Is it possible to make the text only shows up when you hover over the text and not the audio button?
Try this for html / css layout frontend changes on the DuoLingo web portal: https://forum.duolingo.com/comment/24634938/Lessons-Userstyle-to-get-some-things-of-the-old-look-back
You need to install the Stylus (not Stylish!!!) addon for your browser, to make those CSS changes work: https://forum.duolingo.com/comment/24634938$comment_id=27870938
New Bug 11/05/2018 (any recent Duolingo website update in the past 1-2 days?)
Normal Portuguese audio (left hand side) stopped playing for my EN->PT tree
Q: Is it worth retrying with Violentmonkey?
Speaker OFF, Sound effects ON (for my other PT->DE and EN->DE reverse trees, so I do not touch it for EN->PT as well)
Enhanced tree configuration:
Read text in Portuguese: activated
Read text in English: disabled
Listening exercises: activated
List of TTS: Google yandex baidu / yandex google baidu (both options not working)
Firefox: V52.9.0esr (no option to switch to Quantum or Google Chrome)
- Tampermonkey: V4.8.5847 from 09/14/2018
PT->EN translations in my forward EN->PT tree
The read Portuguese sentence (from the console log in orange) from Portuguse->English text translations is not auto played anymore.
Has there maybe been any Duolingo website update in the last 1-2 days?
It was shortly working before and there was no Tampermonkey update!
If you have speaker ON, Duolingo usually auto-plays these sentences by itself.
But I have your user script do the job for me to read and play Portuguese audio, because my speaker is turned OFF and I have ZERO interests to change this for each course back and forth.
Always worked like a charm!
[DuolingoTreeEnhancer] Saying 'Ficarei feliz se você ficar. ' userscript.html:1116:5
[DuolingoTreeEnhancer] Saying 'Depois que o filme começar, não pararemos!.
I do not hear any audio after the log phrase "Saying".
Do you use the internal Duolingo speaker button?
When I hit the hotkey Ctrl + Space this works, but the auto-play is annoyingly turned off (because of my setting).
If this functionality is now broken, is there hopefully any fallback for me to use the 2nd yandex or Baidu TTS service to play the Portuguese sentence?
Maybe playing everything with Google TTS is just a little bit too much...
EN->PT translations in my forward EN->PT tree
Still works for the "reverse way".
Your script does the job.
[DuolingoTreeEnhancer] Saying 'Uma consciência limpa é o melhor travesseiro. ' userscript.html:1116:5
"[DuolingoTreeEnhancer] Playing URL http://translate.google.com/translate_tts?ie=UTF-8&tl=pt&total=1&textlen=46&tk=485074|83024&q=Uma%20consci%C3%AAncia%20limpa%20%C3%A9%20o%20melhor%20travesseiro.%20&client=tw-ob" userscript.html:937:5
[DuolingoTreeEnhancer] Saying 'Qual é a sua altura?. ' userscript.html:1116:5
"[DuolingoTreeEnhancer] Playing URL http://translate.google.com/translate_tts?ie=UTF-8&tl=pt&total=1&textlen=22&tk=517486|884725&q=Qual%20%C3%A9%20a%20sua%20altura%3F.%20&client=tw-ob"
What would be the easiest steps to track this down as a start and not wasting too much time, especially spoken about your very valuable developer time.
Camilo, you probably don't use the same settings as me, do you?
In another comment you had to tell me that there is no way to auto-activate the speaker ON setting per course (e.g EN->PT on, PT->DE off).
Viele Grüße aus Deutschland
First time I reconfigured the settings and placed yandex before Google for the EN->PT course.
Firefox V52.9.0esr console message:
HTTP-Laden ist mit dem Status 400 fehlgeschlagen.
Laden der Medienressource http://tts.voicetech.yandex.net/tts?text=Ele%20disse%20que%20isso%20n%C3%A3o%20traria%20solu%C3%A7%C3%A3o%20para%20o%20problema.%20&lang=pt_PT&format=mp3&quality=hi fehlgeschlagen. WebRequest.jsm:342:4
Alle Kandidaten für die Ressource konnten nicht geladen werden. Medien-Laden pausiert.
Sentence: "Ele disse que isso não traria solução para o problema."
Is anybody using Camilo's "Duolingo Next Lesson" Tampermonkey user script?
Finally I have added a new (longer) comment highlighting some facts about
- to filter skills by strength (there was a user style to filter golden skills)
- rename skill names (adding prefixes, e.g on our www.duome.eu/USERNAME/progress page)
- a (crowns) level-up lesson strategy concept to focus on more difficult grammar (e.g Subjunctives) / Verb tense skills
in Camilo's "Duolingo Next Lesson" thread: https://forum.duolingo.com/comment/26849592$comment_id=29666271
as well as "[HOWTO]: Different ways for spaced repetition with skill strength viewer (user script and extension)" thread: https://forum.duolingo.com/comment/29304553$comment_id=29666130
I would like to invite advanced users and user script or user style programming gods to join and discuss questions and ideas on a brainstorming level.
Best regards / Viele Grüße