Exemplo n.º 1
0
}
// Submission download requested
if ($is_allowedToEdit && $cmd == 'rqDownload' && (claro_is_platform_admin() || get_conf('allow_download_all_submissions'))) {
    require_once $includePath . '/lib/form.lib.php';
    $dialogBox->title(get_lang('Download'));
    $dialogBox->form('<form action="' . get_module_url('CLWRK') . '/export.php" method="POST">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exDownload" />' . "\n" . '<input type="radio" name="downloadMode" id="downloadMode_from" value="from" checked /><label for="downloadMode_from">' . get_lang('Submissions posted or modified after date :') . '</label><br />' . "\n" . claro_html_date_form('day', 'month', 'year', time(), 'long') . ' ' . claro_html_time_form('hour', 'minute', time() - fmod(time(), 86400) - 3600) . '<small>' . get_lang('(d/m/y hh:mm)') . '</small>' . '<br /><br />' . "\n" . '<input type="radio" name="downloadMode" id="downloadMode_all" value="all" /><label for="downloadMode_all">' . get_lang('All submissions') . '</label><br /><br />' . "\n" . '<input type="checkbox" name="downloadOnlyCurrentMembers" id="downloadOnlyCurrentMembers_id" value="yes" checked="checked" /><label for="downloadOnlyCurrentMembers_id">' . get_lang('Download only submissions from current course members') . '</label><br /><br />' . "\n" . '<input type="checkbox" name="downloadScore" id="downloadScore_id" value="yes" checked="checked" /><label for="downloadScore_id">' . get_lang('Download score') . '</label><br /><br />' . "\n" . '<input type="submit" value="' . get_lang('OK') . '" />&nbsp;' . "\n" . claro_html_button('work.php', get_lang('Cancel')) . '</form>' . "\n");
}
if ($is_allowedToEdit) {
    /*--------------------------------------------------------------------
                            CHANGE VISIBILITY
      --------------------------------------------------------------------*/
    // change visibility of an assignment
    if ($cmd == 'exChVis') {
        if (isset($_REQUEST['vis'])) {
            $_REQUEST['vis'] == 'v' ? $visibility = 'VISIBLE' : ($visibility = 'INVISIBLE');
            Assignment::updateAssignmentVisibility($assigId, $visibility);
            // notify eventmanager
            $eventNotifier->notifyCourseEvent('work_updated', claro_get_current_course_id(), claro_get_current_tool_id(), $assigId, claro_get_current_group_id(), '0');
            if ($_REQUEST['vis'] == 'v') {
                $eventNotifier->notifyCourseEvent('work_visible', claro_get_current_course_id(), claro_get_current_tool_id(), $assigId, claro_get_current_group_id(), '0');
            } else {
                $eventNotifier->notifyCourseEvent('work_invisible', claro_get_current_course_id(), claro_get_current_tool_id(), $assigId, claro_get_current_group_id(), '0');
            }
        }
    }
    /*--------------------------------------------------------------------
                            DELETE AN ASSIGNMENT
      --------------------------------------------------------------------*/
    // delete/remove an assignment
    if ($cmd == 'exRmAssig') {
        $assignment->delete();