mainScript.js
/* 
    This function reads the input Question text file and if answer file is already uploaded then it calls 'findAnswer'
    function 
    */
This function reads the input Question text file and if answer file is already uploaded then it calls 'findAnswer'
function
This function reads the input Question text file and if answer file is already uploaded then it calls ' findAnswer ' function
function readQuestionUNLFile() {
        questionInput = document.getElementById('questionFileInput');
        questionInput.addEventListener('change', function (e) {
            questionFile = questionInput.files[0];
            textType = /text.*/;
            if (questionFile.type.match(textType)) {
                var questionReader = new FileReader();
                questionReader.onload = function (e) {
                    var x = questionReader.result.split("{unl}")[1].split(")");
                    var iCount = 0;
                    while (iCount < x.length - 1) {
                        questionObject.push(
                {
                    relationName: x[iCount].split("(")[0].trim(),
                    firstArgument: x[iCount].split("(")[1].split(",")[0].trim(),
                    secondArgument: x[iCount].split("(")[1].split(",")[1].trim(),
                    otherInfo: "no"
                }
		                    );
                        iCount++;
                    }
                    var xx = questionObject[1].relationName.substring(1, 2);
                    canFindAnswer++;
                    if (canFindAnswer > 1) { findAnswer(); }
                }
                questionReader.readAsText(questionFile);
            }
            else {
                alert("Input file cannot be read");
            }
        });
    }
function readQuestionUNLFile ( ) { questionInput = document . getElementById ( 'questionFileInput' ) ; questionInput . addEventListener ( 'change' , function ( e ) { questionFile = questionInput . files [ 0 ] ; textType = / text.* / ; if ( questionFile . type . match ( textType ) ) { var questionReader = new FileReader ( ) ; questionReader . onload = function ( e ) { var x = questionReader . result . split ( "{unl}" ) [ 1 ] . split ( ")" ) ; var iCount = 0 ; while ( iCount < x . length - 1 ) { questionObject . push ( { relationName : x [ iCount ] . split ( "(" ) [ 0 ] . trim ( ) , firstArgument : x [ iCount ] . split ( "(" ) [ 1 ] . split ( "," ) [ 0 ] . trim ( ) , secondArgument : x [ iCount ] . split ( "(" ) [ 1 ] . split ( "," ) [ 1 ] . trim ( ) , otherInfo : "no" } ) ; iCount ++ ; } var xx = questionObject [ 1 ] . relationName . substring ( 1 , 2 ) ; canFindAnswer ++ ; if ( canFindAnswer > 1 ) { findAnswer ( ) ; } } questionReader . readAsText ( questionFile ) ; } else { alert ( "Input file cannot be read" ) ; } } ) ; }
This function reads the input Question text file and if answer file is already uploaded then it calls 'findAnswer'
function
This function reads the input Question text file and if answer file is already uploaded then it calls ' findAnswer ' function