diff --git a/main/gradebook/gradebook_add_link.php b/main/gradebook/gradebook_add_link.php index e047c40af4..02cd980efa 100644 --- a/main/gradebook/gradebook_add_link.php +++ b/main/gradebook/gradebook_add_link.php @@ -7,7 +7,7 @@ /** * Init */ -$language_file = 'gradebook'; +$language_file = array('gradebook', 'exercice'); //$cidReset = true; require_once '../inc/global.inc.php'; require_once 'lib/be.inc.php'; diff --git a/main/gradebook/gradebook_edit_link.php b/main/gradebook/gradebook_edit_link.php index b6a826f80b..721ed6a9c7 100644 --- a/main/gradebook/gradebook_edit_link.php +++ b/main/gradebook/gradebook_edit_link.php @@ -7,7 +7,7 @@ /** * Init */ -$language_file = array('gradebook','link'); +$language_file = array('gradebook', 'exercice', 'link'); //$cidReset = true; require_once '../inc/global.inc.php'; require_once 'lib/be.inc.php'; @@ -42,9 +42,9 @@ if ($session_id == 0) { $form = new LinkAddEditForm(LinkAddEditForm :: TYPE_EDIT, $cats, null, $link, 'edit_link_form', api_get_self() . '?selectcat=' . $linkcat. '&editlink=' . $linkedit); if ($form->validate()) { - $values = $form->exportValues(); - $parent_cat = Category :: load($values['select_gradebook']); - + $values = $form->exportValues(); + $parent_cat = Category :: load($values['select_gradebook']); + $final_weight = null; /* if ($parent_cat[0]->get_parent_id() == 0) { @@ -52,13 +52,13 @@ if ($form->validate()) { } else { $cat = Category :: load($parent_cat[0]->get_parent_id()); $global_weight = $cat[0]->get_weight(); - $final_weight = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight(); - }*/ - + $final_weight = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight(); + }*/ + $final_weight = $values['weight_mask']; - + $link->set_weight($final_weight); - + if (!empty($values['select_gradebook'])) { $link->set_category_id($values['select_gradebook']); } @@ -76,15 +76,15 @@ if ($form->validate()) { } //Update weight into forum thread - $sql_t = 'UPDATE '.$tbl_forum_thread.' SET thread_weight='.$final_weight.' + $sql_t = 'UPDATE '.$tbl_forum_thread.' SET thread_weight='.$final_weight.' WHERE c_id = '.$course_id.' AND thread_id=(SELECT ref_id FROM '.$tbl_grade_links.' WHERE id='.intval($_GET['editlink']).' and type=5) '; - + Database::query($sql_t); - + //Update weight into student publication(work) - $sql_t = 'UPDATE '.$tbl_work.' SET weight='.$final_weight.' + $sql_t = 'UPDATE '.$tbl_work.' SET weight='.$final_weight.' WHERE c_id = '.$course_id.' AND id = (SELECT ref_id FROM '.$tbl_grade_links.' WHERE id='.intval($_GET['editlink'] ).' AND type=3 )'; - + Database::query($sql_t); header('Location: '.$_SESSION['gradebook_dest'].'?linkedited=&selectcat=' . $link->get_category_id()); exit; @@ -94,18 +94,18 @@ $interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_d $htmlHeadXtra[] = '