diff --git a/main/gradebook/gradebook_add_eval.php b/main/gradebook/gradebook_add_eval.php index c78ba66b35..83998a24c3 100644 --- a/main/gradebook/gradebook_add_eval.php +++ b/main/gradebook/gradebook_add_eval.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']); diff --git a/main/gradebook/gradebook_add_link.php b/main/gradebook/gradebook_add_link.php index 6e39e55356..7dafaec5e1 100644 --- a/main/gradebook/gradebook_add_link.php +++ b/main/gradebook/gradebook_add_link.php @@ -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']); diff --git a/main/gradebook/lib/fe/evalform.class.php b/main/gradebook/lib/fe/evalform.class.php index 14618a821e..7b1f4d57e4 100644 --- a/main/gradebook/lib/fe/evalform.class.php +++ b/main/gradebook/lib/fe/evalform.class.php @@ -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(); diff --git a/main/gradebook/lib/fe/gradebooktable.class.php b/main/gradebook/lib/fe/gradebooktable.class.php index e3877674e7..5f52a4106a 100644 --- a/main/gradebook/lib/fe/gradebooktable.class.php +++ b/main/gradebook/lib/fe/gradebooktable.class.php @@ -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;