public static function get_activity_groupmode($cmid) {
        global $USER;

        // Warnings array, it can be empty at the end but is mandatory.
        $warnings = array();

        $params = array(
            'cmid' => $cmid
        );
        $params = self::validate_parameters(self::get_activity_groupmode_parameters(), $params);
        $cmid = $params['cmid'];

        $cm = get_coursemodule_from_id(null, $cmid, 0, false, MUST_EXIST);

        // Security checks.
        $context = context_module::instance($cm->id);
        self::validate_context($context);

        $groupmode = groups_get_activity_groupmode($cm);

        $results = array(
            'groupmode' => $groupmode,
            'warnings' => $warnings
        );
        return $results;
    }
public static function get_activity_groupmode($cmid) {
        global $USER;

        // Warnings array, it can be empty at the end but is mandatory.
        $warnings = array();

        $params = array(
            'cmid' => $cmid
        );
        $params = self::validate_parameters(self::get_activity_groupmode_parameters(), $params);
        $cmid = $params['cmid'];

        $cm = get_coursemodule_from_id(null, $cmid, 0, false, MUST_EXIST);

        // Security checks.
        $context = context_module::instance($cm->id);
        self::validate_context($context);

        $groupmode = groups_get_activity_groupmode($cm);

        $results = array(
            'groupmode' => $groupmode,
            'warnings' => $warnings
        );
        return $results;
    }
public static function get_activity_groupmode ( $ cmid ) { global $ USER ; // Warnings array, it can be empty at the end but is mandatory. $ warnings = array ( ) ; $ params = array ( 'cmid' => $ cmid ) ; $ params = self :: validate_parameters ( self :: get_activity_groupmode_parameters ( ) , $ params ) ; $ cmid = $ params [ 'cmid' ] ; $ cm = get_coursemodule_from_id ( null , $ cmid , 0 , false , MUST_EXIST ) ; // Security checks. $ context = context_module :: instance ( $ cm -> id ) ; self :: validate_context ( $ context ) ; $ groupmode = groups_get_activity_groupmode ( $ cm ) ; $ results = array ( 'groupmode' => $ groupmode , 'warnings' => $ warnings ) ; return $ results ; }
Returns effective groupmode used in a given activity.

@throws moodle_exception
@param int $cmid course module id.
@return array containing the group mode and possible warnings.
@since Moodle 3.0
@throws moodle_exception
Returns effective groupmode used in a given activity .