Update from 1.11.x

pull/3733/head
Julio Montoya 4 years ago
parent 9814a8bb1b
commit 586f385531
  1. 49
      assets/css/scorm.css
  2. 21
      public/main/inc/ajax/course.ajax.php
  3. 14
      public/main/inc/ajax/gradebook.ajax.php
  4. 26
      public/main/survey/survey.lib.php
  5. 2
      public/main/tracking/course_log_resources.php
  6. 2
      public/main/tracking/course_log_tools.php
  7. 2
      public/main/tracking/course_session_report.php
  8. 2
      public/main/tracking/question_course_report.php

@ -1,4 +1,4 @@
image-avatar/*
/*
File used to display Learning Path item in student view
If scorm.css file exists in theme folder, scorm.css file is used instead of this one
See https://support.chamilo.org/issues/6976
@ -524,7 +524,6 @@ See https://support.chamilo.org/issues/6976
}
.c-menu-right {
display: inline-flex;
width: 100%;
position: relative;
top: 0;
left: 0;
@ -703,6 +702,52 @@ See https://support.chamilo.org/issues/6976
.tabs-right{
text-align: right;
}
#learning_path_toc .panel-default{
border: none;
box-shadow: none;
}
.status-heading .panel-heading{
padding: 0;
}
.status-heading .panel-heading .item-header{
padding: 10px 15px 10px 30px;
display: inline-block;
width: 100%;
color: #333333;
font-weight: bold;
background: url("../../public/img/scorm/folder-item-open.png") #f5f5f5 no-repeat 10px center;
}
#learning_path_toc .child_item.lp_item_type_document.scorm_completed{
background: url(../../public/img/icons/svg/check-completed.svg) #FFFFFF right center no-repeat;
}
#learning_path_toc .child_item.lp_item_type_document.scorm_not_attempted{
background: url(../../public/img/icons/svg/check-not-attempted.svg) #FFFFFF right center no-repeat;
}
#learning_path_toc .root_item.lp_item_type_document.scorm_completed{
background: url(../../public/img/icons/svg/check-completed.svg) #FFFFFF right center no-repeat;
}
#learning_path_toc .root_item.lp_item_type_document.scorm_not_attempted{
background: url(../../public/img/icons/svg/check-not-attempted.svg) #FFFFFF right center no-repeat;
}
#learning_path_toc .root_item.lp_item_type_document.scorm_highlight{
background-color: #f1f4f9;
}
#learning_path_toc .child_item.lp_item_type_document.scorm_highlight{
background-color: #f1f4f9;
}
.status-heading .panel-heading .item-action{
padding: 10px 15px;
display: inline-block;
width: 100%;
background-color: transparent;
color: #525252;
border-left: 1px solid #cdcdcd;
}
#learning_path_toc .panel-collapse .panel-body{
padding: 10px 0 10px 10px;
}
/* END LP VIEW COLLAPSE */
/* Small devices (tablets, 768px and up) */
@media (min-width: 768px) {

@ -121,8 +121,16 @@ switch ($action) {
break;
}
$categoryToAvoid = '';
if (!api_is_platform_admin()) {
$categoryToAvoid = api_get_configuration_value('course_category_code_to_use_as_model');
}
$list = [];
foreach ($categories as $item) {
$categoryCode = $item['code'];
if (!empty($categoryToAvoid) && $categoryToAvoid == $categoryCode) {
continue;
}
$list['items'][] = [
'id' => $item['id'],
'text' => strip_tags($item['name']),
@ -156,6 +164,19 @@ switch ($action) {
);
} elseif (api_is_teacher()) {
$courseList = CourseManager::get_course_list_of_user_as_course_admin(api_get_user_id(), $_GET['q']);
$category = api_get_configuration_value('course_category_code_to_use_as_model');
if (!empty($category)) {
$alreadyAdded = [];
if (!empty($courseList)) {
$alreadyAdded = array_column($courseList, 'id');
}
$coursesInCategory = CourseCategory::getCoursesInCategory($category, $_GET['q']);
foreach ($coursesInCategory as $course) {
if (!in_array($course['id'], $alreadyAdded)) {
$courseList[] = $course;
}
}
}
}
}

@ -10,6 +10,20 @@ api_protect_course_script(true);
$action = $_REQUEST['a'];
switch ($action) {
case 'add_gradebook_comment':
if (true !== api_get_configuration_value('allow_gradebook_comments')) {
exit;
}
if (api_is_allowed_to_edit(null, true)) {
$userId = $_REQUEST['user_id'] ?? 0;
$gradeBookId = $_REQUEST['gradebook_id'] ?? 0;
$comment = $_REQUEST['comment'] ?? '';
GradebookUtils::saveComment($gradeBookId, $userId, $comment);
echo 1;
exit;
}
echo 0;
break;
case 'get_gradebook_weight':
if (api_is_allowed_to_edit(null, true)) {
$cat_id = $_GET['cat_id'];

@ -2470,9 +2470,23 @@ class SurveyManager
}
ksort($newQuestionList);
$order = api_get_configuration_value('survey_duplicate_order_by_name');
foreach ($itemList as $class) {
$className = $class['name'];
$users = $class['users'];
$userInfoList = [];
foreach ($users as $userId) {
$userInfoList[] = api_get_user_info($userId);
}
if ($order) {
usort(
$userInfoList,
function ($a, $b) {
return $a['lastname'] > $b['lastname'];
}
);
}
foreach ($newQuestionList as $question) {
$text = $question['question'];
@ -2488,15 +2502,14 @@ class SurveyManager
'survey_id' => $surveyId,
'question_id' => 0,
'shared_question_id' => 0,
'answers' => $question['answers'],
'answers' => $question['answers'] ?? null,
];
self::save_question($surveyData, $values, false);
$classCounter++;
continue;
}
foreach ($users as $userId) {
$userInfo = api_get_user_info($userId);
foreach ($userInfoList as $userInfo) {
if (false !== strpos($text, $studentTag)) {
$replacedText = str_replace($studentTag, $userInfo['complete_name'], $text);
@ -2758,7 +2771,12 @@ class SurveyManager
if (empty($sessionId)) {
$subscribe = CourseManager::is_user_subscribed_in_course($userId, $courseCode);
} else {
$subscribe = CourseManager::is_user_subscribed_in_course($userId, $courseCode, true, $sessionId);
$subscribe = CourseManager::is_user_subscribed_in_course(
$userId,
$courseCode,
true,
$sessionId
);
}
// User is not subscribe skip!

@ -66,7 +66,7 @@ if ($export_csv || $exportXls) {
if ($exportXls) {
Export::arrayToXls($csvData);
}
die;
exit;
}
if (empty($session_id)) {

@ -448,7 +448,7 @@ if ($linkReporting) {
if ($export_csv) {
$temp = [
$row['title'],
$row['count_visits'].' '.get_lang('clicks', ''),
$row['count_visits'].' '.get_lang('clicks'),
];
$csv_content[] = $temp;
}

@ -121,7 +121,7 @@ $total_average_score = 0;
$total_average_score_count = 0;
$html_result = '';
if (!empty($users) && is_array($users)) {
$html_result .= '<table class="data_table">';
$html_result .= '<table class="table table-hover table-striped data_table">';
$html_result .= '<tr><th>'.get_lang('User').'</th>';
foreach ($course_list as $item) {
$html_result .= '<th>'.$item['title'].'<br /> '.get_lang('Average score').' %</th>';

@ -173,7 +173,7 @@ $course_average = [];
$counter = 0;
if (!empty($main_question_list) && is_array($main_question_list)) {
$html_result .= '<table class="data_table">';
$html_result .= '<table class="table table-hover table-striped data_table">';
$html_result .= '<tr><th>'.get_lang('Question').
Display::return_icon('info3.gif', get_lang('These questions have been taken from the learning paths'), ['align' => 'absmiddle', 'hspace' => '3px']).'</th>';
$html_result .= '<th>'.$course_info['visual_code'].' '.get_lang('Average score').Display::return_icon('info3.gif', get_lang('All learners attempts are considered'), ['align' => 'absmiddle', 'hspace' => '3px']).' </th>';

Loading…
Cancel
Save