Gradebook tool, corrections about an author's name.

skala
Ivan Tcholakov 15 years ago
parent 01368d1d6b
commit ecb0e2c57d
  1. 4
      main/gradebook/lib/fe/flatviewtable.class.php
  2. 2
      main/gradebook/lib/fe/linkaddeditform.class.php
  3. 2
      main/gradebook/lib/fe/linkform.class.php
  4. 2
      main/gradebook/lib/fe/scoredisplayform.class.php
  5. 2
      main/gradebook/lib/fe/usertable.class.php
  6. 4
      main/gradebook/lib/gradebook_functions_users.inc.php
  7. 26
      main/gradebook/lib/scoredisplay.class.php

@ -8,7 +8,7 @@ define ('LIMIT',10);
/**
* Table to display flat view (all evaluations and links for all students)
* @author Stijn Konings
* @author Bert Stepp<EFBFBD> (refactored, optimised)
* @author Bert Steppé (refactored, optimised)
* @author Julio Montoya Armas Gradebook Graphics
*/
class FlatViewTable extends SortableTable
@ -24,7 +24,7 @@ class FlatViewTable extends SortableTable
function FlatViewTable ($selectcat, $users= array (), $evals= array (), $links= array (), $limit_enabled = false, $offset = 0, $addparams = null) {
parent :: __construct ('flatviewlist', null, null, (api_is_western_name_order() xor api_sort_by_first_name()) ? 1 : 0);
$this->datagen = new FlatViewDataGenerator($users, $evals, $links);
$this->selectcat = $selectcat;
$this->limit_enabled = $limit_enabled;
$this->offset = $offset;

@ -9,7 +9,7 @@ require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.ph
/**
* Form used to add or edit links
* @author Stijn Konings
* @author Bert Stepp<EFBFBD>
* @author Bert Steppé
*/
class LinkAddEditForm extends FormValidator
{

@ -9,7 +9,7 @@ require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.ph
/**
* Forms related to links
* @author Stijn Konings
* @author Bert Stepp<EFBFBD> (made more generic)
* @author Bert Steppé (made more generic)
* @package dokeos.gradebook
*/
class LinkForm extends FormValidator

@ -7,7 +7,7 @@ require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.ph
/**
* Form for the score display dialog
* @author Stijn Konings
* @author Bert Stepp<EFBFBD>
* @author Bert Steppé
* @package dokeos.gradebook
*/
class ScoreDisplayForm extends FormValidator

@ -6,7 +6,7 @@ require_once (dirname(__FILE__).'/../be.inc.php');
/**
* Table to display flat view of a student's evaluations and links
* @author Stijn Konings
* @author Bert Stepp<EFBFBD> (refactored, optimised, use of caching, datagenerator class)
* @author Bert Steppé (refactored, optimised, use of caching, datagenerator class)
*/
class UserTable extends SortableTable
{

@ -92,7 +92,7 @@ function get_all_users ($evals = array(), $links = array()) {
/**
* Search students matching a given last name and/or first name
* @author Bert Stepp<EFBFBD>
* @author Bert Steppé
*/
function find_students($mask= '') {
// students shouldn't be here // don't search if mask empty
@ -100,7 +100,7 @@ function find_students($mask= '') {
return null;
}
$mask = Database::escape_string($mask);
$tbl_user= Database :: get_main_table(TABLE_MAIN_USER);
$tbl_cru= Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$sql= 'SELECT DISTINCT user.user_id, user.lastname, user.firstname, user.email' . ' FROM ' . $tbl_user . ' user';

@ -16,7 +16,7 @@ define('SCORE_ONLY_CUSTOM',3);
/**
* Class to display scores according to the settings made by the platform admin.
* This class works as a singleton: call instance() to retrieve an object.
* @author Bert Stepp<EFBFBD>
* @author Bert Steppé
* @package dokeos.gradebook
*/
class ScoreDisplay
@ -66,7 +66,7 @@ class ScoreDisplay
private $custom_enabled;
private $upperlimit_included;
private $custom_display;
private $custom_display_conv;
private $custom_display_conv;
/**
* Protected constructor - call instance() to instantiate
@ -238,13 +238,13 @@ class ScoreDisplay
* (only taken into account if custom score display is enabled and for course/platform admin)
*/
public function display_score($score,$type, $what = SCORE_BOTH) {
$type2 = $type & 7; // removes the 'SCORE_IGNORE_SPLIT' bit
$type2 = $type & 7; // removes the 'SCORE_IGNORE_SPLIT' bit
$split_enabled = ($type2 == $type);
$my_score=($score==0) ? 1 : $score;
if ($this->custom_enabled && isset($this->custom_display_conv)) {
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($my_score);
@ -261,8 +261,8 @@ class ScoreDisplay
$display.= ' ('.$this->display_custom ($my_score).')';
}
} else {
// if no custom display set, use default display
} else {
// if no custom display set, use default display
$display = $this->display_default ($my_score, $type2);
}
return (($split_enabled ? $this->get_color_display_start_tag($my_score) : '')
@ -285,13 +285,13 @@ class ScoreDisplay
case SCORE_AVERAGE : // XX %
return $this->display_as_percent($score);
case SCORE_DECIMAL : // 0.50 (X/Y)
case SCORE_DECIMAL : // 0.50 (X/Y)
return $this->display_as_decimal($score);
}
}
private function display_as_decimal($score) {
$score_denom=($score[1]==0) ? 1 : $score[1];
return round(($score[0]/ $score_denom),2);

Loading…
Cancel
Save