Fixed bug by which certificates were not always showing the right score although the students did succeed to the evaluation tests (fixes #2342)

skala
ywarnier 14 years ago
parent 53aca7d468
commit f7f581f04b
  1. 5
      main/exercice/exercice.php
  2. 2
      main/gradebook/gradebook_flatview.php
  3. 9
      main/gradebook/index.php

@ -654,7 +654,7 @@ if ($show == 'test') {
if ($show == 'test') {
?>
<script>
<script type="text/javascript">
$(function() {
/*
@ -665,7 +665,7 @@ if ($show == 'test') {
*/
});
</script>
<style>
<style type="text/css">
/*
New interface not yet ready for 1.8.8
Vertical Tabs
@ -895,6 +895,7 @@ if ($show == 'test') {
}
//This query might be improved later on by ordering by the new "tms" field rather than by exe_id
//Don't remove this marker: note-query-exe-results
$qry = "SELECT * FROM $TBL_TRACK_EXERCICES
WHERE exe_exo_id = ".$row['id']." AND exe_user_id = " . api_get_user_id() . " AND exe_cours_id = '" . api_get_course_id() . "' AND status <>'incomplete' AND orig_lp_id = 0 AND orig_lp_item_id = 0 AND session_id = '" . api_get_session_id() . "'
ORDER BY exe_id DESC";

@ -283,7 +283,7 @@ if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') {
if (strlen($my_info_path_img[5]) == 32) {
echo '<img src="'.$image_file.'">';
}
$flatviewtable->display();
$flatviewtable->display();
$flatviewtable->display_graph_by_resource();
echo '</div>';
}

@ -857,11 +857,12 @@ if ($category != '0') {
//Do not remove this the gradebook/lib/fe/gradebooktable.class.php file load this variable as a global
$my_score_in_gradebook = round($scoretotal[0],2);
//Show certificate
$certificate_min_score=$cats[0]->get_certificate_min_score();
//Show certificate
$certificate_min_score=$cats[0]->get_certificate_min_score();
$scoredisplay = ScoreDisplay :: instance();
$scoretotal_display = $scoredisplay->display_score($scoretotal,SCORE_DIV_PERCENT);
if (isset($certificate_min_score) && (int)$item_value >= (int)$certificate_min_score) {
$scoretotal_display = $scoredisplay->display_score($scoretotal,SCORE_DIV_PERCENT); //a student always sees only the teacher's repartition
//$score_compare = ($scoretotal[0] / $scoretotal[1]) * 100; //build the total percentage obtained in order to compare it to the minimum certification percentage
if (isset($certificate_min_score) && $item_value >= $certificate_min_score) {
$url = api_get_path(WEB_CODE_PATH) .'gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']).'?export_certificate=yes&cat_id='.$cats[0]->get_id();
//$certificates.= '<img src="'.api_get_path(WEB_CODE_PATH) . 'img/logo.gif" />'.get_lang('Certificates').'</a>&nbsp;<strong>'.get_lang('Total').': '.$scoretotal_display.'</strong>';
$certificates = Display::url(Display::return_icon('certificate.png', get_lang('Certificates'), array(), 48), $url, array('target'=>'_blank'));

Loading…
Cancel
Save