<html><div class="arrow-steps clearfix">
    <div class="step" name="module-154870"> <span> <a href="#module-154870">Вступ</a></span></div>
    <div class="step" name="module-168331"> <span><a href="#module-168331">Тема 1</a></span></div>
    <div class="step" name="module-168177"> <span><a href="#module-168177">ПР 1</a></span></div>
    <div class="step" name="module-168203"> <span><a href="#module-168203">ПР 2</a></span></div>
    <div class="step" name="module-168337"> <span><a href="#module-168337">Тема 2</a></span></div>
    <div class="step" name="module-168338"> <span><a href="#module-168338">Тема 3</a></span></div>
    <div class="step" name="module-136840"> <span><a href="#module-136840">ПР 3</a></span></div>
    <div class="step" name="module-161426"> <span><a href="#module-161426">ПР 4</a></span></div>
    <div class="step" name="module-138284"> <span><a href="#module-138284">ПР 5</a></span></div>
    <div class="step" name="module-162675"> <span><a href="#module-162675">ПР 6</a></span></div>
    <div class="step" name="module-168339"> <span><a href="#module-168339">Тема 4</a></span></div>
    <div class="step" name="module-162785"> <span><a href="#module-162785">ПР 7</a></span></div>
    <div class="step" name="module-162968"> <span><a href="#module-162968">ПР 8</a></span></div>
    <div class="step" name="module-168340"> <span><a href="#module-168340">Тема 5</a></span></div>
    <div class="step" name="module-167898"> <span><a href="#module-167898">ПР 9</a></span></div>
    <div class="step" name="module-167900"> <span><a href="#module-167900">ПР 10</a></span></div>
    <div class="step" name="module-168395"> <span><a href="#module-168395">Тема 6</a></span></div>
    <div class="step" name="module-143094"> <span><a href="#module-143094">ПР 11</a></span></div>
    <div class="step" name="module-168010"> <span><a href="#module-168010">ПР 12</a></span></div>
    <div class="step" name="module-168408"> <span><a href="#module-168408">Тема 7</a></span></div>
    <div class="step" name="module-168021"> <span><a href="#module-168021">ПР 13</a></span></div>
    <div class="step" name="module-168023"> <span><a href="#module-168023">ПР 14</a></span></div>
    <div class="step" name="module-146904"> <span><a href="#module-146904">МКР</a></span></div>
    <div class="step" name="module-168273"> <span><a href="#module-168273">ДКР</a></span></div>
    <div class="step" name="module-168496"> <span><a href="#module-168496">Тема 8</a></span></div>
    <div class="step" name="module-168046"> <span><a href="#module-168046">ПР 15</a></span></div>
    <div class="step" name="module-168069"> <span><a href="#module-168069">ПР 16</a></span></div>
    <div class="step" name="ocinka"> <span><a href="#" id="ototal">Бали: --</a></span></div>
</div>

</html>
<script>
    var css = '.clearfix:after {  clear: both;  content: "";  display: block;  height: 0;}/* Responsive Arrow Progress Bar */.container {  font-family: sans-serif;}.arrow-steps .step {  font-size: 14px;  text-align: left;  color: #777;  cursor: default;  margin: 0 2px 0 0;  padding: 10px 2px 10px 20px;  width: auto;  heigth: 20px;  float: left;  position: relative;  background-color: #ddd;}.arrow-steps .step a {  color: #777;  text-decoration: none;}.arrow-steps .step:after,.arrow-steps .step:before {  content: "";  position: absolute;  top: 0;  right: -16px;  width: 0;  height: 20;  border-top: 20px solid transparent;  border-bottom: 20px solid transparent;  border-left: 17px solid #ddd;  z-index: 2;}.arrow-steps .step:before {  right: auto;  left: 0;  border-left: 17px solid #fff;  z-index: 0;}.arrow-steps .step:first-child:before {  border: none;}.arrow-steps .step:last-child:after {  border: none;}.arrow-steps .step:first-child {  border-top-left-radius: 4px;  border-bottom-left-radius: 4px;}.arrow-steps .step:last-child {  border-top-right-radius: 4px;  border-bottom-right-radius: 4px;  padding: 10px 10px 10px 20px;}.arrow-steps .step span {  position: relative;}*.arrow-steps .step.current {  color: #fff;  background-color: #5599e5;}.arrow-steps .step.current a {  color: #fff;  text-decoration: none;}.arrow-steps .step.current:after {  border-left: 17px solid #5599e5;}.arrow-steps .step.done {  color: #fff;  background-color: #2f69aa;}.arrow-steps .step.done a {  color: #fff;  text-decoration: none;}.arrow-steps .step.done:after {  border-left: 17px solid #2f69aa;}',
        head = document.head || document.getElementsByTagName('head')[0],
        style = document.createElement('style');

    head.appendChild(style);

    style.type = 'text/css';
    if (style.styleSheet) {
        // This is required for IE8 and below.
        style.styleSheet.cssText = css;
    } else {
        style.appendChild(document.createTextNode(css));
    }
