Преглед изворни кода

[svn r19979] Logic change - Fixed attempts of an exercise in lp mode full screen - partial FS#3579

Cristian Fasanando пре 16 година
родитељ
комит
08359b40f7
3 измењених фајлова са 33 додато и 7 уклоњено
  1. 8 3
      main/exercice/exercise_result.php
  2. 16 3
      main/exercice/exercise_show.php
  3. 9 1
      main/newscorm/lp_view.php

+ 8 - 3
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 19955 2009-04-21 21:04:23Z juliomontoya $
+* 	@version $Id: exercise_result.php 19979 2009-04-22 17:12:35Z cfasanando $
 *
 *	@todo	split more code up in functions, move functions to library?
 */
@@ -1048,10 +1048,15 @@ $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 }	
+<?php }
+}	
 /*
 ==============================================================================
 		Tracking of results

+ 16 - 3
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 19955 2009-04-21 21:04:23Z juliomontoya $
+* 	@version $Id: exercise_show.php 19979 2009-04-22 17:12:35Z cfasanando $
 *
 * 	@todo remove the debug code and use the general debug library
 * 	@todo use the Database:: functions
@@ -377,7 +377,12 @@ function display_hotspot_answer($answerId, $answer, $studentChoice, $answerComme
 			echo '</td>
 			</tr>
 			</table>';
-		}	
+		}
+		
+		if ($origin == 'learnpath') {
+			$show_results = false;
+		}
+			
 		if ($show_results) {			
 		?>
 			<table>
@@ -1039,7 +1044,7 @@ if($origin!='learnpath') {?>
 					 </form>
 				<?php }
 		 	}  		
-			if ($origin=='learnpath' || $origin=='student_progress') {?>				
+			if ($origin=='student_progress') {?>				
 				<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 } else if($origin=='myprogress') {?>
 				<button type="button" class="save" onclick="top.location.href='../auth/my_progress.php?course=<?php echo api_get_course_id()?>'" value="<?php echo get_lang('Finish'); ?>" ><?php echo get_lang('Finish');?></button>				
@@ -1052,6 +1057,14 @@ 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 } 
+
 	//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";
 	echo '</body></html>';

+ 9 - 1
main/newscorm/lp_view.php

@@ -86,6 +86,7 @@ $lp_item_id = $_SESSION['oLP']->get_current_item_id();
 //Prepare variables for the test tool (just in case) - honestly, this should disappear later on
 $_SESSION['scorm_view_id'] = $_SESSION['oLP']->get_view_id();
 $_SESSION['scorm_item_id'] = $lp_item_id;
+$_SESSION['lp_mode'] = $_SESSION['oLP']->mode;
 //reinit exercises variables to avoid spacename clashes (see exercise tool)
 if(isset($exerciseResult) or isset($_SESSION['exerciseResult']))
 {
@@ -192,7 +193,14 @@ if ($type_quiz && !empty($_REQUEST['exeId']) && isset($_GET['lp_id']) && isset($
 			api_sql_query($sql_upd_score,__FILE__,__LINE__);
 		}
 	}
-	$src = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?action=stats';
+	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';
+	}		
+		
 }
 
 $_SESSION['oLP']->set_previous_item($lp_item_id);