Minor - format code.

skala
Julio Montoya 12 years ago
parent 9f54bf017b
commit f639192a65
  1. 44
      main/exercice/overview.php

@ -43,7 +43,7 @@ $learnpath_item_view_id = isset($_REQUEST['learnpath_item_view_id']) ? intval($_
$origin = isset($_REQUEST['origin']) ? Security::remove_XSS($_REQUEST['origin']) : null;
$interbreadcrumb[] = array ("url" => "exercice.php?gradebook=$gradebook", "name" => get_lang('Exercices'));
$interbreadcrumb[] = array ("url" => "#","name" => $objExercise->name);
$interbreadcrumb[] = array ("url" => "#", "name" => $objExercise->getCutTitle());
$time_control = false;
$clock_expired_time = ExerciseLib::get_session_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id);
@ -57,7 +57,7 @@ $urlMainExercise = api_get_path(WEB_CODE_PATH).'exercice/';
$exercise_stat_info = $objExercise->getStatTrackExerciseInfo($learnpath_id, $learnpath_item_id, 0);
if ($time_control) {
// Get time left for expiring time
$time_left = api_strtotime($clock_expired_time,'UTC') - time();
$time_left = api_strtotime($clock_expired_time, 'UTC') - time();
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/stylesheet/jquery.epiclock.css');
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/renderers/minute/epiclock.minute.css');
@ -84,7 +84,7 @@ if ($origin != 'learnpath') {
$html = '';
$message = '';
$is_allowed_to_edit = api_is_allowed_to_edit(null,true);
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$edit_link = '';
if ($is_allowed_to_edit) {
$url = api_get_path(WEB_CODE_PATH).'exercice/admin.php?'.api_get_cidreq().'&id_session='.api_get_session_id().'&exerciseId='.$objExercise->id;
@ -138,7 +138,16 @@ if ($visible_return['value'] == false) {
}
}
$attempts = getExerciseResultsByUser(api_get_user_id(), $objExercise->id, api_get_course_int_id(), api_get_session_id(), $learnpath_id, $learnpath_item_id, 'desc');
$attempts = getExerciseResultsByUser(
api_get_user_id(),
$objExercise->id,
api_get_course_int_id(),
api_get_session_id(),
$learnpath_id,
$learnpath_item_id,
'desc'
);
$counter = count($attempts);
$my_attempt_array = array();
@ -164,8 +173,6 @@ if (!empty($attempts)) {
$attempt_link = Display::url(get_lang('Show'), $attempt_url, array('class'=>$btn_class.'btn'));
$teacher_revised = Display::label(get_lang('Validated'), 'success');
//$attempt_link = get_lang('NoResult');
//$attempt_link = Display::return_icon('quiz_na.png', get_lang('NoResult'), array(), ICON_SIZE_SMALL);
if ($attempt_result['attempt_revised'] == 0) {
$teacher_revised = Display::label(get_lang('NotValidated'), 'info');
}
@ -175,11 +182,24 @@ if (!empty($attempts)) {
);
$attempt_link .= "   ".$teacher_revised;
if (in_array($objExercise->results_disabled, array(RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS, RESULT_DISABLE_SHOW_SCORE_ONLY, RESULT_DISABLE_SHOW_FINAL_SCORE_ONLY_WITH_CATEGORIES))) {
if (in_array(
$objExercise->results_disabled,
array(
RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS,
RESULT_DISABLE_SHOW_SCORE_ONLY,
RESULT_DISABLE_SHOW_FINAL_SCORE_ONLY_WITH_CATEGORIES
)
)) {
$row['result'] = $score;
}
if (in_array($objExercise->results_disabled, array(RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS, RESULT_DISABLE_SHOW_FINAL_SCORE_ONLY_WITH_CATEGORIES))
if (in_array(
$objExercise->results_disabled,
array(
RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS,
RESULT_DISABLE_SHOW_FINAL_SCORE_ONLY_WITH_CATEGORIES
)
)
|| ($objExercise->results_disabled == RESULT_DISABLE_SHOW_SCORE_ONLY && $objExercise->feedback_type == EXERCISE_FEEDBACK_TYPE_END)) {
$row['attempt_link'] = $attempt_link;
}
@ -201,8 +221,7 @@ if (!empty($attempts)) {
case RESULT_DISABLE_SHOW_SCORE_ONLY:
if ($objExercise->feedback_type != EXERCISE_FEEDBACK_TYPE_END) {
$header_names = array(get_lang('Attempt'), get_lang('StartDate'), get_lang('Score'));
}
else {
} else {
$header_names = array(get_lang('Attempt'), get_lang('StartDate'), get_lang('Score'), get_lang('Details'));
}
break;
@ -218,7 +237,7 @@ if (!empty($attempts)) {
$column = 0;
$table->setCellContents($row, $column, $data);
$class = 'class="row_odd"';
if($row % 2) {
if ($row % 2) {
$class = 'class="row_even"';
}
$table->setRowAttributes($row, $class, true);
@ -230,9 +249,6 @@ if (!empty($attempts)) {
}
if ($objExercise->selectAttempts()) {
if ($is_allowed_to_edit) {
//$options.= Display::div(get_lang('ExerciseAttempts').' '.$objExercise->selectAttempts(), array('class'=>'right_option'));
}
$attempt_message = get_lang('Attempts').' '.$counter.' / '.$objExercise->selectAttempts();
if ($counter == $objExercise->selectAttempts()) {

Loading…
Cancel
Save