本文整理汇总了PHP中stdClass::get_user_submission方法的典型用法代码示例。如果您正苦于以下问题:PHP stdClass::get_user_submission方法的具体用法?PHP stdClass::get_user_submission怎么用?PHP stdClass::get_user_submission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stdClass
的用法示例。
在下文中一共展示了stdClass::get_user_submission方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* Setup all the various parts of an assignment activity including creating an onlinetext submission.
*/
protected function setUp()
{
$this->user = $this->getDataGenerator()->create_user();
$this->course = $this->getDataGenerator()->create_course();
$generator = $this->getDataGenerator()->get_plugin_generator('mod_assign');
$params['course'] = $this->course->id;
$instance = $generator->create_instance($params);
$this->cm = get_coursemodule_from_instance('assign', $instance->id);
$this->context = context_module::instance($this->cm->id);
$this->assign = new testable_assign($this->context, $this->cm, $this->course);
$this->setUser($this->user->id);
$this->submission = $this->assign->get_user_submission($this->user->id, true);
$this->data = new stdClass();
$this->data->onlinetext_editor = array('itemid' => file_get_unused_draft_itemid(), 'text' => 'Submission text', 'format' => FORMAT_PLAIN);
}
示例2: setUp
/**
* Setup all the various parts of an assignment activity including creating a file submission.
*/
protected function setUp()
{
$this->user = $this->getDataGenerator()->create_user();
$this->course = $this->getDataGenerator()->create_course();
$generator = $this->getDataGenerator()->get_plugin_generator('mod_assign');
$params['course'] = $this->course->id;
$instance = $generator->create_instance($params);
$this->cm = get_coursemodule_from_instance('assign', $instance->id);
$this->context = context_module::instance($this->cm->id);
$this->assign = new testable_assign($this->context, $this->cm, $this->course);
$this->setUser($this->user->id);
$this->submission = $this->assign->get_user_submission($this->user->id, true);
$fs = get_file_storage();
$dummy = (object) array('contextid' => $this->context->id, 'component' => 'assignsubmission_onenote', 'filearea' => \local_onenote\api\base::ASSIGNSUBMISSION_ONENOTE_FILEAREA, 'itemid' => $this->submission->id, 'filepath' => '/', 'filename' => 'myassignmnent.pdf');
$this->fi = $fs->create_file_from_string($dummy, 'Content of ' . $dummy->filename);
$dummy = (object) array('contextid' => $this->context->id, 'component' => 'assignsubmission_onenote', 'filearea' => \local_onenote\api\base::ASSIGNSUBMISSION_ONENOTE_FILEAREA, 'itemid' => $this->submission->id, 'filepath' => '/', 'filename' => 'myassignmnent.png');
$this->fi2 = $fs->create_file_from_string($dummy, 'Content of ' . $dummy->filename);
$this->files = $fs->get_area_files($this->context->id, 'assignsubmission_onenote', \local_onenote\api\base::ASSIGNSUBMISSION_ONENOTE_FILEAREA, $this->submission->id, 'id', false);
}