Skip to contents

Helper function to enforce fixed area rules (this one checks if the total amount of pixels that have been scrolled down from the top of the website is superior to 30). NB: you should probably not have to call this function yourself, but you can use it as a basis to create your own rule. All arguments are automatically passed to any rule function by eye_scroll_correct

Usage

rule_after_scrolling(data_line, fixed_areas_bundle, flag, scroll)

Arguments

data_line

The current line in the .csv file. Includes all the original columns, along with a new "Timestamp.Shifted" column (Timestamp - time_shit), along with "Corrected.X" and "Corrected.Y" columns, which are "Fixation.X" and "Fixation.Y" respectively shifted by top_left_x and top_left_y of the calibration stage

fixed_areas_bundle

The array of fixed areas linked to this rule

flag

A boolean that says if this rule is TRUE or FALSE at the moment

scroll

The total amount of pixels that have been scrolled down from the top of the website at the moment

Value

A boolean saying if this rule should now be enforced or not

Examples

rule_after_scrolling <- function (data_line, fixed_areas_bundle, flag, scroll)
{
  if (scroll >= 30)
  {
    return (TRUE)
  }
  else
  {
    return(FALSE)
  }
}
rules <- list(rule_before_scrolling, rule_after_scrolling, rule_true)