function turkInfo() {
        const turk = {
            previewMode: false,
            outsideTurk: false,
            hitId: "INVALID_URL_PARAMETER",
            assignmentId: "INVALID_URL_PARAMETER",
            workerId: "INVALID_URL_PARAMETER",
            turkSubmitTo: "INVALID_URL_PARAMETER",
        };
        const param = function (url, name) {
            name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
            const regexS = "[\\?&]" + name + "=([^&#]*)";
            const regex = new RegExp(regexS);
            const results = regex.exec(url);
            return results == null ? "" : results[1];
        };
        const src = param(window.location.href, "assignmentId")
            ? window.location.href
            : document.referrer;
        const keys = ["assignmentId", "hitId", "workerId", "turkSubmitTo"];
        keys.map(function (key) {
            turk[key] = unescape(param(src, key));
        });
        turk.previewMode = turk.assignmentId == "ASSIGNMENT_ID_NOT_AVAILABLE";
        turk.outsideTurk =
            !turk.previewMode && turk.hitId === "" && turk.assignmentId == "" && turk.workerId == "";
        return turk;
    }
/**
     * Gets information about the Mechanical Turk Environment, HIT, Assignment, and Worker
     * by parsing the URL variables that Mechanical Turk generates.
     * @returns An object containing information about the Mechanical Turk Environment, HIT, Assignment, and Worker.
     */
Gets information about the Mechanical Turk Environment, HIT, Assignment, and Worker
by parsing the URL variables that Mechanical Turk generates.
@returns An object containing information about the Mechanical Turk Environment, HIT, Assignment, and Worker.
Gets information about the Mechanical Turk Environment HIT Assignment and Worker by parsing the URL variables that Mechanical Turk generates . @returns An object containing information about the Mechanical Turk Environment HIT Assignment and Worker .
function turkInfo() {
        const turk = {
            previewMode: false,
            outsideTurk: false,
            hitId: "INVALID_URL_PARAMETER",
            assignmentId: "INVALID_URL_PARAMETER",
            workerId: "INVALID_URL_PARAMETER",
            turkSubmitTo: "INVALID_URL_PARAMETER",
        };
        const param = function (url, name) {
            name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
            const regexS = "[\\?&]" + name + "=([^&#]*)";
            const regex = new RegExp(regexS);
            const results = regex.exec(url);
            return results == null ? "" : results[1];
        };
        const src = param(window.location.href, "assignmentId")
            ? window.location.href
            : document.referrer;
        const keys = ["assignmentId", "hitId", "workerId", "turkSubmitTo"];
        keys.map(function (key) {
            turk[key] = unescape(param(src, key));
        });
        turk.previewMode = turk.assignmentId == "ASSIGNMENT_ID_NOT_AVAILABLE";
        turk.outsideTurk =
            !turk.previewMode && turk.hitId === "" && turk.assignmentId == "" && turk.workerId == "";
        return turk;
    }
function turkInfo ( ) { const turk = { previewMode : false , outsideTurk : false , hitId : "INVALID_URL_PARAMETER" , assignmentId : "INVALID_URL_PARAMETER" , workerId : "INVALID_URL_PARAMETER" , turkSubmitTo : "INVALID_URL_PARAMETER" , } ; const param = function ( url , name ) { name = name . replace ( / [\[] / , "\\[" ) . replace ( / [\]] / , "\\]" ) ; const regexS = "[\\?&]" + name + "=([^&#]*)" ; const regex = new RegExp ( regexS ) ; const results = regex . exec ( url ) ; return results == null ? "" : results [ 1 ] ; } ; const src = param ( window . location . href , "assignmentId" ) ? window . location . href : document . referrer ; const keys = [ "assignmentId" , "hitId" , "workerId" , "turkSubmitTo" ] ; keys . map ( function ( key ) { turk [ key ] = unescape ( param ( src , key ) ) ; } ) ; turk . previewMode = turk . assignmentId == "ASSIGNMENT_ID_NOT_AVAILABLE" ; turk . outsideTurk = ! turk . previewMode && turk . hitId === "" && turk . assignmentId == "" && turk . workerId == "" ; return turk ; }
Gets information about the Mechanical Turk Environment, HIT, Assignment, and Worker
 by parsing the URL variables that Mechanical Turk generates.
Gets information about the Mechanical Turk Environment HIT Assignment and Worker by parsing the URL variables that Mechanical Turk generates .