original_string: public function get_current_group($cm, $course, $context) {
          $groupmode = groups_get_activity_groupmode($cm, $course);
          $currentgroup = groups_get_activity_group($cm, true);
  
          if ($groupmode == SEPARATEGROUPS && !$currentgroup && !has_capability('moodle/site:accessallgroups', $context)) {
              $currentgroup = self::NO_GROUPS_ALLOWED;
          }
  
          return $currentgroup;
      }
code: public function get_current_group($cm, $course, $context) {
          $groupmode = groups_get_activity_groupmode($cm, $course);
          $currentgroup = groups_get_activity_group($cm, true);
  
          if ($groupmode == SEPARATEGROUPS && !$currentgroup && !has_capability('moodle/site:accessallgroups', $context)) {
              $currentgroup = self::NO_GROUPS_ALLOWED;
          }
  
          return $currentgroup;
      }
code_tokens: public function get_current_group ( $ cm , $ course , $ context ) { $ groupmode = groups_get_activity_groupmode ( $ cm , $ course ) ; $ currentgroup = groups_get_activity_group ( $ cm , true ) ; if ( $ groupmode == SEPARATEGROUPS && ! $ currentgroup && ! has_capability ( 'moodle/site:accessallgroups' , $ context ) ) { $ currentgroup = self :: NO_GROUPS_ALLOWED ; } return $ currentgroup ; }
docstring: Get the current group for the user user looking at the report.
  
  @param object $cm the course_module information.
  @param object $coures the course settings.
  @param context $context the quiz context.
  @return int the current group id, if applicable. 0 for all users,
  NO_GROUPS_ALLOWED if the user cannot see any group.
docstring_tokens: Get the current group for the user user looking at the report .