}
$sql = Database::query('SELECT * FROM ' . $table_evaluation . ' WHERE category_id = ' . $my_selectcat);
while ($row = Database::fetch_array($sql)) {
    $item_weight = $row['weight'];
    //$item_weight = $masked_total*$item_weight/$original_total;
    //update only if value changed
    if (isset($_POST['evaluation'][$row['id']])) {
        Evaluation::add_evaluation_log($row['id']);
        //$new_weight = trim($_POST['evaluation'][$row['id']]*$original_total/$masked_total);
        $new_weight = trim($_POST['evaluation'][$row['id']]);
        $update_sql = 'UPDATE ' . $table_evaluation . ' SET weight = ' . "'" . Database::escape_string($new_weight) . "'" . ' WHERE id = ' . $row['id'];
        Database::query($update_sql);
        $item_weight = trim($_POST['evaluation'][$row['id']]);
    }
    $type_evaluated = isset($row['type']) ? $table_evaluated[$type_evaluated][3] : null;
    $output .= '<tr><td>' . build_type_icon_tag('evalnotempty') . '</td><td>' . $row['name'] . ' ' . Display::label(get_lang('Evaluation') . $type_evaluated) . '</td>';
    $output .= '<td><input type="hidden" name="eval_' . $row['id'] . '" value="' . $row['name'] . '" /><input type="text" size="10" name="evaluation[' . $row['id'] . ']" value="' . $item_weight . '"/></td></tr>';
}
//by iflorespaz
$my_api_cidreq = api_get_cidreq();
if ($my_api_cidreq == '') {
    $my_api_cidreq = 'cidReq=' . $my_category['course_code'];
}
?>
    <div class="actions">
        <a href="<?php 
echo Security::remove_XSS($_SESSION['gradebook_dest']) . '?' . $my_api_cidreq;
?>
&selectcat=<?php 
echo $my_selectcat;
?>
 /**
  * @param $item
  * @param array $attributes
  * @return string
  */
 private function build_type_column($item, $attributes = array())
 {
     return build_type_icon_tag($item->get_icon_name(), $attributes);
 }
 /**
  * @param $item
  * @return string
  */
 private function build_type_column($item)
 {
     return build_type_icon_tag($item->get_icon_name());
 }