Fix fatal error

pull/3924/head
Julio Montoya 4 years ago
parent 4b6eaa319b
commit fcbcc74b3e
  1. 19
      public/main/exercise/export/scorm/ScormExercise.php
  2. 7
      public/main/mySpace/index.php
  3. 4
      public/main/mySpace/lp_tracking.php
  4. 12
      public/main/mySpace/myStudents.php
  5. 4
      public/main/mySpace/progression.php

@ -2,6 +2,7 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CQuiz; use Chamilo\CourseBundle\Entity\CQuiz;
use Symfony\Component\Serializer\Encoder\JsonEncoder; use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
@ -100,11 +101,11 @@ class ScormExercise
*/ */
public function end_body() public function end_body()
{ {
$button = '<input $button = '<input
id="chamilo_scorm_submit" id="chamilo_scorm_submit"
class="btn btn-primary" class="btn btn-primary"
type="button" type="button"
name="chamilo_scorm_submit" name="chamilo_scorm_submit"
value="OK" />'; value="OK" />';
return '</table><br />'.$button.'</form></body>'; return '</table><br />'.$button.'</form></body>';
@ -127,7 +128,7 @@ class ScormExercise
.'<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv2p1.dtd">'."\n"; .'<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv2p1.dtd">'."\n";
}*/ }*/
list($js, $html) = $this->exportQuestions(); [$js, $html] = $this->exportQuestions();
return $this->startPage() return $this->startPage()
.$this->start_header() .$this->start_header()
@ -157,8 +158,10 @@ class ScormExercise
$em = Database::getManager(); $em = Database::getManager();
// Export cquiz data // Export cquiz data
$quizRepo = Container::getQuizRepository();
/** @var CQuiz $exercise */ /** @var CQuiz $exercise */
$exercise = $em->find('ChamiloCourseBundle:CQuiz', $this->exercise->iId); $exercise = $quizRepo->find($this->exercise->iId);
$exercise->setDescription(''); $exercise->setDescription('');
$exercise->setTextWhenFinished(''); $exercise->setTextWhenFinished('');
@ -169,7 +172,7 @@ class ScormExercise
$counter = 0; $counter = 0;
$scormQuestion = new ScormQuestion(); $scormQuestion = new ScormQuestion();
foreach ($this->exercise->selectQuestionList() as $q) { foreach ($this->exercise->selectQuestionList() as $q) {
list($jstmp, $htmltmp) = $scormQuestion->exportQuestionToScorm($q, $counter); [$jstmp, $htmltmp] = $scormQuestion->exportQuestionToScorm($q, $counter);
$js .= $jstmp."\n"; $js .= $jstmp."\n";
$html .= $htmltmp."\n"; $html .= $htmltmp."\n";
$counter++; $counter++;

@ -33,8 +33,6 @@ $skipData = api_get_configuration_value('tracking_skip_generic_data');
$logInfo = [ $logInfo = [
'tool' => SECTION_TRACKING, 'tool' => SECTION_TRACKING,
'tool_id' => 0,
'tool_id_detail' => 0,
]; ];
Event::registerLog($logInfo); Event::registerLog($logInfo);
@ -340,7 +338,10 @@ if (false === $skipData) {
$csv_content[] = [get_lang('Learners')]; $csv_content[] = [get_lang('Learners')];
$csv_content[] = [get_lang('InactivesLearners'), $nb_inactive_students]; $csv_content[] = [get_lang('InactivesLearners'), $nb_inactive_students];
$csv_content[] = [get_lang('Time spent on portal'), $totalTimeSpent]; $csv_content[] = [get_lang('Time spent on portal'), $totalTimeSpent];
$csv_content[] = [get_lang('Average number of courses to which my learners are subscribed'), round($avg_courses_per_student, 3)]; $csv_content[] = [
get_lang('Average number of courses to which my learners are subscribed'),
round($avg_courses_per_student, 3),
];
$csv_content[] = [ $csv_content[] = [
get_lang('Progress in courses'), get_lang('Progress in courses'),
is_null($avgTotalProgress) is_null($avgTotalProgress)

@ -98,8 +98,8 @@ switch ($action) {
api_not_allowed(); api_not_allowed();
} }
$view = $em->getRepository(\Chamilo\CourseBundle\Entity\CLpView::class)->find($itemView->getLpViewId()); $view = $itemView->getView();
$lp = $em->getRepository(\Chamilo\CourseBundle\Entity\CLp::class)->find($view->getLpId()); $lp = $view->getLp();
$duration = learnpathItem::getScormTimeFromParameter('js', $itemView->getTotalTime()); $duration = learnpathItem::getScormTimeFromParameter('js', $itemView->getTotalTime());
$endTime = $itemView->getStartTime() + $itemView->getTotalTime(); $endTime = $itemView->getStartTime() + $itemView->getTotalTime();

@ -918,7 +918,7 @@ if (is_numeric($avg_student_score)) {
} }
$userInfoExtra['student_score'] = (float) $score; $userInfoExtra['student_score'] = (float) $score;
$userInfoExtra['student_progress'] = (float) $avg_student_progress; $userInfoExtra['student_progress'] = $avg_student_progress;
$userInfoExtra['first_connection'] = $first_connection_date; $userInfoExtra['first_connection'] = $first_connection_date;
$userInfoExtra['last_connection'] = $last_connection_date; $userInfoExtra['last_connection'] = $last_connection_date;
$userInfoExtra['last_connection_in_course'] = api_format_date( $userInfoExtra['last_connection_in_course'] = api_format_date(
@ -1999,13 +1999,13 @@ if (empty($details)) {
} }
echo '</td>'; echo '</td>';
if (!empty($hookContents)) { /*if (!empty($hookContents)) {
foreach ($hookContents as $hookContent) { foreach ($hookContents as $hookContent) {
if (isset($hookContent['value'])) { if (isset($hookContent['value'])) {
echo Display::tag('td', $hookContent['value'], $hookContent['attrs']); echo Display::tag('td', $hookContent['value'], $hookContent['attrs']);
} }
} }
} }*/
echo '</tr>'; echo '</tr>';
$data_exercices[$i][] = $exercise->getTitle(); $data_exercices[$i][] = $exercise->getTitle();
@ -2022,11 +2022,11 @@ if (empty($details)) {
if (!empty($hookContents)) { if (!empty($hookContents)) {
$csvContentIndex = count($csv_content) - 1; $csvContentIndex = count($csv_content) - 1;
foreach ($hookContents as $hookContent) { /*foreach ($hookContents as $hookContent) {
if (isset($hookContent['value'])) { if (isset($hookContent['value'])) {
$csv_content[$csvContentIndex][] = strip_tags($hookContent['value']); $csv_content[$csvContentIndex][] = strip_tags($hookContent['value']);
} }
} }*/
} }
$i++; $i++;
} }
@ -2044,7 +2044,7 @@ if (empty($details)) {
$user_list = SurveyManager::get_people_who_filled_survey( $user_list = SurveyManager::get_people_who_filled_survey(
$survey['survey_id'], $survey['survey_id'],
false, false,
$courseInfo['real_id'] $course->getId()
); );
$survey_done = Display::return_icon( $survey_done = Display::return_icon(
'accept_na.png', 'accept_na.png',

@ -36,8 +36,8 @@ $result_course = Database::query($sql_course);
if (Database::num_rows($result_course) > 0) { if (Database::num_rows($result_course) > 0) {
if (isset($_POST['export'])) { if (isset($_POST['export'])) {
$export_result = export_csv($header, $data, 'test.csv'); // TODO: There is no data for exporting yet. //$export_result = export_csv($header, $data, 'test.csv'); // TODO: There is no data for exporting yet.
echo Display::return_message($export_result, 'error'); //echo Display::return_message($export_result, 'error');
} }
echo '<table class="table table-hover table-striped data_table"> echo '<table class="table table-hover table-striped data_table">
<tr> <tr>

Loading…
Cancel
Save