/** * 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; }
/** * 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')]); }
/** * 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); }
/** * 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]); }
/** * 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); }
/** * 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; }
/** * 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)]]]]); }
/** * 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)]); }
/** * 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]); }
/** * 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' => 'http://adlnet.gov/expapi/verbs/registered', 'display' => $this->readVerbDisplay($opts)], 'object' => $this->readApp($opts)]); }
/** * 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')]]); }
/** * 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'])]); }
/** * 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]); }
/** * 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')]); }
/** * 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]); }
/** * 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']); }
/** * 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']); return array_merge(parent::read($opts), ['attempt' => $attempt, 'module' => $this->repo->readModule($attempt->quiz, 'quiz')]); }
/** * 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://activitystrea.ms/schema/1.0/start', 'display' => $this->readVerbDisplay($opts)], 'object' => ['id' => $opts['attempt_url'], 'definition' => ['type' => $opts['attempt_type'], 'name' => [$opts['context_lang'] => $opts['attempt_name']], 'extensions' => [$opts['attempt_ext_key'] => $opts['attempt_ext']]]], 'context' => ['contextActivities' => ['grouping' => [$this->readCourse($opts), $this->readModule($opts)]]]]); }
/** * 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://adlnet.gov/expapi/verbs/registered', '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']]]], 'context' => ['contextActivities' => ['grouping' => [$this->readCourse($opts)], 'parent' => [$this->readModule($opts)], 'category' => [['id' => 'http://xapi.trainingevidencesystems.com/recipes/attendance/0_0_1#detailed', 'definition' => ['type' => 'http://id.tincanapi.com/activitytype/recipe']]]]]]); }
/** * 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://adlnet.gov/expapi/verbs/completed', 'display' => $this->readVerbDisplay($opts)], 'object' => $this->readCourse($opts)]); }
/** * 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://adlnet.gov/expapi/verbs/launched', 'display' => $this->readVerbDisplay($opts)], 'object' => $this->readModule($opts), 'context' => ['contextActivities' => ['grouping' => [$this->readCourse($opts)]]]]); }
/** * 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' => 'user_loggedin']); }
/** * Reads data for an event. * @param [String => Mixed] $opts * @return [String => Mixed] * @override Event */ public function read(array $opts) { $submission = $this->repo->readObject($opts['objectid'], $opts['objecttable']); return array_merge(parent::read($opts), ['submission' => $submission, 'module' => $this->repo->readModule($submission->assignment, 'assign')]); }
/** * 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' => 'user_registered', 'user_id' => $opts['relateduser']->id, 'user_url' => $opts['relateduser']->url, 'user_name' => $opts['relateduser']->username]); }
/** * 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' => 'http://id.tincanapi.com/verb/viewed', 'display' => $this->readVerbDisplay($opts)]]); }
/** * 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), []); }
public function read($input) { $xfer = 0; $fname = null; $ftype = 0; $fid = 0; $xfer += $input->readStructBegin($fname); while (true) { $xfer += $input->readFieldBegin($fname, $ftype, $fid); if ($ftype == TType::STOP) { break; } switch ($fid) { case 0: if ($ftype == TType::LST) { $this->success = array(); $_size173 = 0; $_etype176 = 0; $xfer += $input->readListBegin($_etype176, $_size173); for ($_i177 = 0; $_i177 < $_size173; ++$_i177) { $elem178 = null; $elem178 = new Event(); $xfer += $elem178->read($input); $this->success[] = $elem178; } $xfer += $input->readListEnd(); } else { $xfer += $input->skip($ftype); } break; default: $xfer += $input->skip($ftype); break; } $xfer += $input->readFieldEnd(); } $xfer += $input->readStructEnd(); return $xfer; }