Greasy Fork is available in English.

AtCoder-Submission-RadioButton

AtCoderで提出時ラジオボタンを生成します

Ajankohdalta 6.10.2019. Katso uusin versio.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

  1. // ==UserScript==
  2. // @name AtCoder-Submission-RadioButton
  3. // @namespace https://github.com/penicillin0/
  4. // @version 0.1.1
  5. // @description AtCoderで提出時ラジオボタンを生成します
  6. // @author penicillin0
  7. // @license MIT
  8. // @match https://atcoder.jp/contests/*/submit*
  9. // @supportURL https://twitter.com/penicillin0at
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14. // 問題名を配列に
  15. const problem_names_Elements = document.getElementById('select-task').children;
  16.  
  17. //問題ごとにループ
  18. for (var i = 0; i < problem_names_Elements.length; i++) {
  19. const problem_name = problem_names_Elements[i].innerHTML
  20.  
  21. // ボタンの作成
  22. const button_txt = `<input type="radio" value="ボタン2" name="quiz" onclick="clickBtn(${i});" />${problem_name}<br>`
  23. // ボタンの挿入位置
  24. const button_place = document.querySelector('div.col-sm-12 span.error');
  25. // ボタンの挿入
  26. button_place.insertAdjacentHTML('beforebegin', button_txt);
  27. };
  28.  
  29. // scriptの作成
  30. const script_elem = document.createElement("script");
  31. // scriptの中身
  32. script_elem.innerText = `function clickBtn(index) {
  33. document.getElementById('select-task').selectedIndex = index;
  34. };`
  35. // buttonの下の挿入
  36. const button_place = document.querySelector('div.col-sm-12 span.error');
  37. button_place.appendChild(script_elem);
  38. })();