Fixing hotpotatoes lang see #5994

1.9.x
Julio Montoya 11 years ago
parent ce77ad80ad
commit 96fe2b76e7
  1. 2
      main/gradebook/gradebook_add_link.php
  2. 44
      main/gradebook/gradebook_edit_link.php
  3. 2
      main/gradebook/index.php
  4. 2
      main/gradebook/lib/be/exerciselink.class.php

@ -7,7 +7,7 @@
/** /**
* Init * Init
*/ */
$language_file = 'gradebook'; $language_file = array('gradebook', 'exercice');
//$cidReset = true; //$cidReset = true;
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
require_once 'lib/be.inc.php'; require_once 'lib/be.inc.php';

@ -7,7 +7,7 @@
/** /**
* Init * Init
*/ */
$language_file = array('gradebook','link'); $language_file = array('gradebook', 'exercice', 'link');
//$cidReset = true; //$cidReset = true;
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
require_once 'lib/be.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); $form = new LinkAddEditForm(LinkAddEditForm :: TYPE_EDIT, $cats, null, $link, 'edit_link_form', api_get_self() . '?selectcat=' . $linkcat. '&editlink=' . $linkedit);
if ($form->validate()) { if ($form->validate()) {
$values = $form->exportValues(); $values = $form->exportValues();
$parent_cat = Category :: load($values['select_gradebook']); $parent_cat = Category :: load($values['select_gradebook']);
$final_weight = null; $final_weight = null;
/* /*
if ($parent_cat[0]->get_parent_id() == 0) { if ($parent_cat[0]->get_parent_id() == 0) {
@ -52,13 +52,13 @@ if ($form->validate()) {
} else { } else {
$cat = Category :: load($parent_cat[0]->get_parent_id()); $cat = Category :: load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0]->get_weight(); $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']; $final_weight = $values['weight_mask'];
$link->set_weight($final_weight); $link->set_weight($final_weight);
if (!empty($values['select_gradebook'])) { if (!empty($values['select_gradebook'])) {
$link->set_category_id($values['select_gradebook']); $link->set_category_id($values['select_gradebook']);
} }
@ -76,15 +76,15 @@ if ($form->validate()) {
} }
//Update weight into forum thread //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) '; 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); Database::query($sql_t);
//Update weight into student publication(work) //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 )'; 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); Database::query($sql_t);
header('Location: '.$_SESSION['gradebook_dest'].'?linkedited=&selectcat=' . $link->get_category_id()); header('Location: '.$_SESSION['gradebook_dest'].'?linkedited=&selectcat=' . $link->get_category_id());
exit; exit;
@ -94,18 +94,18 @@ $interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_d
$htmlHeadXtra[] = '<script type="text/javascript"> $htmlHeadXtra[] = '<script type="text/javascript">
$(document).ready( function() { $(document).ready( function() {
$("#hide_category_id").change(function(){ $("#hide_category_id").change(function(){
$("#hide_category_id option:selected").each(function () { $("#hide_category_id option:selected").each(function () {
var cat_id = $(this).val(); var cat_id = $(this).val();
$.ajax({ $.ajax({
url: "'.api_get_path(WEB_AJAX_PATH).'gradebook.ajax.php?a=get_gradebook_weight", url: "'.api_get_path(WEB_AJAX_PATH).'gradebook.ajax.php?a=get_gradebook_weight",
data: "cat_id="+cat_id, data: "cat_id="+cat_id,
success: function(return_value) { success: function(return_value) {
if (return_value != 0 ) { if (return_value != 0 ) {
$("#max_weight").html(return_value); $("#max_weight").html(return_value);
} }
}, },
}); });
}); });
}); });
}); });
@ -113,4 +113,4 @@ $(document).ready( function() {
Display :: display_header(get_lang('EditLink')); Display :: display_header(get_lang('EditLink'));
$form->display(); $form->display();
Display :: display_footer(); Display :: display_footer();

@ -7,7 +7,7 @@
/** /**
* Init * Init
*/ */
$language_file= 'gradebook'; $language_file = array('gradebook', 'exercice');
// $cidReset : This is the main difference with gradebook.php, here we say, // $cidReset : This is the main difference with gradebook.php, here we say,
// basically, that we are inside a course, and many things depend from that // basically, that we are inside a course, and many things depend from that
$cidReset= false; $cidReset= false;

@ -299,7 +299,7 @@ class ExerciseLink extends AbstractLink
public function get_type_name() public function get_type_name()
{ {
if ($this->is_hp == 1) { if ($this->is_hp == 1) {
return get_lang('Hopotatoe'); return get_lang('HotPotatoes');
} else { } else {
return get_lang('Quiz'); return get_lang('Quiz');
} }

Loading…
Cancel
Save