Fixing exercise preview URL + fixing show_results condition

skala
Julio Montoya 14 years ago
parent 7bf7035529
commit e5c8ac4cb0
  1. 2
      main/exercice/admin.php
  2. 13
      main/exercice/exercise.class.php
  3. 12
      main/exercice/exercise_result.php
  4. 8
      main/exercice/overview.php

@ -455,7 +455,7 @@ if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['
if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) && !isset($_GET['editQuestion'])) {
echo '<a href="exercice.php?'.api_get_cidReq().'">'.Display::return_icon('back.png', get_lang('BackToExercisesList'),'','32').'</a>';
}
echo '<a href="exercise_submit.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&preview=1">'.Display::return_icon('preview_view.png', get_lang('Preview'),'','32').'</a>';
echo '<a href="overview.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&preview=1">'.Display::return_icon('preview_view.png', get_lang('Preview'),'','32').'</a>';
echo Display::url(Display::return_icon('test_results.png', get_lang('Results'),'','32'), 'exercice.php?'.api_get_cidReq().'&show=result&exerciseId='.$objExercise->id);

@ -1568,15 +1568,18 @@ class Exercise {
$label = get_lang('NextQuestion');
$class = 'next';
}
if ($this->type == ONE_PER_PAGE) {
//Next question
$all_button .= '<a href="javascript://" class="a_button blue medium" onclick="save_now('.$question_id.'); ">'.$label.'</a>';
if ($this->type == ONE_PER_PAGE) {
if ($questionNum != 1) {
$prev_question = $questionNum - 2;
$all_button .= '<a href="javascript://" class="a_button white small" onclick="previous_question('.$prev_question.'); "> << </a>';
$all_button .= '<a href="javascript://" class="a_button white medium" onclick="previous_question('.$prev_question.'); ">'.get_lang('PreviousQuestion').'</a>';
}
//Next question
$all_button .= '<a href="javascript://" class="a_button blue medium" onclick="save_now('.$question_id.'); ">'.$label.'</a>';
//$all_button .= '&nbsp;<span id="save_all_reponse"></span>';
$all_button .= '<span id="save_for_now_'.$question_id.'"></span>&nbsp;';

@ -40,7 +40,6 @@ require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
$this_section = SECTION_COURSES;
/* ACCESS RIGHTS */
// notice for unauthorized people.
api_protect_course_script(true);
// Database table definitions
@ -120,7 +119,6 @@ if (api_is_course_admin() && $origin != 'learnpath') {
}
$feedback_type = $objExercise->feedbacktype;
$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);
if (!empty($exercise_stat_info['data_tracking'])) {
@ -164,7 +162,7 @@ if ($show_results || $show_only_score) {
echo $exercise_header = $objExercise->show_exercise_result_header(api_get_person_name($user_info['firstName'], $user_info['lastName']));
}
Display :: display_confirmation_message(get_lang('Saved').'<br /><br />',false);
Display :: display_confirmation_message(get_lang('Saved').'<br />',false);
$counter = 1;
// Loop over all question to show results for each of them, one by one
@ -187,9 +185,11 @@ if (!empty($question_list)) {
// show titles
echo $objQuestionTmp->return_header($objExercise->feedback_type, $counter);
$counter++;
// We're inside *one* question. Go through each possible answer for this question
$result = $objExercise->manage_answer($exercise_stat_info['exe_id'], $questionId, null ,'exercise_result', array(), false, true, $show_results, $objExercise->selectPropagateNeg(), $hotspot_delineation_result);
}
}
// We're inside *one* question. Go through each possible answer for this question
$result = $objExercise->manage_answer($exercise_stat_info['exe_id'], $questionId, null ,'exercise_result', array(), false, true, $show_results, $objExercise->selectPropagateNeg(), $hotspot_delineation_result);
$total_score += $result['score'];
$total_weight += $result['weight'];
} // end foreach() block that loops over all questions

@ -70,9 +70,13 @@ if ($is_allowed_to_edit ) {
$html .= Display::tag('h1', $objExercise->name .' '.$edit_link);
$html .= Display::div($objExercise->description, array('class'=>'exercise_description'));
//Buttons
$extra_params = '';
if (isset($_GET['preview'])) {
$extra_params = '&preview=1';
}
//Notice we not add there the lp_item_view__id because is not already generated
$exercise_url = api_get_path(WEB_CODE_PATH).'exercice/exercise_submit.php?'.api_get_cidreq().'&id_session='.api_get_session_id().'&exerciseId='.$objExercise->id.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id;
$exercise_url = api_get_path(WEB_CODE_PATH).'exercice/exercise_submit.php?'.api_get_cidreq().'&id_session='.api_get_session_id().'&exerciseId='.$objExercise->id.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.$extra_params;
$label = get_lang('StartTest');
if ($time_control && !empty($clock_expired_time)) {

Loading…
Cancel
Save