Minor - format code

pull/2606/head
Julio Montoya 7 years ago
parent 673dd3d346
commit e3d67828a2
  1. 31
      main/exercise/exercise_show.php

@ -19,7 +19,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$debug = false;
$origin = api_get_origin();
$currentUserId = api_get_user_id();
$printHeaders = $origin == 'learnpath';
$printHeaders = $origin === 'learnpath';
$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; //exe id
if (empty($id)) {
@ -107,7 +107,7 @@ if (!empty($sessionId) && !$is_allowedToEdit) {
}
$allowCoachFeedbackExercises = api_get_setting('allow_coach_feedback_exercises') === 'true';
$maxEditors = intval(api_get_setting('exercise_max_ckeditors_in_page'));
$maxEditors = (int) api_get_setting('exercise_max_ckeditors_in_page');
$isCoachAllowedToEdit = api_is_allowed_to_edit(false, true);
$isFeedbackAllowed = false;
@ -140,11 +140,11 @@ if (api_is_in_gradebook()) {
}
$interbreadcrumb[] = [
'url' => "exercise.php?".api_get_cidreq(),
'url' => 'exercise.php?'.api_get_cidreq(),
'name' => get_lang('Exercises'),
];
$interbreadcrumb[] = [
'url' => "overview.php?exerciseId=".$exercise_id.'&'.api_get_cidreq(),
'url' => 'overview.php?exerciseId='.$exercise_id.'&'.api_get_cidreq(),
'name' => $objExercise->selectTitle(true),
];
$interbreadcrumb[] = ['url' => '#', 'name' => get_lang('Result')];
@ -168,11 +168,7 @@ if ($action != 'export') {
if ($origin != 'learnpath') {
Display::display_header('');
} else {
$htmlHeadXtra[] = "
<style>
body { background: none;}
</style>
";
$htmlHeadXtra[] = "<style>body { background: none; } </style>";
Display::display_reduced_header();
}
@ -184,8 +180,8 @@ if ($action != 'export') {
]); ?>
<script>
<?php echo $scoreJsCode; ?>
var maxEditors = <?php echo $maxEditors; ?>;
var maxEditors = <?php echo intval($maxEditors); ?>;
function showfck(sid, marksid) {
$('#' + sid).toggleClass('hidden');
$('#' + marksid).toggleClass('hidden');
@ -198,7 +194,6 @@ if ($action != 'export') {
function getFCK(vals, marksid) {
var f = document.getElementById('myform');
var m_id = marksid.split(',');
for (var i = 0; i < m_id.length; i++) {
var oHidn = document.createElement("input");
@ -235,7 +230,6 @@ if (!empty($track_exercise_info)) {
// if the results_disabled of the Quiz is 1 when block the script
$result_disabled = $track_exercise_info['results_disabled'];
if (true) {
if ($result_disabled == RESULT_DISABLE_NO_SCORE_AND_EXPECTED_ANSWERS) {
$show_results = false;
} elseif ($result_disabled == RESULT_DISABLE_SHOW_SCORE_ONLY) {
@ -273,7 +267,6 @@ if (!empty($track_exercise_info)) {
$showTotalScoreAndUserChoicesInLastAttempt = false;
}
}
}
} else {
echo Display::return_message(get_lang('CantViewResults'), 'warning');
$show_results = false;
@ -328,7 +321,6 @@ $sql = "SELECT attempts.question_id, answer
$result = Database::query($sql);
$question_list_from_database = [];
$exerciseResult = [];
while ($row = Database::fetch_array($result)) {
$question_list_from_database[] = $row['question_id'];
$exerciseResult[$row['question_id']] = $row['answer'];
@ -352,7 +344,7 @@ if (!empty($track_exercise_info['data_tracking'])) {
// Display the text when finished message if we are on a LP #4227
$end_of_message = $objExercise->selectTextWhenFinished();
if (!empty($end_of_message) && ($origin == 'learnpath')) {
if (!empty($end_of_message) && ($origin === 'learnpath')) {
echo Display::return_message($end_of_message, 'normal', false);
echo "<div class='clear'>&nbsp;</div>";
}
@ -436,8 +428,8 @@ foreach ($questionList as $questionId) {
break;
case MULTIPLE_ANSWER_TRUE_FALSE_DEGREE_CERTAINTY:
$choiceTmp = [];
$choiceTmp["choice"] = $choice;
$choiceTmp["choiceDegreeCertainty"] = $choiceDegreeCertainty;
$choiceTmp['choice'] = $choice;
$choiceTmp['choiceDegreeCertainty'] = $choiceDegreeCertainty;
$questionResult = $objExercise->manage_answer(
$id,
@ -723,8 +715,8 @@ foreach ($questionList as $questionId) {
$marksname = '';
if ($isFeedbackAllowed && $action != 'export') {
$name = "fckdiv".$questionId;
$marksname = "marksName".$questionId;
$name = 'fckdiv'.$questionId;
$marksname = 'marksName'.$questionId;
if (in_array($answerType, [FREE_ANSWER, ORAL_EXPRESSION, ANNOTATION])) {
$url_name = get_lang('EditCommentsAndMarks');
} else {
@ -790,7 +782,6 @@ foreach ($questionList as $questionId) {
echo ExerciseLib::getOralFeedbackForm($id, $questionId, $student_id);
echo '</div>';
}
echo '</div>';
} else {
$comnt = Event::get_comments($id, $questionId);

Loading…
Cancel
Save