summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-11-20 16:24:39 +0100
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-11-20 16:24:39 +0100
commitcd76af42463bd80539db8c9671a427a9f0fe5d69 (patch)
tree96ca9acdc178968e50ea39ca52c2346f3d91b436 /js
parentfbe5805e1b1e7e92015a9f6f039d7b9e0689c41f (diff)
downloadBits-cd76af42463bd80539db8c9671a427a9f0fe5d69.tar.gz
Bits-cd76af42463bd80539db8c9671a427a9f0fe5d69.zip
color change, rating change
Diffstat (limited to 'js')
-rw-r--r--js/liststudy.js5
-rw-r--r--js/reviewdesu.js4
2 files changed, 6 insertions, 3 deletions
diff --git a/js/liststudy.js b/js/liststudy.js
index b33ed6c..4d715b8 100644
--- a/js/liststudy.js
+++ b/js/liststudy.js
@@ -59,7 +59,10 @@ function show_contents_table() {
}
html += '<td>' + items[i].win + '</td>';
html += '<td' + (items[i].fail > 0 ? (items[i].fail > items[i].win ? ' style="background-color: #ff7777"' : ' style="background-color: #FFFF00"') : '') + '>' + items[i].fail + '</td>';
- html += '<td style="background-color: ' + (items[i].score == max_score ? '#00aa00' : (items[i].score > med_score ? '#55FF55' : '#FFFF00')) + '">' + items[i].score + '</td></tr>';
+ html += '<td style="background-color: ' +
+ (items[i].score == max_score ? '#00aa00' :
+ (items[i].score > med_score ? '#55FF55' :
+ (items[i].score < 0 ? '#FF7777' : '#FFFF00'))) + '">' + items[i].score + '</td></tr>';
}
html += '</table>';
html += '<p>Medium score : ' + med_score + '</p>';
diff --git a/js/reviewdesu.js b/js/reviewdesu.js
index 2868dbb..45726dd 100644
--- a/js/reviewdesu.js
+++ b/js/reviewdesu.js
@@ -48,7 +48,7 @@ function prepare_questions() {
function next_question() {
if (questions.length == 0) {
- score = Math.ceil(score * 50 / total);
+ score = Math.ceil(score * 100 / total);
$("core").innerHTML = '<p>Finished. Score : ' + score + '/100. Saving data...</p>';
new Ajax.Request('index.php?p=brresults-study-' + batchid, {
method: 'post',
@@ -86,6 +86,6 @@ function show_answer() {
function answer_question(a) {
results.push([question.key, a]);
- score += (a+1);
+ score += a;
next_question();
}