Fixing BT#1272 when adding a chamilo quiz in a sco

skala
Julio Montoya 15 years ago
parent 3c55f301a5
commit 169193a5b1
  1. 40
      main/newscorm/learnpath.class.php

@ -2805,7 +2805,15 @@ class learnpath {
} else {
$course_path = $sys_course_path; //system path
}
//now go through the specific cases to get the end of the path
//Fixed issue BT#1272 - If the item type is a Chamilo Quiz, then force it to load the link as a normal Chamilo LP not a SCO
if ($lp_item_type == 'quiz') {
$lp_type = 1;
}
//Now go through the specific cases to get the end of the path
//@todo use constants instead of int values
switch ($lp_type) {
case 1 :
if ($lp_item_type == 'dokeos_chapter') {
@ -5406,8 +5414,12 @@ class learnpath {
else
$parent = 0;
$sql = "SELECT * FROM " . $tbl_lp_item . "
WHERE lp_id = " . $this->lp_id;
$sql = "
SELECT *
FROM " . $tbl_lp_item . "
WHERE
lp_id = " . $this->lp_id;
$result = Database::query($sql);
$arrLP = array ();
@ -5437,7 +5449,8 @@ class learnpath {
if ($action == 'add')
$return .= get_lang("CreateTheForum") . ' :' . "\n";
elseif ($action == 'move') $return .= get_lang("MoveTheCurrentForum") . ' :' . "\n";
else $return .= get_lang("EditCurrentForum") . ' :' . "\n";
else
$return .= get_lang("EditCurrentForum") . ' :' . "\n";
$return .= ' </div>
</div>';
@ -5477,7 +5490,7 @@ class learnpath {
if (is_array($arrLP)) {
reset($arrLP);
}
$return .= "\t\t\t\t" . '</select>';
$return .= "\t\t\t" . '</td>' . "\n";
$return .= "\t\t" . '</tr>' . "\n";
@ -5551,7 +5564,6 @@ class learnpath {
$return .= "\t" . '<input name="post_time" type="hidden" value="' . time() . '" />' . "\n";
$return .= '</form>' . "\n";
$return .= '</div>' . "\n";
return $return;
}
@ -5780,8 +5792,8 @@ class learnpath {
* @return string HTML form
*/
function display_item_form($item_type, $title = '', $action = 'add', $id = 0, $extra_info = 'new') {
global $_course, $charset;
//$parent_item_id = $_SESSION['parent_item_id'];
global $_course;
global $charset;
$tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
@ -5888,7 +5900,6 @@ class learnpath {
}
$parent_select->setSelected($s_selected_parent);
}
if (is_array($arrLP)) {
reset($arrLP);
}
@ -6109,7 +6120,6 @@ class learnpath {
$parent_select = & $form->addElement('select', 'parent', get_lang('Parent'), '', 'class="learnpath_item_form" style="width:40%;" onchange="load_cbo(this.value);"');
$my_count=0;
foreach ($arrHide as $key => $value) {
if ($my_count!=0) {
// the LP name is also the first section and is not in the same charset like the other sections
@ -6136,9 +6146,8 @@ class learnpath {
}
$arrHide = array ();
$parent_item_id = $_SESSION['parent_item_id'];
//POSITION
for ($i = 0; $i < count($arrLP); $i++) {
if ($arrLP[$i]['parent_item_id'] == $parent_item_id && $arrLP[$i]['id'] != $id) {
if ($extra_info['previous_item_id'] == $arrLP[$i]['id'])
@ -6963,12 +6972,13 @@ class learnpath {
case TOOL_STUDENTPUBLICATION :
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_student_publication_form('move', $item_id, $row);
break;
break;
case TOOL_FORUM :
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_forum_form('move', $item_id, $row);
case TOOL_THREAD :
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_forum_form('move', $item_id, $row);
break;
$return .= $this->display_forum_form('move', $item_id, $row);
}
}

Loading…
Cancel
Save