@@ 6622-6673 (lines=52) @@ | ||
6619 | } |
|
6620 | } |
|
6621 | ||
6622 | if ($action != 'move') { |
|
6623 | $id_prerequisite = 0; |
|
6624 | if (is_array($arrLP)) { |
|
6625 | foreach ($arrLP as $key => $value) { |
|
6626 | if ($value['id'] == $id) { |
|
6627 | $id_prerequisite = $value['prerequisite']; |
|
6628 | break; |
|
6629 | } |
|
6630 | } |
|
6631 | } |
|
6632 | $arrHide = array (); |
|
6633 | for ($i = 0; $i < count($arrLP); $i++) { |
|
6634 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
|
6635 | if (is_array($extra_info)) { |
|
6636 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
6637 | $s_selected_position = $arrLP[$i]['id']; |
|
6638 | } |
|
6639 | } elseif ($action == 'add') { |
|
6640 | $s_selected_position = 0; |
|
6641 | } |
|
6642 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
|
6643 | } |
|
6644 | } |
|
6645 | /*// Commented the prerequisites, only visible in edit (exercise). |
|
6646 | $return .= '<tr>'; |
|
6647 | $return .= '<td class="label"><label for="idPrerequisites">'.get_lang('LearnpathPrerequisites').'</label></td>'; |
|
6648 | $return .= '<td class="input"><select name="prerequisites" id="prerequisites" class="learnpath_item_form"><option value="0">'.get_lang('NoPrerequisites').'</option>'; |
|
6649 | ||
6650 | foreach($arrHide as $key => $value){ |
|
6651 | if($key==$s_selected_position && $action == 'add'){ |
|
6652 | $return .= '<option value="'.$key.'" selected="selected">'.$value['value'].'</option>'; |
|
6653 | } |
|
6654 | elseif($key==$id_prerequisite && $action == 'edit'){ |
|
6655 | $return .= '<option value="'.$key.'" selected="selected">'.$value['value'].'</option>'; |
|
6656 | } |
|
6657 | else{ |
|
6658 | $return .= '<option value="'.$key.'">'.$value['value'].'</option>'; |
|
6659 | } |
|
6660 | } |
|
6661 | ||
6662 | $return .= "</select></td>"; |
|
6663 | */ |
|
6664 | /*$return .= '<tr>'; |
|
6665 | $return .= '<td class="label"><label for="maxTimeAllowed">' . get_lang('MaxTimeAllowed') . '</label></td>'; |
|
6666 | $return .= '<td class="input"><input name="maxTimeAllowed" style="width:98%;" id="maxTimeAllowed" value="' . $extra_info['max_time_allowed'] . '" /></td>'; |
|
6667 | ||
6668 | // Remove temporarily the test description. |
|
6669 | //$return .= '<td class="label"><label for="idDescription">'.get_lang('Description').' :</label></td>'; |
|
6670 | //$return .= '<td class="input"><textarea id="idDescription" name="description" rows="4">' . $item_description . '</textarea></td>'; |
|
6671 | ||
6672 | $return .= '</tr>'; */ |
|
6673 | } |
|
6674 | ||
6675 | if ($action == 'add') { |
|
6676 | $form->addButtonSave(get_lang('AddExercise'), 'submit_button'); |
|
@@ 6840-6858 (lines=19) @@ | ||
6837 | $return .= '<td class="input"><input id="idTitle" name="title" type="text" value="' . $item_title . '" /></td>'; |
|
6838 | $return .= '</tr>'; |
|
6839 | $id_prerequisite = 0; |
|
6840 | if (is_array($arrLP) && count($arrLP) > 0) { |
|
6841 | foreach ($arrLP as $key => $value) { |
|
6842 | if ($value['id'] == $id) { |
|
6843 | $id_prerequisite = $value['prerequisite']; |
|
6844 | break; |
|
6845 | } |
|
6846 | } |
|
6847 | ||
6848 | $arrHide = array (); |
|
6849 | for ($i = 0; $i < count($arrLP); $i++) { |
|
6850 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
|
6851 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
6852 | $s_selected_position = $arrLP[$i]['id']; |
|
6853 | elseif ($action == 'add') $s_selected_position = 0; |
|
6854 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
|
6855 | ||
6856 | } |
|
6857 | } |
|
6858 | } |
|
6859 | } |
|
6860 | ||
6861 | $return .= '<tr>'; |
|
@@ 7036-7056 (lines=21) @@ | ||
7033 | } |
|
7034 | } |
|
7035 | ||
7036 | if ($action != 'move') { |
|
7037 | $id_prerequisite = 0; |
|
7038 | if (is_array($arrLP)) { |
|
7039 | foreach ($arrLP as $key => $value) { |
|
7040 | if ($value['id'] == $id) { |
|
7041 | $id_prerequisite = $value['prerequisite']; |
|
7042 | break; |
|
7043 | } |
|
7044 | } |
|
7045 | } |
|
7046 | ||
7047 | $arrHide = array(); |
|
7048 | for ($i = 0; $i < count($arrLP); $i++) { |
|
7049 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
|
7050 | if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7051 | $s_selected_position = $arrLP[$i]['id']; |
|
7052 | elseif ($action == 'add') $s_selected_position = 0; |
|
7053 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
|
7054 | } |
|
7055 | } |
|
7056 | } |
|
7057 | ||
7058 | if ($action == 'add') { |
|
7059 | $form->addButtonSave(get_lang('AddForumToCourse'), 'submit_button'); |
|
@@ 8215-8235 (lines=21) @@ | ||
8212 | } |
|
8213 | } |
|
8214 | ||
8215 | if ($action != 'move') { |
|
8216 | $id_prerequisite = 0; |
|
8217 | if (is_array($arrLP)) { |
|
8218 | foreach ($arrLP as $key => $value) { |
|
8219 | if ($value['id'] == $id) { |
|
8220 | $id_prerequisite = $value['prerequisite']; |
|
8221 | break; |
|
8222 | } |
|
8223 | } |
|
8224 | } |
|
8225 | $arrHide = array (); |
|
8226 | for ($i = 0; $i < count($arrLP); $i++) { |
|
8227 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
|
8228 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
8229 | $s_selected_position = $arrLP[$i]['id']; |
|
8230 | elseif ($action == 'add') $s_selected_position = 0; |
|
8231 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
|
8232 | ||
8233 | } |
|
8234 | } |
|
8235 | } |
|
8236 | ||
8237 | if ($action == 'add') { |
|
8238 | $form->addButtonCreate(get_lang('AddAssignmentToCourse'), 'submit_button'); |