當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。