Merge branch 'master' of github.com:chamilo/chamilo-lms into tailwind

pull/4000/head
Yannick Warnier 3 years ago
commit 413a485f40
  1. 22
      assets/css/scorm.css
  2. 14
      assets/vue/App.vue
  3. 76
      assets/vue/components/AudioRecorder.vue
  4. 35
      assets/vue/components/message/Form.vue
  5. 4
      public/main/admin/user_information.php
  6. 4
      public/main/inc/ajax/model.ajax.php
  7. 3
      public/main/inc/lib/attendance.lib.php
  8. 2
      public/main/inc/lib/myspace.lib.php
  9. 10
      public/main/inc/lib/sessionmanager.lib.php
  10. 241
      public/main/inc/lib/tracking.lib.php
  11. 13
      public/main/lp/learnpath.class.php
  12. 24
      public/main/mySpace/course.php
  13. 16
      public/main/tracking/courseLog.php
  14. 6
      public/main/tracking/course_log_tools.php
  15. 3
      public/main/tracking/exams.php
  16. 6
      public/main/tracking/lp_results_by_user.php
  17. 6
      public/main/tracking/total_time.php
  18. 2
      src/CoreBundle/Component/Utils/ScriptHandler.php
  19. 16
      src/CoreBundle/Resources/views/LearnPath/menubar.html.twig
  20. 32
      src/CoreBundle/Resources/views/LearnPath/view.html.twig

