Not allowing typing questions

here’s the full fixed script I’m using successfully

// ==UserScript==
// @name Memrise All Typing
// @namespace https://github.com/cooljingle
// @description All typing / no multiple choice when doing Memrise typing courses
// @match https://www.memrise.com/course//garden/
// @match https://www.memrise.com/garden/review/*
// @version 0.1.4
// @updateURL https://github.com/cooljingle/memrise-all-typing/raw/master/Memrise_All_Typing.user.js
// @downloadURL https://github.com/cooljingle/memrise-all-typing/raw/master/Memrise_All_Typing.user.js
// @grant none
// ==/UserScript==

$(document).ready(function() {

//*****************************************************************************************************************************************************
//MEMRISE ALL TYPING
//-----------------------------------------------------------------------------------------------------------------------------------------------------
//This userscript prevents multiple choice from occuring, replacing it with a typing prompt.
//You can configure the extent to which this happens by clicking the 'All Typing Settings' link on the left when in a learning session.
//Changes you make will be saved locally on your machine.
//*****************************************************************************************************************************************************

var localStorageIdentifier = "memrise-all-typing",
    localStorageObject = JSON.parse(localStorage.getItem(localStorageIdentifier)) || {};

$("body").append(
        `
            <div class='modal fade' id='all-typing-modal' tabindex='-1' role='dialog'>
                <div class='modal-dialog' role='document'>
                    <div class='modal-content'>
                        <div class='modal-header'>
                            <button type='button' class='close' data-dismiss='modal'><span >×</span></button>
                            <h1 class='modal-title' id='all-typing-modal-label'>All Typing Settings</h1>
                        </div>
                        <div class='modal-body'>
                            <div>
                                <input class='all-typing-setting' id='include-reviews' type='checkbox'>
                                <label for='include-reviews'>Include Reviews</label>
                                <em style='font-size:85%'>only typing when reviewing an item which hasn't been watered for a while</em>
                            </div>
                            <div>
                                <input class='all-typing-setting' id='include-mistake-reviews' type='checkbox'>
                                <label for='include-mistake-reviews'>Include Mistake Reviews</label>
                                <em style='font-size:85%'>only typing on items that reoccur after getting them wrong earlier in the session</em>
                            </div>
                            <div>
                                <input class='all-typing-setting' id='include-learning' type='checkbox'>
                                <label for='include-learning'>Include Learning</label>
                                <em style='font-size:85%'>only typing on new items you are learning</em>
                            </div>
                            <div>
                                <input class='all-typing-setting' id='include-typing-disabled' type='checkbox'>
                                <label for='include-typing-disabled'>Include Typing Disabled</label>
                                <em style='font-size:85%'>enables typing even if typing was disabled due to <ul><li>course column set to no typing, or </li><li>official Memrise course and text > 15 characters</li></ul></em>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        `);

$('#left-area').append("<a data-toggle='modal' data-target='#all-typing-modal'>All Typing Settings</a>");

$('#all-typing-modal').on('shown.bs.modal', function() {
    $(document).off('focusin.modal'); //enable focus events on modal
});

$('.all-typing-setting')
    .prop('checked', function(){ return localStorageObject[$(this).attr('id')] !== false; }) //all options true by default
    .css({
        "vertical-align": "top",
        "float": "left",
        "margin-right": "5px"
    })
    .change(function(e){
        localStorageObject[e.target.id] = $(this).is(':checked');
        localStorage.setItem(localStorageIdentifier, JSON.stringify(localStorageObject));
        console.log(localStorageObject);
    });


MEMRISE.garden.boxes.load = (function() {
    var cached_function = MEMRISE.garden.boxes.load;
    return function() {
        onReviews();
        onMistakeReviews();
        onLearning();
        onTypingDisabled();
        return cached_function.apply(this, arguments);
    };
}());

function onReviews() {
    MEMRISE.garden.session.box_factory.is_lowest_rung = function() {
        if(localStorageObject["include-reviews"] !== false) {
            return false;
        }
    };
}

function onMistakeReviews() {
    MEMRISE.garden.boxes.add_next = (function() {
        var cached_function = MEMRISE.garden.boxes.add_next;
        return function() {
        if(localStorageObject["include-mistake-reviews"] !== false) {
            makeMaybeTyping(arguments[0]);
        }
            return cached_function.apply(this, arguments);
        };
    }());
}

function onLearning() {
    MEMRISE.garden.session.box_factory.make = (function() {
        var cached_function = MEMRISE.garden.session.box_factory.make;
        return function() {
            var result = cached_function.apply(this, arguments);
            if (arguments[0].learn_session_level && localStorageObject["include-learning"] !== false) {
                makeMaybeTyping(result);
            }
            return result;
        };
    }());
}

function onTypingDisabled() {
    MEMRISE.garden.session.box_factory.isTypingDisabled = function() {
        if(localStorageObject["include-typing-disabled"] !== false) {
            return false;
        }
    };
}

function makeMaybeTyping(box) {
    if (box.template === "multiple_choice") {
        var boxCopy = jQuery.extend({}, box);
        box.template = MEMRISE.garden.session.box_factory.makeMaybeTyping(boxCopy).template;
    }
}

});

