[svn r17307] logic changes - it show qualification of student - partial(FS#3249)

skala
Isaac Flores 16 years ago
parent 3363c5f613
commit e7ae63e1ac
  1. 28
      main/gradebook/gradebook_showlog_eval.php
  2. 28
      main/gradebook/gradebook_showlog_link.php
  3. 4
      main/gradebook/lib/fe/displaygradebook.php
  4. 7
      main/gradebook/lib/fe/gradebooktable.class.php
  5. 10
      main/gradebook/lib/flatview_data_generator.class.php
  6. 22
      main/gradebook/lib/scoredisplay.class.php

@ -43,28 +43,28 @@ $sql="SELECT le.name,le.description,le.date_log,le.weight,le.visible,le.type,us.
$result=api_sql_query($sql);
echo '<table width="100%" border="0" >';
echo '<tr>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('GradebookNameLog').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('GradebookDescriptionLog').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('Date').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('Weight').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('GradebookVisibilityLog').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('ResourceType').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('GradebookWhoChangedItLog').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookNameLog').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookDescriptionLog').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('Date').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('Weight').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookVisibilityLog').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('ResourceType').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookWhoChangedItLog').'</strong></td>';
echo '</tr>';
while($row=Database::fetch_array($result)) {
echo '<tr>';
echo '<td align="center" Class="Gradebook-table-body">'.$row[0].'</td>';
echo '<td align="center" class="Gradebook-table-body">'.$row[1].'</td>';
echo '<td align="center" class="Gradebook-table-body">'.date('d-m-Y H:i:s',$row[2]).'</td>';
echo '<td align="center" class="Gradebook-table-body">'.$row[3].'</td>';
echo '<td align="center" Class="gradebook-table-body">'.$row[0].'</td>';
echo '<td align="center" class="gradebook-table-body">'.$row[1].'</td>';
echo '<td align="center" class="gradebook-table-body">'.date('d-m-Y H:i:s',$row[2]).'</td>';
echo '<td align="center" class="gradebook-table-body">'.$row[3].'</td>';
if (1 == $row[4]) {
$visib=get_lang('GradebookVisible');
} else {
$visib=get_lang('GradebookInvisible');
}
echo '<td align="center" Class="Gradebook-table-body">'.$visib.'</td>';
echo '<td align="center" class="Gradebook-table-body">'.$row[5].'</td>';
echo '<td align="center" class="Gradebook-table-body">'.$row[6].'</td>';
echo '<td align="center" Class="gradebook-table-body">'.$visib.'</td>';
echo '<td align="center" class="gradebook-table-body">'.$row[5].'</td>';
echo '<td align="center" class="gradebook-table-body">'.$row[6].'</td>';
echo '</tr>';
}
echo '</table>';

@ -45,13 +45,13 @@ $sql="SELECT lk.name,lk.description,lk.date_log,lk.weight,lk.visible,lk.type,us.
$result=api_sql_query($sql);
echo '<table width="100%" border="0" >';
echo '<tr>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('GradebookNameLog').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('GradebookDescriptionLog').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('Date').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('Weight').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('GradebookVisibilityLog').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('ResourceType').'</strong></td>';
echo '<td align="center" class="Gradebook-table-header"><strong>'.get_lang('GradebookWhoChangedItLog').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookNameLog').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookDescriptionLog').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('Date').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('Weight').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookVisibilityLog').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('ResourceType').'</strong></td>';
echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookWhoChangedItLog').'</strong></td>';
echo '</tr>';
while($row=Database::fetch_array($result)){
@ -61,18 +61,18 @@ if ('0000-00-00 00:00:00'!=$row[2]) {
$date_log='0000-00-00 00:00:00';
}
echo '<tr>';
echo '<td align="center" Class="Gradebook-table-body">'.$row[0].'</td>';
echo '<td align="center" Class="Gradebook-table-body">'.$row[1].'</td>';
echo '<td align="center" Class="Gradebook-table-body">'.$date_log.'</td>';
echo '<td align="center" Class="Gradebook-table-body">'.$row[3].'</td>';
echo '<td align="center" Class="gradebook-table-body">'.$row[0].'</td>';
echo '<td align="center" Class="gradebook-table-body">'.$row[1].'</td>';
echo '<td align="center" Class="gradebook-table-body">'.$date_log.'</td>';
echo '<td align="center" Class="gradebook-table-body">'.$row[3].'</td>';
if (1 == $row[4]) {
$visib=get_lang('GradebookVisible');
} else {
$visib=get_lang('GradebookInvisible');
}
echo '<td align="center" Class="Gradebook-table-body">'.$visib.'</td>';
echo '<td align="center" Class="Gradebook-table-body">'.$row[5].'</td>';
echo '<td align="center" Class="Gradebook-table-body">'.$row[6].'</td>';
echo '<td align="center" Class="gradebook-table-body">'.$visib.'</td>';
echo '<td align="center" Class="gradebook-table-body">'.$row[5].'</td>';
echo '<td align="center" Class="gradebook-table-body">'.$row[6].'</td>';
echo '</tr>';
}
echo '</table>';

