// ==UserScript==
// @name 国开回顾
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://chengdu.ouchn.cn/mod/quiz/review.php?attempt=*&cmid=*
// @icon https://www.google.com/s2/favicons?domain=ouchn.cn
// @grant none
// ==/UserScript==
(function() {
'use strict';
var res = "";
$(".que").each(function(){
var que = $(this);
var bt = que.find(".info .no").text();
res += "\n";
res += "\n";
if(bt.indexOf("信息")<0){
res += bt+" ";
} else {
res += "## ";
}
que.find(".formulation").each(function(){
var _this = $(this);
var qtext = _this.find(".qtext");
var prompt = _this.find(".prompt");
var answer = _this.find(".answer");
if(qtext.length>0) {
res += qtext.text();
res += "\n";
}
if(prompt.length>0) {
// res += prompt.text();
// res += "\n";
}
if(answer.length>0){
answer.children().each(function(){
var cc = $(this);
if(cc.hasClass("correct")){
res += "<span style='color:red'>"+cc.text()+"</span>";
res += "\n";
} else {
res += cc.text();
res += "\n";
}
});
}
});
});
console.log(res);
})();