Exercise: Use iid instead of id - refs BT#19115

pull/3973/head
Angel Fernando Quiroz Campos 4 years ago
parent 5d2f8c647c
commit dc6b05957d
  1. 8
      main/exercise/oral_expression.class.php

@ -118,10 +118,12 @@ class OralExpression extends Question
false false
); );
var_dump($this);
$recordAudioView->assign('directory', $directory); $recordAudioView->assign('directory', $directory);
$recordAudioView->assign('user_id', $this->userId); $recordAudioView->assign('user_id', $this->userId);
$recordAudioView->assign('file_name', $this->fileName); $recordAudioView->assign('file_name', $this->fileName);
$recordAudioView->assign('question_id', $this->id); $recordAudioView->assign('question_id', $this->iid);
$template = $recordAudioView->get_template('exercise/oral_expression.tpl'); $template = $recordAudioView->get_template('exercise/oral_expression.tpl');
@ -142,13 +144,13 @@ class OralExpression extends Question
if ($loadFromDatabase) { if ($loadFromDatabase) {
$em = Database::getManager(); $em = Database::getManager();
//Load the real filename just if exists //Load the real filename just if exists
if (isset($this->exeId, $this->userId, $this->id, $this->sessionId, $this->course['real_id'])) { if (isset($this->exeId, $this->userId, $this->iid, $this->sessionId, $this->course['real_id'])) {
$result = $em $result = $em
->getRepository('ChamiloCoreBundle:TrackEAttempt') ->getRepository('ChamiloCoreBundle:TrackEAttempt')
->findOneBy([ ->findOneBy([
'exeId' => $this->exeId, 'exeId' => $this->exeId,
'userId' => $this->userId, 'userId' => $this->userId,
'questionId' => $this->id, 'questionId' => $this->iid,
'sessionId' => $this->sessionId, 'sessionId' => $this->sessionId,
'cId' => $this->course['real_id'], 'cId' => $this->course['real_id'],
]); ]);

Loading…
Cancel
Save