@ -208,8 +208,8 @@ class DisplayGradebook
for ($count=0; $count < count($evals_links); $count++) {
$item = $evals_links[$count];
$score = $item->calc_score($user_id);
$my_score_denom=($score[1]*$item->get_weight()==0) ? 1 : $score[1]*$item->get_weight();
$item_value+=$score[0]/$my_score_denom;
$my_score_denom=($score[1]==0) ? 1 : $score[1];
$item_value+=$score[0]/$my_score_denom*$item->get_weight();
$item_total+=$item->get_weight();
//$row[] = $scoredisplay->display_score($score,SCORE_DIV_PERCENT);
}

@ -27,7 +27,7 @@ require_once (dirname(__FILE__).'/../be.inc.php');
/**
* Table to display categories, evaluations and links
* @author Stijn Konings
* @author Bert Steppé (refactored, optimised)
* @author Bert Steppé (refactored, optimised)
*/
class GradebookTable extends SortableTable
{
@ -164,8 +164,9 @@ class GradebookTable extends SortableTable
for ($count=0; $count < count($evals_links); $count++) {
$item = $evals_links[$count];
$score = $item->calc_score($stud_id);
$score_denom=($score[1]*$item->get_weight()==0) ? 1 : $score[1]*$item->get_weight();
$item_value+=$score[0]/$score_denom;
$score_denom=($score[1]==0) ? 1 : $score[1];
$item_value+=$score[0]/$score_denom*$item->get_weight();
$item_total+=$item->get_weight();
}
$item_value = number_format($item_value, 2, '.', ' ');

@ -153,13 +153,11 @@ class FlatViewDataGenerator
$count++) {
$item = $this->evals_links [$count + $items_start];
$score = $item->calc_score($user[0]);
$divide=$score[1]*$item->get_weight();
if ($divide!=0) {
$item_value+=$score[0]/$divide;
}
$item_total+=$item->get_weight();
$divide=( ($score[1])==0 ) ? 1 : $score[1];
$item_value+=$score[0]/$divide*$item->get_weight();
$item_total+=$item->get_weight();
$row[] = $scoredisplay->display_score($score,SCORE_DIV_PERCENT);
}
}
$total_score=array($item_value,$item_total);
$row[] = $scoredisplay->display_score($total_score,SCORE_DIV_PERCENT);

@ -216,32 +216,30 @@ class ScoreDisplay
public function display_score($score,$type,$what = SCORE_BOTH) {
$type2 = $type & 7; // removes the 'SCORE_IGNORE_SPLIT' bit
$split_enabled = ($type2 == $type);
if (!isset($score)) {
return '';
} elseif ($this->custom_enabled && isset($this->custom_display_conv)) {
$my_score=($score==0) ? 1 : $score;
if ($this->custom_enabled && isset($this->custom_display_conv)) {
// students only see the custom display
if (!api_is_allowed_to_create_course()) {
$display = $this->display_custom($score);
$display = $this->display_custom($my_score);
}
// course/platform admins
elseif ($what == SCORE_ONLY_DEFAULT) {
$display = $this->display_default ($score, $type2);
$display = $this->display_default ($my_score, $type2);
}
elseif ($what == SCORE_ONLY_CUSTOM) {
$display = $this->display_custom ($score);
$display = $this->display_custom ($my_score);
} else {
$display = $this->display_default ($score, $type2)
.' ('.$this->display_custom ($score).')';
$display = $this->display_default ($my_score, $type2)
.' ('.$this->display_custom ($my_score).')';
}
} else {
// if no custom display set, use default display
$display = $this->display_default ($score, $type2);
$display = $this->display_default ($my_score, $type2);
}
return (($split_enabled ? $this->get_color_display_start_tag($score) : '')
return (($split_enabled ? $this->get_color_display_start_tag($my_score) : '')
. $display
. ($split_enabled ? $this->get_color_display_end_tag($score) : ''));
. ($split_enabled ? $this->get_color_display_end_tag($my_score) : ''));
}
// Internal functions

Loading…
Cancel
Save