From b5df80586deacabadc2f0802bcc606100e833d72 Mon Sep 17 00:00:00 2001 From: Patrick Cool Date: Wed, 12 Nov 2008 16:44:48 +0100 Subject: [PATCH] [svn r16726] first part of css cleanup (currently only the css/corporate style) --- main/dropbox/index.php | 15 +- main/exercice/admin.php | 18 +- main/exercice/exercice.php | 355 +++++++++------------- main/exercice/exercice_submit.php | 32 +- main/exercice/exercise.lib.php | 43 +-- main/exercice/multiple_answer.class.php | 36 ++- main/exercice/question.class.php | 84 ++--- main/exercice/question_list_admin.inc.php | 23 +- main/exercice/question_pool.php | 61 ++-- 9 files changed, 319 insertions(+), 348 deletions(-) diff --git a/main/dropbox/index.php b/main/dropbox/index.php index 9fd8c8907d..00dce3bb51 100644 --- a/main/dropbox/index.php +++ b/main/dropbox/index.php @@ -1,4 +1,5 @@ '; if ($view_dropbox_category_received<>0) { - echo get_lang('CurrentlySeeing').': '.$dropbox_categories[$view_dropbox_category_received]['cat_name'].'
'; + echo get_lang('CurrentlySeeing').': '.$dropbox_categories[$view_dropbox_category_received]['cat_name'].' '; echo ''.get_lang('up').''.get_lang('Root')."\n"; } echo ' '.get_lang('AddNewCategory').''; - + echo ''; // object initialisation $dropbox_person = new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor); // note: are the $is_courseAdmin and $is_courseTutor parameters needed???? @@ -467,14 +469,15 @@ if ($_GET['view']=='sent' OR $dropbox_cnf['sent_received_tabs']==false) } /* *** Menu Sent *** */ + echo '
'; if ($view_dropbox_category_sent<>0) { - echo get_lang('CurrentlySeeing').': '.$dropbox_categories[$view_dropbox_category_sent]['cat_name'].'
'; + echo get_lang('CurrentlySeeing').': '.$dropbox_categories[$view_dropbox_category_sent]['cat_name'].' '; echo ''.get_lang('Up').''.get_lang('Root')."\n"; } echo " ".get_lang('UploadNewFile')." \n"; echo " ".get_lang('AddNewCategory')."\n"; - + echo '
'; //echo '
'; // object initialisation diff --git a/main/exercice/admin.php b/main/exercice/admin.php index 3ba8fee7b5..0ec69085c6 100644 --- a/main/exercice/admin.php +++ b/main/exercice/admin.php @@ -1,9 +1,13 @@ -selectDescription(); -echo '

'.$objExercise->selectTitle().'

       --> '.get_lang('Preview').''; +echo '
'.$objExercise->selectTitle().'
'; if(!empty($description)) { - echo '
'.stripslashes($description).'
'; + echo '
'.stripslashes($description).'
'; } -echo '

