Skip to content

Commit 96516aa

Browse files
committed
Merge branch 'master' of github.com:chamilo/chamilo-lms
2 parents 71dc4e8 + 29ac1aa commit 96516aa

File tree

21 files changed

+403
-88
lines changed

21 files changed

+403
-88
lines changed

assets/css/scss/index.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,5 @@
7878
@import "userreluser";
7979
@import 'social';
8080
@import 'skill';
81+
82+
@import "libs/mediaelementjs/styles";
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
.mejs {
2+
&__container {
3+
@apply bg-transparent rounded-lg
4+
focus:outline-none drop-shadow-lg;
5+
6+
video {
7+
@apply rounded-lg;
8+
}
9+
}
10+
11+
&__overlay {
12+
@apply bg-support-3 rounded-lg;
13+
14+
&-loading {
15+
16+
&-bg-img {
17+
@apply text-white;
18+
19+
svg {
20+
@apply fill-current;
21+
}
22+
}
23+
}
24+
25+
&-play {
26+
}
27+
28+
&-button {
29+
@apply text-white;
30+
31+
svg {
32+
@apply fill-current;
33+
}
34+
}
35+
}
36+
37+
&__controls {
38+
&:not([style*="display: none"]) {
39+
@apply bg-none bg-white border border-gray-30 rounded-b-lg;
40+
41+
button {
42+
@apply text-gray-90;
43+
}
44+
svg {
45+
@apply fill-current;
46+
}
47+
}
48+
}
49+
50+
&__currenttime,
51+
&__duration {
52+
@apply text-gray-90;
53+
}
54+
55+
&__time-total,
56+
&__time-buffering,
57+
&__time-loaded {
58+
@apply bg-gray-30 rounded-lg overflow-hidden;
59+
}
60+
61+
&__time-hovered {
62+
@apply bg-gray-5 rounded-lg;
63+
}
64+
65+
&__time-current {
66+
@apply bg-primary rounded-none;
67+
}
68+
69+
&__time-handle-content {
70+
@apply border-support-3;
71+
}
72+
73+
&__volume {
74+
&-button > &-slider {
75+
@apply bg-white;
76+
}
77+
78+
&-total {
79+
@apply bg-gray-90 border-gray-90;
80+
}
81+
82+
&-current,
83+
&-handle {
84+
@apply bg-gray-90;
85+
}
86+
87+
&-handle {
88+
@apply border-gray-90;
89+
}
90+
}
91+
}
Lines changed: 46 additions & 0 deletions
Loading

assets/vue/composables/mediaElementLoader.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import "mediaelement/build/mediaelementplayer.min.css"
22
import "mediaelement/full"
33

4+
import iconSprite from "../../css/scss/libs/mediaelementjs/icons.svg"
5+
46
const videoSelector = "video:not(.skip), audio:not(.skip)"
57

68
const mejsOptions = {
7-
iconSprite: "/build/libs/mediaelement/mejs-controls.svg",
9+
iconSprite,
810
}
911

1012
function newVideosCallback(newVideo) {
@@ -14,6 +16,8 @@ function newVideosCallback(newVideo) {
1416
return
1517
}
1618

19+
newVideo.classList.add("not-prose")
20+
1721
// eslint-disable-next-line no-undef
1822
new MediaElementPlayer(newVideo, mejsOptions)
1923
}

public/main/exercise/exercise.class.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3629,6 +3629,11 @@ public function manage_answer(
36293629
$nbrAnswers = 1;
36303630
}
36313631

