original_string: protected function feedback_viewed(\cm_info $cm, $contextid, $userid, $after = null) {
          // If stats are published any write action counts as viewed feedback.
          if (!empty($this->instancedata[$cm->instance]->publish_stats)) {
              $user = (object)['id' => $userid];
              return $this->any_write_log($contextid, $user);
          }
  
          return parent::feedback_viewed($cm, $contextid, $userid, $after);
      }
code: protected function feedback_viewed(\cm_info $cm, $contextid, $userid, $after = null) {
          // If stats are published any write action counts as viewed feedback.
          if (!empty($this->instancedata[$cm->instance]->publish_stats)) {
              $user = (object)['id' => $userid];
              return $this->any_write_log($contextid, $user);
          }
  
          return parent::feedback_viewed($cm, $contextid, $userid, $after);
      }
code_tokens: protected function feedback_viewed ( \ cm_info $ cm , $ contextid , $ userid , $ after = null ) { // If stats are published any write action counts as viewed feedback. if ( ! empty ( $ this -> instancedata [ $ cm -> instance ] -> publish_stats ) ) { $ user = ( object ) [ 'id' => $ userid ] ; return $ this -> any_write_log ( $ contextid , $ user ) ; } return parent :: feedback_viewed ( $ cm , $ contextid , $ userid , $ after ) ; }
docstring: Overwritten to mark as viewed if stats are published.
  
  @param \cm_info $cm
  @param int $contextid
  @param int $userid
  @param int $after
  @return bool
docstring_tokens: Overwritten to mark as viewed if stats are published .