BorjaScript

Spain-estudios script por Borja

2014/07/12のページです。最新版はこちら

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name        BorjaScript
// @namespace   http://spain-estudios.com/
// @include     http://spain-estudios.com/?survey=job
// @version     1.2
// @grant       none
// @description Spain-estudios script por Borja
// ==/UserScript==

var surv = $('.surv').html();
var surv_num = surv.replace(/\D+/g, '');

var num_name = surv_num;
if(num_name == '410') { num_name = '4'; } //Bug con la pregunta 4

var timerVar = setInterval(function () {
    Script();
}, 1000);

function Script() {
    var done = 0;

    while(done==0) {
	    if ($('[name="q' + num_name + '"]').length > 0) {
		    
		    //usar con precaucion
		    //$("#TimerButton").prop('value', 'Responder');
		    //$("#TimerButton").prop('disabled', false);


	        if ($('[name="q' + num_name + '"]').is(':checked')) {
	            //hay una opcion selecionado
	            if ($('#TimerButton').prop('value') == 'Responder') {
	                $('#TimerButton').click();
	                done = 1;
	            }
	        } else {
	            //si no hay una opcion selecionada
	            var value = 1 + Math.floor(Math.random() * 3);
	            $('[value^=\'' + value + '\']').prop('checked', true)
	            if ($('#TimerButton').prop('value') == 'Responder') {
	                $('#TimerButton').click();
	                done = 1;
	            }
	        }
	        if (done == 1) {
	          	setTimeout(function () { }, 7000);
	        }
	    }
	}
}