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;
    }
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;
    }
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 ; }
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
Returns true if a page has been viewed before