当前位置: 首页>>代码示例>>PHP>>正文


PHP workshop::submission_attachment_options方法代码示例

本文整理汇总了PHP中workshop::submission_attachment_options方法的典型用法代码示例。如果您正苦于以下问题:PHP workshop::submission_attachment_options方法的具体用法?PHP workshop::submission_attachment_options怎么用?PHP workshop::submission_attachment_options使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在workshop的用法示例。


在下文中一共展示了workshop::submission_attachment_options方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: redirect

    }
    if ($asid == workshop::ALLOCATION_EXISTS) {
        // the training assessment of the example was not found but the allocation already
        // exists. this probably means that the user is the author of the reference assessment.
        echo $output->header();
        echo $output->box(get_string('assessmentreferenceconflict', 'workshop'));
        echo $output->continue_button($workshop->view_url());
        echo $output->footer();
        die;
    }
    redirect($workshop->exassess_url($asid));
}
if ($edit and $canmanage) {
    require_once dirname(__FILE__) . '/submission_form.php';
    $example = file_prepare_standard_editor($example, 'content', $workshop->submission_content_options(), $workshop->context, 'mod_workshop', 'submission_content', $example->id);
    $example = file_prepare_standard_filemanager($example, 'attachment', $workshop->submission_attachment_options(), $workshop->context, 'mod_workshop', 'submission_attachment', $example->id);
    $mform = new workshop_submission_form($PAGE->url, array('current' => $example, 'workshop' => $workshop, 'contentopts' => $workshop->submission_content_options(), 'attachmentopts' => $workshop->submission_attachment_options()));
    if ($mform->is_cancelled()) {
        redirect($workshop->view_url());
    } elseif ($canmanage and $formdata = $mform->get_data()) {
        if ($formdata->example == 1) {
            // this was used just for validation, it must be set to one when dealing with example submissions
            unset($formdata->example);
        } else {
            throw new coding_exception('Invalid submission form data value: example');
        }
        $timenow = time();
        if (is_null($example->id)) {
            $formdata->workshopid = $workshop->id;
            $formdata->example = 1;
            $formdata->authorid = $USER->id;
开发者ID:rushi963,项目名称:moodle,代码行数:31,代码来源:exsubmission.php

示例2: elseif

    // ok you can go
    $seenaspublished = true;
} elseif (is_null($submission->id) and $cansubmit) {
    // ok you can go
} else {
    print_error('nopermissions', 'error', $workshop->view_url(), 'view or create submission');
}
if ($assess and $submission->id and !$isreviewer and $canallocate and $workshop->assessing_allowed($USER->id)) {
    require_sesskey();
    $assessmentid = $workshop->add_allocation($submission, $USER->id);
    redirect($workshop->assess_url($assessmentid));
}
if ($edit) {
    require_once __DIR__ . '/submission_form.php';
    $submission = file_prepare_standard_editor($submission, 'content', $workshop->submission_content_options(), $workshop->context, 'mod_workshop', 'submission_content', $submission->id);
    $submission = file_prepare_standard_filemanager($submission, 'attachment', $workshop->submission_attachment_options(), $workshop->context, 'mod_workshop', 'submission_attachment', $submission->id);
    $mform = new workshop_submission_form($PAGE->url, array('current' => $submission, 'workshop' => $workshop, 'contentopts' => $workshop->submission_content_options(), 'attachmentopts' => $workshop->submission_attachment_options()));
    if ($mform->is_cancelled()) {
        redirect($workshop->view_url());
    } elseif ($cansubmit and $formdata = $mform->get_data()) {
        if ($formdata->example == 0) {
            // this was used just for validation, it must be set to zero when dealing with normal submissions
            unset($formdata->example);
        } else {
            throw new coding_exception('Invalid submission form data value: example');
        }
        $timenow = time();
        if (is_null($submission->id)) {
            $formdata->workshopid = $workshop->id;
            $formdata->example = 0;
            $formdata->authorid = $USER->id;
开发者ID:jackdaniels79,项目名称:moodle,代码行数:31,代码来源:submission.php


注:本文中的workshop::submission_attachment_options方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。