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