more improvements

This commit is contained in:
Ross
2020-12-12 13:55:59 +00:00
parent 5ca4438e77
commit 9dc9cb4bf0
5 changed files with 33 additions and 17 deletions
+5
View File
@@ -318,3 +318,8 @@ img.uploading:hover {
.parent-help .help-text {
opacity: 0%;
}
.google-link {
padding-left: 10px;
font-size: smaller;
}
+9 -4
View File
@@ -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);
})