Пример #1
0
/**
 * @file group.php
 * @brief group statistics
 */
$require_current_course = true;
$require_course_admin = true;
$require_help = true;
$helpTopic = 'Usage';
$require_login = true;
require_once '../../include/baseTheme.php';
require_once 'modules/group/group_functions.php';
require_once "statistics_tools_bar.php";
statistics_tools($course_code, "group");
$navigation[] = array('url' => 'index.php?course=' . $course_code, 'name' => $langUsage);
$pageName = $langGroupUsage;
initialize_group_info();
$q = Database::get()->queryArray("SELECT id, name, g.description, max_members, COUNT(*) AS registered\n\t              FROM `group` AS g, group_members AS gm\n\t\t      WHERE g.course_id = ?d AND g.id = gm.group_id\n\t\t      GROUP BY g.id", $course_id);
if (count($q) > 0) {
    $tool_content .= "<div class='table-responsive'><table class='table-default'>\n\t\t<tr>\n\t\t  <th class='text-left'>{$langGroupName}</th>\n\t\t  <th class='text-center'>{$langGroupTutor}</th>\n\t\t  <th class='text-center'>{$langRegistered}</th>\n\t\t  <th class='text-center'>{$langMax}</th>\n\t\t</tr>";
    foreach ($q as $group) {
        $tool_content .= "<td>\n\t\t\t<a href='../group/group_usage.php?course={$course_code}&amp;module=usage&amp;group_id={$group->id}'>" . q($group->name) . "</a></td>";
        $tool_content .= "<td>" . display_user(group_tutors($group->id)) . "</td>";
        $tool_content .= "<td class='text-center'>{$group->registered}</td>";
        if ($group->max_members == 0) {
            $tool_content .= "<td class='text-center'>-</td>";
        } else {
            $tool_content .= "<td class='text-center'>{$group->max_members}</td>";
        }
        $tool_content .= "</tr>";
    }
    $tool_content .= "</table></div>";
Пример #2
0
 * Open eClass is an open platform distributed in the hope that it will
 * be useful (without any warranty), under the terms of the GNU (General
 * Public License) as published by the Free Software Foundation.
 * The full license can be read in "/info/license/license_gpl.txt".
 *
 * Contact address: GUnet Asynchronous eLearning Group,
 *                  Network Operations Center, University of Athens,
 *                  Panepistimiopolis Ilissia, 15784, Athens, Greece
 *                  e-mail: info@openeclass.org
 * ======================================================================== */
$require_current_course = TRUE;
require_once '../../include/init.php';
require_once 'group_functions.php';
require_once 'modules/usage/duration_query.php';
$group_id = intval($_REQUEST['group_id']);
initialize_group_info($group_id);
if (!$is_editor and !$is_tutor) {
    header('Location: group_space.php?course=' . $course_code . '&group_id=' . $group_id);
    exit;
}
if ($is_editor) {
    if (isset($_GET['enc']) and $_GET['enc'] == '1253') {
        $charset = 'Windows-1253';
    } else {
        $charset = 'UTF-8';
    }
    $crlf = "\r\n";
    header("Content-Type: text/csv; charset={$charset}");
    header("Content-Disposition: attachment; filename=groupuserduration.csv");
    if (isset($_REQUEST['u_date_start']) and isset($_REQUEST['u_date_end'])) {
        $u_date_start = $_REQUEST['u_date_start'];
Пример #3
0
function send_file($id, $file_type) {
    global $course_code, $uid, $is_editor, $courses;
    if (isset($file_type)) {
        $info = Database::get()->querySingle("SELECT * FROM assignment WHERE id = ?d", $id);
        // don't show file if: assignment nonexistent, not editor, not active assignment, module not visible
        if (count($info) == 0 or
            !($is_editor or
              ($info->active and visible_module(MODULE_ID_ASSIGN)))) {
            return false;
        }
        send_file_to_client("$GLOBALS[workPath]/admin_files/$info->file_path", $info->file_name, null, true);
    } else {
        $info = Database::get()->querySingle("SELECT * FROM assignment_submit WHERE id = ?d", $id);
        if (count($info)==0) {
            return false;
        }
        if ($info->group_id) {
            initialize_group_info($info->group_id);
        }
        if (!($is_editor or $info->uid == $uid or $GLOBALS['is_member'])) {
            return false;
        }
        send_file_to_client("$GLOBALS[workPath]/$info->file_path", $info->file_name, null, true);
    }
    exit;
}
Пример #4
0
function send_file($id, $file_type)
{
    global $course_code, $uid, $is_editor;
    if (isset($file_type)) {
        $info = Database::get()->querySingle("SELECT * FROM assignment WHERE id = ?d", $id);
        if (count($info) == 0) {
            return false;
        }
        if (!($is_editor || $GLOBALS['is_member'])) {
            return false;
        }
        send_file_to_client("{$GLOBALS['workPath']}/admin_files/{$info->file_path}", $info->file_name, null, true);
    } else {
        $info = Database::get()->querySingle("SELECT * FROM assignment_submit WHERE id = ?d", $id);
        if (count($info) == 0) {
            return false;
        }
        if ($info->group_id) {
            initialize_group_info($info->group_id);
        }
        if (!($is_editor or $info->uid == $uid or $GLOBALS['is_member'])) {
            return false;
        }
        send_file_to_client("{$GLOBALS['workPath']}/{$info->file_path}", $info->file_name, null, true);
    }
    exit;
}
Пример #5
0
function init_forum_group_info($forum_id)
{
    global $course_id, $group_id, $can_post, $is_member, $is_editor;
    $q = Database::get()->querySingle("SELECT id FROM `group`\n\t\t\tWHERE course_id = ?d AND forum_id = ?d", $course_id, $forum_id);
    if ($q) {
        $group_id = $q->id;
        initialize_group_info($group_id);
    } else {
        $group_id = false;
    }
    if (!$group_id or $is_member or $is_editor) {
        $can_post = true;
    } else {
        $can_post = false;
    }
    return $group_id;
}