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


PHP Event::read方法代码示例

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


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

示例1: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     $statement = array_merge_recursive(parent::read($opts), ['verb' => ['id' => 'http://adlnet.gov/expapi/verbs/attended', 'display' => $this->readVerbDisplay($opts)], 'object' => ['id' => $opts['session_url'], 'definition' => ['type' => $opts['session_type'], 'name' => [$opts['context_lang'] => $opts['session_name']], 'description' => [$opts['context_lang'] => $opts['session_description']]]], 'result' => ['duration' => $opts['attempt_duration'], 'completion' => $opts['attempt_completion']], 'context' => ['instructor' => $this->readUser($opts, 'user'), 'contextActivities' => ['grouping' => [$this->readCourse($opts)], 'parent' => [$this->readModule($opts)], 'category' => [['id' => 'http://xapi.trainingevidencesystems.com/recipes/attendance/0_0_1#simple', 'definition' => ['type' => 'http://id.tincanapi.com/activitytype/recipe']]]]]]);
     // Overwrite actor, don't merge it.
     $statement['actor'] = $this->readUser($opts, 'attendee');
     return $statement;
 }
开发者ID:learninglocker,项目名称:xapi-recipe-emitter,代码行数:13,代码来源:Attended.php

示例2: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     $grade = $this->repo->readObject($opts['objectid'], $opts['objecttable']);
     $grade_comment = $this->repo->readGradeComment($grade->id, $grade->assignment)->commenttext;
     $grade_items = $this->repo->readGradeItems($grade->assignment, 'assign');
     return array_merge(parent::read($opts), ['grade' => $grade, 'grade_comment' => $grade_comment, 'grade_items' => $grade_items, 'graded_user' => $this->repo->readUser($grade->userid), 'module' => $this->repo->readModule($grade->assignment, 'assign')]);
 }
开发者ID:garemoko,项目名称:Moodle-Log-Expander,代码行数:13,代码来源:AssignmentGraded.php

示例3: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     $statement = ['verb' => ['id' => 'http://adlnet.gov/expapi/verbs/completed', 'display' => $this->readVerbDisplay($opts)], 'result' => ['score' => ['raw' => $opts['attempt_score_raw'], 'min' => $opts['attempt_score_min'], 'max' => $opts['attempt_score_max'], 'scaled' => $opts['attempt_score_scaled']], 'completion' => $opts['attempt_completed'], 'duration' => $opts['attempt_duration']], 'object' => ['id' => $opts['module_url'], 'definition' => ['type' => $opts['module_type'], 'name' => [$opts['context_lang'] => $opts['module_name']], 'description' => [$opts['context_lang'] => $opts['module_description']]]], 'context' => ['contextActivities' => ['grouping' => [$this->readCourse($opts), ['id' => $opts['attempt_url'], 'definition' => ['type' => $opts['attempt_type'], 'name' => [$opts['context_lang'] => $opts['attempt_name']], 'extensions' => [$opts['attempt_ext_key'] => $opts['attempt_ext']]]]]]]];
     if (!is_null($opts['attempt_success'])) {
         $statement['result']['success'] = $opts['attempt_success'];
     }
     return array_merge_recursive(parent::read($opts), $statement);
 }
开发者ID:ds10,项目名称:xAPI-Recipe-Emitter,代码行数:14,代码来源:AttemptCompleted.php

示例4: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     $attempt = $this->repo->readAttempt($opts['objectid']);
     $grade_items = $this->repo->readGradeItems($attempt->quiz, 'quiz');
     $attempt->questions = $this->repo->readQuestionAttempts($attempt->id);
     $questions = $this->repo->readQuestions($attempt->quiz);
     return array_merge(parent::read($opts), ['attempt' => $attempt, 'module' => $this->repo->readModule($attempt->quiz, 'quiz'), 'grade_items' => $grade_items, 'questions' => $questions]);
 }
开发者ID:garemoko,项目名称:Moodle-Log-Expander,代码行数:14,代码来源:AttemptEvent.php

示例5: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     $statement = ['verb' => ['id' => 'http://adlnet.gov/expapi/verbs/answered', 'display' => $this->readVerbDisplay($opts)], 'result' => ['score' => ['raw' => $opts['attempt_score_raw'], 'min' => $opts['attempt_score_min'], 'max' => $opts['attempt_score_max'], 'scaled' => $opts['attempt_score_scaled']], 'completion' => $opts['attempt_completed'], 'response' => $opts['attempt_response']], 'object' => $this->readQuestion($opts), 'context' => ['contextActivities' => ['parent' => [$this->readModule($opts)], 'grouping' => [$this->readCourse($opts), ['id' => $opts['attempt_url']]]]]];
     if (!is_null($opts['attempt_success'])) {
         $statement['result']['success'] = $opts['attempt_success'];
     }
     return array_merge_recursive(parent::read($opts), $statement);
 }
开发者ID:learninglocker,项目名称:xapi-recipe-emitter,代码行数:14,代码来源:QuestionAnswered.php

