diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index 97507676a2..907edde139 100755 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -778,7 +778,13 @@ if ($show == 'test') { //Showing exercise title $row['title']=text_filter($row['title']); - echo Display::tag('h1',$row['title']); + echo Display::tag('h1',$row['title']); + + if ($session_id == $row['session_id']) { + //Settings + //echo Display::url(Display::return_icon('settings.png',get_lang('Edit'), array('width'=>'22px'))." ".get_lang('Edit'), 'exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$row['id']); + } + echo '
'; echo $session_img; $exid = $row['id']; @@ -800,7 +806,7 @@ if ($show == 'test') { if ($session_id == $row['session_id']) { //Settings - echo Display::url(Display::return_icon('settings.png',get_lang('Edit'), array('width'=>'22px'))." ".get_lang('Edit'), 'exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$row['id']); + echo Display::url(Display::return_icon('edit.gif',get_lang('Edit'), array('width'=>'20px')), 'exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$row['id']); //Export echo Display::url(Display::return_icon('cd.gif', get_lang('CopyExercise')), '', array('onclick'=>"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToCopy'),ENT_QUOTES,$charset))." ".addslashes($row['title'])."?"."')) return false;",'href'=>'exercice.php?'.api_get_cidreq().'&choice=copy_exercise&sec_token='.$token.'&exerciseId='.$row['id'])); diff --git a/main/exercice/exercise.lib.php b/main/exercice/exercise.lib.php index 188fec91d2..0be1607b12 100755 --- a/main/exercice/exercise.lib.php +++ b/main/exercice/exercise.lib.php @@ -1015,7 +1015,8 @@ function get_exam_results_data($from, $number_of_items, $column, $direction) { $ex = show_score($my_res, $my_total); - $result_list = round(($my_res / ($my_total != 0 ? $my_total : 1)) * 100, 2) . '% (' . $my_res . ' / ' . $my_total . ') --> '.$ex; + //$result_list = round(($my_res / ($my_total != 0 ? $my_total : 1)) * 100, 2) . '% (' . $my_res . ' / ' . $my_total . ')'; + $result_list = $ex; $html_link = ''; if ($is_allowedToEdit || $is_tutor) { @@ -1105,5 +1106,26 @@ function show_score($score, $weight, $show_porcentage = true) { } +function convert_score($score, $weight) { + $html = ''; + $score_rounded = $score; + + if ($score != '' && $weight != '') { + $max_note = api_get_setting('exercise_max_score'); + $min_note = api_get_setting('exercise_min_score'); + if ($max_note != '' && $min_note != '') { + + if (!empty($weight)) { + + $score = $min_note + ($max_note - $min_note) * $score /$weight; + } else { + $score = $min_note; + } + $score_rounded = round($score, 2); + } + } + return $score_rounded; +} + diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php index 3672eb635c..6d8c04b47d 100755 --- a/main/exercice/exercise_show.php +++ b/main/exercice/exercise_show.php @@ -578,12 +578,13 @@ if ($show_results) { '; - //echo get_lang('Score')." : $my_total_score/$my_total_weight"; - echo get_lang('Score')." : ".show_score($my_total_score,$total_weighting,false); + echo get_lang('Score')." : $my_total_score/$my_total_weight"; + //echo get_lang('Score')." : ".show_score($my_total_score, $total_weighting, false); echo ''; unset($objAnswerTmp); diff --git a/main/newscorm/lp_stats.php b/main/newscorm/lp_stats.php index 57063c5dc3..0f5280d60b 100755 --- a/main/newscorm/lp_stats.php +++ b/main/newscorm/lp_stats.php @@ -14,6 +14,7 @@ require_once 'learnpath.class.php'; require_once 'resourcelinker.inc.php'; require_once api_get_path(LIBRARY_PATH).'tracking.lib.php'; require_once api_get_path(LIBRARY_PATH).'course.lib.php'; +require_once '../exercice/exercise.lib.php'; if (empty($_SESSION['_course']['id']) && isset($_GET['course'])) { $course_code = Security::remove_XSS($_GET['course']); @@ -285,7 +286,9 @@ if (is_array($list) && count($list) > 0) { if (!$is_allowed_to_edit && $result_disabled_ext_all) { $view_score = Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting')); } else { - $view_score = ($score == 0 ? '/' : ($maxscore === 0 ? $score : $score . '/' . float_format($maxscore, 1))); + //$view_score = ($score == 0 ? '/' : ($maxscore === 0 ? $score : $score . '/' . float_format($maxscore, 1))); + $view_score = show_score($score,$maxscore, false); + } $output .= "