Prechádzať zdrojové kódy

[svn r20975] minor changes in exercises and work see FS#3909

Carlos Vargas 16 rokov pred
rodič
commit
079267736c

+ 4 - 4
main/exercice/exercise.class.php

@@ -25,7 +25,7 @@
 *	Exercise class: This class allows to instantiate an object of type Exercise
 *	@package dokeos.exercise
 * 	@author Olivier Brouckaert
-* 	@version $Id: exercise.class.php 20795 2009-05-18 18:05:02Z iflorespaz $
+* 	@version $Id: exercise.class.php 20975 2009-05-25 18:09:56Z cvargas1 $
 */
 
 
@@ -1035,9 +1035,9 @@ class Exercise
 				
 	  			if(($this -> start_time!='0000-00-00 00:00:00')||($this -> end_time!='0000-00-00 00:00:00'))
 	            	$defaults['enabletimelimit'] = 1;
-			    
+	    
 			    $defaults['start_time'] = ($this->start_time!='0000-00-00 00:00:00')? $this -> start_time : date('Y-m-d 12:00:00');
-	            $defaults['end_time'] = ($this->end_time!='0000-00-00 00:00:00')?$this -> end_time : date('Y-m-d 12:00:00');
+	            $defaults['end_time'] = ($this->end_time!='0000-00-00 00:00:00')?$this -> end_time : date('Y-m-d 12:00:00',time()+84600);
 	            
 			} else {
 				$defaults['exerciseType'] = 2;
@@ -1048,7 +1048,7 @@ class Exercise
 				$defaults['results_disabled'] = 0;
 				
 				$defaults['start_time'] = date('Y-m-d 12:00:00');
-				$defaults['end_time'] = date('Y-m-d 12:00:00');
+				$defaults['end_time'] = date('Y-m-d 12:00:00',time()+84600);
 			}
 		} else {
 			$defaults['exerciseTitle'] = $this -> selectTitle();

+ 10 - 8
main/work/work.lib.php

@@ -1,4 +1,4 @@
-<?php //$Id: work.lib.php 20716 2009-05-16 07:28:22Z ivantcholakov $
+<?php //$Id: work.lib.php 20975 2009-05-25 18:09:56Z cvargas1 $
 /* For licensing terms, see /dokeos_license.txt */
 /**
 *	@package dokeos.work
@@ -6,7 +6,7 @@
 * 	@author Patrick Cool <patrick.cool@UGent.be>, Ghent University - ability for course admins to specify wether uploaded documents are visible or invisible by default.
 * 	@author Roan Embrechts, code refactoring and virtual course support
 * 	@author Frederic Vauthier, directories management
-* 	@version $Id: work.lib.php 20716 2009-05-16 07:28:22Z ivantcholakov $
+* 	@version $Id: work.lib.php 20975 2009-05-25 18:09:56Z cvargas1 $
 */
 /**
  * Displays action links (for admins, authorized groups members and authorized students)
@@ -608,13 +608,15 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
 			} else {
 				$add_to_name = '';
 			}
-			
 			$show_as_icon = get_work_id($mydir); //true or false
-			if ($show_as_icon) {
-				$row[] = '<a href="'.api_get_self().'?cidReq='.api_get_course_id().'&gradebook='.$gradebook.'&action=downloadfolder&path=/'.$mydir.'"><img src="../img/zip_save.gif" style="float:right;" alt="'.get_lang('Save').'" title="'.get_lang('Save').'" width="17" height="17"/></a><a href="'.api_get_self().'?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.Security::remove_XSS($_GET['gradebook']).'&curdirpath='.$mydir.'"'.$class.'>'.$dir.'</a>'.$add_to_name.'<br>'.$cant_files.' '.$text_file.$dirtext;
-			} else {
-				$row[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.$gradebook.'&curdirpath='.$mydir.'"'.$class.'>'.$dir.'</a>'.$add_to_name.'<br>'.$cant_files.' '.$text_file.$dirtext;	
-			}									
+				if ($cant_files>0) {
+					$zip='<a href="'.api_get_self().'?cidReq='.api_get_course_id().'&gradebook='.$gradebook.'&action=downloadfolder&path=/'.$mydir.'"><img src="../img/zip_save.gif" style="float:right;" alt="'.get_lang('Save').'" title="'.get_lang('Save').'" width="17" height="17"/></a>';	
+				}		
+				if ($show_as_icon) {
+					$row[] = $zip.'<a href="'.api_get_self().'?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.Security::remove_XSS($_GET['gradebook']).'&curdirpath='.$mydir.'"'.$class.'>'.$dir.'</a>'.$add_to_name.'<br>'.$cant_files.' '.$text_file.$dirtext;
+				} else {
+					$row[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.$gradebook.'&curdirpath='.$mydir.'"'.$class.'>'.$dir.'</a>'.$add_to_name.'<br>'.$cant_files.' '.$text_file.$dirtext;	
+				}								
 		}
 		
 		if ($count_files!=0) {

+ 12 - 4
main/work/work.php

@@ -1,4 +1,4 @@
-<?php //$Id: work.php 20798 2009-05-18 18:13:25Z cvargas1 $
+<?php //$Id: work.php 20975 2009-05-25 18:09:56Z cvargas1 $
 /* For licensing terms, see /dokeos_license.txt */
 /**
 *	@package dokeos.work
@@ -6,7 +6,7 @@
 * 	@author Patrick Cool <patrick.cool@UGent.be>, Ghent University - ability for course admins to specify wether uploaded documents are visible or invisible by default.
 * 	@author Roan Embrechts, code refactoring and virtual course support
 * 	@author Frederic Vauthier, directories management
-*  	@version $Id: work.php 20798 2009-05-18 18:13:25Z cvargas1 $
+*  	@version $Id: work.php 20975 2009-05-25 18:09:56Z cvargas1 $
 *
 * 	@todo refactor more code into functions, use quickforms, coding standards, ...
 */
@@ -1185,14 +1185,22 @@ if ($is_course_member) {
 		$form->addElement('hidden', 'accepted', 1);
 		$form->addElement('hidden', 'sec_token', $stok);
 		
+		if (isset($_GET['edit'])) {
+			$text=get_lang('UpdateWork');
+			$class='save';	
+		} else {
+			$text=get_lang('SendWork');
+			$class='upload';			
+		}
+		
 		// fix the Ok button when we see the tool in the learn path
 		if ($origin== 'learnpath') {
 			$form->addElement('html', '<div style="margin-left:137px">');		
-			$form->addElement('style_submit_button','submitWork', get_lang('SendFile'),array('class="upload"','value="submitWork"'));		
+			$form->addElement('style_submit_button','submitWork', $text, array('class="'.$class.'"','value="submitWork"'));		
 			$form->addElement('html', '</div>');
 		} else {
 			//$form->addElement('submit','submitWork', get_lang('SendFile'));
-			$form->addElement('style_submit_button', 'submitWork', get_lang('SendFile'),array('class="upload"','value="submitWork"'));
+			$form->addElement('style_submit_button', 'submitWork', $text, array('class="'.$class.'"','value="submitWork"'));
 		}
 		
 		if (!empty($_POST['submitWork']) || $edit) {