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

pull/5002/head
Angel Fernando Quiroz Campos 1 year ago
commit 81109a634c
  1. 2
      package.json
  2. 89
      public/certificates/index.php
  3. 29
      public/main/attendance/index.php
  4. 19
      public/main/exercise/admin.php
  5. 80
      public/main/exercise/exercise.class.php
  6. 36
      public/main/exercise/exercise.php
  7. 7
      public/main/exercise/exercise_admin.php
  8. 25
      public/main/exercise/exercise_report.php
  9. 5
      public/main/exercise/exercise_result.php
  10. 18
      public/main/exercise/exercise_submit.php
  11. 10
      public/main/exercise/overview.php
  12. 16
      public/main/exercise/question.class.php
  13. 6
      public/main/gradebook/index.php
  14. 5
      public/main/gradebook/lib/be/attendancelink.class.php
  15. 25
      public/main/gradebook/lib/be/learnpathlink.class.php
  16. 9
      public/main/inc/lib/attendance.lib.php
  17. 54
      public/main/inc/lib/exercise.lib.php
  18. 2
      public/main/survey/survey_question.php
  19. 4
      src/CoreBundle/Component/Utils/ActionIcon.php
  20. 16
      yarn.lock

@ -93,7 +93,7 @@
"textcomplete": "^0.18.2",
"timeago": "^1.6.7",
"timepicker": "^1.14.1",
"tinymce": "^5.10.8",
"tinymce": "^5.10.9",
"video.js": "^7.21.5",
"vue-flatpickr-component": "^9.0.8",
"vue-i18n": "9.2.2",

@ -1,89 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Show specified user certificate.
*/
require_once '../main/inc/global.inc.php';
$action = isset($_GET['action']) ? $_GET['action'] : null;
$userId = isset($_GET['user_id']) ? $_GET['user_id'] : 0;
$certificate = new Certificate($_GET['id'], $userId);
CustomCertificatePlugin::redirectCheck($certificate, $_GET['id'], $userId);
switch ($action) {
case 'export':
$hideExportLink = api_get_setting('hide_certificate_export_link');
$hideExportLinkStudent = api_get_setting('hide_certificate_export_link_students');
if ('true' === $hideExportLink ||
(api_is_student() && 'true' === $hideExportLinkStudent)
) {
api_not_allowed(true);
}
$certificate->generate(['hide_print_button' => true]);
if ($certificate->isHtmlFileGenerated()) {
$certificatePathList[] = $certificate->html_file;
$pdfParams = [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
];
$orientation = api_get_setting('document.certificate_pdf_orientation');
$pdfParams['orientation'] = 'landscape';
if (!empty($orientation)) {
$pdfParams['orientation'] = $orientation;
}
$pageFormat = 'landscape' === $pdfParams['orientation'] ? 'A4-L' : 'A4';
$userInfo = api_get_user_info($certificate->user_id);
$pdfName = api_replace_dangerous_char(
get_lang('Certificate').' '.$userInfo['username']
);
$pdf = new PDF($pageFormat, $pdfParams['orientation'], $pdfParams);
$pdf->html_to_pdf(
$certificatePathList,
$pdfName,
null,
false,
false
);
}
break;
default:
// Special rules for anonymous users
if (!$certificate->isVisible()) {
Display::display_reduced_header();
echo Display::return_message(
get_lang('The requested certificate exists on this portal, but it has not been made public. Please login to view it.'),
'warning'
);
Display::display_reduced_footer();
break;
}
if (!$certificate->isAvailable()) {
Display::display_reduced_header();
echo Display::return_message(
get_lang('No certificate available'),
'error'
);
Display::display_reduced_footer();
break;
}
// Show certificate HTML
$certificate->show();
break;
}

