timelineVariable(variable_name) {
            if (typeof this.timeline_parameters == "undefined") {
                return this.findTimelineVariable(variable_name);
            }
            else {
                // if progress.current_location is -1, then the timeline variable is being evaluated
                // in a function that runs prior to the trial starting, so we should treat that trial
                // as being the active trial for purposes of finding the value of the timeline variable
                var loc = Math.max(0, this.progress.current_location);
                // if loc is greater than the number of elements on this timeline, then the timeline
                // variable is being evaluated in a function that runs after the trial on the timeline
                // are complete but before advancing to the next (like a loop_function).
                // treat the last active trial as the active trial for this purpose.
                if (loc == this.timeline_parameters.timeline.length) {
                    loc = loc - 1;
                }
                // now find the variable
                return this.timeline_parameters.timeline[loc].timelineVariable(variable_name);
            }
        }
// recursive downward search for active trial to extract timeline variable

recursive downward search for active trial to extract timeline variable
recursive downward search for active trial to extract timeline variable
timelineVariable(variable_name) {
            if (typeof this.timeline_parameters == "undefined") {
                return this.findTimelineVariable(variable_name);
            }
            else {
                var loc = Math.max(0, this.progress.current_location);
                if (loc == this.timeline_parameters.timeline.length) {
                    loc = loc - 1;
                }
                return this.timeline_parameters.timeline[loc].timelineVariable(variable_name);
            }
        }
timelineVariable ( variable_name ) { if ( typeof this . timeline_parameters == "undefined" ) { return this . findTimelineVariable ( variable_name ) ; } else { var loc = Math . max ( 0 , this . progress . current_location ) ; if ( loc == this . timeline_parameters . timeline . length ) { loc = loc - 1 ; } return this . timeline_parameters . timeline [ loc ] . timelineVariable ( variable_name ) ; } }
recursive downward search for active trial to extract timeline variable
recursive downward search for active trial to extract timeline variable
// if progress.current_location is -1, then the timeline variable is being evaluated
 // in a function that runs prior to the trial starting, so we should treat that trial
 // as being the active trial for purposes of finding the value of the timeline variable
 // if loc is greater than the number of elements on this timeline, then the timeline
 // variable is being evaluated in a function that runs after the trial on the timeline
 // are complete but before advancing to the next (like a loop_function).
 // treat the last active trial as the active trial for this purpose.
 // now find the variable
