Improve Gradebook Tool CT#968

skala
Carlos Vargas 15 years ago
parent 6463840700
commit 92846b6222
  1. 9
      main/css/blue_lagoon/default.css
  2. 9
      main/css/chamilo/default.css
  3. 16
      main/css/chamilo_green/default.css
  4. 9
      main/css/chamilo_red/default.css
  5. 9
      main/css/cool_blue/default.css
  6. 9
      main/css/corporate/default.css
  7. 9
      main/css/delicious_bordeaux/default.css
  8. 9
      main/css/dokeos_blue/default.css
  9. 9
      main/css/dokeos_classic/default.css
  10. 9
      main/css/dokeos_classic_2D/default.css
  11. 9
      main/css/empire_green/default.css
  12. 9
      main/css/fruity_orange/default.css
  13. 9
      main/css/medical/default.css
  14. 9
      main/css/public_admin/default.css
  15. 9
      main/css/royal_purple/default.css
  16. 9
      main/css/silver_line/default.css
  17. 9
      main/css/sober_brown/default.css
  18. 9
      main/css/steel_grey/default.css
  19. 9
      main/css/tasty_olive/default.css
  20. 13
      main/gradebook/gradebook_view_result.php
  21. 4
      main/gradebook/lib/fe/catform.class.php
  22. 2
      main/gradebook/lib/fe/displaygradebook.php
  23. 41
      main/gradebook/lib/fe/evalform.class.php
  24. 2
      main/gradebook/lib/fe/exportgradebook.php
  25. 6
      main/gradebook/lib/fe/linkaddeditform.class.php
  26. 5
      main/gradebook/lib/gradebook_functions_users.inc.php
  27. 3
      main/gradebook/lib/results_data_generator.class.php

