Minor - fix php notice

pull/2990/head
Julio 6 years ago
parent 9a8c969384
commit 13d8e0bda9
  1. 6
      main/mySpace/myStudents.php

@ -1795,6 +1795,7 @@ if (empty($details)) {
// @when using sessions we do not show the survey list // @when using sessions we do not show the survey list
if (empty($sessionId)) { if (empty($sessionId)) {
$survey_list = SurveyManager::get_surveys($course_code, $sessionId); $survey_list = SurveyManager::get_surveys($course_code, $sessionId);
if (!empty($survey_list)) {
$survey_data = []; $survey_data = [];
foreach ($survey_list as $survey) { foreach ($survey_list as $survey) {
$user_list = SurveyManager::get_people_who_filled_survey( $user_list = SurveyManager::get_people_who_filled_survey(
@ -1820,7 +1821,7 @@ if (empty($details)) {
$survey_data[] = $data; $survey_data[] = $data;
} }
if (!empty($survey_list)) { if (!empty($survey_data)) {
$table = new HTML_Table(['class' => 'data_table']); $table = new HTML_Table(['class' => 'data_table']);
$header_names = [get_lang('Survey'), get_lang('Answered')]; $header_names = [get_lang('Survey'), get_lang('Answered')];
$row = 0; $row = 0;
@ -1830,7 +1831,6 @@ if (empty($details)) {
$column++; $column++;
} }
$row = 1; $row = 1;
if (!empty($survey_data)) {
foreach ($survey_data as $data) { foreach ($survey_data as $data) {
$column = 0; $column = 0;
$table->setCellContents($row, $column, $data); $table->setCellContents($row, $column, $data);
@ -1842,10 +1842,10 @@ if (empty($details)) {
$column++; $column++;
$row++; $row++;
} }
}
echo $table->toHtml(); echo $table->toHtml();
} }
} }
}
require_once '../work/work.lib.php'; require_once '../work/work.lib.php';
$userWorks = getWorkPerUser($student_id, $courseInfo['real_id'], $sessionId); $userWorks = getWorkPerUser($student_id, $courseInfo['real_id'], $sessionId);

Loading…
Cancel
Save