Fixing bug when adding links and eval see #5168

skala
Julio Montoya 13 years ago
parent 8e7aa1ed41
commit d24a70d807
  1. 4
      main/gradebook/gradebook_add_eval.php
  2. 6
      main/gradebook/gradebook_add_link.php
  3. 10
      main/gradebook/lib/fe/evalform.class.php
  4. 15
      main/gradebook/lib/fe/gradebooktable.class.php

@ -49,7 +49,9 @@ if ($form->validate()) {
$parent_cat = Category :: load($values['hid_category_id']);
$global_weight = $cat[0]->get_weight();
$values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
//$values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
$values['weight'] = $values['weight_mask'];
$eval->set_weight($values['weight']);
$eval->set_max($values['max']);

@ -72,9 +72,9 @@ if (isset($_GET['typeselected']) && $_GET['typeselected'] != '0') {
$parent_cat = Category :: load($addvalues['select_gradebook']);
$global_weight = $category[0]->get_weight();
$addvalues['weight'] = $addvalues['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
$link->set_weight($addvalues['weight']);
//$addvalues['weight'] = $addvalues['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
$link->set_weight($addvalues['weight_mask']);
if ($link->needs_max()) {
$link->set_max($addvalues['max']);

@ -422,13 +422,13 @@ class EvalForm extends FormValidator
$this->addElement('header', $form_title);
$this->addElement('hidden', 'zero', 0);
$this->addElement('hidden', 'hid_user_id');
$this->addElement('hidden', 'hid_user_id');
$this->addElement('hidden', 'hid_course_code');
$this->add_textfield('name', get_lang('EvaluationName'), true, array (
'class' => 'span3',
'maxlength' => '50',
'id' => 'evaluation_title'
'class' => 'span3',
'maxlength' => '50',
'id' => 'evaluation_title'
));
$cat_id = $this->evaluation_object->get_category_id();

@ -53,7 +53,10 @@ class GradebookTable extends SortableTable {
} else {
$this->set_header($column++, get_lang('Weight'), false);
$this->set_header($column++, get_lang('Result'), false);
$this->set_header($column++, get_lang('Actions'), false);
if (!empty($cats)) {
$this->set_header($column++, get_lang('Actions'), false);
}
}
/*if (api_is_allowed_to_edit(null, true)) {
@ -238,7 +241,9 @@ class GradebookTable extends SortableTable {
$score = $scoredisplay->display_score(array($score, null), SCORE_SIMPLE);
$row[] = Display::tip($score, $complete_score);
$row[] = $this->build_edit_column($item);
if (!empty($cats)) {
$row[] = $this->build_edit_column($item);
}
}
}
@ -329,10 +334,12 @@ class GradebookTable extends SortableTable {
$value_data = isset($data[4]) ? $data[4] : null;
if (!is_null($value_data)) {
//$row[] = Display::tip($data[4], $data[4]);
$row[] = $data[4];
$row[] = $data[4];
}
}
$row[] = null;
if (!empty($cats)) {
$row[] = null;
}
}
$row['child_of'] = $parent_id;

Loading…
Cancel
Save