3632+
$generatedFile = '';
3633+
if ($answerType == ORAL_EXPRESSION) {
3634+
$generatedFile = ExerciseLib::getOralFeedbackAudio($exeId, $questionId);
3635+
}
3636+
36323637
$user_answer = '';
36333638
// Get answer list for matching
36343639
$sql = "SELECT iid, answer
@@ -6143,7 +6148,7 @@ public function manage_answer(
61436148
'open_question' => $arrques,
61446149
'open_answer' => $arrans,
61456150
'answer_type' => $answerType,
6146-
'generated_oral_file' => '',
6151+
'generated_oral_file' => $generatedFile,
61476152
'user_answered' => $userAnsweredQuestion,
61486153
'correct_answer_id' => $correctAnswerId,
61496154
'answer_destination' => $answerDestination,

public/main/exercise/exercise_show.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ function getFCK(vals, marksid) {
623623
if (!empty($comnt)) {
624624
echo ExerciseLib::getFeedbackText($comnt);
625625
}
626-
echo ExerciseLib::getOralFeedbackAudio($id, $questionId, $student_id);
626+
echo ExerciseLib::getOralFeedbackAudio($id, $questionId);
627627
echo '</div>';
628628

629629
echo '<div id="'.$name.'" class="row hidden">';
@@ -672,7 +672,7 @@ function getFCK(vals, marksid) {
672672
if (!empty($comnt)) {
673673
echo '<b>'.get_lang('Feedback').'</b>';
674674
echo ExerciseLib::getFeedbackText($comnt);
675-
echo ExerciseLib::getOralFeedbackAudio($id, $questionId, $student_id);
675+
echo ExerciseLib::getOralFeedbackAudio($id, $questionId);
676676
}
677677
}
678678

public/main/inc/lib/SkillModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ public function getUserSkillsTable($userId, $courseId = 0, $sessionId = 0, $addT
837837
$isHierarchicalTable = ('true' === api_get_setting('skill.skills_hierarchical_view_in_user_tracking'));
838838
$allowLevels = api_get_setting('skill.skill_levels_names', true);
839839

840-
$tableResult = '<div id="skillList">';
840+
$tableResult = '<div id="skillList" class="bg-white p-6 shadow-lg rounded-lg mt-4 mb-14">';
841841
if ($isHierarchicalTable) {
842842
$tableResult = '<div class="table-responsive">';
843843
}

public/main/inc/lib/exercise.lib.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4489,8 +4489,7 @@ public static function displayQuestionListByAttempt(
44894489
$comnt = Event::get_comments($exeId, $questionId);
44904490
$teacherAudio = self::getOralFeedbackAudio(
44914491
$exeId,
4492-
$questionId,
4493-
api_get_user_id()
4492+
$questionId
44944493
);
44954494

44964495
if (!empty($comnt) || $teacherAudio) {
@@ -5112,15 +5111,9 @@ public static function getOralFeedbackForm($attemptId, $questionId)
51125111
}
51135112

51145113
/**
5115-
* Get the audio componen for a teacher audio feedback.
5116-
*
5117-
* @param int $attemptId
5118-
* @param int $questionId
5119-
* @param int $userId
5120-
*
5121-
* @return string
5114+
* Get the audio component for a teacher audio feedback.
51225115
*/
5123-
public static function getOralFeedbackAudio($attemptId, $questionId, $userId)
5116+
public static function getOralFeedbackAudio(int $attemptId, int $questionId): string
51245117
{
51255118
/** @var TrackEExercise $tExercise */
51265119
$tExercise = Container::getTrackEExerciseRepository()->find($attemptId);

public/main/inc/lib/legal.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ public static function sendLegal(int $userId, int $coachId)
402402

403403
$extraFieldValue = new ExtraFieldValue('user');
404404
$value = $extraFieldValue->get_values_by_handler_and_field_variable($userId, 'termactivated');
405-
if (false === $value) {
405+
if (false === $value || $value['value'] != 1) {
406406
$extraFieldInfo = $extraFieldValue->getExtraField()->get_handler_field_info_by_field_variable('termactivated');
407407
if ($extraFieldInfo) {
408408
$newParams = [

public/main/inc/lib/sessionmanager.lib.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9847,29 +9847,39 @@ public static function insertUsersInCourse(
98479847
array $relationInfo = [],
98489848
bool $updateSession = true
98499849
) {
9850+
$em = Database::getManager();
98509851
$course = api_get_course_entity($courseId);
98519852
$session = api_get_session_entity($sessionId);
98529853

9853-
$em = Database::getManager();
98549854

98559855
$relationInfo = array_merge(['visibility' => 0, 'status' => Session::STUDENT], $relationInfo);
98569856

98579857
foreach ($studentIds as $studentId) {
98589858
$user = api_get_user_entity($studentId);
98599859

9860-
$session
9861-
->addUserInCourse($relationInfo['status'], $user, $course)
9862-
->setVisibility($relationInfo['visibility']);
9860+
if (!$session->hasUserInCourse($user, $course)) {
9861+
$session->addUserInCourse($relationInfo['status'], $user, $course)
9862+
->setVisibility($relationInfo['visibility']);
9863+
9864+
Event::logUserSubscribedInCourseSession($user, $course, $session);
9865+
}
98639866

9864-
Event::logUserSubscribedInCourseSession($user, $course, $session);
9867+
$subscription = new SessionRelUser();
9868+
$subscription->setUser($user);
9869+
$subscription->setSession($session);
9870+
$subscription->setRelationType(Session::STUDENT);
98659871

9866-
if ($updateSession) {
9872+
if ($updateSession && !$session->hasUser($subscription)) {
98679873
$session->addUserInSession(Session::STUDENT, $user);
98689874
}
98699875
}
98709876

9871-
$em->persist($session);
9872-
$em->flush();
9877+
try {
9878+
$em->persist($session);
9879+
$em->flush();
9880+
} catch (\Exception $e) {
9881+
error_log("Error executing flush: " . $e->getMessage());
9882+
}
98739883
}
98749884

98759885
public static function getCareersFromSession(int $sessionId): array

0 commit comments

Comments
 (0)