[svn r18547] Logic changes - Fixed average score in tests into course tracking - see FS#3510

skala
Cristian Fasanando 16 years ago
parent 1b3cbb22d9
commit 4c03c4d0de
  1. 6
      main/mySpace/myStudents.php
  2. 17
      main/tracking/courseLog.php

@ -1,4 +1,4 @@
<?php //$Id: myStudents.php 18520 2009-02-16 17:14:35Z juliomontoya $
<?php //$Id: myStudents.php 18547 2009-02-17 16:16:55Z cfasanando $
/* For licensing terms, see /dokeos_license.txt */
/**
* Implements the tracking of students in the Reporting pages
@ -644,7 +644,9 @@ if(!empty($_GET['student']))
//QUIZZ IN LP
$score = Tracking::get_avg_student_score(intval($_GET['student']), Database::escape_string($_GET['course']), array($a_learnpath['id']));
if (empty($score)) {
$score = 0;
}
if($i%2==0){
$s_css_class="row_odd";
}

@ -211,7 +211,7 @@ if($_GET['studentlist'] == 'false') {
***************************/
echo '<div class="admin_section">
<h4>
<img src="../img/quiz.gif" align="absbottom">&nbsp;'.get_lang('AverageResultsToTheExercices').' <a href="../exercice/exercice.php?'.api_get_cidreq().'&show=result">'.get_lang('SeeDetail').'</a>
<img src="../img/quiz.gif" align="absbottom">&nbsp;'.get_lang('AverageResultsToTheExercices').' &nbsp;-&nbsp;<a href="../exercice/exercice.php?'.api_get_cidreq().'&show=result">'.get_lang('SeeDetail').'</a>
</h4>
<table class="data_table">';
@ -226,6 +226,16 @@ if($_GET['studentlist'] == 'false') {
}
if (Database::num_rows($rs)>0) {
// gets course actual administrators
$sql = "SELECT user.user_id FROM $table_user user, $TABLECOURSUSER course_user
WHERE course_user.user_id=user.user_id AND course_user.course_code='".api_get_course_id()."' AND course_user.status='1'";
$res = api_sql_query($sql,__FILE__,__LINE__);
$admin_course = '';
while($row = Database::fetch_row($res)) {
$admin_course .='\''.$row[0].'\',';
}
$admin_course = substr($admin_course,0,(strlen($admin_course)-1));
$cond_user = (!empty($admin_course)?' AND exe_user_id NOT IN('.$admin_course.')':' ');
while($quiz = Database::fetch_array($rs)) {
$quiz_avg_score = 0;
@ -233,6 +243,7 @@ if($_GET['studentlist'] == 'false') {
$sql = 'SELECT exe_result , exe_weighting
FROM '.$TABLETRACK_EXERCISES.'
WHERE exe_exo_id = '.$quiz['id'].'
'.$cond_user.'
AND orig_lp_id = 0
AND orig_lp_item_id = 0
ORDER BY exe_date DESC';
@ -248,7 +259,7 @@ if($_GET['studentlist'] == 'false') {
if($nb_attempts>0) {
$quiz_avg_score = $quiz_avg_score / $nb_attempts;
}
echo '<tr><td>'.$quiz['title'].'</td><td align="right">'.round($quiz_avg_score,1).' %</td></tr>';
echo '<tr><td>'.$quiz['title'].'</td><td align="right">'.round($quiz_avg_score,2).' %</td></tr>';
if ($export_csv) {
$temp=array($quiz['title'],$quiz_avg_score);
$csv_content[] = $temp;
@ -271,7 +282,7 @@ if($_GET['studentlist'] == 'false') {
echo '<div class="admin_section">
<h4>
<img src="../img/forum.gif" align="absbottom">&nbsp;'.get_lang('Forum').' <a href="../forum/index.php?cidReq='.$_course['id'].'">'.get_lang('SeeDetail').'</a>
<img src="../img/forum.gif" align="absbottom">&nbsp;'.get_lang('Forum').'&nbsp;-&nbsp;<a href="../forum/index.php?cidReq='.$_course['id'].'">'.get_lang('SeeDetail').'</a>
</h4>
<table class="data_table">';
$count_number_of_posts_by_course = Tracking :: count_number_of_posts_by_course($_course['id']);

Loading…
Cancel
Save