'; + + +echo '
'; +echo Display::return_icon('search.gif').''.get_lang('Preview').''; +echo '
'; if($newQuestion || $editQuestion) diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index d765b1ea81..e71302efdf 100644 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -1,20 +1,27 @@ - - -'; if($_GET['delete']=='delete' && ($is_allowedToEdit || api_is_coach()) && !empty($_GET['did'])){ $sql='DELETE FROM '.Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES).' WHERE exe_id = '.(int)$_GET['did']; @@ -158,7 +144,7 @@ if ($show=='result' && $_REQUEST['comments']=='update' && ($is_allowedToEdit || $test = $_GET['test']; $from = $_SESSION['_user']['mail']; $from_name = $_SESSION['_user']['firstName']." ".$_SESSION['_user']['lastName']; - $url = api_get_path(WEB_CODE_PATH).'exercice/exercice.php?'.api_get_cidreq().'&show=result'; + $url = api_get_path(WEB_CODE_PATH).'exercice/exercice.php?'.api_get_cidreq().'&show=result'; foreach ($_POST as $key=>$v) { @@ -378,24 +364,14 @@ else echo ''; } -// used for stats -include_once(api_get_path(LIBRARY_PATH).'events.lib.inc.php'); +// tracking event_access_tool(TOOL_QUIZ); -Display::display_introduction_section(TOOL_QUIZ); - - -// selects $limitExPage exercises at the same time -$from=$page*$limitExPage; -$sql="SELECT count(id) FROM $TBL_EXERCICES"; -$res = api_sql_query($sql,__FILE__,__LINE__); -list($nbrexerc) = Database::fetch_array($res); - -HotPotGCt($documentPath,1,$_user['user_id']); - -// only for administrator +// display the introduction section +Display::display_introduction_section(TOOL_QUIZ,'left'); +// Action handling if($is_allowedToEdit) { @@ -492,40 +468,35 @@ if($is_allowedToEdit) break; } } +} + +// the actions +echo '
'; + // display the next and previous link if needed + $from=$page*$limitExPage; + $sql="SELECT count(id) FROM $TBL_EXERCICES"; + $res = api_sql_query($sql,__FILE__,__LINE__); + list($nbrexerc) = Database::fetch_array($res); + HotPotGCt($documentPath,1,$_user['user_id']); + // only for administrator + if($is_allowedToEdit) + { if($show == 'test') { $sql="SELECT id,title,type,active,description, results_disabled FROM $TBL_EXERCICES WHERE active<>'-1' ORDER BY title LIMIT ".(int)$from.",".(int)($limitExPage+1); $result=api_sql_query($sql,__FILE__,__LINE__); } -} -// only for students -elseif($show == 'test') -{ + } + // only for students + elseif($show == 'test') + { $sql="SELECT id,title,type,description, results_disabled FROM $TBL_EXERCICES WHERE active='1' ORDER BY title LIMIT ".(int)$from.",".(int)($limitExPage+1); $result=api_sql_query($sql,__FILE__,__LINE__); -} - - -if($show == 'test'){ - - $nbrExercises=Database::num_rows($result); - - echo ''. - ''; - - if (($is_allowedToEdit) and ($origin != 'learnpath')) - { - echo ''. - '', - '', - '
'. - 'new test '.get_lang('NewEx').''. - ' | HotPotatoes '.get_lang('ImportHotPotatoesQuiz').''. - ''; } - else + if($show == 'test') { - echo ''; - } + $nbrExercises=Database::num_rows($result); //get HotPotatoes files (active and inactive) $res = api_sql_query ("SELECT * @@ -544,38 +515,85 @@ if($show == 'test'){ if($is_allowedToEdit) {//if user is allowed to edit, also show hidden HP tests $nbrHpTests = $nbrTests; - }else + } + else { $nbrHpTests = $nbrActiveTests; } $nbrNextTests = $nbrexerc-$nbrHpTests-(($page*$limitExPage)); + echo ''; //show pages navigation link for previous page if($page) { - echo "<< ",get_lang("PreviousPage")." | "; + echo "".Display::return_icon('previous.gif').get_lang("PreviousPage")." | "; } elseif($nbrExercises+$nbrNextTests > $limitExPage) { - echo "<< ",get_lang("PreviousPage")." | "; + echo Display::return_icon('previous.gif').get_lang('PreviousPage')." | "; } //show pages navigation link for previous page if($nbrExercises+$nbrNextTests > $limitExPage) { - echo ">> ",get_lang("NextPage").""; + echo "".get_lang("NextPage").Display::return_icon('next.gif').""; } elseif($page) { - echo get_lang("NextPage") . " >>"; + echo get_lang("NextPage") . Display::return_icon('next.gif'); + } + echo ''; } - echo '
'; + if (($is_allowedToEdit) and ($origin != 'learnpath')) + { + echo ''.Display::return_icon('new_test.gif',get_lang('NewEx')).get_lang('NewEx').''; + echo ''.Display::return_icon('jqz.jpg',get_lang('ImportHotPotatoesQuiz')).get_lang('ImportHotPotatoesQuiz').''; + echo ''.Display::return_icon('show_test_results.gif',get_lang('ImportHotPotatoesQuiz')).get_lang("Results").''; + // the actions for the statistics + if($show == 'result') + { + // the form + if(api_is_platform_admin() || api_is_course_admin() || api_is_course_tutor() || api_is_course_coach()) + { + if($_SESSION['export_user_fields']==false) + { + $alt = get_lang('ExportWithUserFields'); + $extra_user_fields = ''; + } + else + { + $alt = get_lang('ExportWithoutUserFields'); + $extra_user_fields = ''; + } + echo ''.Display::return_icon('excel.gif',get_lang('ExportAsCSV')).get_lang('ExportAsCSV').''; + echo ''.Display::return_icon('excel.gif',get_lang('ExportAsXLS')).get_lang('ExportAsXLS').''; + echo ''.Display::return_icon('synthese_view.gif',$alt).$alt.''; + echo ''.Display::return_icon('quiz.gif').get_lang('BackToExercisesList').''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
'; + echo ''; + echo ''; + echo '
'; + echo '
'; + echo $extra_user_fields; + echo '
'; + + } + } + } +echo '
'; // closing the actions div + ?> + + - + @@ -593,8 +611,8 @@ if($show == 'test'){ } else { - ?> - + ?> + @@ -606,7 +624,7 @@ if($show == 'test'){ { ?> - + '."\n"; + // prof only if($is_allowedToEdit) { + echo ''."\n"; ?> - - + '; - echo ''; + echo ''; ?> - "; echo "\n"; @@ -684,23 +697,18 @@ if($show == 'test'){ else { ?> - - + + echo ($rowi>1?get_lang('Questions'):get_lang('Question')); ?> - - - - '; + echo ''; } // skips the last exercise, that is only used to know if we have or not to create a link "Next page" @@ -811,27 +817,27 @@ if($show == 'test'){ - +
>>
- - - - + + - - -
- > -
-
>1?'Questions':'Question'))).' - <?php echo htmlentities(get_lang('Modify'),ENT_QUOTES,$charset); ?> + + <?php echo htmlentities(get_lang('Modify'),ENT_QUOTES,$charset); ?> <?php echo htmlentities(get_lang('Build'),ENT_QUOTES,$charset); ?> - ')) return false;"> <?php echo htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?> + ')) return false;"> <?php echo htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?> - <?php echo htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?> + <?php echo htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?> - <?php echo htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?> + <?php echo htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?> '.htmlentities(get_lang('EnableResults'),ENT_QUOTES,$charset).''; + echo ''.htmlentities(get_lang('EnableResults'),ENT_QUOTES,$charset).''; else - echo ''.htmlentities(get_lang('DisableResults'),ENT_QUOTES,$charset).''; + echo ''.htmlentities(get_lang('DisableResults'),ENT_QUOTES,$charset).''; + */ echo "
- - - + + - - - -
 
