Browse Source

[svn r20280] Removed button "Quit test" when you finished a test into lp - partial FS#4105

Cristian Fasanando 16 years ago
parent
commit
a44635dbd8

+ 5 - 8
main/exercice/exercise_result.php

@@ -29,7 +29,7 @@
 *	@author Olivier Brouckaert, main author
 *	@author Roan Embrechts, some refactoring
 * 	@author Julio Montoya Armas switchable fill in blank option added
-* 	@version $Id: exercise_result.php 20231 2009-04-30 18:08:12Z cvargas1 $
+* 	@version $Id: exercise_result.php 20280 2009-05-04 16:10:06Z cfasanando $
 *
 *	@todo	split more code up in functions, move functions to library?
 */
@@ -1058,14 +1058,11 @@ $exerciseTitle=api_parse_tex($exerciseTitle);
 
 		<br /><br />
 <?php if($origin == 'learnpath') {	
-	Display::display_normal_message(get_lang('ExerciseFinished'));
+	//Display::display_normal_message(get_lang('ExerciseFinished'));
 	$lp_mode =  $_SESSION['lp_mode'];	
-	if ($lp_mode == 'fullscreen') {							
-?>					
-	<button type="button" class="save" onclick="window.opener.location.href='../newscorm/lp_controller.php?cidReq=<?php echo api_get_course_id()?>&amp;action=view&amp;lp_id=<?php echo $learnpath_id ?>&amp;lp_item_id=<?php echo $learnpath_item_id ?>&amp;exeId=<?php echo $exeId ?>';window.close()" value="<?php echo get_lang('Finish'); ?>"><?php echo get_lang('Finish');?></button>				
-<?php } else { ?>					
-	<button type="button" class="save" onclick="top.location.href='../newscorm/lp_controller.php?cidReq=<?php echo api_get_course_id()?>&amp;action=view&amp;lp_id=<?php echo $learnpath_id ?>&amp;lp_item_id=<?php echo $learnpath_item_id ?>&amp;exeId=<?php echo $exeId ?>';" value="<?php echo get_lang('Finish'); ?>"><?php echo get_lang('Finish');?></button>				
-<?php }
+	$url = '../newscorm/lp_controller.php?cidReq='.api_get_course_id().'&action=view&lp_id='.$learnpath_id.'&lp_item_id='.$learnpath_item_id.'&exeId='.$exeId;
+	$href = ($lp_mode == 'fullscreen')?' window.opener.location.href="'.$url.'" ':' top.location.href="'.$url.'" ';	 
+	echo '<script language="javascript" type="text/javascript">'.$href.'</script>'."\n";
 }	
 /*
 ==============================================================================

+ 8 - 12
main/exercice/exercise_show.php

@@ -4,7 +4,7 @@
 *
 *	@package dokeos.exercise
 * 	@author Julio Montoya Armas Added switchable fill in blank option added
-* 	@version $Id: exercise_show.php 20236 2009-04-30 21:01:58Z iflorespaz $
+* 	@version $Id: exercise_show.php 20280 2009-05-04 16:10:06Z cfasanando $
 *
 * 	@todo remove the debug code and use the general debug library
 * 	@todo use the Database:: functions
@@ -1045,10 +1045,6 @@ if($origin!='learnpath') {
 		}
 		echo '!</div>';		
 	}
-} else {
-	echo '<br /><br />';	
-  	Display::display_normal_message(get_lang('ExerciseFinished'));
-	echo '<br />';
 } 
 
 if (is_array($arrid) && is_array($arrmarks)) {
@@ -1091,13 +1087,13 @@ if ($origin != 'learnpath') {
 	//we are not in learnpath tool
 	Display::display_footer();
 } else {
-	$lp_mode =  $_SESSION['lp_mode'];	
-	if ($lp_mode == 'fullscreen') {							
-?>					
-	<button type="button" class="save" onclick="window.opener.location.href='../newscorm/lp_controller.php?cidReq=<?php echo api_get_course_id()?>&amp;action=view&amp;lp_id=<?php echo $learnpath_id ?>&amp;lp_item_id=<?php echo $learnpath_item_id ?>&amp;exeId=<?php echo $exeId ?>';window.close()" value="<?php echo get_lang('Finish'); ?>"><?php echo get_lang('Finish');?></button>				
-<?php } else { ?>					
-	<button type="button" class="save" onclick="top.location.href='../newscorm/lp_controller.php?cidReq=<?php echo api_get_course_id()?>&amp;action=view&amp;lp_id=<?php echo $learnpath_id ?>&amp;lp_item_id=<?php echo $learnpath_item_id ?>&amp;exeId=<?php echo $exeId ?>';" value="<?php echo get_lang('Finish'); ?>"><?php echo get_lang('Finish');?></button>				
-<?php } 
+	
+	
+	$lp_mode =  $_SESSION['lp_mode'];
+	
+	$url = '../newscorm/lp_controller.php?cidReq='.api_get_course_id().'&action=view&lp_id='.$learnpath_id.'&lp_item_id='.$learnpath_item_id.'&exeId='.$exeId;
+	$href = ($lp_mode == 'fullscreen')?' window.opener.location.href="'.$url.'" ':' top.location.href="'.$url.'" ';	 
+	echo '<script language="javascript" type="text/javascript">'.$href.'</script>'."\n";
 
 	//record the results in the learning path, using the SCORM interface (API)
 	echo '<script language="javascript" type="text/javascript">window.parent.API.void_save_asset('.$totalScore.','.$totalWeighting.');</script>'."\n";

+ 16 - 12
main/newscorm/blank.php

@@ -23,19 +23,23 @@ include_once('../inc/reduced_header.inc.php');
 
 <?php
 
-switch($_GET['error']){
-	case 'document_deleted':
-		echo '<br /><br />';
-		Display::display_error_message(get_lang('DocumentHasBeenDeleted'));
-		break;
-	case 'prerequisites':	
-		echo '<br /><br />';	
-		Display::display_normal_message(get_lang('_prereq_not_complete'));
-		break;
-	default:
-		break;
+if (isset($_GET['error'])) {
+	switch($_GET['error']){
+		case 'document_deleted':
+			echo '<br /><br />';
+			Display::display_error_message(get_lang('DocumentHasBeenDeleted'));
+			break;
+		case 'prerequisites':	
+			echo '<br /><br />';	
+			Display::display_normal_message(get_lang('_prereq_not_complete'));
+			break;
+		default:
+			break;
+	}
+} else if(isset($_GET['msg']) && $_GET['msg']=='exerciseFinished') {
+	echo '<br /><br />';
+	Display::display_normal_message(get_lang('ExerciseFinished'));
 }
-
 ?>
 
 </body>

+ 4 - 8
main/newscorm/lp_view.php

@@ -153,6 +153,8 @@ foreach($list as $toc) {
 	}	
 }
 
+$ctok = $_SESSION['sec_token'];
+
 // update status,total_time from lp_item_view table when you finish the exercises in learning path
 if ($type_quiz && !empty($_REQUEST['exeId']) && isset($_GET['lp_id']) && isset($_GET['lp_item_id'])) {
 	global $src;
@@ -193,14 +195,8 @@ if ($type_quiz && !empty($_REQUEST['exeId']) && isset($_GET['lp_id']) && isset($
 			api_sql_query($sql_upd_score,__FILE__,__LINE__);
 		}
 	}
-	if($_SESSION['oLP']->mode == 'fullscreen') {
-		$lp_next_item_id = $_SESSION['oLP']->get_next_item_id();
-		$src = $_SESSION['oLP']->get_link('http',$lp_next_item_id);
-		$_SESSION['oLP']->current = $lp_next_item_id;				
-	} else {
-		$src = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?action=stats';
-	}		
-		
+	
+	$src = 'blank.php?msg=exerciseFinished';					
 }
 
 $_SESSION['oLP']->set_previous_item($lp_item_id);