function submitToTurk(data) {
        const turk = turkInfo();
        const assignmentId = turk.assignmentId;
        const turkSubmitTo = turk.turkSubmitTo;
        if (!assignmentId || !turkSubmitTo)
            return;
        const form = document.createElement("form");
        form.method = "POST";
        form.action = turkSubmitTo + "/mturk/externalSubmit?assignmentId=" + assignmentId;
        for (const key in data) {
            if (data.hasOwnProperty(key)) {
                const hiddenField = document.createElement("input");
                hiddenField.type = "hidden";
                hiddenField.name = key;
                hiddenField.id = key;
                hiddenField.value = data[key];
                form.appendChild(hiddenField);
            }
        }
        document.body.appendChild(form);
        form.submit();
    }
/**
     * Send data to Mechnical Turk for storage.
     * @param data An object containing `key:value` pairs to send to Mechanical Turk. Values
     * cannot contain nested objects, arrays, or functions.
     * @returns Nothing
     */
Send data to Mechnical Turk for storage.
@param data An object containing `key:value` pairs to send to Mechanical Turk. Values
cannot contain nested objects, arrays, or functions.
@returns Nothing
Send data to Mechnical Turk for storage . @param data An object containing ` key : value ` pairs to send to Mechanical Turk . Values cannot contain nested objects arrays or functions . @returns Nothing
function submitToTurk(data) {
        const turk = turkInfo();
        const assignmentId = turk.assignmentId;
        const turkSubmitTo = turk.turkSubmitTo;
        if (!assignmentId || !turkSubmitTo)
            return;
        const form = document.createElement("form");
        form.method = "POST";
        form.action = turkSubmitTo + "/mturk/externalSubmit?assignmentId=" + assignmentId;
        for (const key in data) {
            if (data.hasOwnProperty(key)) {
                const hiddenField = document.createElement("input");
                hiddenField.type = "hidden";
                hiddenField.name = key;
                hiddenField.id = key;
                hiddenField.value = data[key];
                form.appendChild(hiddenField);
            }
        }
        document.body.appendChild(form);
        form.submit();
    }
function submitToTurk ( data ) { const turk = turkInfo ( ) ; const assignmentId = turk . assignmentId ; const turkSubmitTo = turk . turkSubmitTo ; if ( ! assignmentId || ! turkSubmitTo ) return ; const form = document . createElement ( "form" ) ; form . method = "POST" ; form . action = turkSubmitTo + "/mturk/externalSubmit?assignmentId=" + assignmentId ; for ( const key in data ) { if ( data . hasOwnProperty ( key ) ) { const hiddenField = document . createElement ( "input" ) ; hiddenField . type = "hidden" ; hiddenField . name = key ; hiddenField . id = key ; hiddenField . value = data [ key ] ; form . appendChild ( hiddenField ) ; } } document . body . appendChild ( form ) ; form . submit ( ) ; }
Send data to Mechnical Turk for storage.
Send data to Mechnical Turk for storage .