function randomIfInsert(actualRandom) {
        return {
            timeline: [randomIf],
            timeline_variables: actualRandom.timeline_variables,
            conditional_function: function () { //function only happens is response is not correct!
                let data = jsPsych.data.get().last(1).values()[0];
                return data.correct !== true;
            }
        }
    }
/*function for inserting the same random element after incorrect response*/
function for inserting the same random element after incorrect response
function for inserting the same random element after incorrect response
function randomIfInsert(actualRandom) {
        return {
            timeline: [randomIf],
            timeline_variables: actualRandom.timeline_variables,
            conditional_function: function () { 
                let data = jsPsych.data.get().last(1).values()[0];
                return data.correct !== true;
            }
        }
    }
function randomIfInsert ( actualRandom ) { return { timeline : [ randomIf ] , timeline_variables : actualRandom . timeline_variables , conditional_function : function ( ) { let data = jsPsych . data . get ( ) . last ( 1 ) . values ( ) [ 0 ] ; return data . correct !== true ; } } }
function for inserting the same random element after incorrect response
function for inserting the same random element after incorrect response
//function only happens is response is not correct!