@ -2151,6 +2151,15 @@ span.radio {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2375,6 +2375,15 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2382,6 +2382,22 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
#label_result {
float: left;
text-align: right;
margin-right: 10px;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2379,6 +2379,15 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2039,6 +2039,15 @@ div.comments {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -1495,6 +1495,15 @@ span.radio {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/**********************************************
* EXERCISE TOOL *
**********************************************/

@ -2032,6 +2032,15 @@ div.comments {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2045,6 +2045,15 @@ div.comments {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2114,6 +2114,15 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2148,6 +2148,15 @@ input.forms {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2056,6 +2056,15 @@ div.comments {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2056,6 +2056,15 @@ div.comments {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2073,6 +2073,15 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2093,6 +2093,15 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2052,6 +2052,15 @@ div.comments {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -1760,6 +1760,15 @@ div.system_announcement {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2112,6 +2112,15 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2057,6 +2057,15 @@ div.comments {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -2037,6 +2037,15 @@ div.comments {
border: 1px solid rgb(153, 153, 153);
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
}
.label_result {
float: left;
width: 25%;
text-align: left;
}
.formw_result {
width: 75%;
float:left;
}
/* actions */
.actions_lp {
background:#F8F8F8;

@ -193,7 +193,7 @@ if ($export_result_form->validate()) {
// export results to pdf file
if ($file_type == 'pdf') {
$number_decimals = api_get_setting('gradebook_number_decimals');
$datagen = new ResultsDataGenerator ($eval[0],$allresults);
// set headers pdf
@ -229,13 +229,15 @@ if ($export_result_form->validate()) {
if ($scoredisplay->is_custom()) {
$head_display_score = get_lang('Display');
}
if ($number_decimals == null) {
$head_letter = get_lang('Letters');
}
$head_table = array(
array(get_lang('Item'),5),
array(get_lang('Code'),15),
array($head_ape_name, 50),
array(get_lang('Score'),15),
array(get_lang('Letters'),15),
array($head_letter,15),
array($head_display_score,15)
);
@ -245,7 +247,6 @@ if ($export_result_form->validate()) {
} else {
$data_array = $datagen->get_data(ResultsDataGenerator :: RDG_SORT_LASTNAME,0,null, true, true);
}
$data_table = array();
foreach ($data_array as $data) {
$result = array();
@ -257,7 +258,9 @@ if ($export_result_form->validate()) {
$result[] = $user_info['lastname'].', '.$user_info['firstname'];
}
$result[] = $data['score'];
$result[] = api_strtoupper(get_lang('Literal'.$data['scoreletter']));
if ($number_decimals == null) {
$result[] = api_strtoupper(get_lang('Literal'.$data['scoreletter']));
}
if ($scoredisplay->is_custom()) {
$result[] = $data['display'];
}

@ -121,8 +121,8 @@ class CatForm extends FormValidator {
private function build_basic_form() {
$this->addElement('hidden', 'zero', 0);
$this->add_textfield('name', get_lang('CategoryName'),true,array('size'=>'54','maxlength'=>'50'));
$this->add_textfield('weight', get_lang('Weight'),true,array('size'=>'4','maxlength'=>'4'));
$this->add_textfield('certif_min_score', get_lang('CertificateMinScore'),false,array('size'=>'4','maxlength'=>'4'));
$this->add_textfield('weight', get_lang('Weight'),true,array('size'=>'4','maxlength'=>'5'));
$this->add_textfield('certif_min_score', get_lang('CertificateMinScore'),false,array('size'=>'4','maxlength'=>'5'));
$this->addElement('hidden','hid_user_id');
$this->addElement('hidden','hid_parent_id');
$this->addElement('textarea', 'description', get_lang('Description'),array('rows'=>'3','cols' => '34'));

@ -53,7 +53,7 @@ class DisplayGradebook
}
$evalinfo= '<table width="100%" border="0"><tr><td>';
$evalinfo .= get_lang('EvaluationName') . ' :<b> ' . $evalobj->get_name() . ' </b>(' . api_convert_and_format_date($evalobj->get_date()).' )<br />' . get_lang('Course') . ' :<b> ' . $course . '</b><br>' . get_lang('Weight') . ' :<b> ' . $evalobj->get_weight() . '</b><br>' . get_lang('Max') . ' :<b> ' . $evalobj->get_max() . '</b><br>' . $description . get_lang('Visible') . ' :<b> ' . $visible . '</b><br>' . $average;
$evalinfo .= get_lang('EvaluationName') . ' :<b> ' . $evalobj->get_name() . ' </b>(' . api_convert_and_format_date($evalobj->get_date()).' )<br />' . get_lang('Course') . ' :<b> ' . $course . '</b><br>' . get_lang('Weight') . ' :<b> ' . $evalobj->get_weight() . '</b><br>' . get_lang('QualificationNumeric') . ' :<b> ' . $evalobj->get_max() . '</b><br>' . $description . get_lang('Visible') . ' :<b> ' . $visible . '</b><br>' . $average;
if (!$evalobj->has_results())
$evalinfo .= '<br /><i>' . get_lang('NoResultsInEvaluation') . '</i>';
elseif ($scoredisplay->is_custom() && api_get_self() != '/dokeos/main/gradebook/gradebook_statistics.php')

@ -120,13 +120,13 @@ class EvalForm extends FormValidator
$this->addElement('hidden', 'minvalue', 0);
$this->addElement('header','h1','<b>'.get_lang('EditResult').'</b>');
$renderer = $this->defaultRenderer();
$elementTemplateTwoLabel = '<div class="row">
<div class="label">
$elementTemplateTwoLabel = '<div class="row"><ul style="list-style-type:none;">
<li><div class="label_result" >
<!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}
</div>
<div class="formw">
<div class="formw_result">
<!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error --> {element} / '.$this->evaluation_object->get_max().'
</div>
</div></li></ul>
</div>';
$results_and_users = array();
@ -145,10 +145,10 @@ class EvalForm extends FormValidator
$renderer =& $this->defaultRenderer();
$this->add_textfield('score[' . $result->get_id() . ']',
$this->build_stud_label($user['user_id'], $user['lastname'], $user['firstname']),
$this->build_stud_label($user['user_id'], $user['username'], $user['lastname'], $user['firstname']),
false,
array ('size' => 4,
'maxlength' => 4));
'maxlength' => 5));
$this->addRule('score[' . $result->get_id() . ']', get_lang('OnlyNumbers'), 'numeric');
$this->addRule(array (
@ -159,7 +159,7 @@ class EvalForm extends FormValidator
$renderer->setElementTemplate($elementTemplateTwoLabel,'score[' . $result->get_id() . ']');
}
$this->setDefaults($defaults);
$this->addElement('style_submit_button', 'submit',get_lang('Ok'),'class="save"');
$this->addElement('style_submit_button', 'submit',get_lang('EditResult'),'class="save"');
}
/**
* This function builds a form to move an item to another category
@ -193,19 +193,20 @@ class EvalForm extends FormValidator
$renderer = $this->defaultRenderer();
$elementTemplateTwoLabel = '<div class="row">
<div class="label">
<div class="label_result">
<!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}
</div>
<div class="formw">
<div class="formw_result">
<!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error --> {element} / '.$this->evaluation_object->get_max().'
</div>
</div>';
foreach ($tblusers as $user) {
//user_id, user.username, lastname, firstname
$this->add_textfield('score[' . $user[0] . ']',
$this->build_stud_label($user[0], $user[1], $user[2]),
$this->build_stud_label($user[0], $user[1], $user[2], $user[3]),
false,
array ('size' => 4,
'maxlength' => 4));
'maxlength' => 5));
$this->addRule('score[' . $user[0] . ']', get_lang('OnlyNumbers'), 'numeric');
$this->addRule(array (
@ -222,7 +223,7 @@ class EvalForm extends FormValidator
}
$this->addElement('hidden', 'nr_users', $nr_users);
$this->addElement('hidden', 'evaluation_id', $this->result_object->get_evaluation_id());
$this->addElement('style_submit_button', 'submit', get_lang('Ok'),'class="save"');
$this->addElement('style_submit_button', 'submit', get_lang('AddResult'),'class="save"');
}
/**
* Builds a form to edit a result
@ -238,13 +239,13 @@ class EvalForm extends FormValidator
$this->addElement('static', null, null, api_get_person_name($userinfo['lastName'], $userinfo['firstName']));
$this->add_textfield('score', get_lang('Result'), false, array (
'size' => '4',
'maxlength' => '4'
'maxlength' => '5'
));
$this->addElement('static', null, null,'/');
$this->add_textfield('maximum', null, false, array (
'size' => '4',
'maxlength' => '4',
'maxlength' => '5',
'disabled' => 'disabled'
));
$this->addElement('style_submit_button', 'submit', get_lang('Edit'),'class="save"');
@ -308,18 +309,18 @@ class EvalForm extends FormValidator
));
$this->add_textfield('weight', get_lang('Weight'), true, array (
'size' => '4',
'maxlength' => '4'
'maxlength' => '5'
));
if ($edit) {
if (!$this->evaluation_object->has_results()) {
$this->add_textfield('max', get_lang('QualificationNumeric'), true, array (
'size' => '4',
'maxlength' => '4'
'maxlength' => '5'
));
} else {
$this->add_textfield('max', get_lang('QualificationNumeric'), false, array (
'size' => '4',
'maxlength' => '4',
'maxlength' => '5',
'disabled' => 'disabled'
));
$this->addElement('static','label','','<small>'.get_lang('CannotChangeTheMaxNote').'</small>');
@ -327,7 +328,7 @@ class EvalForm extends FormValidator
} else {
$this->add_textfield('max', get_lang('QualificationNumeric'), true, array (
'size' => '4',
'maxlength' => '4'
'maxlength' => '5'
));
}
$this->addElement('textarea', 'description', get_lang('Description'), array (
@ -348,7 +349,7 @@ class EvalForm extends FormValidator
}
private function build_stud_label ($id, $lastname, $firstname) {
private function build_stud_label ($id, $username,$lastname, $firstname) {
$opendocurl_start = '';
$opendocurl_end = '';
// evaluation's origin is a link
@ -360,7 +361,7 @@ class EvalForm extends FormValidator
$opendocurl_end = '</a>';
}
}
return $opendocurl_start . api_get_person_name($firstname, $lastname) . $opendocurl_end;
return $opendocurl_start . api_get_person_name($firstname, $lastname) .' ('.$username.')'. $opendocurl_end;
}
function sort_by_user ($item1, $item2) {

@ -161,7 +161,7 @@ function export_pdf_with_html($headers_table, $data_table, $headers_pdf, $footer
$content_table .= '<tr>';
$content_table .= '<td>'.($item<10?'0'.$item:$item).'</td>';
foreach ($data as $key => $content) {
if (!empty($content)) {
if (isset($content)) {
$key == 1 ? $align='align="left"':$align='align="center"';
$content_table .= '<td '.$align.' style="padding:4px;" >'.$content.'</td>';
}

@ -72,7 +72,7 @@ class LinkAddEditForm extends FormValidator
}
// ELEMENT: weight
$this->add_textfield('weight', get_lang('Weight'),true,array('size'=>'4','maxlength'=>'4'));
$this->add_textfield('weight', get_lang('Weight'),true,array('size'=>'4','maxlength'=>'5'));
$this->addRule('weight',get_lang('OnlyNumbers'),'numeric');
$this->addRule(array ('weight', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
if ($form_type == self :: TYPE_EDIT) {
@ -81,9 +81,9 @@ class LinkAddEditForm extends FormValidator
// ELEMENT: max
if ($link->needs_max()) {
if ($form_type == self :: TYPE_EDIT && $link->has_results()) {
$this->add_textfield('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '4', 'disabled' => 'disabled'));
$this->add_textfield('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '5', 'disabled' => 'disabled'));
} else {
$this->add_textfield('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '4'));
$this->add_textfield('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '5'));
$this->addRule('max', get_lang('OnlyNumbers'), 'numeric');
$this->addRule(array ('max', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
}

@ -20,13 +20,13 @@ function get_users_in_course($course_id) {
$course_id = Database::escape_string($course_id);
if (!empty($current_session)) {
$sql = "SELECT user.user_id,lastname,firstname
$sql = "SELECT user.user_id, user.username, lastname, firstname
FROM $tbl_session_course_user as scru, $tbl_user as user
WHERE scru.id_user=user.user_id
AND scru.status=0
AND scru.course_code='$course_id' AND id_session ='$current_session' $order_clause ";
} else {
$sql = 'SELECT user.user_id,lastname,firstname'
$sql = 'SELECT user.user_id, user.username, lastname, firstname'
.' FROM '.$tbl_course_user.' as course_rel_user, '.$tbl_user.' as user'
.' WHERE course_rel_user.user_id=user.user_id'
.' AND course_rel_user.status='.STUDENT
@ -44,6 +44,7 @@ function get_user_array_from_sql_result($result) {
if (!array_key_exists($user['user_id'],$a_students)) {
$a_current_student = array ();
$a_current_student[] = $user['user_id'];
$a_current_student[] = $user['username'];
$a_current_student[] = $user['lastname'];
$a_current_student[] = $user['firstname'];
$a_students['STUD'.$user['user_id']] = $a_current_student;

@ -56,6 +56,7 @@ class ResultsDataGenerator
public function get_data ($sorting = 0, $start = 0, $count = null, $ignore_score_color = false, $pdf=false) {
// do some checks on count, redefine if invalid value
$number_decimals = api_get_setting('gradebook_number_decimals');
if (!isset($count)) {
$count = count ($this->results) - $start;
}
@ -80,7 +81,7 @@ class ResultsDataGenerator
} else {
$user['score'] = $this->get_score_display($result->get_score(),true, $ignore_score_color);
}
if ($pdf == true){
if ($pdf == true and $number_decimals == null){
$user['scoreletter'] = $result->get_score();
}
if ($scoredisplay->is_custom())

Loading…
Cancel
Save