diff --git a/main/exercice/exercice_history.php b/main/exercice/exercice_history.php index 614d146943..44e8042920 100755 --- a/main/exercice/exercice_history.php +++ b/main/exercice/exercice_history.php @@ -62,6 +62,7 @@ if(!$is_allowedToEdit){ $TBL_USER = Database::get_main_table(TABLE_MAIN_USER); $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); +$TBL_EXERCICES_QUESTION = Database::get_course_table(TABLE_QUIZ_QUESTION); $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES); $TBL_TRACK_ATTEMPT_RECORDING= Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING); //$nameTools=get_lang('Exercices'); @@ -87,6 +88,7 @@ $TBL_TRACK_ATTEMPT_RECORDING= Database::get_statistic_table(TABLE_STATISTIC_TRAC + @@ -98,7 +100,7 @@ $sql = 'SELECT * FROM '.$TBL_EXERCICES; $query = api_sql_query($sql,__FILE__,__LINE__); */ -$sql = 'SELECT *, CONCAT(firstname,'."' '".',lastname) as full_name FROM '.$TBL_TRACK_ATTEMPT_RECORDING.' LEFT JOIN '.$TBL_USER.' ON user_id = author where exe_id = '.(int)$_GET['exe_id'].' ORDER BY insert_date ASC'; +$sql = "SELECT *, quiz_question.question, CONCAT(firstname,' ',lastname) as full_name FROM $TBL_TRACK_ATTEMPT_RECORDING,$TBL_USER,$TBL_EXERCICES_QUESTION quiz_question WHERE quiz_question.id = question_id AND user_id = author AND exe_id = '".(int)$_GET['exe_id']."' ORDER BY insert_date ASC"; $query = api_sql_query($sql,__FILE__,__LINE__); while($row = mysql_fetch_array($query)){ @@ -106,12 +108,14 @@ while($row = mysql_fetch_array($query)){ if($i%2==0) echo 'class="row_odd"'; else echo 'class="row_even"'; echo '>'; - echo ''.$row['question_id'].''; + echo ''.$row['question'].''; + echo ''.get_lang('NewScore').': '.$row['marks'].''; if(!empty($row['teacher_comment'])){ echo ''.get_lang('NewComment').': '.$row['teacher_comment'].''; } else { - echo ''.get_lang('NewScore').': '.$row['marks'].''; + echo ''.get_lang('WithoutComment').''; } + echo ''.$row['insert_date'].''; echo ''.(empty($row['full_name'])?''.get_lang('OriginalValue').'':$row['full_name']).''; diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php index ce23841959..c13616913b 100644 --- a/main/exercice/exercise.class.php +++ b/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 17296 2008-12-15 17:08:44Z cfasanando $ +* @version $Id: exercise.class.php 17311 2008-12-16 00:53:24Z cfasanando $ */ @@ -805,8 +805,10 @@ class Exercise $form -> addElement('select', 'exerciseAttempts',get_lang('ExerciseAttempts').' : ',$attempt_option); $form -> addElement('checkbox', 'enabletimelimit',null ,get_lang('EnableTimeLimits')); - $form -> addElement('date', 'start_time', get_lang('ExeStartTime'), array('language'=>'es','format' => 'dMYHi')); - $form -> addElement('date', 'end_time', get_lang('ExeEndTime'), array('language'=>'es','format' => 'dMYHi')); + //$form -> addElement('date', 'start_time', get_lang('ExeStartTime'), array('language'=>'es','format' => 'dMYHi')); + //$form -> addElement('date', 'end_time', get_lang('ExeEndTime'), array('language'=>'es','format' => 'dMYHi')); + $form->addElement('datepicker', 'start_time', get_lang('ExeStartTime'), array('form_name'=>'exercise_admin')); + $form->addElement('datepicker', 'end_time', get_lang('ExeEndTime'), array('form_name'=>'exercise_admin')); // Exercise attempts //$form -> addElement('text', 'exerciseAttempts', get_lang('ExerciseAttempts').' : ',array('size'=>'2')); @@ -819,9 +821,9 @@ class Exercise // rules $form -> addRule ('exerciseTitle', get_lang('GiveExerciseName'), 'required'); $form -> addRule ('exerciseAttempts', get_lang('Numeric'), 'numeric'); - $form -> addRule ('start_time', get_lang('DateNotValid'), 'errordate'); - $form -> addRule ('end_time', get_lang('DateNotValid'), 'errordate'); - $form -> addRule (array('start_time','end_time'), get_lang('StartDateMustNotBeGreaterThanEndDate'), 'comparedate'); + $form -> addRule ('start_time', get_lang('DateNotValid'), 'date'); + $form -> addRule ('end_time', get_lang('DateNotValid'), 'date'); + $form->addRule(array ('start_time', 'end_time'), get_lang('StartDateShouldBeBeforeEndDate'), 'date_compare', 'lte'); // defaults @@ -877,9 +879,9 @@ class Exercise if($form -> getSubmitValue('enabletimelimit')==1) { $start_time = $form -> getSubmitValue('start_time'); - $this->start_time = $start_time['Y'].'-'.$start_time['M'].'-'.$start_time['d'].' '.$start_time['H'].':'.$start_time['i'].':00'; + $this->start_time = $start_time['Y'].'-'.$start_time['F'].'-'.$start_time['d'].' '.$start_time['H'].':'.$start_time['i'].':00'; $end_time = $form -> getSubmitValue('end_time'); - $this->end_time = $end_time['Y'].'-'.$end_time['M'].'-'.$end_time['d'].' '.$end_time['H'].':'.$end_time['i'].':00'; + $this->end_time = $end_time['Y'].'-'.$end_time['F'].'-'.$end_time['d'].' '.$end_time['H'].':'.$end_time['i'].':00'; } else {