-
Notifications
You must be signed in to change notification settings - Fork 0
/
cum_score_ui.js
41 lines (26 loc) · 1.2 KB
/
cum_score_ui.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*----------------------------------------------------------------------------------------------------------------------------------*/
cum_score_ui_new = function(performance) {
var table = document.createElement("table");
var tr = document.createElement("tr");
var td = document.createElement("td");
td.appendChild(document.createTextNode("Total Score:"));
table.appendChild(tr);
tr.appendChild(td);
tr = document.createElement("tr");
td = document.createElement("td");
var p = document.createElement("p");
p.innerHTML = performance.cum_score;
td.appendChild(p);
tr.appendChild(td);
table.appendChild(tr);
table.border = "0";
//performance.add_notify_score(update_cum_score_ui, p);
update_cum_score_ui(p, performance.poet);
performance.poet.notify_score.add_notify(update_cum_score_ui, p);
return table;
}
/*----------------------------------------------------------------------------------------------------------------------------------*/
function update_cum_score_ui(p, poet) {
p.innerHTML = Math.round(poet.total_score * 100) / 100;
}
/*----------------------------------------------------------------------------------------------------------------------------------*/