</script>

<script>
    window.onload = function() {
        myFunction()
    };

    function loadData() {
        var url = 'https://do.ipo.kpi.ua/grade/report/user/index.php?id=5927';
        return fetch(url)
            .then((resp) => resp.text());
    }




    async function myFunction() {
        var step = document.getElementsByClassName('step');
        var filename = 'https://do.ipo.kpi.ua/grade/report/user/index.php?id=5927';

        const data = await loadData(filename); // Очікуємо завантаження даних
        const parser = new DOMParser();
        let doc = parser.parseFromString(data, 'text/html');
        let table = doc.querySelector('table');




        for (var i = 0; i < step.length; i++) {
            let stepId = step[i].getAttribute('name');

            if (stepId != null) {
                let activity = document.getElementById(stepId);
                if (activity != null) {
                    let image = activity.getElementsByTagName('img')[1];
                    if (image != undefined) {
                        let src = image.getAttribute('src');
                        if (src != undefined && src.includes("completion-auto-y") || src != undefined && src.includes("completion-auto-pass")) {
                            let Row = table.rows[1 + i];
                            let grageCol = Row.querySelectorAll('td')[0];
                            if (grageCol.innerHTML != "-" || i == 0) {
                                step[i].classList.add("done");
                            } else {
                                step[i].classList.add("current");
                            }


                        }
                    }
                }
            }
        }
        document.getElementById('module-154878').getElementsByClassName('no-overflow')[1].style.overflow = "hidden";
    }
    if (document.getElementById('ototal')) {
        function file_get_contents(filename) {
            fetch(filename).then((resp) => resp.text()).then(data => {
                // Initialize the document parser
                const parser = new DOMParser();
                let doc = parser.parseFromString(data, 'text/html');

                // Get the <table> element content
                let table = doc.querySelector('table');
                let lastRow = table.rows[table.rows.length - 1];
                let grageCol = lastRow.querySelectorAll('td')[0];

                // Replace my empty element with the retrieved content
                document.getElementById('ototal').innerHTML = "Бали: " + grageCol.innerHTML;
            });
        }

        // Call the function and point it to my GitHub Pages page
        file_get_contents('https://do.ipo.kpi.ua/grade/report/user/index.php?id=5927');
    }
</script>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        // Перевіряємо, чи відсутня кнопка з текстом "Завершити редагування"
        const buttonElement = document.querySelector('button.btn.btn-primary');

        // Якщо кнопка відсутня або не містить текст "Завершити редагування", виконуємо код
        if (!buttonElement || buttonElement.textContent !== 'Завершити редагування') {
            // Отримуємо всі елементи <div> з класом "availabilityinfo isrestricted"
            const divElements = document.querySelectorAll('div.availabilityinfo.isrestricted');

            // Перебираємо всі елементи <div> і замінюємо їх на <span> з потрібною структурою
            divElements.forEach(function(divElement) {
                // Створюємо новий <span> елемент
                const spanElement = document.createElement('span');
                spanElement.className = 'availabilityinfo isrestricted';

                // Створюємо новий <span> елемент з класом "badge badge-info" і текстом
                const badgeElement = document.createElement('span');
                badgeElement.className = 'badge badge-info';
                badgeElement.textContent = 'Недоступно. Завершіть попередню активність.';
                spanElement.appendChild(badgeElement);
                // Замінюємо <div> на новостворений <span>
                divElement.parentNode.replaceChild(spanElement, divElement);
            });
        }
    });
</script>
<script defer="">
    // Отримуємо посилання на елемент 
    const bodyElement = document.querySelector('body');
    const sidePanel = document.querySelector('.d-print-none.moodle-has-zindex');

    // Перевіряємо, чи знайдено елемент
    if (sidePanel) {
        console.log('Замінюємо клас moodle-has-zindex на closed');
        sidePanel.classList.add('closed');
    }
    if (bodyElement) {
        // Замінюємо значення margin-left на 0
        bodyElement.style.marginLeft = '0';
        //bodyElement.classList.remove('drawer-open-left');
    }
</script>
<script>
    document.body.style.backgroundColor = "lightblue";
</script>