I would rather type too. It is too easy this way :disappointed:

@ Ziutek I don’t understand one sylabe of it, hihi

@Petri_Wilson72,

Take a look at post number 193 (Mar 3) in this other topic. It gives some help to install the ‘all typing’ script - without needing to understand what it all means.

[Course Forum] French 1-7 by Memrise

2 Likes

@alanh Oh you’re great, thanks a lot, because I am totally a disaster with computers. :cry:

@alanh Tijdens het maken van een les krijg ik steeds een melding in dat “verrekijkertje” Moeten er settings veranderd worden?

Continued by Private Messaging.

[quote=“Ziutek, post:35, topic:8761”]https://github.com/cooljingle/memrise-all-typing/raw/master/Memrise_All_Typing.user.js This was broken by the recent changes but it can be fixed by replacing the enableAllTypingReviews() function by the following.

function enableAllTypingReviews() {
MEMRISE.garden.session.box_factory.is_lowest_rung = function()
[/quote]Where can I find how to use such a script? Do I need some extra software, or can it just be plugged into the browser?

Hi @John_Baite,

Take a look at Post No 3 (Mar 25) in this other topic: Disabling Typing Tests. It will take you to some guidance on how to install the script. It’s quite easy to install.

2 Likes

Thank you. I clicked on the link, then on the next, and then on the Github Memrise-all-typing Instruction:
In fact we only need to install two things! Quite easy.

So, I installed Tampermonkey for Chrome (or Greasemonkey for Firefox) extentsion and a script inside that extension. There is button right on page with the script that says ‘Install’!
After clicking on ‘Dashboard’ the script showed in the Tampermonkey extenstion.

Hi @John_Baite,

Sounds like you have installed the script successfully. The current version is 0.1.4 and you can turn it on or off via the button. by clicking on the green tick or the red cross.

1 Like

[quote=“alanh, post:106, topic:8761”]
the button
[/quote]Yes, it works! Clicking on that button, allows to choose ‘Dashboard’, Then a local page opens showing the scripts. (On the Chrome/Win10 version I am using, I can’t enable/disable directly from that button, though.) It’s so easy, even for non-techs. Thanks so much for your help!

1 Like

Hi @John_Baite,

I use Chrome and Windows 10, too and am currently only running the ‘all typing script’.

From the dropdown box that opens when I click on , I either see a green “tick” or a red “cross” followed by the word “Enabled” in the top line above the “Dashboard” option.

If the green tick is showing, then the script is running and I only get typing tests on your Memrise courses. If the red cross is showing, the script is turned off (even though it says “Enabled”) and I get whatever kind of tests the course creator set (typing, listening, multiple choice). I can switch between them by clicking on the tick or the cross. I turn it on or off depending on my preference for the kind of course I happen to be reviewing. Maybe it’s different if you have uploaded multiple scripts.

You shouldn’t need to visit the “Dashboard” very often unless, maybe, you are running multiple scripts.

1 Like

Thanks! Your help really made me try the script.

Since with quite a number of courses, no audio has been uploaded, this plugs the hole. Hopefully one day we’ll have an easy upload script or Memrise has an upload function.

Thanks for the script, works lovely.

2 Likes

help me i downloaded tampermonkey but all the other scripts are working but this isnt help me

What browser?

If you use on Firefox Greasemonkey V3.17 addon (with auto-update disabled, not the newer V4.1 for older Firefox 52.5.3 esr versions) Cooljingle’s latest “all typing” user script version is definitely working: Warning: Disable Firefox Greasemonkey addon auto-update - V4.1 breaks user-scripts!

my browser is google chrome

@Chris_vanVeen81
So what happens on the web console (F12)? Any errors?
Have you seen the “typing settings” on the left where you have to customize the “all typing” script?

Maybe you can upload an screenshot or copy and paste the errors you see in the JS web console?

Many thanks to those who created and updated the script. It’s truly fantastic and greatly increases Memrise’s utility in learning new languages.