1?get_lang('Questions'):get_lang('Question')); ?>
HotPotatoes >>
<?php echo htmlentities(get_lang('Modify'),ENT_QUOTES,$charset); ?> <?php echo htmlentities(get_lang('Build'),ENT_QUOTES,$charset); ?> - ')) return false;"><?php echo htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?> + ')) return false;"><?php echo htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?> - <?php echo htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?> + <?php echo htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?> - <?php echo htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?> + <?php echo htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?> '; @@ -849,7 +855,7 @@ if($show == 'test'){   - "> + "> @@ -882,11 +888,7 @@ if($show == 'test'){ ?> << '.get_lang('Back').''; - } -}// end if($show == 'test') +} /*****************************************/ /* Exercise Results (uses tracking tool) */ @@ -896,72 +898,16 @@ if($show == 'test'){ if($_configuration['tracking_enabled']) { -function convert_date_to_number($default){ - // 2008-10-12 00:00:00 ---to--> 12345672218 (timestamp) - $parts = split(' ',$default); - list($d_year,$d_month,$d_day) = split('-',$parts[0]); - list($d_hour,$d_minute,$d_second) = split(':',$parts[1]); - return mktime($d_hour, $d_minute, $d_second, $d_month, $d_day, $d_year); -} - -function format_date_result($date){ - if($date == '0000-00-00 00:00:00') return getlang('NoDate'); - return substr($date,8,2).'-'.substr($date,5,2).'-'.substr($date,0,4).' '.substr($date,11,2).':'.substr($date,14,4); -} - if($show == 'result') { - // the form - if(api_is_platform_admin() || api_is_course_admin() || api_is_course_tutor() || api_is_course_coach()) - { - echo '
'; - echo ''; - echo ''; - echo '
'; - echo '
'; - echo ''; - echo ''; - echo '
'; - echo '
'; - if($_SESSION['export_user_fields']==false) - { - $alt = get_lang('ExportWithUserFields'); - echo ''; - } - else - { - $alt = get_lang('ExportWithoutUserFields'); - echo ''; - } - echo '
'; - echo ''.get_lang('ExportAsCSV').' '.get_lang('ExportAsCSV').''; - echo ''.get_lang('ExportAsXLS').' '.get_lang('ExportAsXLS').''; - echo ''.$alt.' '.$alt.''; - echo '

'; - } - - $order_like = (int)$_GET['direction']; - if($order_like != 0 && $order_like != 1) $order_like = 0; - $new_orientation = $order_like ^ 1; - $orientation = array(); - $orientation[0] = 'ASC'; // default order - $orientation[1] = 'DESC'; - $ordering = $orientation[$order_like]; - - $main_url = $_SESSION['checkDokeosURL'].'main/exercice/exercice.php?'.api_get_cidreq().'&show=result&'; - $urlusername = $main_url.'column=username&direction='.(($_GET['column']=='username') ? $new_orientation : 0); - $urlexercisename = $main_url.'column=exercisename&direction='.(($_GET['column']=='exercisename') ? $new_orientation : 0); - $urldate = $main_url.'column=date&direction='.(($_GET['column']=='date') ? $new_orientation : 0); -?> + ?> - - - - - + + + @@ -1148,12 +1094,7 @@ function format_date_result($date){
 '.get_lang("Results").' >>

