/**
  * This function tests whether the class detect users properly in groups.
  *
  */
 public function test_user_in_group()
 {
     $sgroup = new skills_group($this->groupids[0]);
     // Only the last two users are in the group.
     $this->assertTrue($sgroup->user_in_group($this->users[self::NUMBEROFUSERS - 1]->id));
     $this->assertFalse($sgroup->user_in_group($this->users[0]->id));
     $this->assertFalse($sgroup->user_in_group($this->users[4]->id));
 }
$groupid = required_param('groupid', PARAM_INT);
$url = new moodle_url('/blocks/skills_group/edit_skills_group.php', array('courseid' => $courseid, 'groupid' => $groupid, 'sesskey' => $USER->sesskey));
block_skills_group_setup_page($courseid, $url, get_string('adduserstogroup', BLOCK_SG_LANG_TABLE));
$error = null;
$sgs = new skills_group_setting($courseid);
// In case user tries to manually access page - check that settings exist.
if ($sgs->exists()) {
    $sgroup = new skills_group($groupid);
} else {
    $error = get_string('notconfigured', BLOCK_SG_LANG_TABLE);
}
set_header();
echo $OUTPUT->header();
display_header();
if ($error == null) {
    if ($sgroup->user_in_group($USER->id)) {
        display_group_selector();
        display_locked_students($courseid, $groupid);
        display_settings($groupid);
    } else {
        $error = get_string('notingroup', BLOCK_SG_LANG_TABLE);
    }
}
display_buttons();
load_yui_modules($courseid, $groupid, $error);
echo $OUTPUT->footer();
/**
 * This function set the page header -> JS/CSS includes.
 *
 */
function set_header()