web/js/tests.js
// Transforms the output of a ranking test into HTML tables
Transforms the output of a ranking test into HTML tables
Transforms the output of a ranking test into HTML tables
function ranking_table(data, test, alpha) {
    var salida = 
    "<div class=\"table-responsive\"><h2>Results</h2>\
		<a href=\"#modal_export\" data-toggle=\"modal\"><button class=\"btn btn-default\"><span class=\"glyphicon glyphicon-export\"></span>Export</button></a>\
        <table class=\"table table-hover table-striped\">\
            <caption>"+ $("input[value="+test+"]").parent().text() + " test (significance level of " + alpha + ")</caption>\
			<thead><tr><th>Statistic</th><th>p-value</th><th>Result</th></thead>\
            <tbody>\
                <td>"+data.statistic.toFixed(5) + "</td><td>" + data.p_value.toFixed(5) + "</td>";
            if (data.result)
                salida = salida + "<td>H0 is rejected</td></tr>";
            else
                salida = salida + "<td>H0 is accepted</td></tr>";
    salida = salida + "</tbody></table>";
    salida =  salida +
    "   <table class=\"table table-hover table-striped\">\
			<caption>Ranking</caption>\
			<thead><tr><th>Rank</th><th>Algorithm</th></thead>\
            <tbody>";
    $.each(data.rankings, function(index, value) {
        salida = salida + "<tr><td>" + value.toFixed(5) + "</td><td>" + data.names[index] + "</td></tr>";
	});
    salida = salida + "</tbody></table></div>";
    return salida;
}
function ranking_table ( data , test , alpha ) { var salida = "<div class=\"table-responsive\"><h2>Results</h2>\
		<a href=\"#modal_export\" data-toggle=\"modal\"><button class=\"btn btn-default\"><span class=\"glyphicon glyphicon-export\"></span>Export</button></a>\
        <table class=\"table table-hover table-striped\">\
            <caption>" + $ ( "input[value=" + test + "]" ) . parent ( ) . text ( ) + " test (significance level of " + alpha + ")</caption>\
			<thead><tr><th>Statistic</th><th>p-value</th><th>Result</th></thead>\
            <tbody>\
                <td>" + data . statistic . toFixed ( 5 ) + "</td><td>" + data . p_value . toFixed ( 5 ) + "</td>" ; if ( data . result ) salida = salida + "<td>H0 is rejected</td></tr>" ; else salida = salida + "<td>H0 is accepted</td></tr>" ; salida = salida + "</tbody></table>" ; salida = salida + "   <table class=\"table table-hover table-striped\">\
			<caption>Ranking</caption>\
			<thead><tr><th>Rank</th><th>Algorithm</th></thead>\
            <tbody>" ; $ . each ( data . rankings , function ( index , value ) { salida = salida + "<tr><td>" + value . toFixed ( 5 ) + "</td><td>" + data . names [ index ] + "</td></tr>" ; } ) ; salida = salida + "</tbody></table></div>" ; return salida ; }
Transforms the output of a ranking test into HTML tables
Transforms the output of a ranking test into HTML tables