original_string: public function is_unseen($param) {
          global $USER, $DB;
          if (is_array($param)) {
              $seenpages = $param;
              return (!array_key_exists($this->properties->id, $seenpages));
          } else {
              $nretakes = $param;
              if (!$DB->count_records("lesson_attempts", array("pageid"=>$this->properties->id, "userid"=>$USER->id, "retry"=>$nretakes))) {
                  return true;
              }
          }
          return false;
      }
code: public function is_unseen($param) {
          global $USER, $DB;
          if (is_array($param)) {
              $seenpages = $param;
              return (!array_key_exists($this->properties->id, $seenpages));
          } else {
              $nretakes = $param;
              if (!$DB->count_records("lesson_attempts", array("pageid"=>$this->properties->id, "userid"=>$USER->id, "retry"=>$nretakes))) {
                  return true;
              }
          }
          return false;
      }
code_tokens: public function is_unseen ( $ param ) { global $ USER , $ DB ; if ( is_array ( $ param ) ) { $ seenpages = $ param ; return ( ! array_key_exists ( $ this -> properties -> id , $ seenpages ) ) ; } else { $ nretakes = $ param ; if ( ! $ DB -> count_records ( "lesson_attempts" , array ( "pageid" => $ this -> properties -> id , "userid" => $ USER -> id , "retry" => $ nretakes ) ) ) { return true ; } } return false ; }
docstring: Returns true if a page has been viewed before
  
  @param array|int $param Either an array of pages that have been seen or the
  number of retakes a user has had
  @return bool
docstring_tokens: Returns true if a page has been viewed before