<commit_before><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php
require_once('../../../config.php');
require_once('../lib.php');
require_once('common.php');
$id      = required_param('id', PARAM_INT);
$groupid = optional_param('groupid', 0, PARAM_INT); //only for teachers
if (!$chat = $DB->get_record('chat', array('id'=>$id))) {
    print_error('invalidid', 'chat');
}

if (!$course = $DB->get_record('course', array('id'=>$chat->course))) {
    print_error('invalidcourseid');
}

if (!$cm = get_coursemodule_from_instance('chat', $chat->id, $course->id)) {
    print_error('invalidcoursemodule');
}

$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_login($course->id, false, $cm);
require_capability('mod/chat:chat',$context);

if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $cm->id)))
{
    print_header();
    notice(get_string("activityiscurrentlyhidden"));
}

/// Check to see if groups are being used here
 if ($groupmode = groups_get_activity_groupmode($cm)) {   // Groups are being used
    if ($groupid = groups_get_activity_group($cm)) {
        if (!$group = groups_get_group($groupid, false)) {
            print_error('invalidgroupid');
        }
        $groupname = ': '.$group->name;
    } else {
        $groupname = ': '.get_string('allparticipants');
    }
} else {
    $groupid = 0;
    $groupname = '';
}

// login chat room
if (!$chat_sid = chat_login_user($chat->id, 'ajax', $groupid, $course)) {
    print_error('cantlogin', 'chat');
}

// language string
$str_chat     = get_string('modulename', 'chat'); // must be before current_language() in chat_login_user() to force course language!!!
$str_send    = get_string('send', 'chat');
$str_sending = get_string('sending', 'chat');
$str_title   = format_string($course->shortname) . ": ".format_string($chat->name,true).$groupname;
$str_inputarea = get_string('inputarea', 'chat');
$str_userlist  = get_string('userlist',  'chat');
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" /><commit_msg>"CHAT/MDL-14651, move down DOCTYPE declaration"<commit_after><?php
require_once('../../../config.php');
require_once('../lib.php');
require_once('common.php');
$id      = required_param('id', PARAM_INT);
$groupid = optional_param('groupid', 0, PARAM_INT); //only for teachers
if (!$chat = $DB->get_record('chat', array('id'=>$id))) {
    print_error('invalidid', 'chat');
}

if (!$course = $DB->get_record('course', array('id'=>$chat->course))) {
    print_error('invalidcourseid');
}

if (!$cm = get_coursemodule_from_instance('chat', $chat->id, $course->id)) {
    print_error('invalidcoursemodule');
}

$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_login($course->id, false, $cm);
require_capability('mod/chat:chat',$context);

if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $cm->id)))
{
    print_header();
    notice(get_string("activityiscurrentlyhidden"));
}

/// Check to see if groups are being used here
 if ($groupmode = groups_get_activity_groupmode($cm)) {   // Groups are being used
    if ($groupid = groups_get_activity_group($cm)) {
        if (!$group = groups_get_group($groupid, false)) {
            print_error('invalidgroupid');
        }
        $groupname = ': '.$group->name;
    } else {
        $groupname = ': '.get_string('allparticipants');
    }
} else {
    $groupid = 0;
    $groupname = '';
}

// login chat room
if (!$chat_sid = chat_login_user($chat->id, 'ajax', $groupid, $course)) {
    print_error('cantlogin', 'chat');
}

// language string
$str_chat     = get_string('modulename', 'chat'); // must be before current_language() in chat_login_user() to force course language!!!
$str_send    = get_string('send', 'chat');
$str_sending = get_string('sending', 'chat');
$str_title   = format_string($course->shortname) . ": ".format_string($chat->name,true).$groupname;
$str_inputarea = get_string('inputarea', 'chat');
$str_userlist  = get_string('userlist',  'chat');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
{'fraction_non_alphanumeric': 0.19728360957642727, 'fraction_numerical': 0.005294659300184162, 'mean_word_length': 4.816599732262383, 'pattern_counts': {'":': 2, '<': 13, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5187795', 'n_tokens_mistral': 1497, 'n_tokens_neox': 1469, 'n_words': 272}