|
|
|
@ -84,7 +84,7 @@ if ('true' === api_get_setting('enable_record_audio')) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$zoomOptions = api_get_configuration_value('quiz_image_zoom'); |
|
|
|
|
if (isset($zoomOptions['options']) && !in_array($origin, ['embeddable', 'mobileapp'])) { |
|
|
|
|
if (isset($zoomOptions['options']) && !in_array($origin, ['embeddable', 'iframe', 'mobileapp'])) { |
|
|
|
|
$options = $zoomOptions['options']; |
|
|
|
|
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'jquery.elevatezoom.js"></script>'; |
|
|
|
|
$htmlHeadXtra[] = '<script> |
|
|
|
@ -165,7 +165,7 @@ if (empty($exerciseInSession) || (!empty($exerciseInSession) && $exerciseInSessi |
|
|
|
|
|
|
|
|
|
// if the specified exercise doesn't exist or is disabled |
|
|
|
|
if (!$objExercise->read($exerciseId) || |
|
|
|
|
(!$objExercise->selectStatus() && !$is_allowedToEdit && !in_array($origin, ['learnpath', 'embeddable'])) |
|
|
|
|
(!$objExercise->selectStatus() && !$is_allowedToEdit && !in_array($origin, ['learnpath', 'embeddable', 'iframe'])) |
|
|
|
|
) { |
|
|
|
|
unset($objExercise); |
|
|
|
|
$error = get_lang('ExerciseNotFound'); |
|
|
|
@ -268,7 +268,7 @@ if ($objExercise->selectAttempts() > 0) { |
|
|
|
|
if ($attempt_count >= $objExercise->selectAttempts()) { |
|
|
|
|
$show_clock = false; |
|
|
|
|
if (!api_is_allowed_to_edit(null, true)) { |
|
|
|
|
if ($objExercise->results_disabled == 0 && !in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if ($objExercise->results_disabled == 0 && !in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
// Showing latest attempt according with task BT#1628 |
|
|
|
|
$exercise_stat_info = Event::getExerciseResultsByUser( |
|
|
|
|
$user_id, |
|
|
|
@ -295,7 +295,7 @@ if ($objExercise->selectAttempts() > 0) { |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
Display::display_reduced_header(); |
|
|
|
|
Display::display_reduced_footer(); |
|
|
|
|
} else { |
|
|
|
@ -348,14 +348,14 @@ if ($objExercise->selectAttempts() > 0) { |
|
|
|
|
$attempt_html .= $messageReachedMax; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
Display::display_reduced_header(); |
|
|
|
|
} else { |
|
|
|
|
Display::display_header(get_lang('Exercises')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo $attempt_html; |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
Display::display_footer(); |
|
|
|
|
} |
|
|
|
|
exit; |
|
|
|
@ -837,7 +837,7 @@ if ($formSent && isset($_POST)) { |
|
|
|
|
'warning', |
|
|
|
|
false |
|
|
|
|
); |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
//so we are not in learnpath tool |
|
|
|
|
echo '</div>'; //End glossary div |
|
|
|
|
Display::display_footer(); |
|
|
|
@ -904,7 +904,7 @@ if ($question_count != 0) { |
|
|
|
|
'warning', |
|
|
|
|
false |
|
|
|
|
); |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
//so we are not in learnpath tool |
|
|
|
|
echo '</div>'; //End glossary div |
|
|
|
|
Display::display_footer(); |
|
|
|
@ -1023,7 +1023,7 @@ if (false !== $quizKeepAlivePingInterval) { |
|
|
|
|
})</script>"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable', 'mobileapp'])) { |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable', 'mobileapp', 'iframe'])) { |
|
|
|
|
//so we are not in learnpath tool |
|
|
|
|
SessionManager::addFlashSessionReadOnly(); |
|
|
|
|
Display::display_header(null, 'Exercises'); |
|
|
|
@ -1041,7 +1041,7 @@ if ($origin === 'mobileapp') { |
|
|
|
|
|
|
|
|
|
$show_quiz_edition = $objExercise->added_in_lp(); |
|
|
|
|
// I'm in a preview mode |
|
|
|
|
if (api_is_course_admin() && !in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (api_is_course_admin() && !in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
echo '<div class="actions">'; |
|
|
|
|
if ($show_quiz_edition == false) { |
|
|
|
|
echo '<a href="exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->iid.'">'. |
|
|
|
@ -1063,14 +1063,14 @@ $is_visible_return = $objExercise->is_visible( |
|
|
|
|
|
|
|
|
|
if ($is_visible_return['value'] == false) { |
|
|
|
|
echo $is_visible_return['message']; |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
Display::display_footer(); |
|
|
|
|
} |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!api_is_allowed_to_session_edit()) { |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
Display::display_footer(); |
|
|
|
|
} |
|
|
|
|
exit; |
|
|
|
@ -1103,7 +1103,7 @@ if ($limit_time_exists) { |
|
|
|
|
), |
|
|
|
|
'warning' |
|
|
|
|
); |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
Display::display_footer(); |
|
|
|
|
} |
|
|
|
|
exit; |
|
|
|
@ -1135,7 +1135,7 @@ if (isset($_custom['exercises_hidden_when_no_start_date']) && |
|
|
|
|
), |
|
|
|
|
'warning' |
|
|
|
|
); |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
Display::display_footer(); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
@ -1156,7 +1156,7 @@ if ($showQuestionClock) { |
|
|
|
|
</div>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
echo '<div id="highlight-plugin" class="glossary-content">'; |
|
|
|
|
} |
|
|
|
|
if (2 === $reminder) { |
|
|
|
@ -1844,7 +1844,7 @@ if ($objExercise->type == ALL_ON_ONE_PAGE) { |
|
|
|
|
} |
|
|
|
|
echo '</form>'; |
|
|
|
|
|
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable'])) { |
|
|
|
|
if (!in_array($origin, ['learnpath', 'embeddable', 'iframe'])) { |
|
|
|
|
// So we are not in learnpath tool |
|
|
|
|
echo '</div>'; //End glossary div |
|
|
|
|
} |
|
|
|
|