-
Notifications
You must be signed in to change notification settings - Fork 0
/
Moodle quiz revisor.user.js
39 lines (31 loc) · 1.12 KB
/
Moodle quiz revisor.user.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
// ==UserScript==
// @name Moodle quiz revisor
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to not fail
// @author IcAcTech
// @include /^https?://ummoodle\.um\.edu\.mo/mod/quiz/review\.php
// @require http://code.jquery.com/jquery-3.2.1.min.js
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
$("input[type='radio'], input[type='checkbox']").attr('checked', false);
$("input[type='radio'], input[type='checkbox']").attr('disabled', false);
$(".icon.fa.fa-check[title='Correct'], .icon.fa.fa-remove[title='Incorrect']").remove();
$.fn.shuffleChildren = function() {
$.each(this.get(), function(index, el) {
var $el = $(el);
var $find = $el.children();
$find.sort(function() {
return 0.5 - Math.random();
});
$el.empty();
$find.appendTo($el);
});
};
$(".answer").shuffleChildren();
$(".outcome").attr("style", "opacity: 0.1");
$("form.questionflagsaveform > div").shuffleChildren();
})();