本文整理汇总了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;
}
示例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);
}