@ -479,7 +479,8 @@ body {
margin: 0;
}
.icon-toolbar .fa {
.icon-toolbar .fa,
.icon-toolbar .mdi {
width: 35px;
height: 35px;
line-height: 35px;
@ -490,20 +491,24 @@ body {
color: #FFF;
}
.icon-toolbar .fa:hover {
.icon-toolbar .fa:hover,
.icon-toolbar .mdi:hover {
background-color: #000;
}
.expand .fa {
.expand .fa,
.expand .mdi {
background-color: #00829C;
}
.expand .fa:hover {
.expand .fa:hover,
.expand .mdi:hover {
background-color: #006A84;
color: #ffffff;
}
.expand .fa:active, .expand .fa:focus {
.expand .fa:active, .expand .fa:focus,
.expand .mdi:active, .expand .mdi:focus {
color: #ffffff;
}
@ -593,7 +598,7 @@ body {
height: 40px;
width: 40px;
line-height: 19px;
padding: 10px;
padding: 7px;
background: #ffffff;
font-size: 16px;
border: 1px solid #8dcbf3;
@ -861,7 +866,8 @@ body {
padding: 10px 5px;
}
.icon-toolbar .fa {
.icon-toolbar .fa,
.icon-toolbar .mdi {
width: 35px;
height: 35px;
line-height: 35px;
@ -895,4 +901,4 @@ body {
#scorm-info hr {
display: none;
}
}
}

@ -52,7 +52,17 @@ export default {
const showBreadcrumb = ref(true);
const layout = computed(
() => `${currentRoute.value.meta.layout || defaultLayout}Layout`
() => {
let queryParams = new URLSearchParams(window.location.href);
if (queryParams.has('lp')
|| (queryParams.has('origin') && queryParams.get('origin') === 'learnpath')
) {
return 'EmptyLayout';
} else {
return `${currentRoute.value.meta.layout || defaultLayout}Layout`
}
}
);
provide(DefaultApolloClient, apolloClient)
@ -194,4 +204,4 @@ export default {
}),
}
}
</script>
</script>

@ -0,0 +1,76 @@
<template>
<div class="py-2">
<q-btn v-if="!isRecording" color="primary" icon="mic" :label="$t('Start recording')" @click="record()"/>
<q-btn v-if="isRecording" color="red" icon="stop" :label="$t('Stop recording')" @click="stop()"/>
<div v-for="(audio, index) in audioList" :key="index" class="py-2">
<audio controls style="max-width: 100%;">
<source :src="audio">
</audio>
</div>
</div>
</template>
<script>
import {ref} from "vue";
export default {
name: "AudioRecorder",
setup() {
const isRecording = ref(false)
const audioList = ref([]);
let mediaRecorder = null;
let mediaChunks = [];
function record() {
if (!navigator.mediaDevices.getUserMedia) {
return;
}
navigator.mediaDevices.getUserMedia({audio: true})
.then((stream) => {
mediaRecorder = new MediaRecorder(stream);
mediaRecorder.ondataavailable = e => {
mediaChunks.push(e.data)
};
mediaRecorder.onstop = e => {
const blob = new Blob(mediaChunks, {type: 'audio/ogg; codecs=opus'});
const audioUrl = URL.createObjectURL(blob);
mediaChunks = [];
audioList.value.push(audioUrl);
};
mediaRecorder.start();
isRecording.value = true;
})
.catch(console.log);
}
function stop() {
if (!mediaRecorder) {
return;
}
mediaRecorder.stop();
mediaRecorder.stream.getAudioTracks()[0].stop();
isRecording.value = false;
}
return {
record,
stop,
audioList,
isRecording
};
}
}
</script>
<style scoped>
</style>

@ -1,15 +1,26 @@
<template>
<q-form>
<q-input
id="item_title"
v-model="item.title"
:placeholder="$t('Title')"
:error="v$.item.title.$error"
@input="v$.item.title.$touch()"
@blur="v$.item.title.$touch()"
:error-message="titleErrors"
/>
<slot></slot>
<v-container>
<v-row>
<v-col md="9">
<q-input
id="item_title"
v-model="item.title"
:error="v$.item.title.$error"
:error-message="titleErrors"
:placeholder="$t('Title')"
@blur="v$.item.title.$touch()"
@input="v$.item.title.$touch()"
/>
<slot></slot>
</v-col>
<v-col md="3">
<div v-text="$t('Atachments')" class="text-h6"/>
<AudioRecorder></AudioRecorder>
</v-col>
</v-row>
</v-container>
</q-form>
</template>
@ -17,10 +28,12 @@
import has from 'lodash/has';
import useVuelidate from '@vuelidate/core';
import { required } from '@vuelidate/validators';
import AudioRecorder from "../AudioRecorder";
export default {
name: 'MessageForm',
setup () {
components: {AudioRecorder},
setup() {
return { v$: useVuelidate() }
},
props: {

@ -316,7 +316,7 @@ if (count($sessions) > 0) {
$tools = Display::url(
Display::return_icon('statistics.png', get_lang('Statistics')),
api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?details=true&student='.$userId.'&id_session='.$sessionId.'&course='.$courseCode
api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?details=true&student='.$userId.'&sid='.$sessionId.'&course='.$courseCode
);
$tools .= '&nbsp;<a href="course_information.php?id='.$courseId.'&id_session='.$sessionId.'">'.
Display::return_icon('info2.png', get_lang('Overview')).'</a>'.
@ -425,7 +425,7 @@ if (count($courseRelUserList) > 0) {
$courseUrl = api_get_course_url($courseId);
$tools = Display::url(
Display::return_icon('statistics.png', get_lang('Statistics')),
api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?details=true&student='.$userId.'&id_session=0&course='.$courseCode
api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?details=true&student='.$userId.'&sid=0&course='.$courseCode
);
$tools .= '&nbsp;<a href="course_information.php?id='.$courseId.'">'.
Display::return_icon('info2.png', get_lang('Overview')).'</a>'.

@ -1903,13 +1903,13 @@ switch ($action) {
);
$detailButtons[] = Display::url(
Display::return_icon('2rightarrow.png'),
api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id']
api_get_path(WEB_CODE_PATH).'mySpace/course.php?sid='.$session['id']
);
$item = [
'name' => Display::url(
$session['name'],
api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id']
api_get_path(WEB_CODE_PATH).'mySpace/course.php?sid='.$session['id']
),
'date' => $dateToString,
'course_per_session' => $count_courses_in_session,

@ -3110,7 +3110,8 @@ class Attendance
if ($exportToPdf) {
$result = $this->exportAttendanceLogin($startDate, $endDate);
if (empty($result)) {
api_not_allowed(true, get_lang('No data available'));
return false;
//api_not_allowed(true, get_lang('No data available'));
}
}

@ -129,7 +129,7 @@ class MySpace
[],
32
),
api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher'
api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=teacher'
);
$menuItems[] = Display::url(
Display::return_icon(

@ -1313,11 +1313,11 @@ class SessionManager
// Overall Total
$overall_total = ($course_description_progress + $exercises_progress + $forums_progress + $assignments_progress + $wiki_progress + $surveys_progress) / 6;
$link = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$user[0].'&details=true&course='.$course['code'].'&sid='.$user['id_session'].'"> %s </a>';
$linkForum = '<a href="'.api_get_path(WEB_CODE_PATH).'forum/index.php?cid='.$course['real_id'].'&sid='.$user['id_session'].'"> %s </a>';
$linkWork = '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?cid='.$course['real_id'].'&sid='.$user['id_session'].'"> %s </a>';
$linkWiki = '<a href="'.api_get_path(WEB_CODE_PATH).'wiki/index.php?cid='.$course['real_id'].'&sid='.$user['id_session'].'&action=statistics"> %s </a>';
$linkSurvey = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?cid='.$course['real_id'].'&sid='.$user['id_session'].'"> %s </a>';
$link = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$user[0].'&details=true&course='.$course['code'].'&sid='.$sessionId.'"> %s </a>';
$linkForum = '<a href="'.api_get_path(WEB_CODE_PATH).'forum/index.php?cid='.$course['real_id'].'&sid='.$sessionId.'"> %s </a>';
$linkWork = '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?cid='.$course['real_id'].'&sid='.$sessionId.'"> %s </a>';
$linkWiki = '<a href="'.api_get_path(WEB_CODE_PATH).'wiki/index.php?cid='.$course['real_id'].'&sid='.$sessionId.'&action=statistics"> %s </a>';
$linkSurvey = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?cid='.$course['real_id'].'&sid='.$sessionId.'"> %s </a>';
$table[] = [
'lastname' => $user[1],

@ -3975,66 +3975,32 @@ class Tracking
/**
* This function counts the number of post by course.
*
* @param string $course_code
* @param int $sessionId (optional), if is null(default) it'll return results including sessions,
* 0 = session is not filtered
* @param string $courseId
* @param int $sessionId (optional), if is null(default) it'll return results including sessions,
* 0 = session is not filtered
* @param int $groupId
*
* @return int The number of post by course
*/
public static function count_number_of_posts_by_course($course_code, $sessionId = null, $groupId = 0)
public static function count_number_of_posts_by_course($courseId, $sessionId = null, $groupId = 0)
{
$courseInfo = api_get_course_info($course_code);
if (!empty($courseInfo)) {
$tbl_posts = Database::get_course_table(TABLE_FORUM_POST);
$tbl_forums = Database::get_course_table(TABLE_FORUM);
$condition_session = '';
if (isset($sessionId)) {
$sessionId = (int) $sessionId;
$condition_session = api_get_session_condition(
$sessionId,
true,
false,
'f.session_id'
);
}
$courseId = $courseInfo['real_id'];
$groupId = (int) $groupId;
if (!empty($groupId)) {
$groupCondition = " i.to_group_id = $groupId ";
} else {
$groupCondition = ' (i.to_group_id = 0 OR i.to_group_id IS NULL) ';
}
$item = Database::get_course_table(TABLE_ITEM_PROPERTY);
$sql = "SELECT count(*) FROM $tbl_posts p
INNER JOIN $tbl_forums f
ON f.forum_id = p.forum_id AND p.c_id = f.c_id
INNER JOIN $item i
ON (tool = '".TOOL_FORUM."' AND f.c_id = i.c_id AND f.iid = i.ref)
WHERE
p.c_id = $courseId AND
f.c_id = $courseId AND
$groupCondition
$condition_session
";
$result = Database::query($sql);
$row = Database::fetch_row($result);
$count = $row[0];
$repo = Container::getForumPostRepository();
$course = api_get_course_entity($courseId);
$session = api_get_session_entity($sessionId);
$group = api_get_group_entity($groupId);
$qb = $repo->getResourcesByCourse($course, $session, $group);
return $count;
}
$qb->select('count(resource)');
$count = $qb->getQuery()->getSingleScalarResult();
return 0;
return $count;
}
/**
* This function counts the number of threads by course.
*
* @param string Course code
* @param int Session id (optional),
* @param int Course id
* @param int Session id (optional),
* if param $sessionId is null(default) it'll return results including
* sessions, 0 = session is not filtered
* @param int $groupId
@ -4042,67 +4008,27 @@ class Tracking
* @return int The number of threads by course
*/
public static function count_number_of_threads_by_course(
$course_code,
$courseId,
$sessionId = null,
$groupId = 0
) {
$course_info = api_get_course_info($course_code);
if (empty($course_info)) {
return null;
}
$courseId = $course_info['real_id'];
$tbl_threads = Database::get_course_table(TABLE_FORUM_THREAD);
$tbl_forums = Database::get_course_table(TABLE_FORUM);
$condition_session = '';
if (isset($sessionId)) {
$sessionId = (int) $sessionId;
$condition_session = ' AND f.session_id = '.$sessionId;
}
$groupId = (int) $groupId;
if (!empty($groupId)) {
$groupCondition = " i.to_group_id = $groupId ";
} else {
$groupCondition = " (i.to_group_id = 0 OR i.to_group_id IS NULL) ";
}
$item = Database::get_course_table(TABLE_ITEM_PROPERTY);
$sql = "SELECT count(*)
FROM $tbl_threads t
INNER JOIN $tbl_forums f
ON f.iid = t.forum_id AND f.c_id = t.c_id
INNER JOIN $item i
ON (
tool = '".TOOL_FORUM_THREAD."' AND
f.c_id = i.c_id AND
t.iid = i.ref
)
WHERE
t.c_id = $courseId AND
f.c_id = $courseId AND
$groupCondition
$condition_session
";
$result = Database::query($sql);
if (Database::num_rows($result)) {
$row = Database::fetch_row($result);
$count = $row[0];
$repo = Container::getForumThreadRepository();
$course = api_get_course_entity($courseId);
$session = api_get_session_entity($sessionId);
$group = api_get_group_entity($groupId);
$qb = $repo->getResourcesByCourse($course, $session, $group);
return $count;
}
$qb->select('count(resource)');
$count = $qb->getQuery()->getSingleScalarResult();
return 0;
return $count;
}
/**
* This function counts the number of forums by course.
*
* @param string Course code
* @param int Session id (optional),
* @param int Course id
* @param int Session id (optional),
* if param $sessionId is null(default) it'll return results
* including sessions, 0 = session is not filtered
* @param int $groupId
@ -4110,50 +4036,20 @@ class Tracking
* @return int The number of forums by course
*/
public static function count_number_of_forums_by_course(
$course_code,
$courseId,
$sessionId = null,
$groupId = 0
) {
$course_info = api_get_course_info($course_code);
if (empty($course_info)) {
return null;
}
$courseId = $course_info['real_id'];
$condition_session = '';
if (isset($sessionId)) {
$sessionId = (int) $sessionId;
$condition_session = ' AND f.session_id = '.$sessionId;
}
$groupId = (int) $groupId;
if (!empty($groupId)) {
$groupCondition = " i.to_group_id = $groupId ";
} else {
$groupCondition = " (i.to_group_id = 0 OR i.to_group_id IS NULL) ";
}
$tbl_forums = Database::get_course_table(TABLE_FORUM);
$item = Database::get_course_table(TABLE_ITEM_PROPERTY);
$sql = "SELECT count(*)
FROM $tbl_forums f
INNER JOIN $item i
ON f.c_id = i.c_id AND f.iid = i.ref AND tool = '".TOOL_FORUM."'
WHERE
f.c_id = $courseId AND
$groupCondition
$condition_session
";
$result = Database::query($sql);
if (Database::num_rows($result)) {
$row = Database::fetch_row($result);
$count = $row[0];
$repo = Container::getForumRepository();
$course = api_get_course_entity($courseId);
$session = api_get_session_entity($sessionId);
$group = api_get_group_entity($groupId);
return $count;
}
$qb = $repo->getResourcesByCourse($course, $session, $group);
$qb->select('count(resource)');
$count = $qb->getQuery()->getSingleScalarResult();
return 0;
return $count;
}
/**
@ -4542,14 +4438,13 @@ class Tracking
$condition_session = '';
if (isset($session_id)) {
$session_id = intval($session_id);
$condition_session = ' AND cl.session_id = '.$session_id;
$condition_session = ' AND sl.links_session_id = '.$session_id;
}
$sql = "SELECT cl.title, cl.url,count(DISTINCT sl.links_user_id), count(cl.title) as count_visits
FROM $TABLETRACK_LINKS AS sl, $TABLECOURSE_LINKS AS cl
WHERE
cl.c_id = $courseId AND
sl.links_link_id = cl.id AND
sl.links_link_id = cl.iid AND
sl.c_id = $courseId
$condition_session
GROUP BY cl.title, cl.url
@ -8459,16 +8354,16 @@ class TrackingCourseLog
$users = implode(',', $new_user_array);
$extraFieldType = EntityExtraField::USER_FIELD_TYPE;
// Selecting only the necessary information NOT ALL the user list
$sql = "SELECT user.user_id, v.value
$sql = "SELECT user.id as user_id, v.value
FROM $table_user user
INNER JOIN $table_user_field_values v
ON (user.user_id = v.item_id)
ON (user.id = v.item_id)
INNER JOIN $extraField f
ON (f.id = v.field_id)
WHERE
f.extra_field_type = $extraFieldType AND
v.field_id=".intval($field_id)." AND
user.user_id IN ($users)";
user.id IN ($users)";
$result = Database::query($sql);
while ($row = Database::fetch_array($result)) {
@ -8575,7 +8470,7 @@ class TrackingCourseLog
$conditions = [],
$options = []
) {
global $user_ids, $export_csv, $session_id;
global $user_ids, $export_csv, $sessionId;
$includeInvitedUsers = $conditions['include_invited_users']; // include the invited users
$getCount = isset($conditions['get_count']) ? $conditions['get_count'] : false;
@ -8691,12 +8586,12 @@ class TrackingCourseLog
false,
3
);*/
$session = api_get_session_entity($session_id);
$session = api_get_session_entity($sessionId);
$repo = Container::getQuizRepository();
$qb = $repo->findAllByCourse($course, $session, null, 2);
$exercises = $qb->getQuery()->getResult();
if (empty($session_id)) {
if (empty($sessionId)) {
$survey_user_list = [];
// @todo
//$surveyList = SurveyManager::get_surveys($courseCode, $session_id);
@ -8718,7 +8613,7 @@ class TrackingCourseLog
}
$urlBase = api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?details=true&cid='.$courseId.
'&origin=tracking_course&sid='.$session_id;
'&origin=tracking_course&sid='.$sessionId;
$sortByFirstName = api_sort_by_first_name();
Session::write('user_id_list', []);
@ -8746,7 +8641,7 @@ class TrackingCourseLog
Tracking::get_time_spent_on_the_course(
$user['user_id'],
$courseId,
$session_id
$sessionId
)
);
@ -8783,7 +8678,7 @@ class TrackingCourseLog
$exercises,
$user['user_id'],
$courseId,
$session_id
$sessionId
);
$user['exercise_progress'] = $total_user_exercise;
@ -8792,7 +8687,7 @@ class TrackingCourseLog
$exercises,
$user['user_id'],
$courseId,
$session_id
$sessionId
);
$user['exercise_average_best_attempt'] = $total_user_exercise;
@ -8816,7 +8711,7 @@ class TrackingCourseLog
$user['user_id'],
$exercise->iId,
$courseId,
$session_id,
$sessionId,
false
);
@ -8842,14 +8737,14 @@ class TrackingCourseLog
$user['first_connection'] = Tracking::get_first_connection_date_on_the_course(
$user['user_id'],
$courseId,
$session_id,
$sessionId,
false === $export_csv
);
$user['last_connection'] = Tracking::get_last_connection_date_on_the_course(
$user['user_id'],
['real_id' => $course->getId()],
$session_id,
$sessionId,
false === $export_csv
);
@ -8866,7 +8761,7 @@ class TrackingCourseLog
}
}
if (empty($session_id)) {
if (empty($sessionId)) {
$user['survey'] = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0).' / '.$total_surveys;
}
@ -8904,10 +8799,10 @@ class TrackingCourseLog
$userGroupManager = new UserGroupModel();
$user_row['classes'] = $userGroupManager->getLabelsFromNameList($user['user_id'], Usergroup::NORMAL_CLASS);
if (empty($session_id)) {
if (empty($sessionId)) {
$user_row['survey'] = $user['survey'];
} else {
$userSession = SessionManager::getUserSession($user['user_id'], $session_id);
$userSession = SessionManager::getUserSession($user['user_id'], $sessionId);
$user_row['registered_at'] = '';
if ($userSession) {
$user_row['registered_at'] = api_get_local_time($userSession['registered_at']);
@ -8945,7 +8840,7 @@ class TrackingCourseLog
$user_row['link'] = $user['link'];
if ($export_csv) {
if (empty($session_id)) {
if (empty($sessionId)) {
unset($user_row['classes']);
unset($user_row['link']);
} else {
@ -8987,7 +8882,7 @@ class TrackingCourseLog
$direction,
$params = []
) {
global $user_ids, $course_code, $export_csv, $csv_content, $session_id;
global $user_ids, $course_code, $export_csv, $sessionId;
$includeInvitedUsers = false;
$courseId = $params['cid'];
$sessionId = $params['sid'];
@ -9053,7 +8948,7 @@ class TrackingCourseLog
$totalCourseTime = Tracking::get_time_spent_on_the_course(
$user['user_id'],
$courseId,
$session_id
$sessionId
);
$user['time'] = api_time_to_hms($totalCourseTime);
@ -9061,7 +8956,7 @@ class TrackingCourseLog
$user['user_id'],
$course,
[],
$session_id
$sessionId
);
$user['total_lp_time'] = $totalLpTime;
@ -9074,19 +8969,19 @@ class TrackingCourseLog
$user['first_connection'] = Tracking::get_first_connection_date_on_the_course(
$user['user_id'],
$courseId,
$session_id
$sessionId
);
$user['last_connection'] = Tracking::get_last_connection_date_on_the_course(
$user['user_id'],
$courseInfo,
$session_id,
$sessionId,
false === $export_csv
);
$user['link'] = '
<center>
<a
href="../mySpace/myStudents.php?student='.$user['user_id'].'&details=true&cid='.$courseId.'&origin=tracking_course&sid='.$session_id.'">
href="../mySpace/myStudents.php?student='.$user['user_id'].'&details=true&cid='.$courseId.'&origin=tracking_course&sid='.$sessionId.'">
'.Display::return_icon('2rightarrow.png', get_lang('Details')).'
</a>
</center>';
@ -9127,11 +9022,11 @@ class TrackingCourseLog
Display::return_icon('group.png', get_lang('Group reporting'), [], ICON_SIZE_MEDIUM),
'course_log_groups.php?'.api_get_cidreq()
);
$resourcesLink = Display::url(
$resourcesLink = '';
/*$resourcesLink = Display::url(
Display::return_icon('tools.png', get_lang('Report on resource'), [], ICON_SIZE_MEDIUM),
'course_log_resources.php?'.api_get_cidreq(true, false)
);
);*/
$courseLink = Display::url(
Display::return_icon('course.png', get_lang('Course report'), [], ICON_SIZE_MEDIUM),
@ -9155,10 +9050,14 @@ class TrackingCourseLog
$attendanceLink = '';
if (!empty($sessionId)) {
$attendanceLink = Display::url(
Display::return_icon('attendance_list.png', get_lang('Logins'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'attendance/index.php?'.api_get_cidreq().'&action=calendar_logins'
);
$attendance = new Attendance();
$result = $attendance->getAttendanceBaseInLogin(false, true);
if (false !== $result) {
$attendanceLink = Display::url(
Display::return_icon('attendance_list.png', get_lang('Logins'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'attendance/index.php?'.api_get_cidreq().'&action=calendar_logins'
);
}
}
switch ($current) {

@ -1326,13 +1326,15 @@ class learnpath
$settings = api_get_configuration_value('lp_view_settings');
$display = $settings['display'] ?? false;
$icon = Display::getMdiIcon('information');
$reportingIcon = '
<a class="icon-toolbar"
id="stats_link"
href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lpId.'"
onclick="window.parent.API.save_asset(); return true;"
target="content_name" title="'.$reportingText.'">
<span class="fa fa-info"></span><span class="sr-only">'.$reportingText.'</span>
'.$icon.'<span class="sr-only">'.$reportingText.'</span>
</a>';
if (!empty($display)) {
@ -1350,20 +1352,23 @@ class learnpath
$previousIcon = '';
$nextIcon = '';
if (false === $hideArrows) {
$icon = Display::getMdiIcon('chevron-left');
$previousIcon = '
<a class="icon-toolbar" id="scorm-previous" href="#"
onclick="switch_item('.$mycurrentitemid.',\'previous\');return false;" title="'.$previousText.'">
<span class="fa fa-chevron-left"></span><span class="sr-only">'.$previousText.'</span>
'.$icon.'<span class="sr-only">'.$previousText.'</span>
</a>';
$icon = Display::getMdiIcon('chevron-right');
$nextIcon = '
<a class="icon-toolbar" id="scorm-next" href="#"
onclick="switch_item('.$mycurrentitemid.',\'next\');return false;" title="'.$nextText.'">
<span class="fa fa-chevron-right"></span><span class="sr-only">'.$nextText.'</span>
'.$icon.'<span class="sr-only">'.$nextText.'</span>
</a>';
}
if ('fullscreen' === $this->mode) {
$icon = Display::getMdiIcon('view-column');
$navbar = '
<span id="'.$barId.'" class="buttons">
'.$reportingIcon.'
@ -1371,7 +1376,7 @@ class learnpath
'.$nextIcon.'
<a class="icon-toolbar" id="view-embedded"
href="lp_controller.php?action=mode&mode=embedded" target="_top" title="'.$fullScreenText.'">
<span class="fa fa-columns"></span><span class="sr-only">'.$fullScreenText.'</span>
'.$icon.'<span class="sr-only">'.$fullScreenText.'</span>
</a>
</span>';
} else {

@ -10,7 +10,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_TRACKING;
$sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : null;
$sessionId = isset($_GET['sid']) ? (int) $_GET['sid'] : null;
api_block_anonymous_users();
@ -153,7 +153,7 @@ if ($showImportIcon) {
function get_count_courses()
{
$userId = api_get_user_id();
$session = api_get_session_entity($_GET['session_id'] ?? 0);
$session = api_get_session_entity($_GET['sid'] ?? 0);
$keyword = isset($_GET['keyword']) ? $_GET['keyword'] : null;
$drhLoaded = false;
@ -213,8 +213,8 @@ function get_count_courses()
function get_courses($from, $limit, $column, $direction)
{
$userId = api_get_user_id();
$sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : 0;
$session = api_get_session_entity($_GET['session_id'] ?? 0);
$sessionId = isset($_GET['sid']) ? intval($_GET['sid']) : 0;
$session = api_get_session_entity($sessionId);
$keyword = isset($_GET['keyword']) ? $_GET['keyword'] : null;
$follow = isset($_GET['follow']) ? true : false;
$drhLoaded = false;
@ -335,11 +335,15 @@ function get_courses($from, $limit, $column, $direction)
$data['title'],
$courseInfo['course_public_url'].'?id_session='.$sessionId
);
$attendanceLink = Display::url(
Display::return_icon('attendance_list.png', get_lang('Attendance'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'attendance/index.php?cid='.$courseId.'&sid='.$sessionId.'&action=calendar_logins'
);
$attendance = new Attendance();
$result = $attendance->getAttendanceBaseInLogin(false, true);
$attendanceLink = '';
if (false !== $result) {
$attendanceLink = Display::url(
Display::return_icon('attendance_list.png', get_lang('Attendance'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'attendance/index.php?cid='.$courseId.'&sid='.$sessionId.'&action=calendar_logins'
);
}
$courseList[] = [
$title,
@ -381,7 +385,7 @@ $table->set_header(9, get_lang('Details'), false);
$form = new FormValidator('search_course', 'get', api_get_path(WEB_CODE_PATH).'mySpace/course.php');
$form->addElement('text', 'keyword', get_lang('Keyword'));
$form->addButtonSearch(get_lang('Search'));
$form->addElement('hidden', 'session_id', $sessionId);
$form->addElement('hidden', 'sid', $sessionId);
$keyword = isset($_GET['keyword']) ? Security::remove_XSS($_GET['keyword']) : null;

@ -228,7 +228,7 @@ $form_search = new FormValidator(
$renderer = $form_search->defaultRenderer();
$renderer->setCustomElementTemplate('<span>{element}</span>');
$form_search->addHidden('from', Security::remove_XSS($from));
$form_search->addHidden('session_id', $sessionId);
$form_search->addHidden('sessionId', $sessionId);
$form_search->addHidden('sid', $sessionId);
$form_search->addHidden('cid', $courseId);
$form_search->addElement('text', 'user_keyword');
@ -313,18 +313,16 @@ if ($showReporting) {
if (SESSION_INVISIBLE == $visibility) {
continue;
}
// Check if is coach
$isCoach = api_is_coach($session['id'], $courseId);
if (!$isCoach) {
continue;
}
}
$url = $urlWebCode.'mySpace/course.php?session_id='.$session['id'].'&cid='.$courseId;
$url = $urlWebCode.'mySpace/course.php?sid='.$session['id'].'&cid='.$courseId;
$table->setCellContents($row++, 0, $icon.' '.Display::url($session['name'], $url));
}
if ($row > 1) {
if ($row > 0) {
$html .= $table->toHtml();
}
}
@ -628,7 +626,7 @@ if ($nbStudents > 0) {
}
$parameters['cidReq'] = isset($_GET['cidReq']) ? Security::remove_XSS($_GET['cidReq']) : '';
$parameters['id_session'] = $sessionId;
$parameters['sid'] = $sessionId;
$parameters['from'] = isset($_GET['myspace']) ? Security::remove_XSS($_GET['myspace']) : null;
$headerCounter = 0;
@ -758,13 +756,13 @@ if ($nbStudents > 0) {
}
}
$parameters['cidReq'] = $courseCode;
$parameters['id_session'] = $sessionId;
$parameters['sid'] = $sessionId;
$table->set_additional_parameters($parameters);
// display buttons to un hide hidden columns
$html .= '<div id="unhideButtons" class="btn-toolbar">';
$index = 0;
$getLangDisplayColumn = get_lang('Show column');
foreach ($headers as $header) {
/*foreach ($headers as $header) {
$html .= Display::toolbarButton(
$header,
'#',
@ -777,7 +775,7 @@ if ($nbStudents > 0) {
]
);
$index++;
}
}*/
$html .= '</div>';
$html .= '<div id="reporting_table">';

@ -248,19 +248,19 @@ if (!empty($groupId)) {
}
$count_number_of_forums_by_course = Tracking::count_number_of_forums_by_course(
$course_code,
$course_id,
$session_id,
$groupId
);
$count_number_of_threads_by_course = Tracking::count_number_of_threads_by_course(
$course_code,
$course_id,
$session_id,
$groupId
);
$count_number_of_posts_by_course = Tracking::count_number_of_posts_by_course(
$course_code,
$course_id,
$session_id,
$groupId
);

@ -109,7 +109,7 @@ if (!$exportToXLS) {
$menuItems[] = Display::url(
Display::return_icon('teacher.png', get_lang('Trainer View'), [], 32),
api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher'
api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=teacher'
);
if (api_is_platform_admin()) {
$menuItems[] = Display::url(
@ -130,6 +130,7 @@ if (!$exportToXLS) {
$actionsLeft .= $item;
}
}
$actionsLeft = TrackingCourseLog::actionsLeft('exams', $sessionId, false);
} else {
$actionsLeft = TrackingCourseLog::actionsLeft('exams', api_get_session_id(), false);
$actionsRight .= Display::url(

@ -92,11 +92,11 @@ if (!$export_to_csv) {
&nbsp;'.get_lang('Print').'</a>
</div>';
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher">'.get_lang('Trainer View').'</a>';
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=teacher">'.get_lang('Trainer View').'</a>';
if (api_is_platform_admin()) {
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=admin">'.get_lang('Admin view').'</a>';
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=admin">'.get_lang('Admin view').'</a>';
} else {
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=coach">'.get_lang('Admin view').'</a>';
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=coach">'.get_lang('Admin view').'</a>';
}
$menu_items[] = get_lang('Exam tracking');
$nb_menu_items = count($menu_items);

@ -148,10 +148,10 @@ $actionsLeft .= Display::url(
'course_log_tools.php?'.api_get_cidreq()
);
$actionsLeft .= Display::url(
/*$actionsLeft .= Display::url(
Display::return_icon('tools.png', get_lang('ResourcesReporting'), [], ICON_SIZE_MEDIUM),
'course_log_resources.php?'.api_get_cidreq()
);
);*/
$actionsLeft .= Display::url(
Display::return_icon('quiz.png', get_lang('ExamReporting'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'tracking/exams.php?'.api_get_cidreq()
@ -261,7 +261,7 @@ if (api_is_platform_admin(true) ||
$html .= '<ul class="session-list">';
foreach ($sessionList as $session) {
$url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='
$url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?sid='
.$session['id'].'&cidReq='.$courseInfo['code'];
$html .= Display::tag('li', $icon.' '.Display::url($session['name'], $url));
}

@ -272,7 +272,7 @@ class ScriptHandler
}
// Loop through the folder.
$dir = getdir($dirname);
$dir = dir($dirname);
// A sanity check.
$is_object_dir = \is_object($dir);
if ($is_object_dir) {

@ -13,10 +13,10 @@
<div class="circle {{ show_toolbar_by_default == 1 ? 'open' : '' }}">
{% if show_left_column == 1 %}
{% set label = "Collapse" | trans %}
{% set icon_expand = "fa-compress" %}
{% set icon_expand = "arrow-expand-horizontal" %}
{% if lp_mode == 'embedframe' %}
{% set label = "Expand" | trans %}
{% set icon_expand = "fa-collapse" %}
{% set icon_expand = "arrow-collapse-horizontal" %}
{% endif %}
<a href="#"
id="lp-view-expand-toggle"
@ -24,8 +24,7 @@
role="button"
title="{{ label }}"
>
<span class="fa {{ icon_expand }}" aria-hidden="true"></span>
<span class="sr-only"></span>
<i class="mdi-{{ icon_expand }} mdi v-icon notranslate v-icon--size-default" aria-hidden="true" medium=""></i>
</a>
{% endif %}
<a id="home-course"
@ -33,10 +32,13 @@
href="{{ button_home_url }}"
class="icon-toolbar" target="_self"
onclick="javascript: window.parent.API.save_asset();">
<em class="fa fa-home"></em> <span class="hidden-xs hidden-sm"></span>
<i class="mdi-home-outline mdi v-icon notranslate v-icon--size-default" aria-hidden="true" medium=""></i>
</a>
{{ navigation_bar }}
</div>
<a title="{{ 'Options'|trans }}" class="menu-button fa fa-bars icons" href="#"></a>
<a title="{{ 'Options'|trans }}" class="menu-button icons" href="#">
<i class="mdi-menu mdi v-icon notranslate v-icon--size-default" aria-hidden="true" medium=""></i>
</a>
</nav>
{% endautoescape %}
{% endautoescape %}

@ -113,13 +113,13 @@
<div class="col-xs-6">
{% if gamification_stars > 0 %}
{% for i in 1..gamification_stars %}
<em class="fa fa-star level"></em>
<i class="level mdi-star-face mdi v-icon notranslate v-icon--size-default" aria-hidden="true" medium=""></i>
{% endfor %}
{% endif %}
{% if gamification_stars < 4 %}
{% for i in 1..4 - gamification_stars %}
<em class="fa fa-star"></em>
<i class="mdi-home-outline mdi v-icon notranslate v-icon--size-default" aria-hidden="true" medium=""></i>
{% endfor %}
{% endif %}
</div>
@ -160,14 +160,14 @@
<li role="presentation" class="active">
<a href="#lp-view-content" title="{{ 'Lesson'|trans }}"
aria-controls="lp-view-content" role="tab" data-toggle="tab">
<span class="fa fa-book fa-2x fa-fw" aria-hidden="true"></span>
<i class="mdi-book mdi v-icon notranslate v-icon--size-default" aria-hidden="true" medium=""></i>
<span class="sr-only">{{ 'Lesson'|trans }}</span>
</a>
</li>
<li role="presentation">
<a href="#lp-view-forum" title="{{ 'Forum'|trans }}"
aria-controls="lp-view-forum" role="tab" data-toggle="tab">
<span class="fa fa-commenting-o fa-2x fa-fw" aria-hidden="true"></span>
<i class="mdi-message-reply-text mdi v-icon notranslate v-icon--size-default" aria-hidden="true" medium=""></i>
<span class="sr-only">{{ 'Forum'|trans }}</span>
</a>
</li>
@ -253,10 +253,10 @@
$('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
e.preventDefault();
$('#learning_path_main').toggleClass('lp-view-collapsed');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
var className = $('#lp-view-expand-toggle span.fa').attr('class');
if (className == 'fa fa-expand') {
$('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-expand-horizontal');
$('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-collapse-horizontal');
var className = $('#lp-view-expand-toggle i.mdi').attr('class');
if (className == 'mdi-arrow-collapse-horizontal') {
$(this).attr('title', '{{ "Expand" | trans }}');
} else {
$(this).attr('title', '{{ "Collapse" | trans }}');
@ -272,11 +272,11 @@
$('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
e.preventDefault();
$('#learning_path_main').toggleClass('lp-view-collapsed');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
$('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-collapse-horizontal');
$('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-expand-horizontal');
var className = $('#lp-view-expand-toggle span.fa').attr('class');
if (className == 'fa fa-expand') {
var className = $('#lp-view-expand-toggle i.mdi').attr('class');
if (className == 'mdi-arrow-expand-horizontal') {
$(this).attr('title', '{{ "Expand" | trans }}');
} else {
$(this).attr('title', '{{ "Collapse" | trans }}');
@ -290,13 +290,13 @@
$('a#ui-option').on('click', function (e) {
e.preventDefault();
var icon = $(this).children('.fa');
if (icon.is('.fa-chevron-up')) {
icon.removeClass('fa-chevron-up').addClass('fa-chevron-down');
var icon = $(this).children('.mdi');
if (icon.is('.mdi-chevron-up')) {
icon.removeClass('mdi-chevron-up').addClass('mdi-chevron-down');
return;
}
icon.removeClass('fa-chevron-down').addClass('fa-chevron-up');
icon.removeClass('mdi-chevron-down').addClass('mdi-chevron-up');
});
LPViewUtils.setHeightLPToc();

Loading…
Cancel
Save