@@ 6613-6664 (lines=52) @@ | ||
6610 | } |
|
6611 | } |
|
6612 | ||
6613 | if ($action != 'move') { |
|
6614 | $id_prerequisite = 0; |
|
6615 | if (is_array($arrLP)) { |
|
6616 | foreach ($arrLP as $key => $value) { |
|
6617 | if ($value['id'] == $id) { |
|
6618 | $id_prerequisite = $value['prerequisite']; |
|
6619 | break; |
|
6620 | } |
|
6621 | } |
|
6622 | } |
|
6623 | $arrHide = array (); |
|
6624 | for ($i = 0; $i < count($arrLP); $i++) { |
|
6625 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
|
6626 | if (is_array($extra_info)) { |
|
6627 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
6628 | $s_selected_position = $arrLP[$i]['id']; |
|
6629 | } |
|
6630 | } elseif ($action == 'add') { |
|
6631 | $s_selected_position = 0; |
|
6632 | } |
|
6633 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
|
6634 | } |
|
6635 | } |
|
6636 | /*// Commented the prerequisites, only visible in edit (exercise). |
|
6637 | $return .= '<tr>'; |
|
6638 | $return .= '<td class="label"><label for="idPrerequisites">'.get_lang('LearnpathPrerequisites').'</label></td>'; |
|
6639 | $return .= '<td class="input"><select name="prerequisites" id="prerequisites" class="learnpath_item_form"><option value="0">'.get_lang('NoPrerequisites').'</option>'; |
|
6640 | ||
6641 | foreach($arrHide as $key => $value){ |
|
6642 | if($key==$s_selected_position && $action == 'add'){ |
|
6643 | $return .= '<option value="'.$key.'" selected="selected">'.$value['value'].'</option>'; |
|
6644 | } |
|
6645 | elseif($key==$id_prerequisite && $action == 'edit'){ |
|
6646 | $return .= '<option value="'.$key.'" selected="selected">'.$value['value'].'</option>'; |
|
6647 | } |
|
6648 | else{ |
|
6649 | $return .= '<option value="'.$key.'">'.$value['value'].'</option>'; |
|
6650 | } |
|
6651 | } |
|
6652 | ||
6653 | $return .= "</select></td>"; |
|
6654 | */ |
|
6655 | /*$return .= '<tr>'; |
|
6656 | $return .= '<td class="label"><label for="maxTimeAllowed">' . get_lang('MaxTimeAllowed') . '</label></td>'; |
|
6657 | $return .= '<td class="input"><input name="maxTimeAllowed" style="width:98%;" id="maxTimeAllowed" value="' . $extra_info['max_time_allowed'] . '" /></td>'; |
|
6658 | ||
6659 | // Remove temporarily the test description. |
|
6660 | //$return .= '<td class="label"><label for="idDescription">'.get_lang('Description').' :</label></td>'; |
|
6661 | //$return .= '<td class="input"><textarea id="idDescription" name="description" rows="4">' . $item_description . '</textarea></td>'; |
|
6662 | ||
6663 | $return .= '</tr>'; */ |
|
6664 | } |
|
6665 | ||
6666 | if ($action == 'add') { |
|
6667 | $form->addButtonSave(get_lang('AddExercise'), 'submit_button'); |
|
@@ 6831-6849 (lines=19) @@ | ||
6828 | $return .= '<td class="input"><input id="idTitle" name="title" type="text" value="' . $item_title . '" /></td>'; |
|
6829 | $return .= '</tr>'; |
|
6830 | $id_prerequisite = 0; |
|
6831 | if (is_array($arrLP) && count($arrLP) > 0) { |
|
6832 | foreach ($arrLP as $key => $value) { |
|
6833 | if ($value['id'] == $id) { |
|
6834 | $id_prerequisite = $value['prerequisite']; |
|
6835 | break; |
|
6836 | } |
|
6837 | } |
|
6838 | ||
6839 | $arrHide = array (); |
|
6840 | for ($i = 0; $i < count($arrLP); $i++) { |
|
6841 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
|
6842 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
6843 | $s_selected_position = $arrLP[$i]['id']; |
|
6844 | elseif ($action == 'add') $s_selected_position = 0; |
|
6845 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
|
6846 | ||
6847 | } |
|
6848 | } |
|
6849 | } |
|
6850 | } |
|
6851 | ||
6852 | $return .= '<tr>'; |
|
@@ 7027-7047 (lines=21) @@ | ||
7024 | } |
|
7025 | } |
|
7026 | ||
7027 | if ($action != 'move') { |
|
7028 | $id_prerequisite = 0; |
|
7029 | if (is_array($arrLP)) { |
|
7030 | foreach ($arrLP as $key => $value) { |
|
7031 | if ($value['id'] == $id) { |
|
7032 | $id_prerequisite = $value['prerequisite']; |
|
7033 | break; |
|
7034 | } |
|
7035 | } |
|
7036 | } |
|
7037 | ||
7038 | $arrHide = array(); |
|
7039 | for ($i = 0; $i < count($arrLP); $i++) { |
|
7040 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
|
7041 | if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7042 | $s_selected_position = $arrLP[$i]['id']; |
|
7043 | elseif ($action == 'add') $s_selected_position = 0; |
|
7044 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
|
7045 | } |
|
7046 | } |
|
7047 | } |
|
7048 | ||
7049 | if ($action == 'add') { |
|
7050 | $form->addButtonSave(get_lang('AddForumToCourse'), 'submit_button'); |
|
@@ 8206-8226 (lines=21) @@ | ||
8203 | } |
|
8204 | } |
|
8205 | ||
8206 | if ($action != 'move') { |
|
8207 | $id_prerequisite = 0; |
|
8208 | if (is_array($arrLP)) { |
|
8209 | foreach ($arrLP as $key => $value) { |
|
8210 | if ($value['id'] == $id) { |
|
8211 | $id_prerequisite = $value['prerequisite']; |
|
8212 | break; |
|
8213 | } |
|
8214 | } |
|
8215 | } |
|
8216 | $arrHide = array (); |
|
8217 | for ($i = 0; $i < count($arrLP); $i++) { |
|
8218 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
|
8219 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
8220 | $s_selected_position = $arrLP[$i]['id']; |
|
8221 | elseif ($action == 'add') $s_selected_position = 0; |
|
8222 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
|
8223 | ||
8224 | } |
|
8225 | } |
|
8226 | } |
|
8227 | ||
8228 | if ($action == 'add') { |
|
8229 | $form->addButtonCreate(get_lang('AddAssignmentToCourse'), 'submit_button'); |