-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: train all chapters together #110
Comments
I have written a small js-script with wich you get a random chapter every time you click a button "Random Chapter". // ==UserScript==
// @name Random chapter button
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://listudy.org/de/studies/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=listudy.org
// @grant none
// ==/UserScript==
(function() {
'use strict';
let select = document.getElementById('chapter_select');
document.getElementsByClassName('container')[1].children[2].innerText = select[select.value].innerText
let button = document.createElement("BUTTON");
button.setAttribute("id", "button");
button.textContent = "Random chapter"
let chapterSelection = document.getElementsByClassName('chapter_selection')[0]
chapterSelection.appendChild(button)
let button_element = document.getElementById('button')
button_element.onclick = function() {
for(let i = 0; i < select.length; i++) {
select[i].selected = false
}
var choosen_chapter = select[Math.floor(Math.random() * select.length)];
choosen_chapter.selected = true
select.onchange()
// Update main-titel
document.getElementsByClassName('container')[1].children[2].innerText = select[select.value].innerText
}
})(); |
The following js-script lets you train all your chapters at once. Every time when you finish a chapter with success, a new chapter is chosen. // ==UserScript==
// @name New Chapter after success
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://listudy.org/de/studies/x14gpe-1001-checkmates
// @icon https://www.google.com/s2/favicons?sz=64&domain=listudy.org
// @grant none
// ==/UserScript==
(function() {
'use strict';
let select = document.getElementById('chapter_select');
let currentChapter = window.chapter
let first_move_played = false
document.getElementsByClassName('container')[1].children[2].innerText = select[select.value].innerText
let succes_text = document.getElementById('success_text')
var config = { childList: true };
function updateChapter() {
if(window.curr_move.length === 1 && first_move_played) {
for(let i = 0; i < select.length; i++) {
select[i].selected = false
}
let choosen_chapter = select[Math.floor(Math.random() * select.length)];
choosen_chapter.selected = true
document.getElementsByClassName('container')[1].children[2].innerText = select[select.value].innerText
currentChapter = window.chapter
first_move_played = false
select.onchange()
}
else if(window.curr_move.length > 1) {
first_move_played = true
}
}
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutationRecord) {
updateChapter()
});
});
observer.observe(succes_text, config)
})(); |
FYI. I have used ChessTempo to merge chapters into one. Import the PGN file into ChessTempo.com's opening trainer, and then export it and it will come out as one "chapter". |
Thank you for the workaround which does a big part of the job. However an additional item in the chapter drop down menu "all chapters" or "random chapter" would allow you to focus on individual chapters and if you feel well prepared you go for the "random line" option to test your knowledge. |
A small additional feature I would find very useful.
When I train a study, there is a drop box to choose the chapter. You may want to add an entry to the drop box, with "full study", to train all chapters at once. When starting a new line, your program would choose at random from the various chapters, and then again at random which line to choose.
Thank you again for your work!
The text was updated successfully, but these errors were encountered: