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


PHP stdClass::get_user_submission方法代码示例

本文整理汇总了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);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:18,代码来源:events_test.php

示例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);
 }
开发者ID:jamesmcq,项目名称:o365-moodle,代码行数:22,代码来源:events_test.php


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