[英]Add a checkbox to exclude possible answers of a multiple-choice question
Qconcursos.com has many multiple alternative questions, like this one: Qconcursos.com有许多替代问题,例如:
qconcursos.com/questoes-de-concursos/questao/ccc0b219-43 qconcursos.com/questoes-de-concursos/questao/ccc0b219-43
But it lacks an option to eliminate a wrong alternative (like strike-through or fade), which could be extremely helpful. 但是它缺少消除错误选择(如删除线或淡入淡出)的选项,这可能会非常有帮助。
This other site has a very neat solution (the "x" by the right of each alternative) that I would like to mimic on qconcursos.com (a simple strike-through command achievable by a checkbox would be enough). 我想在qconcursos.com上模仿另一个站点的一个非常简洁的解决方案(每个替代方案右边的“ x”)(一个复选框可以实现一个简单的删除线命令就足够了)。
But I have absolutely no idea on how to do that. 但是我绝对不知道该怎么做。
How could one add such a control using Tampermonkey or a some other technique? 如何使用Tampermonkey或其他某种技术添加这样的控件?
Note that Stack Overflow is not a script writing service , but questions asking for such help with a website are sometimes on topic at Web Applications Stack Exchange . 请注意, Stack Overflow并非脚本编写服务 ,但是Web应用程序堆栈交换有时会在网站上寻求此类帮助的问题。
That said, since it is a quick easy diversion, here is a complete working Tampermonkey script that adds the same kind of "x" control, that the second site has, to qconcursos.com: 就是说,由于这是一种快速轻松的转移方法,因此这里有一个完整的可正常运行的Tampermonkey脚本 ,它向qconcursos.com添加了第二个站点具有的相同“ x”控件:
// ==UserScript==
// @name Qconcursos, add exclusion buttons to answers
// @match https://www.qconcursos.com/questoes*
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @grant GM_addStyle
// ==/UserScript==
/* global $ */
$("label[id^='label-alternativa']").after ( `
<span class="tmExcludeSymb">Ⅹ</span>
` );
$(".uma-questao-corpo").on ("click", ".tmExcludeSymb", zEvent => {
$(zEvent.target).parent ().toggleClass ("tmGrayIt");
} );
GM_addStyle ( `
.tmExcludeSymb {
font-weight: bold;
padding: 0.3ex 1em;
cursor: pointer;
}
.tmGrayIt {
opacity: 0.35;
}
` );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.