private function QuizQuestionH5PResponse::saveXAPIData in Quiz 7.4
Recusive save of xAPI data
Parameters
\H5P\XAPIData $data:
1 call to QuizQuestionH5PResponse::saveXAPIData()
- QuizQuestionH5PResponse::save in question_types/
quiz_h5p/ QuizQuestionH5PResponse.class.inc - Save current score and xAPI response in db.
File
- question_types/
quiz_h5p/ QuizQuestionH5PResponse.class.inc, line 38
Class
Code
private function saveXAPIData($data) {
// Save statement data
$dataID = db_insert('quiz_h5p_user_results')
->fields(array(
'parent_id' => $data
->getParentID(),
'question_nid' => $this->question->nid,
'question_vid' => $this->question->vid,
'result_id' => $this->rid,
'score_scaled' => $data
->getScoreScaled(),
'score_raw' => $data
->getScoreRaw(),
'score_min' => $data
->getScoreMin(),
'score_max' => $data
->getScoreMax(),
'interaction_type' => $data
->getInteractionType(),
'description' => $data
->getDescription(),
'correct_responses_pattern' => $data
->getCorrectResponsesPattern(),
'response' => $data
->getResponse(),
'additionals' => $data
->getAdditionals(),
))
->execute();
// Save sub content statements data
if ($data
->isCompound()) {
foreach ($data
->getChildren($dataID) as $subData) {
$this
->saveXAPIData($subData);
}
}
}