示例6: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     $instructor = parent::read($opts)['actor'];
     $statement = array_merge_recursive(parent::read($opts), ['verb' => ['id' => 'http://adlnet.gov/expapi/verbs/scored', 'display' => $this->readVerbDisplay($opts)], 'result' => ['score' => ['raw' => $opts['grade_score_raw'], 'min' => $opts['grade_score_min'], 'max' => $opts['grade_score_max'], 'scaled' => $opts['grade_score_scaled']], 'completion' => $opts['grade_completed'], 'response' => $opts['grade_comment']], 'object' => $this->readModule($opts), 'context' => ['contextActivities' => ['parent' => [$this->readCourse($opts)]], 'instructor' => $instructor]]);
     //Excluded from array merge to make sure that the actor is overwritten e.g. if a different IFI is used.
     $statement['actor'] = ['objectType' => 'Agent', 'name' => $opts['graded_user_name'], 'account' => ['homePage' => $opts['graded_user_url'], 'name' => $opts['graded_user_id']]];
     if (!is_null($opts['grade_success'])) {
         $statement['result']['success'] = $opts['grade_success'];
     }
     return $statement;
 }
开发者ID:ds10,项目名称:xAPI-Recipe-Emitter,代码行数:17,代码来源:AssignmentGraded.php

示例7: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     return array_merge_recursive(parent::read($opts), ['verb' => ['id' => 'http://www.tincanapi.co.uk/verbs/evaluated', 'display' => $this->readVerbDisplay($opts)], 'result' => ['score' => ['raw' => $opts['grade_result']], 'completion' => true], 'object' => ['objectType' => 'Agent', 'name' => $opts['graded_user_name'], 'account' => ['homePage' => $opts['graded_user_url'], 'name' => $opts['graded_user_id']]], 'context' => ['contextActivities' => ['grouping' => [$this->readCourse($opts), $this->readModule($opts)]]]]);
 }
开发者ID:CinecaElearning,项目名称:xAPI-Recipe-Emitter,代码行数:10,代码来源:AssignmentGraded.php

示例8: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     return array_merge(parent::read($opts), ['verb' => ['id' => 'https://brindlewaye.com/xAPITerms/verbs/loggedout/', 'display' => $this->readVerbDisplay($opts)], 'object' => $this->readApp($opts)]);
 }
开发者ID:ds10,项目名称:xAPI-Recipe-Emitter,代码行数:10,代码来源:UserLoggedout.php

示例9: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     $session = $this->repo->readFacetofaceSession($opts['objectid']);
     return array_merge(parent::read($opts), ['module' => $this->repo->readModule($session->facetoface, 'facetoface'), 'session' => $session]);
 }
开发者ID:learninglocker,项目名称:moodle-log-expander,代码行数:11,代码来源:FacetofaceEvent.php

示例10: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     return array_merge_recursive(parent::read($opts), ['verb' => ['id' => 'http://www.tincanapi.co.uk/verbs/enrolled_onto_learning_plan', 'display' => $this->readVerbDisplay($opts)], 'object' => $this->readCourse($opts), 'context' => ['instructor' => $this->readUser($opts, 'instructor')]]);
 }
开发者ID:ds10,项目名称:xAPI-Recipe-Emitter,代码行数:10,代码来源:EnrolmentCreated.php

示例11: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     return array_merge(parent::read($opts), ['module' => $this->repo->readModule($opts['objectid'], $opts['objecttable'])]);
 }
开发者ID:garemoko,项目名称:Moodle-Log-Expander,代码行数:10,代码来源:ModuleEvent.php

示例12: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     $attempt = $this->repo->readFeedbackAttempt($opts['objectid']);
     return array_merge(parent::read($opts), ['module' => $this->repo->readModule($attempt->feedback, 'feedback'), 'questions' => $this->repo->readFeedbackQuestions($attempt->feedback), 'attempt' => $attempt]);
 }
开发者ID:learninglocker,项目名称:moodle-log-expander,代码行数:11,代码来源:FeedbackSubmitted.php

示例13: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     $grade = $this->repo->readObject($opts['objectid'], $opts['objecttable']);
     return array_merge(parent::read($opts), ['grade' => $grade, 'graded_user' => $this->repo->readUser($grade->userid), 'module' => $this->repo->readModule($grade->assignment, 'assign')]);
 }
开发者ID:CinecaElearning,项目名称:Moodle-Log-Expander,代码行数:11,代码来源:AssignmentGraded.php

示例14: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     $scorm_scoes = $this->repo->readObject($opts['objectid'], $opts['objecttable']);
     return array_merge(parent::read($opts), ['module' => $this->repo->readModule($scorm_scoes->scorm, 'scorm'), 'scorm_scoes' => $scorm_scoes]);
 }
开发者ID:garemoko,项目名称:Moodle-Log-Expander,代码行数:11,代码来源:ScormLaunched.php

示例15: read

 /**
  * Reads data for an event.
  * @param [String => Mixed] $opts
  * @return [String => Mixed]
  * @override Event
  */
 public function read(array $opts)
 {
     return array_merge(parent::read($opts), ['recipe' => 'course_viewed', 'course_url' => $opts['course']->url, 'course_name' => $opts['course']->fullname ?: 'A Moodle course', 'course_description' => $opts['course']->summary ?: 'A Moodle course', 'course_type' => static::$xapi_type . $opts['course']->type, 'course_ext' => $opts['course'], 'course_ext_key' => 'http://lrs.learninglocker.net/define/extensions/moodle_course']);
 }
开发者ID:CinecaElearning,项目名称:Moodle-xAPI-Translator,代码行数:10,代码来源:CourseViewed.php


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