original_string: protected function get_activities($starttime, $endtime, $student = false) {
  
          $activitytype = $this->get_activity_type();
  
          // Var $student may not be available, default to not calculating dynamic data.
          $studentid = -1;
          if ($student) {
              $studentid = $student->id;
          }
          $modinfo = get_fast_modinfo($this->course->get_course_data(), $studentid);
          $activities = $modinfo->get_instances_of($activitytype);
  
          $timerangeactivities = array();
          foreach ($activities as $activity) {
  
              if (!$this->activity_completed_by($activity, $starttime, $endtime, $student)) {
                  continue;
              }
  
              $timerangeactivities[$activity->context->id] = $activity;
          }
  
          return $timerangeactivities;
      }
code: protected function get_activities($starttime, $endtime, $student = false) {
  
          $activitytype = $this->get_activity_type();
  
          // Var $student may not be available, default to not calculating dynamic data.
          $studentid = -1;
          if ($student) {
              $studentid = $student->id;
          }
          $modinfo = get_fast_modinfo($this->course->get_course_data(), $studentid);
          $activities = $modinfo->get_instances_of($activitytype);
  
          $timerangeactivities = array();
          foreach ($activities as $activity) {
  
              if (!$this->activity_completed_by($activity, $starttime, $endtime, $student)) {
                  continue;
              }
  
              $timerangeactivities[$activity->context->id] = $activity;
          }
  
          return $timerangeactivities;
      }
code_tokens: protected function get_activities ( $ starttime , $ endtime , $ student = false ) { $ activitytype = $ this -> get_activity_type ( ) ; // Var $student may not be available, default to not calculating dynamic data. $ studentid = - 1 ; if ( $ student ) { $ studentid = $ student -> id ; } $ modinfo = get_fast_modinfo ( $ this -> course -> get_course_data ( ) , $ studentid ) ; $ activities = $ modinfo -> get_instances_of ( $ activitytype ) ; $ timerangeactivities = array ( ) ; foreach ( $ activities as $ activity ) { if ( ! $ this -> activity_completed_by ( $ activity , $ starttime , $ endtime , $ student ) ) { continue ; } $ timerangeactivities [ $ activity -> context -> id ] = $ activity ; } return $ timerangeactivities ; }
docstring: Guesses all activities that were available during a period of time.
  
  @param int $starttime
  @param int $endtime
  @param \stdClass|false $student
  @return array
docstring_tokens: Guesses all activities that were available during a period of time .