简体   繁体   English

添加复选框以排除多项选择题的可能答案

[英]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">&#x2169;</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.

相关问题 在多项选择题测验中允许多个正确答案| Angular.js和JSON - Allowing multiple correct answers in a multiple-choice quiz | Angular.js & JSON 青年学生多项选择图片测验 - Multiple-choice picture quiz for young students 多项选择/修正程序 (JavaScript) - Multiple-Choice / Correction program (JavaScript) 使用 PHP 检查具有多个答案的复选框问题是否正确? - Check whether checkbox question with multiple answers is correct using PHP? 形式:带有多选复选框的“全选”按钮 - Form: “Select all” button with multiple-choice checkboxes JS和复选框:多项选择 - JS and checkbox: multiple choice 以随机顺序显示多项选择测验的答案 - Display answers in random order for multiple choice quiz Google表单 - 根据分配给Google Apps for Business用户的作业预填充多选列表 - Google Forms - Prefill multiple-choice list based on jobs assigned to Google Apps for Business User 是否可以使用 jquery 为特定的多项选择问题选择一个单选按钮并禁用其余单选按钮? - Is it possible to select one radio button and disable the rest for a particular multiple choice question using jquery? 如何在javascript中的(多项选择)答案之间插入中断? - How can I insert a break between (multiple choice) answers in javascript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM