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


PHP assign::get_feedback_plugin_by_type方法代码示例

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


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

示例1: strlen

 /**
  * Format the submission and feedback columns
  *
  * @param string $colname The column name
  * @param stdClass $row The submission row
  * @return mixed string or NULL
  */
 function other_cols($colname, $row)
 {
     if (($pos = strpos($colname, 'assignsubmission_')) !== false) {
         $plugin = $this->assignment->get_submission_plugin_by_type(substr($colname, strlen('assignsubmission_')));
         if ($plugin->is_visible() && $plugin->is_enabled()) {
             if ($row->submissionid) {
                 $submission = new stdClass();
                 $submission->id = $row->submissionid;
                 $submission->timecreated = $row->firstsubmission;
                 $submission->timemodified = $row->timesubmitted;
                 $submission->assignment = $this->assignment->get_instance()->id;
                 $submission->userid = $row->userid;
                 return $this->format_plugin_summary_with_link($plugin, $submission, 'grading', array());
             }
         }
         return '';
     }
     if (($pos = strpos($colname, 'feedback_')) !== false) {
         $plugin = $this->assignment->get_feedback_plugin_by_type(substr($colname, strlen('assignfeedback_')));
         if ($plugin->is_visible() && $plugin->is_enabled()) {
             $grade = null;
             if ($row->gradeid) {
                 $grade = new stdClass();
                 $grade->id = $row->gradeid;
                 $grade->timecreated = $row->firstmarked;
                 $grade->timemodified = $row->timemarked;
                 $grade->assignment = $this->assignment->get_instance()->id;
                 $grade->userid = $row->userid;
                 $grade->grade = $row->grade;
                 $grade->mailed = $row->mailed;
             }
             if ($this->quickgrading && $plugin->supports_quickgrading()) {
                 return $plugin->get_quickgrading_html($row->userid, $grade);
             } else {
                 if ($grade) {
                     return $this->format_plugin_summary_with_link($plugin, $grade, 'grading', array());
                 }
             }
         }
         return '';
     }
     return NULL;
 }
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:50,代码来源:gradingtable.php

示例2: test_upgrade_offline_assignment

    public function test_upgrade_offline_assignment() {
        global $DB;

        $this->setUser($this->editingteachers[0]);
        $generator = $this->getDataGenerator()->get_plugin_generator('mod_assignment');
        $params = array('course'=>$this->course->id,
                        'assignmenttype'=>'offline');
        $record = $generator->create_instance($params);

        $assignment = new assignment_base($record->cmid);

        $this->setAdminUser();
        $log = '';
        $upgrader = new assign_upgrade_manager();

        $this->assertTrue($upgrader->upgrade_assignment($assignment->assignment->id, $log));
        $record = $DB->get_record('assign', array('course'=>$this->course->id));

        $cm = get_coursemodule_from_instance('assign', $record->id);
        $context = context_module::instance($cm->id);

        $assign = new assign($context, $cm, $this->course);

        $plugin = $assign->get_submission_plugin_by_type('onlinetext');
        $this->assertEmpty($plugin->is_enabled());
        $plugin = $assign->get_submission_plugin_by_type('comments');
        $this->assertEmpty($plugin->is_enabled());
        $plugin = $assign->get_submission_plugin_by_type('file');
        $this->assertEmpty($plugin->is_enabled());
        $plugin = $assign->get_feedback_plugin_by_type('comments');
        $this->assertNotEmpty($plugin->is_enabled());
        $plugin = $assign->get_feedback_plugin_by_type('file');
        $this->assertEmpty($plugin->is_enabled());
        $plugin = $assign->get_feedback_plugin_by_type('offline');
        $this->assertEmpty($plugin->is_enabled());

        course_delete_module($cm->id);
    }
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:38,代码来源:upgradelib_test.php


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