Learning Bot for "Microsoft build cloud skills challenge"

Automatically complete each learning module for "Microsoft build cloud skills challenge"

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Learning Bot for "Microsoft build cloud skills challenge"
// @namespace    https://www.microsoft.com/cloudskillschallenge/build/registration/2022
// @version      0.1
// @description  Automatically complete each learning module for "Microsoft build cloud skills challenge"
// @author       You
// @match        https://docs.microsoft.com/*/learn/modules/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=microsoft.com
// @grant        none
// @license      MIT
// ==/UserScript==
(function() {
    'use strict';

    window.setInterval(() => {
        window.scrollTo(0, document.body.scrollHeight);
        let startBtn = document.querySelectorAll('[data-bi-name="start"]');
        if (startBtn.length) {
            startBtn[0].click();
        }

        let nextBtn = document.querySelectorAll('[data-bi-name="continue"]');
        if (nextBtn.length) {
            nextBtn[0].click();
        }

        let modalNextBtn = document.querySelectorAll('.modal-card [data-bi-name="continue"]');
        if (modalNextBtn.length) {
            modalNextBtn[0].click();
        }

        let questions = document.getElementsByClassName('quiz-question');
        for (let q of questions) {
            q.querySelector('label').click();
        }

        let checkBtn = document.querySelectorAll('[data-bi-name="check-answers"]')
        if (checkBtn.length) {
            checkBtn[0].click()
        }

        let achievementBtn = document.querySelectorAll('[data-bi-name="unlock-achievement"]');
        if (achievementBtn.length) {
            achievementBtn[0].click();
        }

        let completedBtn = document.querySelectorAll('[data-bi-name="learn-completion-continue"]');
        if (completedBtn.length) {
            completedBtn[0].click();
        }

        return
    }, 1000);

})();