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


PHP workshop::instruction_editors_options方法代码示例

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


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

示例1: file_rewrite_pluginfile_urls

    }
}

// output starts here
$output = $PAGE->get_renderer('mod_workshop');      // workshop renderer
echo $output->header();
echo $output->heading(get_string('assessedexample', 'workshop'), 2);

$example = $workshop->get_example_by_id($example->id);     // reload so can be passed to the renderer
echo $output->render($workshop->prepare_example_submission(($example)));

// show instructions for assessing as thay may contain important information
// for evaluating the assessment
if (trim($workshop->instructreviewers)) {
    $instructions = file_rewrite_pluginfile_urls($workshop->instructreviewers, 'pluginfile.php', $PAGE->context->id,
        'mod_workshop', 'instructreviewers', 0, workshop::instruction_editors_options($PAGE->context));
    print_collapsible_region_start('', 'workshop-viewlet-instructreviewers', get_string('instructreviewers', 'workshop'));
    echo $output->box(format_text($instructions, $workshop->instructreviewersformat, array('overflowdiv'=>true)), array('generalbox', 'instructions'));
    print_collapsible_region_end();
}

// extend the current assessment record with user details
$assessment = $workshop->get_assessment_by_id($assessment->id);

if ($canmanage and $assessment->weight == 1) {
    $options = array(
        'showreviewer'  => false,
        'showauthor'    => false,
        'showform'      => true,
    );
    $assessment = $workshop->prepare_example_reference_assessment($assessment, $mform, $options);
开发者ID:verbazend,项目名称:AWFA,代码行数:31,代码来源:exassessment.php

示例2: elseif

if ($edit) {
    $PAGE->navbar->add(get_string('mysubmission', 'workshop'), $workshop->submission_url(), navigation_node::TYPE_CUSTOM);
    $PAGE->navbar->add(get_string('editingsubmission', 'workshop'));
} elseif ($ownsubmission) {
    $PAGE->navbar->add(get_string('mysubmission', 'workshop'));
} else {
    $PAGE->navbar->add(get_string('submission', 'workshop'));
}
// Output starts here
$output = $PAGE->get_renderer('mod_workshop');
echo $output->header();
echo $output->heading(format_string($workshop->name), 2);
// show instructions for submitting as thay may contain some list of questions and we need to know them
// while reading the submitted answer
if (trim($workshop->instructauthors)) {
    $instructions = file_rewrite_pluginfile_urls($workshop->instructauthors, 'pluginfile.php', $PAGE->context->id, 'mod_workshop', 'instructauthors', 0, workshop::instruction_editors_options($PAGE->context));
    print_collapsible_region_start('', 'workshop-viewlet-instructauthors', get_string('instructauthors', 'workshop'));
    echo $output->box(format_text($instructions, $workshop->instructauthorsformat, array('overflowdiv' => true)), array('generalbox', 'instructions'));
    print_collapsible_region_end();
}
// if in edit mode, display the form to edit the submission
if ($edit) {
    if (!empty($CFG->enableplagiarism)) {
        require_once $CFG->libdir . '/plagiarismlib.php';
        echo plagiarism_print_disclosure($cm->id);
    }
    $mform->display();
    echo $output->footer();
    die;
}
// else display the submission
开发者ID:alanaipe2015,项目名称:moodle,代码行数:31,代码来源:submission.php

示例3: get_string

                 $buttontext = get_string('assess', 'workshop');
             } else {
                 $class = ' graded';
                 $submission->status = 'graded';
                 $buttontext = get_string('reassess', 'workshop');
             }
             echo $output->box_start('generalbox assessment-summary' . $class);
             echo $output->render($workshop->prepare_submission_summary($submission, $shownames));
             echo $output->box_end();
         }
         print_collapsible_region_end();
     }
     break;
 case workshop::PHASE_CLOSED:
     if (trim($workshop->conclusion)) {
         $conclusion = file_rewrite_pluginfile_urls($workshop->conclusion, 'pluginfile.php', $workshop->context->id, 'mod_workshop', 'conclusion', 0, workshop::instruction_editors_options($workshop->context));
         print_collapsible_region_start('', 'workshop-viewlet-conclusion', get_string('conclusion', 'workshop'));
         echo $output->box(format_text($conclusion, $workshop->conclusionformat, array('overflowdiv' => true)), array('generalbox', 'conclusion'));
         print_collapsible_region_end();
     }
     $finalgrades = $workshop->get_gradebook_grades($USER->id);
     if (!empty($finalgrades)) {
         print_collapsible_region_start('', 'workshop-viewlet-yourgrades', get_string('yourgrades', 'workshop'));
         echo $output->box_start('generalbox grades-yourgrades');
         echo $output->render($finalgrades);
         echo $output->box_end();
         print_collapsible_region_end();
     }
     if (has_capability('mod/workshop:viewallassessments', $PAGE->context)) {
         $perpage = get_user_preferences('workshop_perpage', 10);
         $groupid = groups_get_activity_group($workshop->cm, true);
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:view.php

示例4: workshop_update_instance

/**
 * Given an object containing all the necessary data,
 * (defined by the form in mod_form.php) this function
 * will update an existing instance with new data.
 *
 * @param stdClass $workshop An object from the form in mod_form.php
 * @return bool success
 */
function workshop_update_instance(stdclass $workshop) {
    global $CFG, $DB;
    require_once(dirname(__FILE__) . '/locallib.php');

    $workshop->timemodified          = time();
    $workshop->id                    = $workshop->instance;
    $workshop->useexamples           = (int)!empty($workshop->useexamples);
    $workshop->usepeerassessment     = (int)!empty($workshop->usepeerassessment);
    $workshop->useselfassessment     = (int)!empty($workshop->useselfassessment);
    $workshop->latesubmissions       = (int)!empty($workshop->latesubmissions);
    $workshop->phaseswitchassessment = (int)!empty($workshop->phaseswitchassessment);
    $workshop->evaluation            = 'best';

    // todo - if the grading strategy is being changed, we must replace all aggregated peer grades with nulls
    // todo - if maximum grades are being changed, we should probably recalculate or invalidate them

    $DB->update_record('workshop', $workshop);
    $context = get_context_instance(CONTEXT_MODULE, $workshop->coursemodule);

    // process the custom wysiwyg editors
    if ($draftitemid = $workshop->instructauthorseditor['itemid']) {
        $workshop->instructauthors = file_save_draft_area_files($draftitemid, $context->id, 'mod_workshop', 'instructauthors',
                0, workshop::instruction_editors_options($context), $workshop->instructauthorseditor['text']);
        $workshop->instructauthorsformat = $workshop->instructauthorseditor['format'];
    }

    if ($draftitemid = $workshop->instructreviewerseditor['itemid']) {
        $workshop->instructreviewers = file_save_draft_area_files($draftitemid, $context->id, 'mod_workshop', 'instructreviewers',
                0, workshop::instruction_editors_options($context), $workshop->instructreviewerseditor['text']);
        $workshop->instructreviewersformat = $workshop->instructreviewerseditor['format'];
    }

    // re-save the record with the replaced URLs in editor fields
    $DB->update_record('workshop', $workshop);

    // update gradebook items
    workshop_grade_item_update($workshop);
    workshop_grade_item_category_update($workshop);

    // update calendar events
    workshop_calendar_update($workshop, $workshop->coursemodule);

    return true;
}
开发者ID:ncsu-delta,项目名称:moodle,代码行数:52,代码来源:lib.php

示例5: data_preprocessing

 /**
  * Prepares the form before data are set
  *
  * Additional wysiwyg editor are prepared here, the introeditor is prepared automatically by core.
  * Grade items are set here because the core modedit supports single grade item only.
  *
  * @param array $data to be set
  * @return void
  */
 public function data_preprocessing(&$data)
 {
     if ($this->current->instance) {
         // editing an existing workshop - let us prepare the added editor elements (intro done automatically)
         $draftitemid = file_get_submitted_draft_itemid('instructauthors');
         $data['instructauthorseditor']['text'] = file_prepare_draft_area($draftitemid, $this->context->id, 'mod_workshop', 'instructauthors', 0, workshop::instruction_editors_options($this->context), $data['instructauthors']);
         $data['instructauthorseditor']['format'] = $data['instructauthorsformat'];
         $data['instructauthorseditor']['itemid'] = $draftitemid;
         $draftitemid = file_get_submitted_draft_itemid('instructreviewers');
         $data['instructreviewerseditor']['text'] = file_prepare_draft_area($draftitemid, $this->context->id, 'mod_workshop', 'instructreviewers', 0, workshop::instruction_editors_options($this->context), $data['instructreviewers']);
         $data['instructreviewerseditor']['format'] = $data['instructreviewersformat'];
         $data['instructreviewerseditor']['itemid'] = $draftitemid;
         $draftitemid = file_get_submitted_draft_itemid('conclusion');
         $data['conclusioneditor']['text'] = file_prepare_draft_area($draftitemid, $this->context->id, 'mod_workshop', 'conclusion', 0, workshop::instruction_editors_options($this->context), $data['conclusion']);
         $data['conclusioneditor']['format'] = $data['conclusionformat'];
         $data['conclusioneditor']['itemid'] = $draftitemid;
     } else {
         // adding a new workshop instance
         $draftitemid = file_get_submitted_draft_itemid('instructauthors');
         file_prepare_draft_area($draftitemid, null, 'mod_workshop', 'instructauthors', 0);
         // no context yet, itemid not used
         $data['instructauthorseditor'] = array('text' => '', 'format' => editors_get_preferred_format(), 'itemid' => $draftitemid);
         $draftitemid = file_get_submitted_draft_itemid('instructreviewers');
         file_prepare_draft_area($draftitemid, null, 'mod_workshop', 'instructreviewers', 0);
         // no context yet, itemid not used
         $data['instructreviewerseditor'] = array('text' => '', 'format' => editors_get_preferred_format(), 'itemid' => $draftitemid);
         $draftitemid = file_get_submitted_draft_itemid('conclusion');
         file_prepare_draft_area($draftitemid, null, 'mod_workshop', 'conclusion', 0);
         // no context yet, itemid not used
         $data['conclusioneditor'] = array('text' => '', 'format' => editors_get_preferred_format(), 'itemid' => $draftitemid);
     }
 }
开发者ID:sirromas,项目名称:lms,代码行数:41,代码来源:mod_form.php

示例6: workshop_update_instance

/**
 * Given an object containing all the necessary data,
 * (defined by the form in mod_form.php) this function
 * will update an existing instance with new data.
 *
 * @param stdClass $workshop An object from the form in mod_form.php
 * @return bool success
 */
function workshop_update_instance(stdclass $workshop) {
    global $CFG, $DB;
    require_once(dirname(__FILE__) . '/locallib.php');

    $workshop->timemodified          = time();
    $workshop->id                    = $workshop->instance;
    $workshop->useexamples           = (int)!empty($workshop->useexamples);
    $workshop->usepeerassessment     = 1;
    $workshop->useselfassessment     = (int)!empty($workshop->useselfassessment);
    $workshop->latesubmissions       = (int)!empty($workshop->latesubmissions);
    $workshop->phaseswitchassessment = (int)!empty($workshop->phaseswitchassessment);

    if (isset($workshop->gradinggradepass)) {
        $workshop->gradinggradepass = unformat_float($workshop->gradinggradepass);
    }

    if (isset($workshop->submissiongradepass)) {
        $workshop->submissiongradepass = unformat_float($workshop->submissiongradepass);
    }

    if (isset($workshop->submissionfiletypes)) {
        $workshop->submissionfiletypes = workshop::clean_file_extensions($workshop->submissionfiletypes);
    }

    if (isset($workshop->overallfeedbackfiletypes)) {
        $workshop->overallfeedbackfiletypes = workshop::clean_file_extensions($workshop->overallfeedbackfiletypes);
    }

    // todo - if the grading strategy is being changed, we may want to replace all aggregated peer grades with nulls

    $DB->update_record('workshop', $workshop);
    $context = context_module::instance($workshop->coursemodule);

    // process the custom wysiwyg editors
    if ($draftitemid = $workshop->instructauthorseditor['itemid']) {
        $workshop->instructauthors = file_save_draft_area_files($draftitemid, $context->id, 'mod_workshop', 'instructauthors',
                0, workshop::instruction_editors_options($context), $workshop->instructauthorseditor['text']);
        $workshop->instructauthorsformat = $workshop->instructauthorseditor['format'];
    }

    if ($draftitemid = $workshop->instructreviewerseditor['itemid']) {
        $workshop->instructreviewers = file_save_draft_area_files($draftitemid, $context->id, 'mod_workshop', 'instructreviewers',
                0, workshop::instruction_editors_options($context), $workshop->instructreviewerseditor['text']);
        $workshop->instructreviewersformat = $workshop->instructreviewerseditor['format'];
    }

    if ($draftitemid = $workshop->conclusioneditor['itemid']) {
        $workshop->conclusion = file_save_draft_area_files($draftitemid, $context->id, 'mod_workshop', 'conclusion',
                0, workshop::instruction_editors_options($context), $workshop->conclusioneditor['text']);
        $workshop->conclusionformat = $workshop->conclusioneditor['format'];
    }

    // re-save the record with the replaced URLs in editor fields
    $DB->update_record('workshop', $workshop);

    // update gradebook items
    workshop_grade_item_update($workshop);
    workshop_grade_item_category_update($workshop);

    // update calendar events
    workshop_calendar_update($workshop, $workshop->coursemodule);

    return true;
}
开发者ID:rohitshriwas,项目名称:moodle,代码行数:72,代码来源:lib.php

示例7: get_string

            } else {
                $class = ' graded';
                $submission->status = 'graded';
                $buttontext = get_string('reassess', 'workshop');
            }
            echo $output->box_start('generalbox assessment-summary' . $class);
            echo $output->render($workshop->prepare_submission_summary($submission, $shownames));
            echo $output->box_end();
        }
        print_collapsible_region_end();
    }
    break;
case workshop::PHASE_CLOSED:
    if (trim($workshop->conclusion)) {
        $conclusion = file_rewrite_pluginfile_urls($workshop->conclusion, 'pluginfile.php', $workshop->context->id,
            'mod_workshop', 'conclusion', 0, workshop::instruction_editors_options($workshop->context));
        print_collapsible_region_start('', 'workshop-viewlet-conclusion', get_string('conclusion', 'workshop'));
        echo $output->box(format_text($conclusion, $workshop->conclusionformat, array('overflowdiv'=>true)), array('generalbox', 'conclusion'));
        print_collapsible_region_end();
    }
    $finalgrades = $workshop->get_gradebook_grades($USER->id);
    if (!empty($finalgrades)) {
        print_collapsible_region_start('', 'workshop-viewlet-yourgrades', get_string('yourgrades', 'workshop'));
        echo $output->box_start('generalbox grades-yourgrades');
        echo $output->render($finalgrades);
        echo $output->box_end();
        print_collapsible_region_end();
    }
    if (has_capability('mod/workshop:viewallassessments', $PAGE->context)) {
        $perpage = get_user_preferences('workshop_perpage', 10);
        $groupid = groups_get_activity_group($workshop->cm, true);
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:view.php


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