New Userscript

Tính điểm trung bình của sinh viên FPT tại http://fap.fpt.edu.vn/Grade/StudentTranscript.aspx

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      2.1.2
// @description  Tính điểm trung bình của sinh viên FPT tại http://fap.fpt.edu.vn/Grade/StudentTranscript.aspx
// @author       You
// @match        http://fap.fpt.edu.vn/Grade/StudentTranscript.aspx*
// @require      http://code.jquery.com/jquery-1.9.1.js
// @grant        none
// ==/UserScript==

$(document).ready(function() {
    $('body').append('<input type="button" value="Tính điểm trung bình" id="btnCal">')
    $("#btnCal").css("position", "fixed").css("top", 0).css("left", 0);
    $('#btnCal').click(function(){
        var tbody = $($('.table')[0]).find('tbody');
        var length = $(tbody).find('tr').length;
        var gradeSummary = 0;
        var creditSummary = 0;
        var totalCredit = 0;
        for(var i = 0; i< length;i++){
            var tr = (tbody).find('tr')[i];
            try {
                var subject = $(tr).find('td')[3].innerText;
                var credit = parseFloat($(tr).find('td')[6].innerText);
                var point = parseFloat($($($(tr).find('td')[7]).find('span'))[0].innerText);
                var status = $($($(tr).find('td')[8]).find('span'))[0].innerText;
                if(!subject.includes('OJ') && !subject.includes('VOV')  ){
                    if(status == 'Passed'){
                        if(point > 0){
                            gradeSummary += credit*point;
                            creditSummary += credit;
                        }
                    }
                }
                if(status == 'Passed'){
                    totalCredit += credit;
                }
            } catch (error) {
                continue;
            }
        }
        alert('Điểm trung bình :'+gradeSummary/creditSummary+'\n Số tín chỉ đã học :'+totalCredit);
    });
   
  });