function saveTextToFile(textstr, filename) {
        const blobToSave = new Blob([textstr], {
            type: "text/plain",
        });
        let blobURL = "";
        if (typeof window.webkitURL !== "undefined") {
            blobURL = window.webkitURL.createObjectURL(blobToSave);
        }
        else {
            blobURL = window.URL.createObjectURL(blobToSave);
        }
        const link = document.createElement("a");
        link.id = "jspsych-download-as-text-link";
        link.style.display = "none";
        link.download = filename;
        link.href = blobURL;
        link.click();
    }
// private function to save text file on local drive

private function to save text file on local drive
private function to save text file on local drive
function saveTextToFile(textstr, filename) {
        const blobToSave = new Blob([textstr], {
            type: "text/plain",
        });
        let blobURL = "";
        if (typeof window.webkitURL !== "undefined") {
            blobURL = window.webkitURL.createObjectURL(blobToSave);
        }
        else {
            blobURL = window.URL.createObjectURL(blobToSave);
        }
        const link = document.createElement("a");
        link.id = "jspsych-download-as-text-link";
        link.style.display = "none";
        link.download = filename;
        link.href = blobURL;
        link.click();
    }
function saveTextToFile ( textstr , filename ) { const blobToSave = new Blob ( [ textstr ] , { type : "text/plain" , } ) ; let blobURL = "" ; if ( typeof window . webkitURL !== "undefined" ) { blobURL = window . webkitURL . createObjectURL ( blobToSave ) ; } else { blobURL = window . URL . createObjectURL ( blobToSave ) ; } const link = document . createElement ( "a" ) ; link . id = "jspsych-download-as-text-link" ; link . style . display = "none" ; link . download = filename ; link . href = blobURL ; link . click ( ) ; }
private function to save text file on local drive
private function to save text file on local drive