From b4d5cca6a0611de2f558ea9172f972139619a87b Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Thu, 7 Jan 2010 17:08:54 -0500 Subject: [PATCH 1/3] Updated the document exercise with a new kind of question CT#451 --- tests/procedures/spanish/tests.xls | Bin 49664 -> 52736 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/procedures/spanish/tests.xls b/tests/procedures/spanish/tests.xls index 4c3e173d50831715827d8a8c8dbd6a4d95a2398e..246119b2e18d21b52812f02245bfa3fbf77b9c27 100644 GIT binary patch delta 4534 zcmb_eeQ=cJ5#Q&IDB;6kt=LRReAAiZye1SA4Z;8|6wzTM1O!T>fF8*i50hNThkzCj zKhUDK3M-$QkPt%>%m>LU0z#-vX=jiR+ae?Blt2g}5ISQS|EbIby1VzhZ!X7minYl+ zd-v@7+x_kCv-{k;`Zee351jAbKRg%o-v|J2%j6X2m?ufGkk%qvi)lSY>uFloZ``=S zD@T9#@#nfZ&$SNv^N^ps@)GS}Fg)Tb^XKRL($>HTF!v77rL%7Hr+Dp-_hLpWfHo83 zMj6U5ca80hRmbrC32hlUfdXG)skhi4C^2#ag}J^Xpo$;>x!{8W`YZthyl|CPF8HCC zc4bhAKTEnN(GZLQj4p;{r1#NNA6b-w7n3L59SrRZ$R}$9as*dQh#W?cCP3?EYYXp( z!YDTP!94O%NQ-0PZ|s@53$<4(l9D6}*ba!kd4<>y&r331{O1o6V@DaYB#g)LPl?IN ziH1RLIII$KXy^iz5|vk0A&yH*c6h){o9J|?w=rY#k1@|P`u2QEkpeK^oIKg7PH6~EPy2xXrUaxAHI=};qDF{G9O$H{aa58;2IrfDea5oP`M>a`EY4P={OvelzcCH zTSAMQjs4}3HDg14AHao4$-&6(=eb%*G4-E~RnB~}&J%AmX#)^?w#bGv3ibZVejbXG z8#TP;3uvFu2%kJC;^8G&8SVO0=3WmO-cQhP!~q-eoa9phITcQk1I&|NwBC_?ze9FQ7sV{$H;eJrD+r zGXD30;DhAJj_$)ctZ0`G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6=5% zSg^Dw#b_dICbQfbP3dfe(phfmC{*>x^ceJGtbtLC9!TtEHrZHU&+fZ`O~~p^v6u)O zV@!ESD94lYLV5hjpXX1W4F<+Ok5$re5Cm4CPkvbN0&mtZchmshUc&|xVPk;RxuA7$ zF#>;)Tm^2@^}gA(4gN&cc92fW^fLXm8-Cd?W!qtPT z&@;myN?~K}8b1TC(7&dg)sI0O+&q~;yWkG`@xdcs$_v>|Wp1u(=o>*acW{HNvYW|p zH(+?+s2*Q-c-22^$_TPBk1p|B4CD>YQxExHrU(25Q>P=1@96@&*@Fh$?WXr{so8_g z6e Date: Thu, 7 Jan 2010 17:14:15 -0500 Subject: [PATCH 2/3] fixed export css from results of exercises - partial CT#462 --- main/exercice/exercice.php | 14 ++- main/exercice/exercise_result.class.php | 120 ++++++++++++++++-------- 2 files changed, 89 insertions(+), 45 deletions(-) diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index 796859b7f8..022e596395 100755 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -471,7 +471,7 @@ if (!empty ($_POST['export_report']) && $_POST['export_report'] == 'export_repor switch ($_POST['export_format']) { case 'xls' : $export = new ExerciseResult(); - $export->exportCompleteReportXLS($documentPath, $user_id, $_SESSION['export_user_fields']); + $export->exportCompleteReportXLS($documentPath, $user_id, $_SESSION['export_user_fields'], $_POST['export_filter']); exit; break; case 'csv' : @@ -795,9 +795,11 @@ if (($is_allowedToEdit) and ($origin != 'learnpath')) { echo '
'; echo ''; echo ''; + echo ''; echo '
'; echo '
'; echo ''; + echo ''; echo ''; echo '
'; //echo '
'; @@ -1130,12 +1132,8 @@ if ($_configuration['tracking_enabled'] && ($show == 'result')) { --> $_user['user_id'] clause has been removed + $sql="SELECT ".(api_is_western_name_order() ? "CONCAT(firstname,' ',lastname)" : "CONCAT(lastname,' ',firstname)").", ce.title, te.exe_result , - te.exe_weighting, UNIX_TIMESTAMP(te.exe_date),te.exe_id, user.email, user.user_id - FROM $TBL_EXERCISES ce , $TBL_TRACK_EXERCISES te, $TBL_USER user - WHERE te.exe_exo_id = ce.id AND user_id=te.exe_user_id AND te.exe_cours_id='$cid' - ORDER BY te.exe_cours_id ASC, ce.title ASC, te.exe_date ASC"; + te.exe_weighting, UNIX_TIMESTAMP(te.exe_date), te.exe_id, user.email, user.user_id + FROM $TBL_EXERCISES AS ce , $TBL_TRACK_EXERCISES AS te, $TBL_USER AS user,$TBL_COURSE_REL_USER AS cuser + WHERE user.user_id=cuser.user_id AND te.exe_exo_id = ce.id AND te.status != 'incomplete' AND cuser.user_id=te.exe_user_id AND te.exe_cours_id='" . Database :: escape_string($cid) . "' + AND cuser.status<>1 $session_id_and AND ce.active <>-1 AND orig_lp_id = 0 AND orig_lp_item_id = 0 + AND cuser.course_code=te.exe_cours_id ORDER BY te.exe_cours_id ASC, ce.title ASC, te.exe_date ASC"; $hpsql="SELECT ".(api_is_western_name_order() ? "CONCAT(tu.firstname,' ',tu.lastname)" : "CONCAT(tu.lastname,' ',tu.firstname)").", tth.exe_name, - tth.exe_result , tth.exe_weighting, UNIX_TIMESTAMP(tth.exe_date), tu.email, tu.user_id - FROM $TBL_TRACK_HOTPOTATOES tth, $TBL_USER tu - WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = '".$cid."' - ORDER BY tth.exe_cours_id ASC, tth.exe_date ASC"; - + tth.exe_result , tth.exe_weighting, UNIX_TIMESTAMP(tth.exe_date), tu.email, tu.user_id + FROM $TBL_TRACK_HOTPOTATOES tth, $TBL_USER tu + WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = '" . Database :: escape_string($cid) . " $user_id_and ' + ORDER BY tth.exe_cours_id ASC, tth.exe_date ASC"; + + } else { // get only this user's results - $sql="SELECT '',ce.title, te.exe_result , te.exe_weighting, " . - "UNIX_TIMESTAMP(te.exe_date),te.exe_id - FROM $TBL_EXERCISES ce , $TBL_TRACK_EXERCISES te - WHERE te.exe_exo_id = ce.id AND te.exe_user_id='".Database::escape_string($user_id)."' AND te.exe_cours_id='".Database::escape_string($cid)."' - ORDER BY te.exe_cours_id ASC, ce.title ASC, te.exe_date ASC"; - $hpsql="SELECT '',exe_name, exe_result , exe_weighting, UNIX_TIMESTAMP(exe_date) - FROM $TBL_TRACK_HOTPOTATOES - WHERE exe_user_id = '".Database::escape_string($user_id)."' AND exe_cours_id = '".Database::escape_string($cid)."' - ORDER BY exe_cours_id ASC, exe_date ASC"; + $sql="SELECT '', ce.title, te.exe_result , + te.exe_weighting, UNIX_TIMESTAMP(te.exe_date), te.exe_id + FROM $TBL_EXERCISES AS ce , $TBL_TRACK_EXERCISES AS te, $TBL_USER AS user,$TBL_COURSE_REL_USER AS cuser + WHERE user.user_id=cuser.user_id AND te.exe_exo_id = ce.id AND te.status != 'incomplete' AND cuser.user_id=te.exe_user_id AND te.exe_cours_id='" . Database :: escape_string($cid) . "' + AND cuser.status<>1 AND te.exe_user_id='".Database::escape_string($user_id)."' $session_id_and AND ce.active <>-1 AND orig_lp_id = 0 AND orig_lp_item_id = 0 + AND cuser.course_code=te.exe_cours_id ORDER BY te.exe_cours_id ASC, ce.title ASC, te.exe_date DESC"; + + $hpsql = "SELECT '',exe_name, exe_result , exe_weighting, UNIX_TIMESTAMP(exe_date) + FROM $TBL_TRACK_HOTPOTATOES + WHERE exe_user_id = '" . $user_id . "' AND exe_cours_id = '" . Database :: escape_string($cid) . "' + ORDER BY exe_cours_id ASC, exe_date DESC"; } @@ -160,12 +166,36 @@ class ExerciseResult $NoTestRes = 0; $NoHPTestRes = 0; - $j=0; + $j=0; + + if ($filter) { + switch ($filter) { + case 1 : + $filter_by_not_revised = true; + break; + case 2 : + $filter_by_revised = true; + break; + default : + null; + } + } + //Print the results of tests if(is_array($results)) { for($i = 0; $i < sizeof($results); $i++) { + + $revised = false; + $sql_exe = 'SELECT exe_id FROM ' . Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING) . ' + WHERE author != ' . "''" . ' AND exe_id = ' . "'" . Database :: escape_string($results[$i][5]) . "'" . ' LIMIT 1'; + $query = Database::query($sql_exe, __FILE__, __LINE__); + + if (Database :: num_rows($query) > 0) $revised = true; + if ($filter_by_not_revised && $revised == true) continue; + if ($filter_by_revised && $revised == false) continue; + $return[$i] = array(); $id = $results[$i][5]; $mailid = $results[$i][6]; @@ -210,7 +240,7 @@ class ExerciseResult $return[$j+$i]['max'] = $hpresults[$i][3]; } } - $this->results = $return; + $this->results = $return; return true; } /** @@ -220,10 +250,10 @@ class ExerciseResult * @param boolean Whether to include user fields or not * @return boolean False on error */ - public function exportCompleteReportCSV($document_path='',$user_id=null, $export_user_fields) + public function exportCompleteReportCSV($document_path='',$user_id=null, $export_user_fields = array(), $export_filter = 0) { global $charset; - $this->_getExercisesReporting($document_path,$user_id); + $this->_getExercisesReporting($document_path,$user_id,$export_filter); $filename = 'exercise_results_'.date('YmdGis').'.csv'; if(!empty($user_id)) { @@ -302,10 +332,10 @@ class ExerciseResult * Exports the complete report as an XLS file * @return boolean False on error */ - public function exportCompleteReportXLS($document_path='',$user_id=null, $export_user_fields) + public function exportCompleteReportXLS($document_path='',$user_id=null, $export_user_fields=array(), $export_filter = 0) { global $charset; - $this->_getExercisesReporting($document_path,$user_id); + $this->_getExercisesReporting($document_path,$user_id,$export_filter); $filename = 'exercise_results_'.date('YmdGis').'.xls'; if(!empty($user_id)) { @@ -317,11 +347,23 @@ class ExerciseResult $worksheet =& $workbook->addWorksheet('Report '.date('YmdGis')); $line = 0; $column = 0; //skip the first column (row titles) - if(!empty($this->results[0]['user'])) - { - $worksheet->write($line,$column,get_lang('User')); - $column++; + + // check if exists column 'user' + $with_column_user = false; + foreach ($this->results as $result) { + if (!empty($result['user'])) { + $with_column_user = true; + break; + } + } + + if($with_column_user) { + $worksheet->write($line,$column,get_lang('User')); + $column++; } + + $export_user_fields = true; + if($export_user_fields) { //show user fields section with a big th colspan that spans over all fields @@ -350,12 +392,16 @@ class ExerciseResult $worksheet->write($line,$column,api_html_entity_decode(strip_tags($row['user']), ENT_QUOTES, $charset)); $column++; } - //show user fields data, if any, for this user - $user_fields_values = UserManager::get_extra_user_data(intval($row['user_id']),false,false); - foreach($user_fields_values as $value) - { - $worksheet->write($line,$column,api_html_entity_decode(strip_tags($value), ENT_QUOTES, $charset)); - $column++; + + if($export_user_fields) + { + //show user fields data, if any, for this user + $user_fields_values = UserManager::get_extra_user_data(intval($row['user_id']),false,false); + foreach($user_fields_values as $value) + { + $worksheet->write($line,$column,api_html_entity_decode(strip_tags($value), ENT_QUOTES, $charset)); + $column++; + } } $worksheet->write($line,$column,api_html_entity_decode(strip_tags($row['title']), ENT_QUOTES, $charset)); $column++; From 97cbfb55fded3d9c1b730d7cd9478802d8ebfc8f Mon Sep 17 00:00:00 2001 From: Carlos Vargas Date: Thu, 7 Jan 2010 17:19:02 -0500 Subject: [PATCH 3/3] Update change log --- documentation/changelog.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/documentation/changelog.html b/documentation/changelog.html index cf1aa68b48..c17733fcef 100755 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -98,6 +98,13 @@ + +
  • Exercises tool +
      +
    • If the option is selected glossary terms shows the tools lessons (SCORM) and exercises, in the description of exercise may see terms that may be responses to the question
    • +
    +
  • +

    Dokeos 1.8.6.1 - August 2009