diff --git a/main/auth/categories_list.php b/main/auth/categories_list.php index 79855a8f24..ad540f40dd 100755 --- a/main/auth/categories_list.php +++ b/main/auth/categories_list.php @@ -16,7 +16,7 @@ $stok = Security::get_token();
- +
diff --git a/main/auth/courses.php b/main/auth/courses.php index 1b01dad647..f966ac1ac9 100755 --- a/main/auth/courses.php +++ b/main/auth/courses.php @@ -195,7 +195,7 @@ switch ($action) { if (!$user_can_view_page) { api_not_allowed(true); } - header('Location: ' . api_get_self()); + header('Location: '.api_get_self()); exit; /* if (!CoursesAndSessionsCatalog::is(CATALOG_SESSIONS)) { $courses_controller->courses_categories( @@ -283,7 +283,7 @@ switch ($action) { $continueWithSubscription = SequenceResourceManager::checkSequenceAreCompleted($requirementsData); if (!$continueWithSubscription) { - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'auth/courses.php'); + header('Location: '.api_get_path(WEB_CODE_PATH).'auth/courses.php'); exit; } } @@ -301,16 +301,16 @@ switch ($action) { if ($count <= 0) { // no course in session -> return to catalog - $url = api_get_path(WEB_CODE_PATH) . 'auth/courses.php'; + $url = api_get_path(WEB_CODE_PATH).'auth/courses.php'; } elseif ($count == 1) { // only one course, so redirect directly to this course foreach ($coursesList as $course) { - $url = api_get_path(WEB_COURSE_PATH) . $course['directory'] . '/index.php?id_session=' . intval($_GET['session_id']); + $url = api_get_path(WEB_COURSE_PATH).$course['directory'].'/index.php?id_session='.intval($_GET['session_id']); } } else { - $url = api_get_path(WEB_CODE_PATH) . 'session/index.php?session_id=' . intval($_GET['session_id']); + $url = api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.intval($_GET['session_id']); } - header('Location: ' . $url); + header('Location: '.$url); exit; } //else show error message? diff --git a/main/coursecopy/import_backup.php b/main/coursecopy/import_backup.php index 2329108552..e88bf8f515 100755 --- a/main/coursecopy/import_backup.php +++ b/main/coursecopy/import_backup.php @@ -98,21 +98,21 @@ if (Security::check_token('post') && ( $cr->set_file_option($_POST['same_file_name_option']); $cr->restore(); Display::addFlash(Display::return_message(get_lang('ImportFinished'))); - echo '' . get_lang('CourseHomepage') . ''; + echo ''.get_lang('CourseHomepage').''; } else { if (!$error) { Display::addFlash(Display::return_message(get_lang('NoResourcesInBackupFile'), 'warning')); - echo '' . get_lang('TryAgain') . ''; + echo ''.get_lang('TryAgain').''; } elseif ($filename === false) { Display::addFlash(Display::return_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'), 'error')); - echo '' . get_lang('TryAgain') . ''; + echo ''.get_lang('TryAgain').''; } else { if ($filename == '') { Display::addFlash(Display::return_message(get_lang('SelectBackupFile'), 'error')); - echo '' . get_lang('TryAgain') . ''; + echo ''.get_lang('TryAgain').''; } else { Display::addFlash(Display::return_message(get_lang('UploadError'), 'error')); - echo '' . get_lang('TryAgain') . ''; + echo ''.get_lang('TryAgain').''; } } } @@ -142,10 +142,10 @@ if (Security::check_token('post') && ( CourseSelectForm::display_form($course, $hiddenFields); } elseif ($filename === false) { Display::addFlash(Display::return_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'), 'error')); - echo '' . get_lang('TryAgain') . ''; + echo ''.get_lang('TryAgain').''; } else { Display::addFlash(Display::return_message(get_lang('NoResourcesInBackupFile'), 'warning')); - echo '' . get_lang('TryAgain') . ''; + echo ''.get_lang('TryAgain').''; } } else { $user = api_get_user_info(); @@ -157,7 +157,7 @@ if (Security::check_token('post') && ( $form = new FormValidator( 'import_backup_form', 'post', - api_get_path(WEB_CODE_PATH) . 'coursecopy/import_backup.php?' . api_get_cidreq(), + api_get_path(WEB_CODE_PATH).'coursecopy/import_backup.php?'.api_get_cidreq(), '', array('enctype' => 'multipart/form-data') ); @@ -189,7 +189,7 @@ if (Security::check_token('post') && ( ); $options['null'] = '-'; foreach ($backups as $index => $backup) { - $options[$backup['file']] = $backup['course_code'] . ' (' . $backup['date'] . ')'; + $options[$backup['file']] = $backup['course_code'].' ('.$backup['date'].')'; } $form->addElement( 'select', @@ -207,7 +207,7 @@ if (Security::check_token('post') && ( 'radio', '', '', - '' . get_lang('NoBackupsAvailable') . '', + ''.get_lang('NoBackupsAvailable').'', '', 'disabled="true"' ); diff --git a/main/exercise/MatchingDraggable.php b/main/exercise/MatchingDraggable.php index 3db5fb0bfb..bed9ed4371 100644 --- a/main/exercise/MatchingDraggable.php +++ b/main/exercise/MatchingDraggable.php @@ -66,12 +66,12 @@ class MatchingDraggable extends Question for ($i = 1; $i <= $answer->nbrAnswers; $i++) { if ($answer->isCorrect($i)) { $nb_matches++; - $defaults['answer[' . $nb_matches . ']'] = $answer->selectAnswer($i); - $defaults['weighting[' . $nb_matches . ']'] = float_format($answer->selectWeighting($i), 1); - $defaults['matches[' . $nb_matches . ']'] = $answer->correct[$i]; + $defaults['answer['.$nb_matches.']'] = $answer->selectAnswer($i); + $defaults['weighting['.$nb_matches.']'] = float_format($answer->selectWeighting($i), 1); + $defaults['matches['.$nb_matches.']'] = $answer->correct[$i]; } else { $nb_options++; - $defaults['option[' . $nb_options . ']'] = $answer->selectAnswer($i); + $defaults['option['.$nb_options.']'] = $answer->selectAnswer($i); } } } @@ -102,10 +102,10 @@ class MatchingDraggable extends Question $html = ' - - - - + + + + '; @@ -164,8 +164,8 @@ class MatchingDraggable extends Question $html = '
' . get_lang('Number') . '' . get_lang('Answer') . '' . get_lang('MatchesTo') . '' . get_lang('Weighting') . '' . get_lang('Number').'' . get_lang('Answer').'' . get_lang('MatchesTo').'' . get_lang('Weighting').'
- - + + '; @@ -186,7 +186,7 @@ class MatchingDraggable extends Question ); $form->addHtml(''); - $form->addHtml(''); + $form->addHtml(''); //$form->addText("option[$i]", null); $form->addHtmlEditor( "option[$i]", @@ -273,10 +273,10 @@ class MatchingDraggable extends Question public function return_header($feedback_type = null, $counter = null, $score = null) { $header = parent::return_header($feedback_type, $counter, $score); - $header .= '
' . get_lang('Number') . '' . get_lang('Answer') . '' . get_lang('Number').'' . get_lang('Answer').'
' . chr(64 + $i) . ''.chr(64 + $i).'
+ $header .= '
- - + + '; return $header; diff --git a/main/exercise/UniqueAnswerImage.php b/main/exercise/UniqueAnswerImage.php index 72f7806f84..1c34b497fc 100644 --- a/main/exercise/UniqueAnswerImage.php +++ b/main/exercise/UniqueAnswerImage.php @@ -45,22 +45,22 @@ class UniqueAnswerImage extends UniqueAnswer if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { //Scenario - $commentTitle = ''; - $feedbackTitle = ''; + $commentTitle = ''; + $feedbackTitle = ''; } else { - $commentTitle = ''; + $commentTitle = ''; } $html = ''; $html .= '
' . get_lang('ElementList') . '' . get_lang('CorrespondsTo') . '' . get_lang('ElementList').'' . get_lang('CorrespondsTo').'
' . get_lang('Comment') . '' . get_lang('Scenario') . ''.get_lang('Comment').''.get_lang('Scenario').'' . get_lang('Comment') . ''.get_lang('Comment').'
- - - - ' . $commentTitle . ' - ' . $feedbackTitle . ' - + + + + ' . $commentTitle.' + ' . $feedbackTitle.' + '; @@ -95,7 +95,7 @@ class UniqueAnswerImage extends UniqueAnswer } $question = Question::read($questionid); - $selectQuestion[$questionid] = 'Q' . $key . ' :' . cut( + $selectQuestion[$questionid] = 'Q'.$key.' :'.cut( $question->selectTitle(), 20 ); } @@ -152,18 +152,18 @@ class UniqueAnswerImage extends UniqueAnswer $urlResult = $url; } - $tempScenario['url' . $i] = $urlResult; - $tempScenario['try' . $i] = $tryResult; - $tempScenario['lp' . $i] = $lp; - $tempScenario['destination' . $i] = $listDestination; + $tempScenario['url'.$i] = $urlResult; + $tempScenario['try'.$i] = $tryResult; + $tempScenario['lp'.$i] = $lp; + $tempScenario['destination'.$i] = $listDestination; } else { $defaults['answer[1]'] = get_lang('DefaultUniqueAnswer1'); $defaults['weighting[1]'] = 10; $defaults['answer[2]'] = get_lang('DefaultUniqueAnswer2'); $defaults['weighting[2]'] = 0; - $tempScenario['destination' . $i] = array('0'); - $tempScenario['lp' . $i] = array('0'); + $tempScenario['destination'.$i] = array('0'); + $tempScenario['lp'.$i] = array('0'); } $defaults['scenario'] = $tempScenario; @@ -174,28 +174,28 @@ class UniqueAnswerImage extends UniqueAnswer ); $renderer->setElementTemplate( '', - 'counter[' . $i . ']' + 'counter['.$i.']' ); $renderer->setElementTemplate( '', - 'answer[' . $i . ']' + 'answer['.$i.']' ); $renderer->setElementTemplate( '', - 'comment[' . $i . ']' + 'comment['.$i.']' ); $renderer->setElementTemplate( '', - 'weighting[' . $i . ']' + 'weighting['.$i.']' ); - $answerNumber = $form->addElement('text', 'counter[' . $i . ']', null, ' value = "' . $i . '"'); + $answerNumber = $form->addElement('text', 'counter['.$i.']', null, ' value = "'.$i.'"'); $answerNumber->freeze(); $form->addElement('radio', 'correct', null, null, $i, 'class="checkbox"'); - $form->addHtmlEditor('answer[' . $i . ']', null, null, true, $editorConfig); + $form->addHtmlEditor('answer['.$i.']', null, null, true, $editorConfig); - $form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required'); + $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required'); if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { $form->addHtmlEditor( @@ -208,22 +208,22 @@ class UniqueAnswerImage extends UniqueAnswer // Direct feedback // Adding extra feedback fields $group = array(); - $group['try' . $i] = $form->createElement('checkbox', 'try' . $i, null, get_lang('TryAgain')); - $group['lp' . $i] = $form->createElement( + $group['try'.$i] = $form->createElement('checkbox', 'try'.$i, null, get_lang('TryAgain')); + $group['lp'.$i] = $form->createElement( 'select', - 'lp' . $i, - get_lang('SeeTheory') . ': ', + 'lp'.$i, + get_lang('SeeTheory').': ', $selectLpId ); - $group['destination' . $i] = $form->createElement( + $group['destination'.$i] = $form->createElement( 'select', - 'destination' . $i, - get_lang('GoToQuestion') . ': ', + 'destination'.$i, + get_lang('GoToQuestion').': ', $selectQuestion ); - $group['url' . $i] = $form->createElement( - 'text', 'url' . $i, - get_lang('Other') . ': ', + $group['url'.$i] = $form->createElement( + 'text', 'url'.$i, + get_lang('Other').': ', array( 'class' => 'col-md-2', 'placeholder' => get_lang('Other') @@ -236,9 +236,9 @@ class UniqueAnswerImage extends UniqueAnswer 'scenario' ); } else { - $form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editorConfig); + $form->addHtmlEditor('comment['.$i.']', null, null, false, $editorConfig); } - $form->addText('weighting[' . $i . ']', null, null, array('class' => "col-md-1", 'value' => '0')); + $form->addText('weighting['.$i.']', null, null, array('class' => "col-md-1", 'value' => '0')); $form->addHtml(''); } @@ -284,19 +284,19 @@ class UniqueAnswerImage extends UniqueAnswer $numberAnswers = $form->getSubmitValue('nb_answers'); for ($i = 1; $i <= $numberAnswers; $i++) { - $answer = trim(str_replace(['

', '

'], '', $form->getSubmitValue('answer[' . $i . ']'))); - $comment = trim(str_replace(['

', '

'], '', $form->getSubmitValue('comment[' . $i . ']'))); - $weighting = trim($form->getSubmitValue('weighting[' . $i . ']')); + $answer = trim(str_replace(['

', '

'], '', $form->getSubmitValue('answer['.$i.']'))); + $comment = trim(str_replace(['

', '

'], '', $form->getSubmitValue('comment['.$i.']'))); + $weighting = trim($form->getSubmitValue('weighting['.$i.']')); $scenario = $form->getSubmitValue('scenario'); //$listDestination = $form -> getSubmitValue('destination'.$i); //$destinationStr = $form -> getSubmitValue('destination'.$i); - $try = $scenario['try' . $i]; - $lp = $scenario['lp' . $i]; - $destination = $scenario['destination' . $i]; - $url = trim($scenario['url' . $i]); + $try = $scenario['try'.$i]; + $lp = $scenario['lp'.$i]; + $destination = $scenario['destination'.$i]; + $url = trim($scenario['url'.$i]); /* How we are going to parse the destination value @@ -344,7 +344,7 @@ class UniqueAnswerImage extends UniqueAnswer } //1@@1;2;@@2;4;4;@@http://www.chamilo.org - $dest = $try . '@@' . $lp . '@@' . $destination . '@@' . $url; + $dest = $try.'@@'.$lp.'@@'.$destination.'@@'.$url; $objAnswer->createAnswer( $answer, diff --git a/main/exercise/admin.php b/main/exercise/admin.php index a9c183df66..74f15a68c4 100755 --- a/main/exercise/admin.php +++ b/main/exercise/admin.php @@ -48,7 +48,7 @@ use ChamiloSession as Session; */ require_once __DIR__.'/../inc/global.inc.php'; -$current_course_tool = TOOL_QUIZ; +$current_course_tool = TOOL_QUIZ; $this_section = SECTION_COURSES; // Access control @@ -76,7 +76,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { } if (empty($exerciseId)) { - $exerciseId = isset($_GET['exerciseId']) ? intval($_GET['exerciseId']):'0'; + $exerciseId = isset($_GET['exerciseId']) ? intval($_GET['exerciseId']) : '0'; } $newQuestion = isset($_GET['newQuestion']) ? $_GET['newQuestion'] : 0; @@ -149,7 +149,7 @@ $aType = array( if (!empty($_GET['action']) && $_GET['action'] == 'exportqti2' && !empty($_GET['questionId'])) { require_once 'export/qti2/qti2_export.php'; $export = export_question_qti($_GET['questionId'], true); - $qid = (int)$_GET['questionId']; + $qid = (int) $_GET['questionId']; $archive_path = api_get_path(SYS_ARCHIVE_PATH); $temp_dir_short = uniqid(); $temp_zip_dir = $archive_path."/".$temp_dir_short; @@ -193,7 +193,7 @@ if ($objExercise->sessionId != $sessionId) { if (!$fromExercise) { // gets the right exercise ID, and if 0 creates a new exercise if (!$exerciseId = $objExercise->selectId()) { - $modifyExercise='yes'; + $modifyExercise = 'yes'; } } @@ -243,7 +243,7 @@ if ($cancelQuestion) { } else { // goes back to the question viewing $editQuestion = $modifyQuestion; - unset($newQuestion,$modifyQuestion); + unset($newQuestion, $modifyQuestion); } } @@ -283,14 +283,14 @@ if (isset($_SESSION['gradebook'])) { $gradebook = $_SESSION['gradebook']; } -if (!empty($gradebook) && $gradebook=='view') { - $interbreadcrumb[]= array( +if (!empty($gradebook) && $gradebook == 'view') { + $interbreadcrumb[] = array( 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook') ); } -$interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises')); +$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); if (isset($_GET['newQuestion']) || isset($_GET['editQuestion'])) { $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name); } else { @@ -299,7 +299,7 @@ if (isset($_GET['newQuestion']) || isset($_GET['editQuestion'])) { // shows a link to go back to the question pool if (!$exerciseId && $nameTools != get_lang('ExerciseManagement')) { - $interbreadcrumb[]=array( + $interbreadcrumb[] = array( "url" => api_get_path(WEB_CODE_PATH)."exercise/question_pool.php?fromExercise=$fromExercise&".api_get_cidreq(), "name" => get_lang('QuestionPool') ); @@ -341,8 +341,8 @@ $template = new Template(); $templateName = $template->get_template('exercise/submit.js.tpl'); $htmlHeadXtra[] = $template->fetch($templateName); $htmlHeadXtra[] = api_get_js('d3/jquery.xcolor.js'); -$htmlHeadXtra[] = ''; -$htmlHeadXtra[] = ''; +$htmlHeadXtra[] = ''; +$htmlHeadXtra[] = ''; Display::display_header($nameTools, 'Exercise'); /* @@ -361,22 +361,22 @@ if ($inATest) { echo '
'; if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid'])) echo ''. - Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).''; + Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).''; - if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) && !isset($_GET['editQuestion'])) { + if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) && !isset($_GET['editQuestion'])) { echo ''. - Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).''; + Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).''; } echo ''. - Display::return_icon('preview_view.png', get_lang('Preview'),'',ICON_SIZE_MEDIUM).''; + Display::return_icon('preview_view.png', get_lang('Preview'), '', ICON_SIZE_MEDIUM).''; echo Display::url( - Display::return_icon('test_results.png', get_lang('Results'),'',ICON_SIZE_MEDIUM), + Display::return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH).'exercise/exercise_report.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id ); echo ''. - Display::return_icon('settings.png', get_lang('ModifyExercise'),'',ICON_SIZE_MEDIUM).''; + Display::return_icon('settings.png', get_lang('ModifyExercise'), '', ICON_SIZE_MEDIUM).''; $maxScoreAllQuestions = 0; //$questionList = $objExercise->getQuestionList(); @@ -404,7 +404,7 @@ if ($inATest) { ); if ($objExercise->random > 0) { - echo '
' . + echo '
'. sprintf(get_lang('OnlyXQuestionsPickedRandomly'), $objExercise->random); } echo '
'; @@ -413,13 +413,13 @@ if ($inATest) { // we are in create a new question from question pool not in a test echo '
'; echo ''. - Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'', ICON_SIZE_MEDIUM).''; + Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).''; echo '
'; } else { // If we are in question_pool but not in an test, go back to question create in pool echo '
'; echo ''. - Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM). + Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM). ''; echo '
'; } diff --git a/main/exercise/calculated_answer.class.php b/main/exercise/calculated_answer.class.php index 6468f03e29..bfc7c514ca 100644 --- a/main/exercise/calculated_answer.class.php +++ b/main/exercise/calculated_answer.class.php @@ -129,8 +129,8 @@ class CalculatedAnswer extends Question ), array('ToolbarSet' => 'TestQuestionDescription', 'Width' => '100%', 'Height' => '350')); - $form->addRule('answer', get_lang('GiveText'),'required'); - $form->addRule('answer', get_lang('DefineBlanks'),'regex','/\[.*\]/'); + $form->addRule('answer', get_lang('GiveText'), 'required'); + $form->addRule('answer', get_lang('DefineBlanks'), 'regex', '/\[.*\]/'); $form->addElement('label', null, get_lang('IfYouWantOnlyIntegerValuesWriteBothLimitsWithoutDecimals')); $form->addElement('html', '
'); @@ -215,10 +215,9 @@ class CalculatedAnswer extends Question $newBlankItem = "[".trim($newBlankItem)."]"; // take random float values when one or both edge values have a decimal point $randomValue = - (strpos($lowestValues[$i],'.') !== false || - strpos($highestValues[$i],'.') !== false) ? - mt_rand($lowestValues[$i]*100,$highestValues[$i]*100)/100 : - mt_rand($lowestValues[$i],$highestValues[$i]); + (strpos($lowestValues[$i], '.') !== false || + strpos($highestValues[$i], '.') !== false) ? + mt_rand($lowestValues[$i] * 100, $highestValues[$i] * 100) / 100 : mt_rand($lowestValues[$i], $highestValues[$i]); $auxAnswer = str_replace($blankItem, $randomValue, $auxAnswer); $auxFormula = str_replace($blankItem, $randomValue, $auxFormula); } @@ -252,7 +251,7 @@ class CalculatedAnswer extends Question public function return_header($feedback_type = null, $counter = null, $score = null) { $header = parent::return_header($feedback_type, $counter, $score); - $header .= '
' . get_lang('Number') . '' . get_lang('True') . '' . get_lang('Answer') . '' . get_lang('Weighting') . '' . get_lang('Number').'' . get_lang('True').'' . get_lang('Answer').'' . get_lang('Weighting').'
{error}
{element}
{error}
{element}
{error}
{element}
{error}
{element}
+ $header .= '
'; diff --git a/main/exercise/exercise_result.php b/main/exercise/exercise_result.php index e1122a1b72..53440acac6 100755 --- a/main/exercise/exercise_result.php +++ b/main/exercise/exercise_result.php @@ -58,9 +58,9 @@ if (empty($objExercise)) { $gradebook = ''; if (isset($_SESSION['gradebook'])) { - $gradebook= $_SESSION['gradebook']; + $gradebook = $_SESSION['gradebook']; } -if (!empty($gradebook) && $gradebook=='view') { +if (!empty($gradebook) && $gradebook == 'view') { $interbreadcrumb[] = array( 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook'), @@ -74,9 +74,9 @@ $interbreadcrumb[] = array( "name" => get_lang('Exercises'), ); -$htmlHeadXtra[] = ''; -$htmlHeadXtra[] = ''; -$htmlHeadXtra[] = ''; +$htmlHeadXtra[] = ''; +$htmlHeadXtra[] = ''; +$htmlHeadXtra[] = ''; if ($origin != 'learnpath') { // So we are not in learnpath tool @@ -152,7 +152,7 @@ if ($objExercise->selectAttempts() > 0) { if ($remainingAttempts) { $attemptButton = Display::toolbarButton( get_lang('AnotherAttempt'), - api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?' . api_get_cidreq() . '&' . http_build_query([ + api_get_path(WEB_CODE_PATH).'exercise/overview.php?'.api_get_cidreq().'&'.http_build_query([ 'exerciseId' => $objExercise->id, 'learnpath_id' => $learnpath_id, 'learnpath_item_id' => $learnpath_item_id @@ -173,7 +173,7 @@ if (!empty($exercise_stat_info)) { $max_score = $objExercise->get_max_score(); -Display::display_normal_message(get_lang('Saved').'
',false); +Display::display_normal_message(get_lang('Saved').'
', false); // Display and save questions ExerciseLib::display_question_list_by_attempt( @@ -209,7 +209,7 @@ if ($origin != 'learnpath') { } else { $lp_mode = isset($_SESSION['lp_mode']) ? $_SESSION['lp_mode'] : null; $url = '../lp/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$learnpath_id.'&lp_item_id='.$learnpath_item_id.'&exeId='.$exercise_stat_info['exe_id'].'&fb_type='.$objExercise->feedback_type.'#atoc_'.$learnpath_item_id; - $href = ($lp_mode == 'fullscreen')?' window.opener.location.href="'.$url.'" ':' top.location.href="'.$url.'"'; + $href = ($lp_mode == 'fullscreen') ? ' window.opener.location.href="'.$url.'" ' : ' top.location.href="'.$url.'"'; if (api_is_allowed_to_session_edit()) { Session::erase('objExercise'); diff --git a/main/exercise/exercise_show.php b/main/exercise/exercise_show.php index 14d1747a8d..11adc21548 100755 --- a/main/exercise/exercise_show.php +++ b/main/exercise/exercise_show.php @@ -34,7 +34,7 @@ $TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); // General parameters passed via POST/GET if ($debug) { - error_log('Entered exercise_result.php: ' . print_r($_POST, 1)); + error_log('Entered exercise_result.php: '.print_r($_POST, 1)); } if (empty($formSent)) { @@ -133,20 +133,20 @@ if (isset($_SESSION['gradebook'])) { } if (!empty($gradebook) && $gradebook == 'view') { - $interbreadcrumb[] = array('url' => '../gradebook/' . $_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook')); + $interbreadcrumb[] = array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook')); } $fromlink = ''; -$interbreadcrumb[] = array("url" => "exercise.php?" . api_get_cidreq(), "name" => get_lang('Exercises')); -$interbreadcrumb[] = array("url" => "overview.php?exerciseId=" . $exercise_id . '&' . api_get_cidreq(), "name" => $objExercise->name); +$interbreadcrumb[] = array("url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises')); +$interbreadcrumb[] = array("url" => "overview.php?exerciseId=".$exercise_id.'&'.api_get_cidreq(), "name" => $objExercise->name); $interbreadcrumb[] = array("url" => "#", "name" => get_lang('Result')); $this_section = SECTION_COURSES; -$htmlHeadXtra[] = ''; -$htmlHeadXtra[] = ''; -$htmlHeadXtra[] = ''; +$htmlHeadXtra[] = ''; +$htmlHeadXtra[] = ''; +$htmlHeadXtra[] = ''; if ($origin != 'learnpath') { Display::display_header(''); @@ -272,29 +272,29 @@ if ($show_results || $show_only_total_score || $showTotalScoreAndUserChoicesInLa $i = $totalScore = $totalWeighting = 0; if ($debug > 0) { - error_log("ExerciseResult: " . print_r($exerciseResult, 1)); - error_log("QuestionList: " . print_r($questionList, 1)); + error_log("ExerciseResult: ".print_r($exerciseResult, 1)); + error_log("QuestionList: ".print_r($questionList, 1)); } $arrques = array(); $arrans = array(); -$user_restriction = $is_allowedToEdit ? '' : "AND user_id=" . intval($student_id) . " "; +$user_restriction = $is_allowedToEdit ? '' : "AND user_id=".intval($student_id)." "; $sql = "SELECT attempts.question_id, answer FROM $TBL_TRACK_ATTEMPT as attempts - INNER JOIN " . $TBL_TRACK_EXERCISES . " AS stats_exercises + INNER JOIN ".$TBL_TRACK_EXERCISES." AS stats_exercises ON stats_exercises.exe_id=attempts.exe_id INNER JOIN $TBL_EXERCISE_QUESTION AS quizz_rel_questions ON quizz_rel_questions.exercice_id=stats_exercises.exe_exo_id AND quizz_rel_questions.question_id = attempts.question_id AND - quizz_rel_questions.c_id=" . api_get_course_int_id() . " - INNER JOIN " . $TBL_QUESTIONS . " AS questions + quizz_rel_questions.c_id=".api_get_course_int_id()." + INNER JOIN " . $TBL_QUESTIONS." AS questions ON questions.id=quizz_rel_questions.question_id AND - questions.c_id = " . api_get_course_int_id() . " + questions.c_id = " . api_get_course_int_id()." WHERE - attempts.exe_id = " . intval($id) . " $user_restriction + attempts.exe_id = " . intval($id)." $user_restriction GROUP BY quizz_rel_questions.question_order, attempts.question_id"; $result = Database::query($sql); @@ -526,26 +526,26 @@ foreach ($questionList as $questionId) { $table_resume = '
'.get_lang("Answer").'
- - + + - - - + + + - - - + + + - - - + + +
' . get_lang('Requirements') . '' . get_lang('YourAnswer') . '' . get_lang('Requirements').'' . get_lang('YourAnswer').'
' . get_lang('Overlap') . '' . get_lang('Min') . ' ' . $threadhold1 . '
' . (($final_overlap < 0) ? 0 : intval($final_overlap)) . '
' . get_lang('Overlap').'' . get_lang('Min').' '.$threadhold1.'
'.(($final_overlap < 0) ? 0 : intval($final_overlap)).'
' . get_lang('Excess') . '' . get_lang('Max') . ' ' . $threadhold2 . '
' . (($final_excess < 0) ? 0 : intval($final_excess)) . '
' . get_lang('Excess').'' . get_lang('Max').' '.$threadhold2.'
'.(($final_excess < 0) ? 0 : intval($final_excess)).'
' . get_lang('Missing') . '' . get_lang('Max') . ' ' . $threadhold3 . '
' . (($final_missing < 0) ? 0 : intval($final_missing)) . '
' . get_lang('Missing').'' . get_lang('Max').' '.$threadhold3.'
'.(($final_missing < 0) ? 0 : intval($final_missing)).'
'; if ($answerType != HOT_SPOT_DELINEATION) { @@ -569,25 +569,25 @@ foreach ($questionList as $questionId) { } } - echo '

' . get_lang('Feedback') . '

'; + echo '

'.get_lang('Feedback').'

'; if ($answerType == HOT_SPOT_DELINEATION) { if ($organs_at_risk_hit > 0) { - $message = '
' . get_lang('ResultIs') . ' ' . $result_comment . '
'; - $message .= '

' . get_lang('OARHit') . '

'; + $message = '
'.get_lang('ResultIs').' '.$result_comment.'
'; + $message .= '

'.get_lang('OARHit').'

'; } else { - $message = '

' . get_lang('YourDelineation') . '

'; + $message = '

'.get_lang('YourDelineation').'

'; $message .= $table_resume; - $message .= '
' . get_lang('ResultIs') . ' ' . $result_comment . '
'; + $message .= '
'.get_lang('ResultIs').' '.$result_comment.'
'; } - $message .= '

' . $comment . '

'; + $message .= '

'.$comment.'

'; echo $message; } else { - echo '

' . $comment . '

'; + echo '

'.$comment.'

'; } //showing the score - $queryfree = "SELECT marks from " . $TBL_TRACK_ATTEMPT . " - WHERE exe_id = " . intval($id) . " AND question_id= " . intval($questionId) . ""; + $queryfree = "SELECT marks from ".$TBL_TRACK_ATTEMPT." + WHERE exe_id = " . intval($id)." AND question_id= ".intval($questionId).""; $resfree = Database::query($queryfree); $questionScore = Database::result($resfree, 0, "marks"); $totalScore += $questionScore; @@ -673,8 +673,8 @@ foreach ($questionList as $questionId) { $marksname = ''; if ($isFeedbackAllowed) { - $name = "fckdiv" . $questionId; - $marksname = "marksName" . $questionId; + $name = "fckdiv".$questionId; + $marksname = "marksName".$questionId; if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION, ANNOTATION))) { $url_name = get_lang('EditCommentsAndMarks'); } else { @@ -685,32 +685,32 @@ foreach ($questionList as $questionId) { } } echo '
'; - echo Display::url($url_name, 'javascript://', array('class' => 'btn', 'onclick' => "showfck('" . $name . "', '" . $marksname . "');")); + echo Display::url($url_name, 'javascript://', array('class' => 'btn', 'onclick' => "showfck('".$name."', '".$marksname."');")); echo '
'; - echo '
'; + echo '
'; $comnt = trim(Event::get_comments($id, $questionId)); if (empty($comnt)) { echo '
'; } else { - echo '
' . $comnt . '
'; + echo '
'.$comnt.'
'; } echo '
'; - echo '