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

@ -52,7 +52,17 @@ export default {
const showBreadcrumb = ref(true); const showBreadcrumb = ref(true);
const layout = computed( 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) 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> <template>
<q-form> <q-form>
<q-input <v-container>
id="item_title" <v-row>
v-model="item.title" <v-col md="9">
:placeholder="$t('Title')" <q-input
:error="v$.item.title.$error" id="item_title"
@input="v$.item.title.$touch()" v-model="item.title"
@blur="v$.item.title.$touch()" :error="v$.item.title.$error"
:error-message="titleErrors" :error-message="titleErrors"
/> :placeholder="$t('Title')"
<slot></slot> @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> </q-form>
</template> </template>
@ -17,10 +28,12 @@
import has from 'lodash/has'; import has from 'lodash/has';
import useVuelidate from '@vuelidate/core'; import useVuelidate from '@vuelidate/core';
import { required } from '@vuelidate/validators'; import { required } from '@vuelidate/validators';
import AudioRecorder from "../AudioRecorder";
export default { export default {
name: 'MessageForm', name: 'MessageForm',
setup () { components: {AudioRecorder},
setup() {
return { v$: useVuelidate() } return { v$: useVuelidate() }
}, },
props: { props: {

@ -316,7 +316,7 @@ if (count($sessions) > 0) {
$tools = Display::url( $tools = Display::url(
Display::return_icon('statistics.png', get_lang('Statistics')), 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.'">'. $tools .= '&nbsp;<a href="course_information.php?id='.$courseId.'&id_session='.$sessionId.'">'.
Display::return_icon('info2.png', get_lang('Overview')).'</a>'. Display::return_icon('info2.png', get_lang('Overview')).'</a>'.
@ -425,7 +425,7 @@ if (count($courseRelUserList) > 0) {
$courseUrl = api_get_course_url($courseId); $courseUrl = api_get_course_url($courseId);
$tools = Display::url( $tools = Display::url(
Display::return_icon('statistics.png', get_lang('Statistics')), 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.'">'. $tools .= '&nbsp;<a href="course_information.php?id='.$courseId.'">'.
Display::return_icon('info2.png', get_lang('Overview')).'</a>'. Display::return_icon('info2.png', get_lang('Overview')).'</a>'.

@ -1903,13 +1903,13 @@ switch ($action) {
); );
$detailButtons[] = Display::url( $detailButtons[] = Display::url(
Display::return_icon('2rightarrow.png'), 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 = [ $item = [
'name' => Display::url( 'name' => Display::url(
$session['name'], $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, 'date' => $dateToString,
'course_per_session' => $count_courses_in_session, 'course_per_session' => $count_courses_in_session,

@ -3110,7 +3110,8 @@ class Attendance
if ($exportToPdf) { if ($exportToPdf) {
$result = $this->exportAttendanceLogin($startDate, $endDate); $result = $this->exportAttendanceLogin($startDate, $endDate);
if (empty($result)) { 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 32
), ),
api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher' api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=teacher'
); );
$menuItems[] = Display::url( $menuItems[] = Display::url(
Display::return_icon( Display::return_icon(

@ -1313,11 +1313,11 @@ class SessionManager
// Overall Total // Overall Total
$overall_total = ($course_description_progress + $exercises_progress + $forums_progress + $assignments_progress + $wiki_progress + $surveys_progress) / 6; $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>'; $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='.$user['id_session'].'"> %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='.$user['id_session'].'"> %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='.$user['id_session'].'&action=statistics"> %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='.$user['id_session'].'"> %s </a>'; $linkSurvey = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?cid='.$course['real_id'].'&sid='.$sessionId.'"> %s </a>';
$table[] = [ $table[] = [
'lastname' => $user[1], 'lastname' => $user[1],

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

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

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

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

@ -109,7 +109,7 @@ if (!$exportToXLS) {
$menuItems[] = Display::url( $menuItems[] = Display::url(
Display::return_icon('teacher.png', get_lang('Trainer View'), [], 32), 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()) { if (api_is_platform_admin()) {
$menuItems[] = Display::url( $menuItems[] = Display::url(
@ -130,6 +130,7 @@ if (!$exportToXLS) {
$actionsLeft .= $item; $actionsLeft .= $item;
} }
} }
$actionsLeft = TrackingCourseLog::actionsLeft('exams', $sessionId, false);
} else { } else {
$actionsLeft = TrackingCourseLog::actionsLeft('exams', api_get_session_id(), false); $actionsLeft = TrackingCourseLog::actionsLeft('exams', api_get_session_id(), false);
$actionsRight .= Display::url( $actionsRight .= Display::url(

@ -92,11 +92,11 @@ if (!$export_to_csv) {
&nbsp;'.get_lang('Print').'</a> &nbsp;'.get_lang('Print').'</a>
</div>'; </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()) { 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 { } 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'); $menu_items[] = get_lang('Exam tracking');
$nb_menu_items = count($menu_items); $nb_menu_items = count($menu_items);

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

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

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

@ -113,13 +113,13 @@
<div class="col-xs-6"> <div class="col-xs-6">
{% if gamification_stars > 0 %} {% if gamification_stars > 0 %}
{% for i in 1..gamification_stars %} {% 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 %} {% endfor %}
{% endif %} {% endif %}
{% if gamification_stars < 4 %} {% if gamification_stars < 4 %}
{% for i in 1..4 - gamification_stars %} {% 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 %} {% endfor %}
{% endif %} {% endif %}
</div> </div>
@ -160,14 +160,14 @@
<li role="presentation" class="active"> <li role="presentation" class="active">
<a href="#lp-view-content" title="{{ 'Lesson'|trans }}" <a href="#lp-view-content" title="{{ 'Lesson'|trans }}"
aria-controls="lp-view-content" role="tab" data-toggle="tab"> 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> <span class="sr-only">{{ 'Lesson'|trans }}</span>
</a> </a>
</li> </li>
<li role="presentation"> <li role="presentation">
<a href="#lp-view-forum" title="{{ 'Forum'|trans }}" <a href="#lp-view-forum" title="{{ 'Forum'|trans }}"
aria-controls="lp-view-forum" role="tab" data-toggle="tab"> 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> <span class="sr-only">{{ 'Forum'|trans }}</span>
</a> </a>
</li> </li>
@ -253,10 +253,10 @@
$('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) { $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
e.preventDefault(); e.preventDefault();
$('#learning_path_main').toggleClass('lp-view-collapsed'); $('#learning_path_main').toggleClass('lp-view-collapsed');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-compress'); $('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-expand-horizontal');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-expand'); $('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-collapse-horizontal');
var className = $('#lp-view-expand-toggle span.fa').attr('class'); var className = $('#lp-view-expand-toggle i.mdi').attr('class');
if (className == 'fa fa-expand') { if (className == 'mdi-arrow-collapse-horizontal') {
$(this).attr('title', '{{ "Expand" | trans }}'); $(this).attr('title', '{{ "Expand" | trans }}');
} else { } else {
$(this).attr('title', '{{ "Collapse" | trans }}'); $(this).attr('title', '{{ "Collapse" | trans }}');
@ -272,11 +272,11 @@
$('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) { $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
e.preventDefault(); e.preventDefault();
$('#learning_path_main').toggleClass('lp-view-collapsed'); $('#learning_path_main').toggleClass('lp-view-collapsed');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-expand'); $('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-collapse-horizontal');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-compress'); $('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-expand-horizontal');
var className = $('#lp-view-expand-toggle span.fa').attr('class'); var className = $('#lp-view-expand-toggle i.mdi').attr('class');
if (className == 'fa fa-expand') { if (className == 'mdi-arrow-expand-horizontal') {
$(this).attr('title', '{{ "Expand" | trans }}'); $(this).attr('title', '{{ "Expand" | trans }}');
} else { } else {
$(this).attr('title', '{{ "Collapse" | trans }}'); $(this).attr('title', '{{ "Collapse" | trans }}');
@ -290,13 +290,13 @@
$('a#ui-option').on('click', function (e) { $('a#ui-option').on('click', function (e) {
e.preventDefault(); e.preventDefault();
var icon = $(this).children('.fa'); var icon = $(this).children('.mdi');
if (icon.is('.fa-chevron-up')) { if (icon.is('.mdi-chevron-up')) {
icon.removeClass('fa-chevron-up').addClass('fa-chevron-down'); icon.removeClass('mdi-chevron-up').addClass('mdi-chevron-down');
return; return;
} }
icon.removeClass('fa-chevron-down').addClass('fa-chevron-up'); icon.removeClass('mdi-chevron-down').addClass('mdi-chevron-up');
}); });
LPViewUtils.setHeightLPToc(); LPViewUtils.setHeightLPToc();

Loading…
Cancel
Save