Skip to content

Commit

Permalink
Removed synthetic statistics (#149)
Browse files Browse the repository at this point in the history
Stop synthetic assignments (assignments added by the user) from offering to show nonexistent statistics

Co-authored-by: psvenk <45520974+psvenk@users.noreply.github.com>
  • Loading branch information
andOrlando and psvenk authored Oct 31, 2020
1 parent 22c3b79 commit 6c14ecc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions public/js/buttonFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let newAssignment = function() {
"max_score": 10,
"percentage": 100,
"color": "green",
"synthetic": "true",
});

updateGradePage();
Expand Down
18 changes: 12 additions & 6 deletions public/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,21 @@ let assignmentsTable = new Tabulator("#assignmentsTable", {
{
title: "Stats",
titleFormatter: () => '<i class="fa fa-info-circle" aria-hidden="true"></i>',
formatter: cell =>
(!isNaN(cell.getRow().getData().score)) ?
'<i class="fa fa-info" aria-hidden="true"></i>' : "",
formatter: cell => (
isNaN(cell.getRow().getData().score)
|| currentTableData.currentTermData
.classes[selected_class_i]
.assignments[cell.getRow().getPosition()].synthetic
) ? "" : '<i class="fa fa-info" aria-hidden="true"></i>',
width: 40,
align: "center",
cellClick: async function(e, cell) {
if (isNaN(cell.getRow().getData().score)) {
return;
}
if (
isNaN(cell.getRow().getData().score)
|| currentTableData.currentTermData
.classes[selected_class_i]
.assignments[cell.getRow().getPosition()].synthetic
) return;
noStats();
document.getElementById("no_stats_caption").innerHTML = "Loading Statistics...";
showModal("stats");
Expand Down

0 comments on commit 6c14ecc

Please sign in to comment.