diff --git a/main/auth/inscription.php b/main/auth/inscription.php
index 837bb6cf6d..c3ff85082f 100755
--- a/main/auth/inscription.php
+++ b/main/auth/inscription.php
@@ -75,11 +75,11 @@ if ($extraConditions && isset($extraConditions['conditions'])) {
if (CustomPages::enabled() && CustomPages::exists(CustomPages::REGISTRATION)) {
$layoutForm = FormValidator::LAYOUT_GRID;
-} else{
+} else {
$layoutForm = FormValidator::LAYOUT_HORIZONTAL;
}
-$form = new FormValidator('registration','post','','',[],$layoutForm);
+$form = new FormValidator('registration', 'post', '', '', [], $layoutForm);
$user_already_registered_show_terms = false;
if (api_get_setting('allow_terms_conditions') === 'true') {
$user_already_registered_show_terms = isset($_SESSION['term_and_condition']['user_id']);
@@ -314,7 +314,6 @@ if ($user_already_registered_show_terms === false &&
);
}
-
if (api_get_setting('extended_profile') === 'true') {
// MY PERSONAL OPEN AREA
if (api_get_setting('extendedprofile_registration', 'mypersonalopenarea') === 'true' &&
diff --git a/main/exercise/TestCategory.php b/main/exercise/TestCategory.php
index 64c45fd868..65d25d500d 100644
--- a/main/exercise/TestCategory.php
+++ b/main/exercise/TestCategory.php
@@ -750,8 +750,8 @@ class TestCategory
*
* @param Exercise $exercise
* @param array $category_list
- * pre filled array with the category_id, score, and weight
- * example: array(1 => array('score' => '10', 'total' => 20));
+ * pre filled array with the category_id, score, and weight
+ * example: array(1 => array('score' => '10', 'total' => 20));
*
* @return string
*/
@@ -811,7 +811,7 @@ class TestCategory
true
)
);
- $resultsArray[] = round($category_item['score']/$category_item['total']*10);
+ $resultsArray[] = round($category_item['score'] / $category_item['total'] * 10);
$row++;
}
diff --git a/main/exercise/exercise.class.php b/main/exercise/exercise.class.php
index 19485c8f59..ba436b97b5 100755
--- a/main/exercise/exercise.class.php
+++ b/main/exercise/exercise.class.php
@@ -10412,6 +10412,138 @@ class Exercise
return $content;
}
+ public function getRadarsFromUsers($userList, $exercises, $courseId, $sessionId)
+ {
+ $dataSet = [];
+ $labels = [];
+ /** @var Exercise $exercise */
+ foreach ($exercises as $exercise) {
+ if (empty($labels)) {
+ $categoryNameList = TestCategory::getListOfCategoriesNameForTest($exercise->iId);
+ $labels = array_column($categoryNameList, 'title');
+ }
+
+ foreach ($userList as $userId) {
+ $results = Event::getExerciseResultsByUser(
+ $userId,
+ $exercise->iId,
+ $courseId,
+ $sessionId
+ );
+
+ if ($results) {
+ $firstAttempt = current($results);
+ $exeId = $firstAttempt['exe_id'];
+
+ ob_start();
+ $stats = ExerciseLib::displayQuestionListByAttempt(
+ $exercise,
+ $exeId,
+ false
+ );
+ ob_end_clean();
+
+ $categoryList = $stats['category_list'];
+ $resultsArray = [];
+ foreach ($categoryList as $category_id => $category_item) {
+ $resultsArray[] = round($category_item['score'] / $category_item['total'] * 10);
+ }
+ $dataSet[] = $resultsArray;
+ }
+ }
+ }
+
+ return $this->getRadar($labels, $dataSet);
+ }
+
+ public function getRadar($labels, $dataSet)
+ {
+ if (empty($labels) || empty($dataSet)) {
+ return '';
+ }
+
+ $labels = json_encode($labels);
+
+ // Default preset, after that colors are generated randomly. @todo improve colors. Use a js lib?
+ $colorList = [
+ 'rgb(255, 99, 132, 1.0)',
+ 'rgb(0,0,200,1.0)', // red
+ 'rgb(255, 159, 64, 1.0)', // orange
+ 'rgb(255, 205, 86, 1.0)', //yellow
+ 'rgb(75, 192, 192, 1.0)', // green
+ 'rgb(54, 162, 235, 1.0)', // blue
+ 'rgb(153, 102, 255, 1.0)', // purple
+ //'rgb(201, 203, 207)' grey
+ ];
+
+ $dataSetToJson = [];
+ $counter = 0;
+ foreach ($dataSet as $resultsArray) {
+ $color = isset($colorList[$counter]) ? $colorList[$counter] : 'rgb('.rand(0, 255).', '.rand(0, 255).', '.rand(0, 255).', 1.0)';
+
+ $background = str_replace('1.0', '0.2', $color);
+ $dataSetToJson[] = [
+ 'fill' => true,
+ //'label' => '".get_lang('Categories')."',
+ 'backgroundColor' => $background,
+ 'borderColor' => $color,
+ 'pointBackgroundColor' => $color,
+ 'pointBorderColor' => '#fff',
+ 'pointHoverBackgroundColor' => '#fff',
+ 'pointHoverBorderColor' => $color,
+ 'pointRadius' => 6,
+ 'pointBorderWidth' => 3,
+ 'pointHoverRadius' => 10,
+ 'data' => $resultsArray,
+ ];
+ $counter++;
+ }
+ $resultsToJson = json_encode($dataSetToJson);
+
+ return "
+
+
+ ";
+ }
+
/**
* Get number of questions in exercise by user attempt.
*
@@ -10934,136 +11066,4 @@ class Exercise
get_lang('ShowResultsToStudents')
);
}
-
- public function getRadarsFromUsers($userList, $exercises, $courseId, $sessionId)
- {
- $dataSet = [];
- $labels = [];
- /** @var Exercise $exercise */
- foreach ($exercises as $exercise) {
- if (empty($labels)) {
- $categoryNameList = TestCategory::getListOfCategoriesNameForTest($exercise->iId);
- $labels = array_column($categoryNameList, 'title');
- }
-
- foreach ($userList as $userId) {
- $results = Event::getExerciseResultsByUser(
- $userId,
- $exercise->iId,
- $courseId,
- $sessionId
- );
-
- if ($results) {
- $firstAttempt = current($results);
- $exeId = $firstAttempt['exe_id'];
-
- ob_start();
- $stats = ExerciseLib::displayQuestionListByAttempt(
- $exercise,
- $exeId,
- false
- );
- ob_end_clean();
-
- $categoryList = $stats['category_list'];
- $resultsArray = [];
- foreach ($categoryList as $category_id => $category_item) {
- $resultsArray[] = round($category_item['score'] / $category_item['total'] * 10);
- }
- $dataSet[] = $resultsArray;
- }
- }
- }
-
- return $this->getRadar($labels, $dataSet);
- }
-
- public function getRadar($labels, $dataSet)
- {
- if (empty($labels) || empty($dataSet)) {
- return '';
- }
-
- $labels = json_encode($labels);
-
- // Default preset, after that colors are generated randomly. @todo improve colors. Use a js lib?
- $colorList = [
- 'rgb(255, 99, 132, 1.0)',
- 'rgb(0,0,200,1.0)', // red
- 'rgb(255, 159, 64, 1.0)', // orange
- 'rgb(255, 205, 86, 1.0)', //yellow
- 'rgb(75, 192, 192, 1.0)', // green
- 'rgb(54, 162, 235, 1.0)', // blue
- 'rgb(153, 102, 255, 1.0)', // purple
- //'rgb(201, 203, 207)' grey
- ];
-
- $dataSetToJson = [];
- $counter = 0;
- foreach ($dataSet as $resultsArray) {
- $color = isset($colorList[$counter]) ? $colorList[$counter] : 'rgb('.rand(0,255).', '.rand(0,255).', '.rand(0,255).', 1.0)';
-
- $background = str_replace('1.0', '0.2', $color);
- $dataSetToJson[] = [
- 'fill' => true,
- //'label' => '".get_lang('Categories')."',
- 'backgroundColor' => $background,
- 'borderColor' => $color,
- 'pointBackgroundColor' => $color,
- 'pointBorderColor' => '#fff',
- 'pointHoverBackgroundColor' => '#fff',
- 'pointHoverBorderColor' => $color,
- 'pointRadius' => 6,
- 'pointBorderWidth' => 3,
- 'pointHoverRadius' => 10,
- 'data' => $resultsArray,
- ];
- $counter++;
- }
- $resultsToJson = json_encode($dataSetToJson);
-
- return "
-
-
- ";
- }
}
diff --git a/main/inc/ajax/lp.ajax.php b/main/inc/ajax/lp.ajax.php
index 12a048d50c..74bcbc5c6a 100755
--- a/main/inc/ajax/lp.ajax.php
+++ b/main/inc/ajax/lp.ajax.php
@@ -25,7 +25,7 @@ switch ($action) {
$session_id = (isset($_GET['session_id']) && !empty($_GET['session_id'])) ? (int) $_GET['session_id'] : 0;
$onlyActiveLp = !(api_is_platform_admin(true) || api_is_course_admin());
$results = learnpath::getLpList($course_id, $session_id, $onlyActiveLp);
- $data= [];
+ $data = [];
if (!empty($results)) {
foreach ($results as $lp) {
diff --git a/main/inc/lib/TicketManager.php b/main/inc/lib/TicketManager.php
index a77961125c..0ee2e6587f 100644
--- a/main/inc/lib/TicketManager.php
+++ b/main/inc/lib/TicketManager.php
@@ -1226,7 +1226,7 @@ class TicketManager
$dataExercise = [
'cidReq' => $course['code'],
'id_session' => $sessionId,
- 'exerciseId' => $row['exercise_id']
+ 'exerciseId' => $row['exercise_id'],
];
$urlParamsExercise = http_build_query($dataExercise);
@@ -1241,7 +1241,7 @@ class TicketManager
'cidReq' => $course['code'],
'id_session' => $sessionId,
'lp_id' => $row['lp_id'],
- 'action' => 'view'
+ 'action' => 'view',
];
$urlParamsLp = http_build_query($dataLp);
diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php
index 6d0bf3f26b..5052673693 100644
--- a/main/inc/lib/api.lib.php
+++ b/main/inc/lib/api.lib.php
@@ -1261,7 +1261,7 @@ function api_protect_course_script($print_headers = false, $allow_session_admins
'/plugin/positioning/start.php',
'/plugin/positioning/start_student.php',
'/main/course_home/course_home.php',
- '/main/exercise/overview.php'
+ '/main/exercise/overview.php',
];
if (!in_array($currentPath, $paths, true)) {
diff --git a/main/inc/lib/extra_field.lib.php b/main/inc/lib/extra_field.lib.php
index d7f94599d3..3ee375a1ae 100755
--- a/main/inc/lib/extra_field.lib.php
+++ b/main/inc/lib/extra_field.lib.php
@@ -1003,7 +1003,6 @@ class ExtraField extends Model
|| $field_details['variable'] == 'price'
) {
$authors = true;
-
}
if (!api_is_platform_admin() && $authors == true) {
continue;
diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php
index a31eee56cc..21ed491fd0 100755
--- a/main/inc/lib/social.lib.php
+++ b/main/inc/lib/social.lib.php
@@ -924,7 +924,7 @@ class SocialManager extends UserManager
}
$myExtendedProfileEdit = '';
- if( $user_id == api_get_user_id()){
+ if ($user_id == api_get_user_id()) {
$myExtendedProfileEdit .= ''.
Display::return_icon('edit.png', get_lang('EditExtendProfile'), '', 16).' ';
}
@@ -967,7 +967,7 @@ class SocialManager extends UserManager
$portfolioIcon = Display::return_icon('wiki_task.png', get_lang('Portfolio'));
$personalDataIcon = Display::return_icon('database.png', get_lang('PersonalDataReport'));
$messageSocialIcon = Display::return_icon('promoted_message.png', get_lang('PromotedMessages'));
- $portfolio = Display::return_icon('portfolio.png', get_lang('Portfolio '));
+ $portfolio = Display::return_icon('portfolio.png', get_lang('Portfolio '));
$forumCourseId = api_get_configuration_value('global_forums_course_id');
$groupUrl = api_get_path(WEB_CODE_PATH).'social/groups.php';
@@ -1000,7 +1000,6 @@ class SocialManager extends UserManager
';
if ($settingExtendedProfileEnabled == true) {
-
$active = $show === 'portfolio' ? 'active' : null;
$links .= '
@@ -1231,7 +1230,7 @@ class SocialManager extends UserManager
'data-title' => $sendMessageText,
]
);
- if($settingExtendedProfileEnabled == true) {
+ if ($settingExtendedProfileEnabled == true) {
$active = $show === 'portfolio' ? 'active' : null;
$links .= '
@@ -1467,7 +1466,6 @@ class SocialManager extends UserManager
}
// MY PRODUCTIONS
self::display_productions($user_object->user_id);
-
} else {
$html .= '';
$html .= get_lang('UsersOnLineList');
@@ -2455,7 +2453,7 @@ class SocialManager extends UserManager
/**
* Show middle section for Portfolio extended.
- * Must be active on main/admin/settings.php?category=User into extended_profile
+ * Must be active on main/admin/settings.php?category=User into extended_profile.
*
* @param string $urlForm
*
@@ -2563,7 +2561,7 @@ class SocialManager extends UserManager
$form->addHtml('
');
$form->addHidden('url_content', '');
- return Display::panel($more_info, get_lang('Portfolio') . $editPorfolioLink);
+ return Display::panel($more_info, get_lang('Portfolio').$editPorfolioLink);
}
/**
diff --git a/main/lp/learnpath.class.php b/main/lp/learnpath.class.php
index 9e6066d65e..b73544ea24 100755
--- a/main/lp/learnpath.class.php
+++ b/main/lp/learnpath.class.php
@@ -1831,7 +1831,7 @@ class learnpath
}
/**
- * Get the learning path name by id
+ * Get the learning path name by id.
*
* @param int $lpId
*
@@ -4948,6 +4948,7 @@ class learnpath
if ($debug) {
error_log("Skip saving score with value: $score");
}
+
return false;
}
diff --git a/main/lp/lp_add.php b/main/lp/lp_add.php
index 556f58dfe8..0c03ac60bc 100755
--- a/main/lp/lp_add.php
+++ b/main/lp/lp_add.php
@@ -3,7 +3,7 @@
/* For licensing terms, see /license.txt */
/**
- * This is a learning path creation and player tool in Chamilo
+ * This is a learning path creation and player tool in Chamilo.
*
* @author Patrick Cool
* @author Denes Nagy
diff --git a/main/lp/lp_report.php b/main/lp/lp_report.php
index 78030fa8d4..8751ad6abf 100644
--- a/main/lp/lp_report.php
+++ b/main/lp/lp_report.php
@@ -381,7 +381,7 @@ $parameters = [
'group_filter' => $groupFilter,
'cidReq' => $courseCode,
'id_session' => $sessionId,
- 'lp_id' => $lpId
+ 'lp_id' => $lpId,
];
$table = new SortableTableFromArrayConfig($userList, 1, 20, 'lp');
diff --git a/main/ticket/new_ticket.php b/main/ticket/new_ticket.php
index 819801b25f..6e69ee7f31 100644
--- a/main/ticket/new_ticket.php
+++ b/main/ticket/new_ticket.php
@@ -54,7 +54,7 @@ function updateExerciseList(courseId, sessionId) {
}, function (exerciseList) {
$("", {
value: 0,
- text: "' . get_lang('Select') . '"
+ text: "'.get_lang('Select').'"
}).appendTo($selectExercise);
if (exerciseList.length > 0) {
@@ -65,7 +65,7 @@ function updateExerciseList(courseId, sessionId) {
}).appendTo($selectExercise);
});
- $selectExercise.find("option[value=\'' . $exerciseId . '\']").attr("selected",true);
+ $selectExercise.find("option[value=\''.$exerciseId.'\']").attr("selected",true);
}
$selectExercise.selectpicker("refresh");
@@ -93,7 +93,7 @@ function updateLpList(courseId, sessionId) {
text: lp.text
}).appendTo($selectLp);
});
- $selectLp.find("option[value=\'' . $lpId . '\']").attr("selected",true);
+ $selectLp.find("option[value=\''.$lpId.'\']").attr("selected",true);
}
$selectLp.selectpicker("refresh");
diff --git a/main/ticket/ticket_details.php b/main/ticket/ticket_details.php
index 1361f2ecc6..dcbf54d29c 100644
--- a/main/ticket/ticket_details.php
+++ b/main/ticket/ticket_details.php
@@ -398,7 +398,7 @@ if ($ticket['ticket']['course_url'] != null) {
if (api_get_configuration_value('ticket_lp_quiz_info_add')) {
if (!empty($ticket['ticket']['exercise_url'])) {
echo '
- ' . get_lang('Exercise') . ': ' . $ticket['ticket']['exercise_url'] . '
+ '.get_lang('Exercise').': '.$ticket['ticket']['exercise_url'].'
';
@@ -406,7 +406,7 @@ if ($ticket['ticket']['course_url'] != null) {
if (!empty($ticket['ticket']['lp_id'])) {
echo '
- ' . get_lang('LearningPath') . ': ' . $ticket['ticket']['lp_url'] . '
+ '.get_lang('LearningPath').': '.$ticket['ticket']['lp_url'].'
';
diff --git a/main/ticket/tickets.php b/main/ticket/tickets.php
index c7463d7380..997a420175 100644
--- a/main/ticket/tickets.php
+++ b/main/ticket/tickets.php
@@ -231,11 +231,11 @@ if (!empty($projectId)) {
$extraParams = '';
if (isset($_GET['exerciseId']) && !empty($_GET['exerciseId'])) {
- $extraParams .= '&exerciseId=' . (int) $_GET['exerciseId'];
+ $extraParams .= '&exerciseId='.(int) $_GET['exerciseId'];
}
if (isset($_GET['lpId']) && !empty($_GET['lpId'])) {
- $extraParams .= '&lpId=' . (int) $_GET['lpId'];
+ $extraParams .= '&lpId='.(int) $_GET['lpId'];
}
$actionRight = Display::url(
diff --git a/plugin/buycourses/src/paymentsetup.php b/plugin/buycourses/src/paymentsetup.php
index b9a05252cd..c54e209da6 100644
--- a/plugin/buycourses/src/paymentsetup.php
+++ b/plugin/buycourses/src/paymentsetup.php
@@ -220,17 +220,17 @@ if (file_exists(api_get_path(SYS_PLUGIN_PATH).'buycourses/resources/apiRedsys.ph
if ($tpvRedsysForm->validate()) {
$tpvRedsysFormValues = $tpvRedsysForm->getSubmitValues();
-
+
$plugin->saveTpvRedsysParams($tpvRedsysFormValues);
-
+
Display::addFlash(
Display::return_message(get_lang('Saved'), 'success')
);
-
+
header('Location:'.api_get_self());
exit;
}
-
+
$tpvRedsysForm->addText(
'merchantcode',
[$plugin->get_lang('DS_MERCHANT_MERCHANTCODE'), 'DS_MERCHANT_MERCHANTCODE'],
diff --git a/plugin/cleandeletedfiles/admin.php b/plugin/cleandeletedfiles/admin.php
index 59a0db3227..374f59fae9 100644
--- a/plugin/cleandeletedfiles/admin.php
+++ b/plugin/cleandeletedfiles/admin.php
@@ -7,7 +7,6 @@
*
* @author Jose Angel Ruiz
*/
-
$cidReset = true;
require_once __DIR__.'/config.php';
diff --git a/plugin/cleandeletedfiles/lang/english.php b/plugin/cleandeletedfiles/lang/english.php
index 87ae67dc2d..97c7444257 100644
--- a/plugin/cleandeletedfiles/lang/english.php
+++ b/plugin/cleandeletedfiles/lang/english.php
@@ -14,4 +14,4 @@ $strings['DeleteSelectedFiles'] = "Delete selected files";
$strings['ConfirmDeleteFiles'] = "Are you sure you want to delete all the selected files?";
$strings['DeletedSuccess'] = "The file deletion was successful";
$strings['path_dir'] = "Directory";
-$strings['size'] = "Size";
\ No newline at end of file
+$strings['size'] = "Size";
diff --git a/plugin/cleandeletedfiles/lang/spanish.php b/plugin/cleandeletedfiles/lang/spanish.php
index adaa7b1b38..42c829dd23 100644
--- a/plugin/cleandeletedfiles/lang/spanish.php
+++ b/plugin/cleandeletedfiles/lang/spanish.php
@@ -14,4 +14,4 @@ $strings['DeleteSelectedFiles'] = "Borrar archivos seleccionados";
$strings['ConfirmDeleteFiles'] = "¿Esta seguro que desea borrar todos los ficheros seleccionados?";
$strings['DeletedSuccess'] = "El borrado de archivos ha sido correcto";
$strings['path_dir'] = "Directorio";
-$strings['size'] = "Tamaño";
\ No newline at end of file
+$strings['size'] = "Tamaño";
diff --git a/plugin/cleandeletedfiles/plugin.php b/plugin/cleandeletedfiles/plugin.php
index ce1084ecc8..4e19f62cfe 100644
--- a/plugin/cleandeletedfiles/plugin.php
+++ b/plugin/cleandeletedfiles/plugin.php
@@ -7,6 +7,5 @@
*
* @author Jose Angel Ruiz
*/
-
require_once __DIR__.'/config.php';
$plugin_info = CleanDeletedFilesPlugin::create()->get_info();
diff --git a/plugin/cleandeletedfiles/src/ajax.php b/plugin/cleandeletedfiles/src/ajax.php
index a570fb6221..0ede69d3d7 100644
--- a/plugin/cleandeletedfiles/src/ajax.php
+++ b/plugin/cleandeletedfiles/src/ajax.php
@@ -3,9 +3,8 @@
/* For licensing terms, see /license.txt */
/**
- * Responses to AJAX calls
+ * Responses to AJAX calls.
*/
-
require_once '../config.php';
api_protect_admin_script();
diff --git a/plugin/positioning/src/Positioning.php b/plugin/positioning/src/Positioning.php
index 8c4cd4a7f0..6ce2697a67 100644
--- a/plugin/positioning/src/Positioning.php
+++ b/plugin/positioning/src/Positioning.php
@@ -81,7 +81,6 @@ class Positioning extends Plugin
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
-
return Database::fetch_array($result, 'ASSOC');
}
@@ -101,42 +100,6 @@ class Positioning extends Plugin
$this->setOption('is_initial', $exerciseId, $courseId, $sessionId);
}
- private function setOption($field, $exerciseId, $courseId, $sessionId)
- {
- if (!in_array($field, ['is_initial', 'is_final'], true)) {
- return false;
- }
-
- $data = $this->getPositionData($exerciseId, $courseId, $sessionId);
- $disableField = $field === 'is_initial' ? 'is_final' : 'is_initial';
- if ($data && isset($data['id'])) {
- $id = $data['id'];
- $sql = "UPDATE $this->table SET
- $field = 1,
- $disableField = 0
- WHERE id = $id";
- Database::query($sql);
-
- $sql = "DELETE FROM $this->table
- WHERE $field = 1 AND c_id = $courseId AND session_id = $sessionId AND id <> $id";
- Database::query($sql);
-
- } else {
- $params = [
- 'exercise_id' => $exerciseId,
- 'c_id' => $courseId,
- 'session_id' => $sessionId,
- $field => 1,
- $disableField => 0,
- ];
- $id = Database::insert($this->table, $params);
-
- $sql = "DELETE FROM $this->table
- WHERE $field = 1 AND c_id = $courseId AND session_id = $sessionId AND id <> $id";
- Database::query($sql);
- }
- }
-
public function setFinalExercise($exerciseId, $courseId, $sessionId)
{
$this->setOption('is_final', $exerciseId, $courseId, $sessionId);
@@ -192,6 +155,46 @@ class Positioning extends Plugin
return $this->getCourseExercise($courseId, $sessionId, true, false);
}
+ public function getFinalExercise($courseId, $sessionId)
+ {
+ return $this->getCourseExercise($courseId, $sessionId, false, true);
+ }
+
+ private function setOption($field, $exerciseId, $courseId, $sessionId)
+ {
+ if (!in_array($field, ['is_initial', 'is_final'], true)) {
+ return false;
+ }
+
+ $data = $this->getPositionData($exerciseId, $courseId, $sessionId);
+ $disableField = $field === 'is_initial' ? 'is_final' : 'is_initial';
+ if ($data && isset($data['id'])) {
+ $id = $data['id'];
+ $sql = "UPDATE $this->table SET
+ $field = 1,
+ $disableField = 0
+ WHERE id = $id";
+ Database::query($sql);
+
+ $sql = "DELETE FROM $this->table
+ WHERE $field = 1 AND c_id = $courseId AND session_id = $sessionId AND id <> $id";
+ Database::query($sql);
+ } else {
+ $params = [
+ 'exercise_id' => $exerciseId,
+ 'c_id' => $courseId,
+ 'session_id' => $sessionId,
+ $field => 1,
+ $disableField => 0,
+ ];
+ $id = Database::insert($this->table, $params);
+
+ $sql = "DELETE FROM $this->table
+ WHERE $field = 1 AND c_id = $courseId AND session_id = $sessionId AND id <> $id";
+ Database::query($sql);
+ }
+ }
+
private function getCourseExercise($courseId, $sessionId, $isInitial, $isFinal)
{
$table = $this->table;
@@ -224,9 +227,4 @@ class Positioning extends Plugin
return false;
}
-
- public function getFinalExercise($courseId, $sessionId)
- {
- return $this->getCourseExercise($courseId, $sessionId, false, true);
- }
}
diff --git a/plugin/positioning/start_student.php b/plugin/positioning/start_student.php
index 499b0c03ec..81d9b8ffc3 100644
--- a/plugin/positioning/start_student.php
+++ b/plugin/positioning/start_student.php
@@ -71,7 +71,7 @@ if ($finalData) {
$finalExerciseTitle = $finalExercise->get_formated_title();
if (!empty($initialResults)) {
$lpUrl = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq();
- $lpUrl = Display::url(get_lang('LearningPath'),$lpUrl);
+ $lpUrl = Display::url(get_lang('LearningPath'), $lpUrl);
if ($studentAverage >= $averageToUnlock) {
$url = api_get_path(WEB_CODE_PATH).'exercise/overview.php?'.api_get_cidreq().'&exerciseId='.$exerciseId;
if (empty($finalResults)) {
diff --git a/src/Chamilo/CoreBundle/Component/Editor/Driver/PersonalDriver.php b/src/Chamilo/CoreBundle/Component/Editor/Driver/PersonalDriver.php
index fb21eb5ccd..13b07a9346 100644
--- a/src/Chamilo/CoreBundle/Component/Editor/Driver/PersonalDriver.php
+++ b/src/Chamilo/CoreBundle/Component/Editor/Driver/PersonalDriver.php
@@ -53,8 +53,6 @@ class PersonalDriver extends Driver implements DriverInterface
'image/svg',
];
-
-
$driver = [
'driver' => 'PersonalDriver',
'alias' => get_lang('MyFiles'),
@@ -108,7 +106,6 @@ class PersonalDriver extends Driver implements DriverInterface
];
}
-
return $driver;
}
}