@ -5,6 +5,7 @@
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CAttendance;
use Chamilo\CourseBundle\Entity\CAttendanceCalendar;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
require_once __DIR__.'/../inc/global.inc.php';
@ -214,12 +215,7 @@ switch ($action) {
case 'attendance_list':
if ($allowToEdit) {
$actions = '<a href="index.php?'.api_get_cidreq().'&action=attendance_add">';
$actions .= Display::return_icon(
'new_attendance_list.png',
get_lang('Create a new attendance list'),
'',
ICON_SIZE_MEDIUM
);
$actions .= Display::getMdiIcon('av-timer', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Create a new attendance list'));
$actions .= '</a>';
$content .= Display::toolbarAction('toolbar', [$actions]);
}
@ -649,15 +645,15 @@ switch ($action) {
$actions = '';
if ('calendar_add' === $action) {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendanceId.'">'.
Display::return_icon('back.png', get_lang('Attendance calendar'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Attendance calendar')).'</a>';
} else {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_sheet_list&attendance_id='.$attendanceId.'">'.
Display::return_icon('back.png', get_lang('Attendance sheet'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Attendance sheet')).'</a>';
if (api_is_allowed_to_edit()) {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=calendar_add&attendance_id='.$attendanceId.'">'.
Display::return_icon('add.png', get_lang('Add a date and time'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::ADD, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a date and time')).'</a>';
$actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('Are you sure you want to delete all dates?').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=calendar_all_delete&attendance_id='.$attendanceId.'">'.
Display::return_icon('clean.png', get_lang('Clean the calendar of all lists'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::RESET, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Clean the calendar of all lists')).'</a>';
}
}
$content .= Display::toolbarAction('toolbar', [$actions]);
@ -692,12 +688,7 @@ switch ($action) {
if (!empty($attendance_calendar)) {
foreach ($attendance_calendar as $calendar) {
$content .= '<li class="list-group-item">';
$content .= Display::return_icon(
'lp_calendar_event.png',
get_lang('Date DateTime time'),
null,
ICON_SIZE_MEDIUM
).' '.
$content .= Display::getMdiIcon('calendar-month', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Date DateTime time')).' '.
substr(
$calendar['date_time'],
0,
@ -715,9 +706,9 @@ switch ($action) {
if (api_is_allowed_to_edit()) {
$content .= '<div class="pull-right">';
$content .= '<a href="index.php?'.api_get_cidreq().'&action=calendar_edit&calendar_id='.(int) ($calendar['iid']).'&attendance_id='.$attendanceId.'">'.
Display::return_icon('edit.png', get_lang('Edit'), ['style' => 'vertical-align:middle'], ICON_SIZE_SMALL).'</a>&nbsp;';
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', 'vertical-align: middle;', ICON_SIZE_SMALL, get_lang('Edit')).'</a>&nbsp;';
$content .= '<a onclick="javascript:if(!confirm(\''.get_lang('Are you sure you want to delete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=calendar_delete&calendar_id='.(int) ($calendar['iid']).'&attendance_id='.$attendanceId.'">'.
Display::return_icon('delete.png', get_lang('Delete'), ['style' => 'vertical-align:middle'], ICON_SIZE_SMALL).'</a>';
Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', 'vertical-align: middle;', ICON_SIZE_SMALL, get_lang('Delete')).'</a>';
$content .= '</div>';
}
}
@ -736,7 +727,7 @@ switch ($action) {
if (api_is_course_admin() || api_is_drh()) {
$result = $attendance->getAttendanceBaseInLogin(false, true);
$actions = '<a href="index.php?'.api_get_cidreq().'&action=calendar_list">'.
Display::return_icon('back.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('AttendanceCalendar')).
'</a>';
$content .= Display::toolbarAction('toolbar', [$actions]);
$content .= $result['form'];

@ -3,6 +3,7 @@
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/**
* Exercise administration
@ -292,24 +293,24 @@ if ($inATest) {
if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion'])) {
$actions .= '<a
href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('Go back to the questions list'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Go back to the questions list')).'</a>';
}
if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['editQuestion'])) {
$actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('BackToTestsList'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('BackToTestsList')).'</a>';
}
$actions .= '<a
href="'.api_get_path(WEB_CODE_PATH).'exercise/overview.php?'.api_get_cidreq().'&exerciseId='.$objExercise->getId().'&preview=1">'.
Display::return_icon('preview_view.png', get_lang('Preview'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::CONTENT_PREVIEW, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Preview')).'</a>';
$actions .= Display::url(
Display::return_icon('test_results.png', get_lang('Results and feedback'), '', ICON_SIZE_MEDIUM),
Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Results and feedback')),
api_get_path(WEB_CODE_PATH).'exercise/exercise_report.php?'.api_get_cidreq().'&exerciseId='.$objExercise->getId()
);
$actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->getId().'">'.
Display::return_icon('settings.png', get_lang('Edit test name and settings'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('cog', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Edit test name and settings')).'</a>';
$maxScoreAllQuestions = 0;
if (false === $showPagination) {
@ -336,7 +337,7 @@ if ($inATest) {
}
if ($editQuestion && $objQuestion->existsInAnotherExercise()) {
echo Display::return_message(
Display::getMdiIcon('alert')
Display::getMdiIcon('alert', 'ch-tool-icon', null, ICON_SIZE_SMALL)
.get_lang('ThisQuestionExistsInAnotherTestsWarning'),
'warning',
false
@ -397,12 +398,12 @@ if ($inATest) {
} elseif (isset($_GET['newQuestion'])) {
// we are in create a new question from question pool not in a test
$actions = '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('Go back to the questions list'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Go back to the questions list')).'</a>';
echo Display::toolbarAction('toolbar', [$actions]);
} else {
// If we are in question_pool but not in an test, go back to question create in pool
// If we are in question_pool but not in a test, go back to the questions created in pool
$actions = '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/question_pool.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('Go back to the questions list'), '', ICON_SIZE_MEDIUM).
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Go back to the questions list')).
'</a>';
echo Display::toolbarAction('toolbar', [$actions]);
}

@ -3,6 +3,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
use Chamilo\CoreBundle\Entity\GradebookLink;
use Chamilo\CoreBundle\Entity\TrackEExercise;
use Chamilo\CoreBundle\Entity\TrackEExerciseConfirmation;
@ -8955,14 +8956,11 @@ class Exercise
href="overview.php?'.api_get_cidreq().$mylpid.$mylpitemid.'&exerciseId='.$exerciseId.'"
style = "'.$style.'"
>
'.Display::return_icon('quiz.png', $title).$title.
'.Display::getMdiIcon('order-bool-ascending-variant', 'ch-tool-icon', null, ICON_SIZE_SMALL, $title).$title.
'</a>';
if (ExerciseLib::isQuizEmbeddable($exerciseEntity)) {
$embeddableIcon = Display::return_icon(
'om_integration.png',
get_lang('ThisQuizCanBeEmbeddable')
);
$embeddableIcon = Display::getMdiIcon('book-music-outline', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('ThisQuizCanBeEmbeddable'));
$url .= Display::div($embeddableIcon, ['class' => 'pull-right']);
}
@ -8972,13 +8970,13 @@ class Exercise
if ($repo->isGranted('EDIT', $exerciseEntity) && $allowToEditBaseCourse) {
// Questions list
$actions = Display::url(
Display::return_icon('edit.png', get_lang('Edit')),
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')),
'admin.php?'.api_get_cidreq().'&exerciseId='.$exerciseId
);
// Test settings
$settings = Display::url(
Display::return_icon('settings.png', get_lang('Configure')),
Display::getMdiIcon('cog', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Configure')),
'exercise_admin.php?'.api_get_cidreq().'&exerciseId='.$exerciseId
);
@ -8989,7 +8987,7 @@ class Exercise
// Exercise results
$resultsLink = '<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$exerciseId.'">'.
Display::return_icon('test_results.png', get_lang('Results')).'</a>';
Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Results')).'</a>';
if ($limitTeacherAccess) {
if (api_is_platform_admin()) {
@ -9005,19 +9003,13 @@ class Exercise
$autoLaunch = $exercise->getAutoLaunch();
if (empty($autoLaunch)) {
$actions .= Display::url(
Display::return_icon(
'launch_na.png',
get_lang('Enable')
),
Display::getMdiIcon('rocket-launch', 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Enable')),
'exercise.php?'.api_get_cidreq(
).'&action=enable_launch&sec_token='.$token.'&exerciseId='.$exerciseId
);
} else {
$actions .= Display::url(
Display::return_icon(
'launch.png',
get_lang('Disable')
),
Display::getMdiIcon('rocket-launch', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Disable')),
'exercise.php?'.api_get_cidreq(
).'&action=disable_launch&sec_token='.$token.'&exerciseId='.$exerciseId
);
@ -9026,7 +9018,7 @@ class Exercise
// Export
$actions .= Display::url(
Display::return_icon('cd.png', get_lang('Copy this exercise as a new one')),
Display::getMdiIcon('disc', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Copy this exercise as a new one')),
'',
[
'onclick' => "javascript:if(!confirm('".addslashes(
@ -9042,9 +9034,7 @@ class Exercise
if (true === $allowClean) {
if (!$locked) {
$clean = Display::url(
Display::return_icon(
'clean.png',
get_lang('CleanStudentResults')
Display::getMdiIcon('broom', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('CleanStudentResults')
),
'',
[
@ -9060,9 +9050,7 @@ class Exercise
]
);
} else {
$clean = Display::return_icon(
'clean_na.png',
get_lang('ResourceLockedByGradebook')
$clean = Display::getMdiIcon('broom', 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('ResourceLockedByGradebook')
);
}
}
@ -9071,16 +9059,12 @@ class Exercise
// Visible / invisible
// Check if this exercise was added in a LP
if ($exercise->exercise_was_added_in_lp) {
$visibility = Display::return_icon(
'invisible.png',
get_lang('AddedToLPCannotBeAccessed')
$visibility = Display::getMdiIcon('eye-off', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('AddedToLPCannotBeAccessed')
);
} else {
if (0 === $exerciseEntity->getActive()) {
$visibility = Display::url(
Display::return_icon(
'invisible.png',
get_lang('Activate')
Display::getMdiIcon('eye-off', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Activate')
),
'exercise.php?'.api_get_cidreq(
).'&choice=enable&sec_token='.$token.'&exerciseId='.$exerciseId
@ -9088,9 +9072,7 @@ class Exercise
} else {
// else if not active
$visibility = Display::url(
Display::return_icon(
'visible.png',
get_lang('Deactivate')
Display::getMdiIcon('eye', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Deactivate')
),
'exercise.php?'.api_get_cidreq(
).'&choice=disable&sec_token='.$token.'&exerciseId='.$exerciseId
@ -9106,8 +9088,11 @@ class Exercise
// Export qti ...
$export = Display::url(
Display::return_icon(
'export_qti2.png',
Display::getMdiIcon(
'database',
'ch-tool-icon',
null,
ICON_SIZE_SMALL,
'IMS/QTI'
),
'exercise.php?action=exportqti2&exerciseId='.$exerciseId.'&'.api_get_cidreq()
@ -9120,23 +9105,17 @@ class Exercise
$actions .= $export;
} else {
// not session
$actions = Display::return_icon(
'edit_na.png',
get_lang('ExerciseEditionNotAvailableInSession')
$actions = Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('ExerciseEditionNotAvailableInSession')
);
// Check if this exercise was added in a LP
if ($exercise->exercise_was_added_in_lp) {
$visibility = Display::return_icon(
'invisible.png',
get_lang('AddedToLPCannotBeAccessed')
$visibility = Display::getMdiIcon('eye-off', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('AddedToLPCannotBeAccessed')
);
} else {
if (0 === $exerciseEntity->getActive() || 0 == $visibility) {
$visibility = Display::url(
Display::return_icon(
'invisible.png',
get_lang('Activate')
Display::getMdiIcon('eye-off', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Activate')
),
'exercise.php?'.api_get_cidreq(
).'&choice=enable&sec_token='.$token.'&exerciseId='.$exerciseId
@ -9144,9 +9123,7 @@ class Exercise
} else {
// else if not active
$visibility = Display::url(
Display::return_icon(
'visible.png',
get_lang('Deactivate')
Display::getMdiIcon('eye', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Deactivate')
),
'exercise.php?'.api_get_cidreq(
).'&choice=disable&sec_token='.$token.'&exerciseId='.$exerciseId
@ -9160,9 +9137,9 @@ class Exercise
$actions .= $visibility;
$actions .= '<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$exerciseId.'">'.
Display::return_icon('test_results.png', get_lang('Results')).'</a>';
Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Results')).'</a>';
$actions .= Display::url(
Display::return_icon('cd.gif', get_lang('Copy this exercise as a new one')),
Display::getMdiIcon('disc', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Copy this exercise as a new one')),
'',
[
'onclick' => "javascript:if(!confirm('".addslashes(
@ -9180,10 +9157,7 @@ class Exercise
if (!$locked) {
$deleteUrl = 'exercise.php?'.api_get_cidreq().'&action=delete&sec_token='.$token.'&exerciseId='.$exerciseId;
$delete = Display::url(
Display::return_icon(
'delete.png',
get_lang('Delete')
),
Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')),
'',
[
'onclick' => "javascript:if(!confirm('".
@ -9415,7 +9389,7 @@ class Exercise
if ($isDrhOfCourse) {
$currentRow[] = '<a
href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$exerciseId.'">'.
Display::return_icon('test_results.png', get_lang('Results')).
Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Results')).
'</a>';
}
if ($returnData) {

@ -2,6 +2,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CExerciseCategory;
use Chamilo\CourseBundle\Entity\CQuiz;
@ -317,45 +318,40 @@ $limit = Exercise::PAGINATION_ITEMS_PER_PAGE;
$token = Security::get_token();
if ($is_allowedToEdit && 'learnpath' !== $origin) {
$actionsLeft = '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise_admin.php?'.api_get_cidreq().'">'.
Display::return_icon('new_exercice.png', get_lang('Create a new test'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('order-bool-ascending-variant', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Create a new test')).'</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/question_create.php?'.api_get_cidreq().'">'.
Display::return_icon('new_question.png', get_lang('Add a question'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('help-box', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a question')).'</a>';
if ('true' === api_get_setting('exercise.allow_exercise_categories')) {
$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/category.php?'.api_get_cidreq().'">';
$actionsLeft .= Display::return_icon('folder.png', get_lang('Category'), '', ICON_SIZE_MEDIUM);
$actionsLeft .= Display::getMdiIcon('folder-multiple', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Category'));
$actionsLeft .= '</a>';
}
// Question category
$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/tests_category.php?'.api_get_cidreq().'">';
$actionsLeft .= Display::return_icon('green_open.png', get_lang('Questions category'), '', ICON_SIZE_MEDIUM);
$actionsLeft .= Display::getMdiIcon('folder-multiple', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Questions category'));
$actionsLeft .= '</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/question_pool.php?'.api_get_cidreq().'">';
$actionsLeft .= Display::return_icon('database.png', get_lang('Recycle existing questions'), '', ICON_SIZE_MEDIUM);
$actionsLeft .= Display::getMdiIcon('database', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Recycle existing questions'));
$actionsLeft .= '</a>';
//echo Display::url(Display::return_icon('looknfeel.png', get_lang('Media')), 'media.php?' . api_get_cidreq());
//echo Display::url(Display::getMdiIcon('eye', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Media')), 'media.php?' . api_get_cidreq());
// end question category
/*$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/hotpotatoes.php?'.api_get_cidreq().'">'.
Display::return_icon('import_hotpotatoes.png', get_lang('Import Hotpotatoes'), '', ICON_SIZE_MEDIUM).'</a>';*/
Display::getMdiIcon('fire-circle', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Import Hotpotatoes')).'</a>';*/
// link to import qti2 ...
$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/qti2.php?'.api_get_cidreq().'">'.
Display::return_icon('import_qti2.png', get_lang('Import exercises Qti2'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('archive-arrow-up', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Import exercises Qti2')).'</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/aiken.php?'.api_get_cidreq().'">'.
Display::return_icon('import_aiken.png', get_lang('Import Aiken quiz'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('microsoft-word', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Import Aiken quiz')).'</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/upload_exercise.php?'.api_get_cidreq().'">'.
Display::return_icon('import_excel.png', get_lang('Import quiz from Excel'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('microsoft-excel ', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Import quiz from Excel')).'</a>';
$cleanAll = null;
if ($allowClean) {
$cleanAll = Display::url(
Display::return_icon(
'clean_all.png',
get_lang('Are you sure to delete all test\'s results ?'),
'',
ICON_SIZE_MEDIUM
),
Display::getMdiIcon('clean_all', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Are you sure to delete all test\'s results ?')),
'#',
[
'data-item-question' => addslashes(get_lang('Clear all learners results for every exercises ?')),
@ -419,8 +415,8 @@ if ('true' !== api_get_setting('exercise.allow_exercise_categories')) {
$categories = $manager->getCategories($courseId);
$modifyUrl = api_get_self().'?'.api_get_cidreq();
$total = count($categories);
$upIcon = Display::return_icon('up.png', get_lang('Move up'));
$downIcon = Display::return_icon('down.png', get_lang('Move down'));
$upIcon = Display::getMdiIcon('arrow-up-bold', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move up'));
$downIcon = Display::getMdiIcon('arrow-down-bold', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move down'));
/** @var CExerciseCategory $category */
foreach ($categories as $category) {
$categoryIdItem = $category->getId();
@ -429,12 +425,12 @@ if ('true' !== api_get_setting('exercise.allow_exercise_categories')) {
if ($is_allowedToEdit) {
$up = Display::url($upIcon, $modifyUrl.'&action=up_category&category_id_edit='.$categoryIdItem);
if (0 === $counter) {
$up = Display::url(Display::return_icon('up_na.png'), '#');
$up = Display::url(Display::getMdiIcon('arrow-up-bold', 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Move up')), '#');
}
$down = Display::url($downIcon, $modifyUrl.'&action=down_category&category_id_edit='.$categoryIdItem);
$counter++;
if ($total === $counter) {
$down = Display::url(Display::return_icon('down_na.png'), '#');
$down = Display::url(Display::getMdiIcon('arrow-down-bold', 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Move down')), '#');
}
}
echo Display::page_subheader($category->getName().$up.$down);

@ -3,6 +3,7 @@
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/**
* Exercise administration
@ -183,7 +184,7 @@ if ($form->validate()) {
$actions = '';
if (0 != $objExercise->getId()) {
$actions .= '<a href="admin.php?'.api_get_cidreq().'&exerciseId='.$objExercise->getId().'">'.
Display::return_icon('back.png', get_lang('Go back to the questions list'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Go back to the questions list')).'</a>';
} else {
if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])) {
if (!empty($_POST['lp_id'])) {
@ -195,10 +196,10 @@ if ($form->validate()) {
$lp_id = (int) $lp_id;
$actions .= '<a
href="../lp/lp_controller.php?'.api_get_cidreq().'&gradebook=&action=add_item&type=step&lp_id='.$lp_id.'#resource_tab-2">'.
Display::return_icon('back.png', get_lang('Back to').' '.get_lang('Learning paths'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('back', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Learning paths')).'</a>';
} else {
$actions .= '<a href="exercise.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('Back to test list'), '', ICON_SIZE_MEDIUM).
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to test list')).
'</a>';
}
}

@ -2,6 +2,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
use Chamilo\CoreBundle\Entity\TrackEAttemptRecording;
use Chamilo\CoreBundle\Entity\TrackEExercise;
use Chamilo\CoreBundle\Framework\Container;
@ -423,27 +424,22 @@ if ($is_allowedToEdit && 'learnpath' != $origin) {
api_is_course_tutor() || api_is_session_general_coach()
) {
$actions .= '<a href="exercise.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('Go back to the questions list'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Go back to the questions list')).'</a>';
$actions .= '<a href="live_stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.
Display::return_icon('activity_monitor.png', get_lang('Live results'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('monitor-screenshot', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Live results')).'</a>';
$actions .= '<a href="stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.
Display::return_icon('statistics.png', get_lang('Report by question'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Report by question')).'</a>';
$actions .= '<a id="export_opener" href="'.api_get_self().'?export_report=1&exerciseId='.$exercise_id.'" >'.
Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('content-save', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Export')).'</a>';
$actions .= Display::url(
Display::return_icon('reload.png', get_lang('RecalculateResults'), [], ICON_SIZE_MEDIUM),
Display::getMdiIcon(ActionIcon::REFRESH, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('RecalculateResults')),
api_get_path(WEB_CODE_PATH).'exercise/recalculate_all.php?'.api_get_cidreq()."&exercise=$exercise_id"
);
// clean result before a selected date icon
if ($allowClean) {
$actions .= Display::url(
Display::return_icon(
'clean_before_date.png',
get_lang('Clean all results before a selected date'),
'',
ICON_SIZE_MEDIUM
),
Display::getMdiIcon('delete-clock', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Clean all results before a selected date')),
'#',
['onclick' => 'javascript:display_date_picker()']
);
@ -473,12 +469,7 @@ if ($is_allowedToEdit && 'learnpath' != $origin) {
}
} else {
$actions .= '<a href="exercise.php">'.
Display::return_icon(
'back.png',
get_lang('Go back to the questions list'),
'',
ICON_SIZE_MEDIUM
).
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Go back to the questions list')).
'</a>';
}

@ -2,6 +2,7 @@
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/**
* Exercise result
@ -88,11 +89,11 @@ if (api_is_course_admin() && !in_array($origin, ['learnpath', 'embeddable'])) {
'exercise_result_actions',
[
Display::url(
Display::return_icon('back.png', get_lang('GoBackToQuestionList'), [], 32),
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('GoBackToQuestionList')),
'admin.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id
)
.Display::url(
Display::return_icon('settings.png', get_lang('ModifyExercise'), [], 32),
Display::getMdiIconn('cog', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('ModifyExercise')),
'exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id
),
]

@ -3,6 +3,7 @@
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/**
* Exercise submission
@ -1049,7 +1050,7 @@ if (!in_array($origin, ['learnpath', 'embeddable', 'mobileapp'])) {
if ('mobileapp' == $origin) {
echo '<div class="actions">';
echo '<a href="javascript:window.history.go(-1);">'.
Display::return_icon('back.png', get_lang('GoBackToQuestionList'), [], 32).'</a>';
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('GoBackToQuestionList')).'</a>';
echo '</div>';
}
@ -1060,10 +1061,11 @@ if (api_is_course_admin() && !in_array($origin, ['learnpath', 'embeddable'])) {
$actions = '';
if (false == $show_quiz_edition) {
$actions .= '<a href="exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id.'">'.
Display::return_icon('settings.png', get_lang('Edit test name and settings'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('cog', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Edit test name and settings')).'</a>';
} else {
$actions .= '<a href="#">'.
Display::return_icon('settings_na.png', get_lang('Edit test name and settings'), '', ICON_SIZE_MEDIUM).'</a>';
Display::getMdiIcon('cog', 'ch-tool-icon-disabled', null, ICON_SIZE_MEDIUM, get_lang('Edit test name and settings')).
'</a>';
}
echo Display::toolbarAction('toolbar', [$actions]);
}
@ -1298,7 +1300,7 @@ if ($allowBlockCategory &&
}
$saveIcon = Display::return_icon(
'save.png',
get_lang('Saved...'),
'',
[],
ICON_SIZE_SMALL,
false,
@ -1492,10 +1494,10 @@ if ($allowBlockCategory &&
success: function(return_value) {
if (return_value.ok) {
$("#save_for_now_"+question_id).html(\''.
Display::return_icon('save.png', get_lang('Saved'), [], ICON_SIZE_SMALL).'\');
Display::getMdiIcon(ActionIcon::FORM_SAVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Saved')).'\');
} else if (return_value.error) {
$("#save_for_now_"+question_id).html(\''.
Display::return_icon('error.png', get_lang('Error'), [], ICON_SIZE_SMALL).'\');
Display::getMdiIcon('alert-circle', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Error')).'\');
} else if (return_value.type == "one_per_page") {
var url = "";
if ('.$reminder.' == 1 ) {
@ -1518,7 +1520,7 @@ if ($allowBlockCategory &&
}
$("#save_for_now_"+question_id).html(\''.
Display::return_icon('save.png', get_lang('Saved'), [], ICON_SIZE_SMALL).'\' + return_value.savedAnswerMessage);
Display::getMdiIcon(ActionIcon::FORM_SAVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Saved')).'\' + return_value.savedAnswerMessage);
// Show popup
if ("check_answers" === url_extra) {
@ -1569,7 +1571,7 @@ if ($allowBlockCategory &&
},
error: function() {
$("#save_for_now_"+question_id).html(\''.
Display::return_icon('error.png', get_lang('Error'), [], ICON_SIZE_SMALL).'\');
Display::getMdiIcon('alert-circle', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Error')).'\');
}
});
}

@ -2,6 +2,8 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/**
* Exercise preview.
*
@ -87,7 +89,7 @@ if (!in_array($origin, ['learnpath', 'embeddable', 'mobileapp'])) {
if ('mobileapp' === $origin) {
$actions = '<a href="javascript:window.history.go(-1);">'.
Display::return_icon('back.png', get_lang('GoBackToQuestionList'), [], 32).'</a>';
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('GoBackToQuestionList')).'</a>';
echo Display::toolbarAction('toolbar', [$actions]);
}
@ -99,18 +101,18 @@ $editLink = '';
if ($is_allowed_to_edit) {
if ($objExercise->sessionId == $sessionId) {
$editLink = Display::url(
Display::return_icon('edit.png', get_lang('Edit'), [], ICON_SIZE_SMALL),
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')),
api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id
);
}
$editLink .= Display::url(
Display::return_icon('test_results.png', get_lang('Results and feedback and feedback'), [], ICON_SIZE_SMALL),
Display::getMdiIcon('chart-box', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Results and feedback and feedback')),
api_get_path(WEB_CODE_PATH).'exercise/exercise_report.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id,
['title' => get_lang('Results and feedback and feedback')]
);
}
$iconExercise = Display::return_icon('test-quiz.png', null, [], ICON_SIZE_MEDIUM);
$iconExercise = Display::getMdiIcon('order-bool-ascending-variant', 'ch-tool-icon-gradient', null, ICON_SIZE_MEDIUM, get_lang('Exercise'));
// Exercise name.
if ('true' === api_get_setting('editor.save_titles_as_html')) {

@ -1505,26 +1505,16 @@ abstract class Question
}
echo '<li>';
echo '<div class="icon_image_content">';
echo '<div class="icon_image">';
if (true == $objExercise->exercise_was_added_in_lp) {
echo Display::return_icon(
'database_na.png',
get_lang('Recycle existing questions'),
null,
ICON_SIZE_BIG
);
echo Display::getMdiIcon('database', 'ch-tool-icon-disabled mt-4', null, ICON_SIZE_BIG, get_lang('Recycle existing questions'));
} else {
if (in_array($feedbackType, [EXERCISE_FEEDBACK_TYPE_DIRECT, EXERCISE_FEEDBACK_TYPE_POPUP])) {
echo $url = '<a href="question_pool.php?'.api_get_cidreq()."&type=1&fromExercise=$exerciseId\">";
} else {
echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&fromExercise='.$exerciseId.'">';
}
echo Display::return_icon(
'database.png',
get_lang('Recycle existing questions'),
null,
ICON_SIZE_BIG
);
echo Display::getMdiIcon('database', 'ch-tool-icon mt-4', 'display: block; height: auto;', ICON_SIZE_BIG, get_lang('Recycle existing questions'));
}
echo '</a>';
echo '</div></li>';

@ -458,9 +458,9 @@ if (isset($_GET['deletelink'])) {
thread_qualify_max = 0,
thread_weight = 0,
thread_title_qualify = ""
WHERE c_id = '.$course_id.' AND iid = (
WHERE iid = (
SELECT ref_id FROM '.$tbl_grade_links.'
WHERE id='.$get_delete_link.' AND type = '.LINK_FORUM_THREAD.'
WHERE id = '.$get_delete_link.' AND type = '.LINK_FORUM_THREAD.'
)';
Database::query($sql);
// clean attendance
@ -469,7 +469,7 @@ if (isset($_GET['deletelink'])) {
attendance_qualify_title = ""
WHERE iid = (
SELECT ref_id FROM '.$tbl_grade_links.'
WHERE id='.$get_delete_link.' AND type = '.LINK_ATTENDANCE.'
WHERE id = '.$get_delete_link.' AND type = '.LINK_ATTENDANCE.'
)';
Database::query($sql);
$link[0]->delete();

@ -85,8 +85,7 @@ class AttendanceLink extends AbstractLink
$sql = 'SELECT count(*) AS number FROM '.$tbl_attendance_result."
WHERE
session_id = $sessionId AND
c_id = '.$this->course_id.' AND
attendance_id = '".$this->get_ref_id()."'";
attendance_id = ".$this->get_ref_id();
$result = Database::query($sql);
$number = Database::fetch_row($result);
@ -114,7 +113,7 @@ class AttendanceLink extends AbstractLink
// Get results
$sql = 'SELECT *
FROM '.$tbl_attendance_result.'
WHERE c_id = '.$this->course_id.' AND attendance_id = '.$this->get_ref_id();
WHERE attendance_id = '.$this->get_ref_id();
if (isset($studentId)) {
$sql .= ' AND user_id = '.intval($studentId);
}

@ -50,24 +50,6 @@ class LearnpathLink extends AbstractLink
}
return $list;
/*$session_id = $this->get_session_id();
if (empty($session_id)) {
$session_condition = api_get_session_condition(0, true);
} else {
$session_condition = api_get_session_condition($session_id, true, true);
}
$sql = 'SELECT iid, name FROM '.$this->get_learnpath_table().'
WHERE c_id = '.$this->course_id.' '.$session_condition.' ';
$result = Database::query($sql);
$cats = [];
while ($data = Database::fetch_array($result)) {
$cats[] = [$data['iid'], $data['name']];
}
return $cats;*/
}
/**
@ -77,7 +59,7 @@ class LearnpathLink extends AbstractLink
{
$tbl_stats = Database::get_course_table(TABLE_LP_VIEW);
$sql = "SELECT count(id) AS number FROM $tbl_stats
WHERE c_id = ".$this->course_id." AND lp_id = ".$this->get_ref_id();
WHERE lp_id = ".$this->get_ref_id();
$result = Database::query($sql);
$number = Database::fetch_array($result, 'NUM');
@ -104,7 +86,6 @@ class LearnpathLink extends AbstractLink
$sql = "SELECT * FROM $tbl_stats
WHERE
c_id = ".$this->course_id." AND
lp_id = ".$this->get_ref_id()." AND
session_id = $session_id ";
@ -211,7 +192,7 @@ class LearnpathLink extends AbstractLink
public function is_valid_link()
{
$sql = 'SELECT count(iid) FROM '.$this->get_learnpath_table().'
WHERE c_id = '.$this->course_id.' AND id = '.$this->get_ref_id().' ';
WHERE iid = '.$this->get_ref_id().' ';
$result = Database::query($sql);
$number = Database::fetch_row($result, 'NUM');
@ -265,7 +246,7 @@ class LearnpathLink extends AbstractLink
{
if (!isset($this->learnpath_data)) {
$sql = 'SELECT * FROM '.$this->get_learnpath_table().'
WHERE c_id = '.$this->course_id.' AND iid = '.$this->get_ref_id().' ';
WHERE iid = '.$this->get_ref_id().' ';
$result = Database::query($sql);
$this->learnpath_data = Database::fetch_array($result);
}

@ -776,7 +776,8 @@ class Attendance
$sql = "INSERT INTO $tbl_attendance_sheet SET
user_id = '$uid',
attendance_calendar_id = '$calendar_id',
presence = 1";
presence = 1,
signature = ''";
$result = Database::query($sql);
$affected_rows += Database::affected_rows($result);
@ -803,7 +804,8 @@ class Attendance
$sql = "INSERT INTO $tbl_attendance_sheet SET
user_id ='$uid',
attendance_calendar_id = '$calendar_id',
presence = 0";
presence = 0,
signature = ''";
$result = Database::query($sql);
$affected_rows += Database::affected_rows($result);
} else {
@ -1633,7 +1635,8 @@ class Attendance
$calendar
->setAttendance($attendance)
->setDateTime(new Datetime($this->date_time))
->setDoneAttendance(false);
->setDoneAttendance(false)
->setBlocked(false);
$em = Database::getManager();
$em->persist($calendar);

@ -3,6 +3,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
use Chamilo\CoreBundle\Entity\Asset;
use Chamilo\CoreBundle\Entity\GradebookCategory;
use Chamilo\CoreBundle\Entity\TrackEExercise;
@ -1653,7 +1654,7 @@ HOTSPOT;
$tmp[2] = $row['quiz_title'];
// Send do other test with r=1 to reset current test session variables
$urlToQuiz = api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$row['quiz_id'].'&r=1';
$tmp[3] = '<a href="'.$urlToQuiz.'">'.Display::return_icon('quiz.png', get_lang('Edit')).'</a>';
$tmp[3] = '<a href="'.$urlToQuiz.'">'.Display::getMdiIcon('order-bool-ascending-variant', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'</a>';
if (0 == (int) $row['session_id']) {
$tmp[1] = '-';
}
@ -2272,16 +2273,14 @@ HOTSPOT;
$results[$i]['exe_user_id'],
$teacher_id_list
)) {
$actions .= Display::return_icon('teacher.png', get_lang('Trainer'));
$actions .= Display::getMdiIcon('human-male-board', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Trainer'));
}
}
$revisedLabel = '';
switch ($revised) {
case 0:
$actions .= "<a href='exercise_show.php?".api_get_cidreq()."&action=qualify&id=$id'>".
Display:: return_icon(
'quiz.png',
get_lang('Grade activity')
Display::getMdiIcon(ActionIcon::GRADE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Grade activity')
);
$actions .= '</a>';
$revisedLabel = Display::label(
@ -2291,12 +2290,7 @@ HOTSPOT;
break;
case 1:
$actions .= "<a href='exercise_show.php?".api_get_cidreq()."&action=edit&id=$id'>".
Display:: return_icon(
'edit.png',
get_lang('Edit'),
[],
ICON_SIZE_SMALL
);
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit'));
$actions .= '</a>';
$revisedLabel = Display::label(
get_lang('Validated'),
@ -2311,12 +2305,7 @@ HOTSPOT;
.'&a=close&id='
.$id
.'">'.
Display:: return_icon(
'lock.png',
get_lang('Mark attempt as closed'),
[],
ICON_SIZE_SMALL
);
Display::getMdiIcon(ActionIcon::LOCK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Mark attempt as closed'));
$actions .= '</a>';
$revisedLabel = Display::label(
get_lang('Unclosed'),
@ -2324,12 +2313,7 @@ HOTSPOT;
);
break;
case 3: //still ongoing
$actions .= Display:: return_icon(
'clock.png',
get_lang('Attempt still going on. Please wait.'),
[],
ICON_SIZE_SMALL
);
$actions .= Display::getMdiIcon('clock', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Attempt still going on. Please wait.'));
$actions .= '';
$revisedLabel = Display::label(
get_lang('Ongoing'),
@ -2340,9 +2324,7 @@ HOTSPOT;
if (2 == $filter) {
$actions .= ' <a href="exercise_history.php?'.api_get_cidreq().'&exe_id='.$id.'">'.
Display:: return_icon(
'history.png',
get_lang('View changes history')
Display::getMdiIcon('clipboard-text-clock', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('View changes history')
).'</a>';
}
@ -2354,7 +2336,7 @@ HOTSPOT;
false
);
$actions .= '<a href="http://www.whatsmyip.org/ip-geo-location/?ip='.$ip.'" target="_blank">'
.Display::return_icon('info.png', $ip)
.Display::getMdiIcon('information', 'ch-tool-icon', null, ICON_SIZE_SMALL, $ip)
.'</a>';
$recalculateUrl = api_get_path(WEB_CODE_PATH).'exercise/recalculate.php?'.
@ -2365,7 +2347,7 @@ HOTSPOT;
'user' => $results[$i]['exe_user_id'],
]);
$actions .= Display::url(
Display::return_icon('reload.png', get_lang('Recalculate results')),
Display::getMdiIcon(ActionIcon::REFRESH, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Recalculate results')),
$recalculateUrl,
[
'data-exercise' => $exercise_id,
@ -2381,7 +2363,7 @@ HOTSPOT;
onclick=
"javascript:if(!confirm(\''.sprintf(addslashes(get_lang('Delete attempt?')), $results[$i]['username'], $dt).'\')) return false;"
>';
$delete_link .= Display::return_icon('delete.png', addslashes(get_lang('Delete'))).'</a>';
$delete_link .= Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, addslashes(get_lang('Delete'))).'</a>';
if (api_is_drh() && !api_is_platform_admin()) {
$delete_link = null;
@ -2932,20 +2914,10 @@ EOT;
if ($isSuccess) {
$html = get_lang('Congratulations you passed the test!');
$icon = Display::return_icon(
'completed.png',
get_lang('Correct'),
[],
ICON_SIZE_MEDIUM
);
$icon = Display::getMdiIcon('check-circle', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Correct'));
} else {
$html = get_lang('You didn\'t reach the minimum score');
$icon = Display::return_icon(
'warning.png',
get_lang('Wrong'),
[],
ICON_SIZE_MEDIUM
);
$icon = Display::getMdiIcon('alert', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Wrong'));
}
$html = Display::tag('h4', $html);
$html .= Display::tag(

@ -19,7 +19,7 @@ class survey_question
*/
public function addParentMenu($formData, FormValidator $form, $surveyData)
{
$surveyId = $surveyData['survey_id'];
$surveyId = $surveyData['iid'];
$questionId = isset($formData['question_id']) ? $formData['question_id'] : 0;
$parentId = isset($formData['parent_id']) ? $formData['parent_id'] : 0;
$optionId = isset($formData['parent_option_id']) ? $formData['parent_option_id'] : 0;

@ -8,6 +8,8 @@ namespace Chamilo\CoreBundle\Component\Utils;
enum ActionIcon: string
{
// Add
case ADD = 'plus-box';
// Edit
case EDIT = 'pencil';
// Delete
@ -126,4 +128,6 @@ enum ActionIcon: string
case LOCK = 'lock';
// Unlock
case UNLOCK = 'lock-open-variant';
// Refresh/reload
case REFRESH = 'file-document-refresh';
}

@ -3719,7 +3719,7 @@ __metadata:
textcomplete: ^0.18.2
timeago: ^1.6.7
timepicker: ^1.14.1
tinymce: ^5.10.8
tinymce: ^5.10.9
ts-loader: ^9.5.0
typescript: ^5.2.2
video.js: ^7.21.5
@ -5419,7 +5419,7 @@ __metadata:
"fsevents@patch:fsevents@~2.3.2#~builtin<compat/fsevents>":
version: 2.3.3
resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin<compat/fsevents>::version=2.3.3&hash=df0bf1"
resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin<compat/fsevents>::version=2.3.3&hash=18f3a7"
dependencies:
node-gyp: latest
conditions: os=darwin
@ -9024,7 +9024,7 @@ __metadata:
"resolve@patch:resolve@^1.1.7#~builtin<compat/resolve>, resolve@patch:resolve@^1.14.2#~builtin<compat/resolve>, resolve@patch:resolve@^1.20.0#~builtin<compat/resolve>, resolve@patch:resolve@^1.22.2#~builtin<compat/resolve>":
version: 1.22.8
resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin<compat/resolve>::version=1.22.8&hash=c3c19d"
resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin<compat/resolve>::version=1.22.8&hash=07638b"
dependencies:
is-core-module: ^2.13.0
path-parse: ^1.0.7
@ -9962,10 +9962,10 @@ __metadata:
languageName: node
linkType: hard
"tinymce@npm:^5.10.8":
version: 5.10.8
resolution: "tinymce@npm:5.10.8"
checksum: 702f4f576ecd64087ee588c79f66d859dac8c3d6e9f671016dc41885fcb8c30a637a169eb67195ee2bb0eb1368759801ec191b2325a3bb341d32da1a88f5b680
"tinymce@npm:^5.10.9":
version: 5.10.9
resolution: "tinymce@npm:5.10.9"
checksum: 9927f3132820c183ca1a3ed19b4e650b16276385b4c253e51cf2a399a5981522d4197901b7abd8a7bf7000d783880eda9727b5eee9381b5c4c42c48c48a1d6f5
languageName: node
linkType: hard
@ -10097,7 +10097,7 @@ __metadata:
"typescript@patch:typescript@^5.2.2#~builtin<compat/typescript>":
version: 5.2.2
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=1f5320"
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=701156"
bin:
tsc: bin/tsc
tsserver: bin/tsserver

Loading…
Cancel
Save