more improvements
This commit is contained in:
@@ -8,10 +8,15 @@ var marked_answers = {
|
||||
|
||||
$(document).ready(function () {
|
||||
$(".answer-list li").each(function (index, element) {
|
||||
$(element).append($("<span class='google-link' title='search in google'><a href='https://www.google.com/search?q="+$(element).text()+"' target='_blank'>G</a></span>"));
|
||||
});
|
||||
|
||||
$(".answer-list span.answer").each(function (index, element) {
|
||||
console.log(element);
|
||||
|
||||
$(element).click(function (e) {
|
||||
|
||||
var classes = ['correct', 'half-correct', 'incorrect'];
|
||||
var classes = ['answer correct', 'answer half-correct', 'answer incorrect'];
|
||||
$(element).each(function () {
|
||||
this.className = classes[($.inArray(this.className, classes) + 1) % classes.length];
|
||||
});
|
||||
@@ -146,15 +151,15 @@ function prepAnswerData() {
|
||||
window.marked_answers["correct"] = [];
|
||||
window.marked_answers["half-correct"] = [];
|
||||
window.marked_answers["incorrect"] = [];
|
||||
$("li.correct").map(function () {
|
||||
$("li span.correct").map(function () {
|
||||
ans = $(this).text();
|
||||
window.marked_answers["correct"].push(ans);
|
||||
})
|
||||
$("li.half-correct").map(function () {
|
||||
$("li span.half-correct").map(function () {
|
||||
ans = $(this).text();
|
||||
window.marked_answers["half-correct"].push(ans);
|
||||
})
|
||||
$("li.incorrect").map(function () {
|
||||
$("li span.incorrect").map(function () {
|
||||
ans = $(this).text();
|
||||
window.marked_answers["incorrect"].push(ans);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user