'; - - }// end if($show == 'result') - + } }// end if tracking is enabled if ($origin != 'learnpath') { //so we are not in learnpath tool diff --git a/main/exercice/exercice_submit.php b/main/exercice/exercice_submit.php index 74488e530f..9c438fa0f7 100644 --- a/main/exercice/exercice_submit.php +++ b/main/exercice/exercice_submit.php @@ -1,9 +1,13 @@ - - - - - - - -
- "; + "; echo $s; $i=0; @@ -1026,11 +1027,9 @@ else } } - $s=" - -
- ".get_lang('Question')." "; + $s="
".get_lang('Question')." "; $s.=$i.' : '; + //$s.='
'; if($exerciseType == 2) $s.=' / '.$nbrQuestions.' '; echo $s; @@ -1046,12 +1045,7 @@ else } } // end foreach() - $s="
-
- '; - $s.="
"; + $s.=""; $b=2; echo $s; diff --git a/main/exercice/exercise.lib.php b/main/exercice/exercise.lib.php index f39a610f1a..626a6507df 100644 --- a/main/exercice/exercise.lib.php +++ b/main/exercice/exercise.lib.php @@ -1,29 +1,35 @@ - -* @version $Id: exercise.lib.php 15602 2008-06-18 08:52:24Z pcool $ +* @version $Id: exercise.lib.php 16726 2008-11-12 15:44:48Z pcool $ */ @@ -49,9 +55,8 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false) $questionDescription=$objQuestionTmp->selectDescription(); $questionName=api_parse_tex($questionName); - $s.=$questionName; - $s.=" - + $s.=$questionName.''; + $s.=""; + echo "
"; @@ -436,7 +441,7 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false) echo $s; } - echo "
 
 
"; return $nbrAnswers; } diff --git a/main/exercice/multiple_answer.class.php b/main/exercice/multiple_answer.class.php index 82e4bca1a4..2e4da4d70d 100644 --- a/main/exercice/multiple_answer.class.php +++ b/main/exercice/multiple_answer.class.php @@ -1,22 +1,28 @@ -addElement('text', null,null,'value="'.$i.'"'); $answer_number->freeze(); - $form->addElement('checkbox', 'correct['.$i.']', null, null, 'style="margin-left: 0em;"'); + $form->addElement('checkbox', 'correct['.$i.']', null, null, 'class="checkbox" style="margin-left: 0em;"'); $boxes_names[] = 'correct['.$i.']'; $form->addElement('html_editor', 'answer['.$i.']',null, 'style="vertical-align:middle"'); diff --git a/main/exercice/question.class.php b/main/exercice/question.class.php index 6a16ce8258..1c39d72bf0 100644 --- a/main/exercice/question.class.php +++ b/main/exercice/question.class.php @@ -1,28 +1,34 @@ -'.get_lang('AddQ').' :
'; + //echo ''.get_lang('AddQ').' :
'; foreach(self::$questionTypes as $i=>$a_type) { @@ -865,32 +871,30 @@ abstract class Question eval('$img = '.$a_type[1].'::$typePicture;'); eval('$explanation = get_lang('.$a_type[1].'::$explanationLangVar);'); - echo ' - '; + //echo ''; } - echo ' - -
-
'; + //echo ''; + //echo '
'; + //echo '
'; } } diff --git a/main/exercice/question_list_admin.inc.php b/main/exercice/question_list_admin.inc.php index cc2a8df4d2..321c67929b 100644 --- a/main/exercice/question_list_admin.inc.php +++ b/main/exercice/question_list_admin.inc.php @@ -1,9 +1,13 @@ -'; Question :: display_type_menu (); +echo ''; ?> - - - - - + + + + + + -

- -

+

- - -
- - - + + +
- : + + : + -
', '', '', '', ''; } - echo '
'; - if(!empty($fromExercise)) - { - echo '<<',get_lang('GoBackToEx'),''; - } - else - { - echo '',get_lang('NewQu'),''; - } echo ''; @@ -296,8 +302,7 @@ if($is_allowedToEdit) '',get_lang('NoQuestion'),'
', - ''; + echo ''; Display::display_footer(); } // if not admin of course