Nav apraksta

routes.php 37KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. <?php
  2. // Event::listen('illuminate.query', function($sql, $params)
  3. // {
  4. // print_r($sql);
  5. // echo '<pre>';
  6. // print_r($params);
  7. // echo "</pre>";
  8. // });
  9. /*
  10. |--------------------------------------------------------------------------
  11. | Application Routes
  12. |--------------------------------------------------------------------------
  13. |
  14. | Here is where you can register all of the routes for an application.
  15. | It's a breeze. Simply tell Laravel the URIs it should respond to
  16. | and give it the Closure to execute when that URI is requested.
  17. |
  18. */
  19. // Route model bindings
  20. Route::model('template', 'Template');
  21. Route::model('program', 'Program');
  22. Route::model('five_year_plan', 'FiveYearPlan');
  23. // Composers
  24. View::composer(array(
  25. 'local.professors._navigation',
  26. 'local.managers.admins._new_navigation',
  27. 'local.managers.sCoords._new_navigation',
  28. 'local.managers.pCoords._new_navigation',
  29. ), function ($view) {
  30. // Get user's courses' numbers
  31. $courses = Auth::user()->courses;
  32. $schools = School::orderBy('name', 'asc')->get();
  33. $view->with('courses', $courses)->with('schools', $schools);
  34. });
  35. View::composer(array(
  36. 'local.professors.*',
  37. 'local.managers.admins._new_navigation',
  38. 'local.managers.sCoords._new_navigation',
  39. 'local.managers.pCoords._new_navigation',
  40. 'local.managers.shared.limited-course',
  41. 'local.managers.shared.school',
  42. 'local.managers.shared.school-uhs',
  43. 'local.managers.shared.programs',
  44. 'local.managers.shared.program',
  45. 'local.managers.shared.rubrics',
  46. 'global.view-learning-outcomes-criteria',
  47. 'global.view-learning-outcomes-criteria',
  48. 'global.view-three-year-plan'
  49. ), function ($view) {
  50. $view->with('role', Auth::user()->role);
  51. });
  52. /*
  53. * Login/logout routes
  54. */
  55. /** Use modified guest filter to redirect logged in user */
  56. Route::get('/', array('before' => 'guest', 'uses' => 'AuthController@showLogin'));
  57. Route::post('/login', array('uses' => 'AuthController@login'));
  58. /**
  59. * Protected Routes
  60. */
  61. Route::group(array('before' => 'auth|has_access'), function () {
  62. /**
  63. * Recalculate course outcomes
  64. *
  65. */
  66. Route::get('recalculateCourses', function () {
  67. DB::disableQueryLog();
  68. if (Auth::user()->id != 58)
  69. Redirect::action('AuthController@showLogin');
  70. try {
  71. $courses = Course::all();
  72. foreach ($courses as $course) {
  73. echo $course->id;
  74. // Recalculate course outcomes
  75. $activities = Activity::where('course_id', $course->id)
  76. ->whereNotNull('outcomes_attempted')
  77. ->where('draft', 0)
  78. ->get();
  79. //If there are still evaluated activities in the course, recalculate course outcomes
  80. if (!$activities->isEmpty()) {
  81. $outcomeCount = Outcome::all()->count();
  82. // Variables to hold recalculated outcomes for the course
  83. $course_outcomes_attempted = array_fill(1, $outcomeCount, 0);
  84. $course_outcomes_achieved = array_fill(1, $outcomeCount, 0);
  85. // For each activity
  86. foreach ($activities as $activity2) {
  87. // If activity has been assessed
  88. if ($activity2->outcomes_attempted != NULL) {
  89. echo '<ul>';
  90. // Get the achieved criteria
  91. $criteria_achievement = json_decode($activity2->criteria_achieved, true);
  92. foreach ($criteria_achievement as $criterion_id => $criterion_achieved) {
  93. // Find corresponding learning outcome;
  94. $criterion = Criterion::withTrashed()->where('id', $criterion_id)->first();
  95. print '<li>' . $criterion->id . '</li>';
  96. $outcome = Outcome::find($criterion->outcome_id);
  97. // If criterion is achieved (1), add 1 to both arrays
  98. if ($criterion_achieved === 1) {
  99. $course_outcomes_attempted[$outcome->id] += 1;
  100. $course_outcomes_achieved[$outcome->id] += 1;
  101. }
  102. // Else, only add to the attempted outcomes arrays
  103. elseif ($criterion_achieved === 0) {
  104. $course_outcomes_attempted[$outcome->id] += 1;
  105. }
  106. }
  107. echo '</ul>';
  108. }
  109. }
  110. // Update course
  111. DB::table('courses')
  112. ->where('id', $course->id)
  113. ->update(array(
  114. 'outcomes_attempted' => json_encode($course_outcomes_attempted),
  115. 'outcomes_achieved' => json_encode($course_outcomes_achieved),
  116. 'updated_at' => date('Y-m-d H:i:s')
  117. ));
  118. }
  119. // Otherwise, set them all to NULL
  120. else {
  121. DB::table('courses')
  122. ->where('id', $course->id)
  123. ->update(array(
  124. 'outcomes_attempted' => NULL,
  125. 'outcomes_achieved' => NULL,
  126. 'updated_at' => date('Y-m-d H:i:s')
  127. ));
  128. }
  129. }
  130. return 'success';
  131. } catch (Exception $e) {
  132. return 'failure (' . $e->getLine() . '): ' . $e->getMessage();
  133. }
  134. });
  135. /**
  136. * Shared Routes
  137. */
  138. // Annual Plan routes
  139. Route::post('deleteCommentsFromOutcome', array('uses' => 'AnnualPlansController@deleteCommentsFromOutcome'));
  140. Route::post('addCommentsToOutcome', array('uses' => 'AnnualPlansController@addCommentsToOutcome'));
  141. Route::post('fetchAnnualPlan', array('uses' => 'AnnualPlansController@fetchTheAnnualPlan'));
  142. Route::post('deleteTaFromOutcome', array('uses' => 'TransformativeActionsController@deleteTaFromOutcome'));
  143. Route::post(
  144. 'postTransformativeToOutcome',
  145. array(
  146. 'as' => 'postTransformativeToOutcome',
  147. 'uses' => 'TransformativeActionsController@createTAForOutcome'
  148. )
  149. );
  150. //Para feature de import rubrics
  151. Route::post("fetchTemplatesForCriteria", "AnnualPlansController@fetchTemplatesForCriteria");
  152. Route::post("pairCriteriaFromTemplate", "AnnualPlansController@pairCriteriaFromTemplate");
  153. //end feature
  154. Route::post('postAnnualReport/{annual_id?}', 'AnnualPlansController@postAnnualReport');
  155. Route::get('printAnnualPlan/{annual_plan?}/{submit?}', 'AnnualPlansController@printAnnualPlan');
  156. Route::post('checkIfPlanReady', 'AnnualPlansController@checkIfPlanReady');
  157. Route::post('submitAnnualPlan/{annual_id?}', 'AnnualPlansController@submitAnnualPlan');
  158. Route::post("checkIfReady", 'AnnualPlansController@checkIfReady');
  159. Route::get("printAnnualReport/{annual_plan?}/{submit?}", 'AnnualPlansController@printAnnualReport');
  160. Route::post('fetchObjectiveInfo', array(
  161. 'as' => 'fetchObjectiveInfo',
  162. 'uses' => 'AnnualPlansController@fetchObjectiveInfo'
  163. ));
  164. Route::get('selectAnnualProgram', array(
  165. 'as' => 'selectAnnualProgram',
  166. 'uses' => 'AnnualPlansController@selectProgramPlan'
  167. ));
  168. Route::post("fetchReportWithOutcome", array(
  169. 'as' => 'fetchReportWithOutcome',
  170. 'uses' => 'AnnualPlansController@fetchReportWithOutcome'
  171. ));
  172. Route::get('annual_plan_report/{program_id}', array(
  173. 'as' => 'annual_plan_report/{program_id}',
  174. 'uses' => 'OutcomesController@annualReport'
  175. ));
  176. Route::post('fetchAnnualReport', array(
  177. 'as' => 'fetchAnnualReport',
  178. 'uses' => 'AnnualPlansController@fetchAnnualReport'
  179. ));
  180. //Shared course creation, ( por si School coordinator y Program coordinator
  181. // van a poder crear luego)
  182. Route::get('editCourses', 'CoursesController@editView');
  183. Route::post("createCourse", 'CoursesController@create');
  184. Route::post("updateCourseInfo", 'CoursesController@updateCourseInfo');
  185. Route::post("fetch_assoc_courses", 'CoursesController@fetchCourses');
  186. //Fetch Objectives for Template
  187. Route::post("fetchObjectiveForTemplate", 'TemplatesController@fetchObjectivesForTemplate');
  188. //shared viewTransformativeActions
  189. Route::get('viewTransformativeActions', 'TransformativeActionsController@viewTransformativeActions');
  190. Route::get('viewProgramActivities', 'TransformativeActionsController@viewProgramActivities');
  191. //View Three year plan
  192. Route::get('three-year-plan/show/{program_id}', "ThreeYearPlanController@showPDFs");
  193. Route::get("downloadThreeYearPlanPDF/{path_id}", "ThreeYearPlanController@showHTML");
  194. Route::get("findHTMLlinksTYP/{path_id}", 'ThreeYearPlanController@findHTML');
  195. /////////////////////////////////////////
  196. //
  197. // pairing everything in three year
  198. //
  199. /////////////////////////////////////////
  200. Route::post('pairEveryObjective', "ThreeYearPlanController@pairEveryObjective");
  201. Route::post('pairEveryCourse', "ThreeYearPlanController@pairEveryCourse");
  202. //////////////////////////////////////
  203. //
  204. //View annual plans and report
  205. //
  206. ///////////////////////////////////
  207. Route::get('{annual_report_or_plan}/show/{program_id}', "AnnualPlansController@annualPlansShow");
  208. Route::get("findHTMLlinksAP/{type_of_annual}/{path_id}", "AnnualPlansController@findHTML");
  209. //Route::post('submitAnnualPlan', array('uses' => 'AnnualPlansController@submitAnnualPlan'));
  210. Route::post('fetchTransformativeStatus', array('uses' => 'TransformativeActionsController@fetchStatus'));
  211. Route::post('saveTransStatus', array('uses' => 'TransformativeActionsController@saveTransStatus'));
  212. Route::post('futureTransformativeCourse', 'AnnualPlansController@futureTransformative');
  213. //other stuff
  214. Route::post('deleteCriterion', 'CriteriaController@delete');
  215. Route::post('postActivityCriterionTrans/{activity_id}', array(
  216. 'as' => 'postActivityCriterionTrans/{activity_id}',
  217. 'uses' => 'TransformativeActionsController@postActivityCriterion'
  218. ));
  219. Route::post('changeStatusOfCriterion', array(
  220. 'as' => 'changeStatusOfCriterion',
  221. 'uses' => 'CriteriaController@changeStatus'
  222. ));
  223. Route::post('createThreeYearCycle', array(
  224. 'as' => 'createThreeYearCycle',
  225. 'uses' => 'ThreeYearPlanController@create'
  226. ));
  227. Route::get('printThreeYear/{program_id}/{typ}/{submit?}', array(
  228. 'as' => 'printThreeYear/{program_id}/{typ}/{submit?}',
  229. 'uses' => 'ThreeYearPlanController@printPlan'
  230. ));
  231. Route::get('viewThreeYear/{program_id}/{typ}', array(
  232. 'as' => 'viewThreeYear/{program_id}/{typ}',
  233. 'uses' => 'ThreeYearPlanController@viewPlan'
  234. ));
  235. Route::post('submitTYP/{program_id}', 'ThreeYearPlanController@submit');
  236. // Fetch all criteria associated to an outcome
  237. Route::post('fetchInfo', array(
  238. 'as' => 'fetchInfo',
  239. 'uses' => 'AnnualPlansController@fetchInfo'
  240. ));
  241. Route::post('fetchCriteria', array(
  242. 'as' => 'fetchCriteria',
  243. 'uses' => 'OutcomesController@fetchCriteria'
  244. ));
  245. Route::post('fetchCriterionWithTemplate', array(
  246. 'as' => 'fetchCriterionWithTemplate',
  247. 'uses' => 'CriteriaController@fetchCriterionWithTemplate'
  248. ));
  249. Route::post('fetchFormative', array(
  250. 'as' => 'fetchFormative',
  251. 'uses' => 'TransformativeActionsController@fetchCourses'
  252. ));
  253. Route::post('fetchObjectivesForOutcome', "Objective2Controller@fetchObjectivesForOutcome");
  254. //Objectives and Criteria Shared Routes
  255. Route::get('criteria', array('uses' => 'CriteriaController@edit'));
  256. Route::get('objectives', array('uses' => 'Objective2Controller@edit'));
  257. // Fetch a criterion for a rubric
  258. Route::post('fetchCriterion', array(
  259. 'as' => 'fetchCriterion',
  260. 'uses' => 'CriteriaController@fetchCriterion'
  261. ));
  262. // Fetch Criterions associated to programs
  263. Route::post('fetchAllCriterion', array(
  264. 'as' => 'fetchAllCriterion',
  265. 'uses' => 'CriteriaController@fetchAllCriterion'
  266. ));
  267. ///////////////////////////
  268. //
  269. // pair criteria from template
  270. //
  271. ///////////////////////////
  272. Route::post('fetchFromTemplate', 'CriteriaController@fetchFromTemplate');
  273. Route::post('insertPCOBOFromTemplate', 'Objective2Controller@insertPCOBOFromTemplate');
  274. Route::post('deletePCOBOFromTemplate', 'Objective2Controller@deletePCOBOFromTemplate');
  275. Route::post('updatePCOBOFromTemplate', 'Objective2Controller@updatePCOBOFromTemplate');
  276. Route::post('insertPCOBO', 'Objective2Controller@insertPCOBO');
  277. /*//////////////////
  278. Export criteria from annual plans, rubrics
  279. */ ////////////////
  280. Route::post('fetchOutcomesFromPlan', "AnnualPlansController@fetchOutcomesFromPlan");
  281. Route::post('fetchObjectivesFromPlan', 'AnnualPlansController@fetchObjectivesFromPlan');
  282. Route::post("fetchSemestersFromPlan", 'AnnualPlansController@fetchSemestersFromPlan');
  283. Route::post('fetchCoursesFromPlanForTemplates', 'AnnualPlansController@fetchCoursesFromPlanForTemplate');
  284. Route::post('fetchCriteriaFromPlan', 'AnnualPlansController@fetchCriteriaFromPlan');
  285. ///////////////////////////////////////////////////////
  286. Route::get('viewFormative', array(
  287. 'as' => 'viewFormative',
  288. 'uses' => 'TransformativeActionsController@viewFormativeActions'
  289. ));
  290. Route::post('delete', array(
  291. 'as' => 'delete',
  292. 'uses' => 'TransformativeActionsController@deleteTA'
  293. ));
  294. // Fetch a criterion for a rubric
  295. Route::post('fetchCriterionWithTrashed', array(
  296. 'as' => 'fetchCriterionWithTrashed',
  297. 'uses' => 'CriteriaController@fetchCriterionWithTrashed'
  298. ));
  299. Route::get('learning-outcomes/show/{id}', array(
  300. 'as' => "learning-outcomes/show/{id}",
  301. 'uses' => 'OutcomesController@show'
  302. ));
  303. //Fetch objectives for criteria when outcome is chosen
  304. Route::post('fetchObjectivesForSelect', array(
  305. 'as' => 'fetchObjectivesForSelect',
  306. 'uses' => 'CriteriaController@fetchObjectivesForSelect'
  307. ));
  308. // Fetch a criterion for a rubric with custom content
  309. Route::post('fetchRubricCriterion', array(
  310. 'as' => 'fetchRubricCriterion',
  311. 'uses' => 'RubricsController@fetchRubricCriterion'
  312. ));
  313. Route::post('fetchObjectives', 'Objective2Controller@fetchAllObjectives');
  314. // Load a rubric template
  315. Route::post('loadTemplate', array('uses' => 'TemplatesController@fetch'));
  316. Route::post('filterSemesters', array('uses' => 'SemestersController@filterSemesters'));
  317. // Log out user
  318. Route::get('logout', 'AuthController@logout');
  319. // Edit and update user profile
  320. Route::get('profile', 'UsersController@edit');
  321. Route::post('profile/update', array('before' => 'csrf', 'uses' => 'UsersController@update'));
  322. // Allows users to give feeback
  323. Route::post('feedback/send', array('before' => 'csrf', 'uses' => 'FeedbackController@send'));
  324. Route::resource(
  325. 'feedback',
  326. 'FeedbackController',
  327. array('only' => array('create'))
  328. );
  329. Route::get('agreement', 'AgreementController@index');
  330. Route::post('agreement/agree', array('before' => 'csrf', 'uses' => 'AgreementController@agree'));
  331. // Show users all learning outcomes and criteria
  332. Route::get('learning-outcomes-criteria', 'CriteriaController@index');
  333. Route::post('fetchOutcome', array('before' => 'csrf', 'uses' => 'OutcomesController@fetchOutcome'));
  334. // Show users all objectives and criteria
  335. Route::get('learning-objectives-criteria', 'Objective2Controller@viewObjectives');
  336. Route::post("postDeleteAllCriteria", 'Objective2Controller@postDeleteAll');
  337. Route::post('fetchObjectiveForCriteria', array('before' => 'csrf', 'uses' => 'ObjectivesController@fetchObjectiveForCriteria'));
  338. // Show professor overview to users with courses
  339. Route::get('professor', 'ProfessorsController@overview');
  340. // view objectives and criteria, edit criteria
  341. Route::post('fetchCriteriaFromProgram', 'Objective2Controller@fetchProgramCriteria');
  342. // Assessment reports for users' courses
  343. Route::get('my-assessment-reports', 'OutcomesController@professorAssessmentReport');
  344. Route::post('objectives/fetch', array('before' => 'csrf', 'uses' => 'ObjectivesController@fetch'));
  345. // Transformative Actions for p-coordinators and professors
  346. Route::get('transformativeAction', array('uses' => 'TransformativeActionsController@editTA'));
  347. Route::post('transformativeAction/createTA', array('before' => 'csrf', 'uses' => 'TransformativeActionsController@createTA'));
  348. Route::post('transformativeAction/selectTA', array('before' => 'csrf', 'uses' => 'TransformativeActionsController@selectTA'));
  349. Route::post('transformativeAction/updateTA', array('before' => 'csrf', 'uses' => 'TransformativeActionsController@updateTA'));
  350. Route::post('transformativeAction/filterTA', array('before' => 'csrf', 'uses' => 'TransformativeActionsController@filterTA'));
  351. Route::post('transformativeAction/objectivesFromOutcome', array('before' => 'csrf', 'uses' => 'TransformativeActionsController@objectivesFromOutcome'));
  352. Route::post('criteria/update', array('before' => 'csrf', 'uses' => 'CriteriaController@update'));
  353. Route::delete('critteria/delete', array('before' => 'csrf', 'uses' => 'CriteriaController@destroy'));
  354. //shared print_program and school
  355. Route::get('print_program_students/{program_id}', 'ProgramsController@print_program_students');
  356. Route::get('print_school_students_report/{school_id}', 'SchoolsController@print_school_students_report');
  357. /**
  358. * Administrator Routes
  359. */
  360. Route::group(array('before' => 'admin'), function () {
  361. Route::get('/administrator', 'AdministratorsController@overview2');
  362. Route::get('/administrator2', 'AdministratorsController@overview');
  363. Route::post('/administrator2/filter', 'AdministratorsController@overview2_filter_results');
  364. Route::post('administrator/rubrics', array(
  365. 'as' => 'rubrics',
  366. 'before' => 'csrf',
  367. 'uses' => 'CriteriaController@fetch'
  368. ));
  369. // manage courses permissions.
  370. Route::get('manageCoursesPermissions', 'ProgramsController@assignOtherProgramIndex');
  371. Route::post('addToOtherProgramTYP', 'ProgramsController@addToOtherProgramTYP');
  372. Route::post("fetchPairingInfo", 'ProgramsController@fetchPairingInfo');
  373. Route::post("updatePairingInfo", 'ProgramsController@updatePairingInfo');
  374. //New navigation routes
  375. Route::get('campusAnnualReport', 'AnnualPlansController@adminReportIndex');
  376. Route::get('campusResults', 'OutcomesController@adminProgramIndex');
  377. Route::get('manageSemesterCycle', 'ThreeYearPlanController@manageSemesterCycle');
  378. //Plans routes
  379. Route::get('showThreeYearPlans', 'ThreeYearPlanController@adminIndex');
  380. Route::post('fetchSubmit', 'ThreeYearPlanController@fetchSubmitted');
  381. Route::get('showAnnualPlans', 'AnnualPlansController@adminIndex');
  382. Route::get("showAnnualReports", "AnnualPlansController@adminReportIndex");
  383. Route::post('fetchSubmitAn', 'AnnualPlansController@fetchSubmitted');
  384. //endhere
  385. Route::post('createOutcome', array('before' => 'csrf', 'uses' => 'OutcomesController@create'));
  386. Route::post('createCriterion', array('before' => 'csrf', 'uses' => 'CriteriaController@create'));
  387. Route::get('learning-outcomes', 'OutcomesController@index');
  388. //Route::post('fetchObjectives', 'Objective2Controller@fetchAllObjectives');
  389. // TODO: Change later
  390. Route::get('new-learning-outcomes', 'OutcomesController@newIndex');
  391. Route::post('learning-outcomes/update', array('before' => 'csrf', 'uses' => 'OutcomesController@updateMore'));
  392. Route::post('learning-outcomes/delete', array('before' => 'csrf', 'uses' => 'OutcomesController@delete'));
  393. Route::get('administrator/users/{query?}', 'UsersController@index');
  394. Route::post('administrator/updateAccess', array('before' => 'csrf', 'uses' => 'UsersController@updateAccess'));
  395. Route::post('administrator/users/store', array('before' => 'csrf', 'uses' => 'UsersController@store'));
  396. //Route::get('criteria', array('uses' => 'CriteriaController@edit'));
  397. //Route::get('objectives', array('uses' => 'Objective2Controller@edit'));
  398. Route::get('administrator/semesters', 'SemestersController@edit');
  399. Route::post('administrator/semesters/update', 'SemestersController@update');
  400. Route::post('deleteObjective', 'Objective2Controller@delete');
  401. Route::get('assessment-report', 'OutcomesController@assessmentReport');
  402. // TODO: Change later
  403. Route::get('new-assessment-report/{outcome_id}', 'OutcomesController@newAssessmentReport');
  404. Route::get('template-list', 'TemplatesController@index');
  405. Route::get('template/{template}', 'TemplatesController@show');
  406. Route::post('onLoadFetch', 'TemplatesController@onLoadFetch');
  407. Route::get('courses/reassign', 'CoursesController@reassign');
  408. Route::post('courses/update', array('before' => 'csrf', 'uses' => 'CoursesController@update'));
  409. Route::get('activities/create', 'ActivitiesController@newCreate');
  410. Route::get('total_assessment-report', 'OutcomesController@totalAssessmentReport');
  411. });
  412. /**
  413. * School Coordinator Routes
  414. */
  415. Route::group(array('before' => 'scoord'), function () {
  416. Route::get('school-coordinator-test', 'SchoolCoordinatorsController@overview_test');
  417. Route::get('school-coordinator', 'SchoolCoordinatorsController@overview');
  418. Route::get('school/{id}', array(
  419. 'as' => 'school-coordinator',
  420. 'uses' => 'SchoolsController@show'
  421. ));
  422. Route::get('program/{id}', 'ProgramsController@show');
  423. Route::post('programs/report', 'ProgramsController@showReport');
  424. Route::get('template/{template}', 'TemplatesController@show');
  425. // Route::post('storeTypInfo', 'OutcomesController@storeCycleInfo'); //TODO: where is this route supposed to be placed?
  426. Route::get('programs', 'ProgramsController@index');
  427. Route::get('template-list', 'TemplatesController@index');
  428. Route::post('deleteObjective', 'Objective2Controller@delete');
  429. // Print school report
  430. Route::get('print_school/{id}', 'SchoolsController@print_school');
  431. // Assessment reports
  432. Route::get('school-assessment-report', 'OutcomesController@schoolAssessmentReport');
  433. Route::get('student_school_assessment-report/{school_id}', 'SchoolsController@studentSchoolAssessmentReport');
  434. // Gabriel added this, so the school coordinator can add criterias and objectives
  435. Route::post('createCriterion', array('before' => 'csrf', 'uses' => 'CriteriaController@create'));
  436. //Route::get('school-objective', 'Objective2Controller@edit');
  437. //Route::get('school-criteria', 'CriteriaController@edit');
  438. Route::post('crtiteria/update', array('before' => 'csrf', 'uses' => 'CriteriaController@update'));
  439. //Show users annual plan
  440. Route::get('annual-plan-program/{program_id}/{typ_id?}', 'AnnualPlansController@showPlan');
  441. Route::post('annual-plan-fetchTYP/{program_id}/{typ_id}', 'AnnualPlansController@fetchTYP');
  442. Route::post('annual-plan-postOnChange', 'AnnualPlansController@postAnnualPlan');
  443. Route::post('annual-plan-deleteCriteria', 'AnnualPlansController@deleteCriteria');
  444. Route::get('annual-plan-show/{program_id}', 'AnnualPlansController@viewAllPlans');
  445. Route::post('fetchAllTables', 'AnnualPlansController@fetchAllTables');
  446. Route::post('annual-plan-postTA', 'AnnualPlansController@postTA');
  447. Route::post('annual-report-post', 'AnnualPlansController@postReport');
  448. Route::post('annual-plan-deleteTA', 'AnnualPlansController@deleteTA');
  449. Route::post('annual-plan-trans-report', 'AnnualPlansController@transformativeReport');
  450. // Show users plan de tres a~nos
  451. Route::get('three-years-plan/{program_id}', 'ThreeYearPlanController@threeYearsReport');
  452. Route::post('fetchThreeYears', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@fetchThreeYears'));
  453. Route::post('typ/lookUp', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@lookup_typ_semester_outcome'));
  454. Route::post('section2_arrive', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@section2_arrive'));
  455. Route::post('section2_on_change', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@section2_on_change'));
  456. Route::post('section3_arrive', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@section3_arrive'));
  457. Route::post('section3_on_change', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@section3_on_change'));
  458. Route::post('typ/getObjectives', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@getObjectivesForTYP'));
  459. Route::post('typ/updateOutcomeSemsters', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@typ_update_outcomes_semesters'));
  460. Route::post('typ/update', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@update_typ_outcomes_semesters'));
  461. Route::post('createAnnualPlan/{program_id}', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@createAnnualPlan'));
  462. Route::post('verifyAndCreate/{program_id}', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@verifyAndCreate'));
  463. });
  464. /**
  465. * Program Coordinator Routes
  466. */
  467. Route::group(array('before' => 'pcoord'), function () {
  468. Route::get('program-coordinator', 'ProgramCoordinatorsController@overview');
  469. Route::post('deleteObjective', 'Objective2Controller@delete');
  470. Route::get('rubrics_old', 'TemplatesController@newTemplate');
  471. Route::get('rubrics', 'TemplatesController@newTemplate_new');
  472. Route::get('template/{template}', 'TemplatesController@show');
  473. Route::post('saveTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@create'));
  474. Route::post('updateTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@update'));
  475. Route::post('deleteTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@destroy'));
  476. Route::get('course/{id}', 'CoursesController@showLimited');
  477. Route::get('rubrics/{template_id}/download', 'TemplatesController@download');
  478. Route::post('program/fetch', array('before' => 'csrf', 'uses' => 'ProgramsController@fetch'));
  479. Route::post('createCriterion', array('before' => 'csrf', 'uses' => 'CriteriaController@create'));
  480. Route::get('printRubric/{id}', 'TemplatesController@printview');
  481. Route::get('rubric/{rubric_id}', 'RubricsController@show_limited');
  482. Route::get('grouped_course/{code}/{number}/{semester_code}', 'CoursesController@showGrouped');
  483. Route::get('template-list', 'TemplatesController@index');
  484. Route::get('student_program_assessment-report/{program_id}', 'ProgramsController@studentProgramAssessmentReport');
  485. //Criteria and objectives
  486. //Route::get('program-criteria', 'CriteriaController@edit');
  487. Route::post('crtiteria/update', array('before' => 'csrf', 'uses' => 'CriteriaController@update'));
  488. //Route::get('program-objective', 'Objective2Controller@edit');
  489. // Print program report
  490. Route::get('print_program/{id}', 'ProgramsController@print_program');
  491. // Print course (grouped sections) report
  492. Route::get('print_course/{code}/{number}/{semester_code}', 'CoursesController@print_course');
  493. // Assessment reports
  494. Route::get('program-assessment-report/{program_id}', 'OutcomesController@programAssessmentReport');
  495. Route::get('assessment-reports', 'OutcomesController@managerAssessmentReports');
  496. // Learning Objectives
  497. Route::get('program/{program}/objectives', 'ObjectivesController@index');
  498. Route::post('updateObjective', array('before' => 'csrf', 'uses' => 'ObjectivesController@update'));
  499. Route::post('program/{id}/createObjective', array('before' => 'csrf', 'uses' => 'ObjectivesController@create'));
  500. Route::post('fetchObjective', array('before' => 'csrf', 'uses' => 'ObjectivesController@fetchObjective'));
  501. Route::post('fetchObjectivesForCriteria', array('before' => 'csrf', 'uses' => 'ObjectivesController@fetchObjectivesForCriteria'));
  502. //Objectives
  503. //Route::get('objective', 'Objective2Controller@edit');
  504. Route::post('createObjective', array('before' => 'csrf', 'uses' => 'Objective2Controller@create'));
  505. Route::post('updateObjective', array('before' => 'csrf', 'uses' => 'Objective2Controller@update'));
  506. Route::post('fetchObjectiveWithTrashed', array('before' => 'csrf', 'uses' => 'Objective2Controller@fetchObjectiveWithTrashed'));
  507. Route::post('deletePCOBO', 'Objective2Controller@deletePCOBO');
  508. Route::post('updatePCOBO', 'Objective2Controller@updatePCOBO');
  509. // Five year plans,
  510. Route::get('five-year-plans', 'FiveYearPlansController@index');
  511. Route::get('program/{program}/five-year-plans/create', 'FiveYearPlansController@create');
  512. Route::get('program/{program}/five-year-plans/{five_year_plan}', 'FiveYearPlansController@show');
  513. Route::get('program/{program}/five-year-plans/{five_year_plan}/edit', 'FiveYearPlansController@edit');
  514. Route::get('five-year-plans/{five_year_plan}/ms-word', 'FiveYearPlansController@msWord');
  515. Route::post('five-year-plans/store', array('before' => 'csrf', 'uses' => 'FiveYearPlansController@store'));
  516. Route::post('five-year-plans/update', array('before' => 'csrf', 'uses' => 'FiveYearPlansController@update'));
  517. // Annual plans
  518. Route::get('annual-plans', 'AnnualPlansController@index');
  519. Route::get('program/{program}/annual-plans/create', 'AnnualPlansController@create');
  520. Route::get('program/{program}/annual-plans/{five_year_plan}', 'AnnualPlansController@show');
  521. Route::get('program/{program}/annual-plans/{five_year_plan}/edit', 'AnnualPlansController@edit');
  522. Route::post('annual-plans/store', array('before' => 'csrf', 'uses' => 'AnnualPlansController@store'));
  523. Route::post('annual-plans/update', array('before' => 'csrf', 'uses' => 'AnnualPlansController@update'));
  524. Route::get('learning-outcomes/shows/{id}', 'OutcomesController@show');
  525. // TODO: Change route name
  526. Route::get('learning-outcomes/newshow/{id}', 'OutcomesController@newShow');
  527. Route::get('new-report/{id}', 'OutcomesController@newReport');
  528. Route::get('new-report-all', 'OutcomesController@newReportAll');
  529. Route::get('courses/{id}', 'CoursesController@newShow');
  530. Route::get('annual-plan-program/{program_id}/{typ_id?}', 'AnnualPlansController@showPlan');
  531. Route::post('annual-plan-fetchTYP/{program_id}', 'AnnualPlansController@fetchTYP');
  532. Route::post('annual-plan-CreateOrEdit/{program_id}', 'AnnualPlansController@CreateOrEdit');
  533. Route::post('annual-plan-postOnChange', 'AnnualPlansController@postAnnualPlan');
  534. Route::post('annual-plan-deleteCriteria', 'AnnualPlansController@deleteCriteria');
  535. //Gabriel added this
  536. Route::get('annual-plan-program/{program_id}/{typ_id?}', 'AnnualPlansController@showPlan');
  537. Route::post('annual-plan-fetchTYP/{program_id}/{typ_id}', 'AnnualPlansController@fetchTYP');
  538. Route::post('annual-plan-postOnChange', 'AnnualPlansController@postAnnualPlan');
  539. Route::post('annual-plan-deleteCriteria', 'AnnualPlansController@deleteCriteria');
  540. Route::get('annual-plan-show/{program_id}', 'AnnualPlansController@viewAllPlans');
  541. Route::post('fetchAllTables', 'AnnualPlansController@fetchAllTables');
  542. Route::post('annual-plan-postTA', 'AnnualPlansController@postTA');
  543. Route::post('annual-report-post', 'AnnualPlansController@postReport');
  544. Route::post('annual-plan-deleteTA', 'AnnualPlansController@deleteTA');
  545. Route::post('annual-plan-trans-report', 'AnnualPlansController@transformativeReport');
  546. // Transformative Actions
  547. Route::post('transformativeAction/approveTA', array('before' => 'csrf', 'uses' => 'TransformativeActionsController@approveTA'));
  548. // Show users plan de tres a~nos
  549. Route::get('three-years-plan/{program_id}', 'ThreeYearPlanController@threeYearsReport');
  550. Route::post('fetchThreeYears', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@fetchThreeYears'));
  551. Route::post('typ/lookUp', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@lookup_typ_semester_outcome'));
  552. Route::post('section2_arrive', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@section2_arrive'));
  553. Route::post('section2_on_change', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@section2_on_change'));
  554. Route::post('section3_arrive', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@section3_arrive'));
  555. Route::post('section3_on_change', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@section3_on_change'));
  556. Route::post('typ/getObjectives', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@getObjectivesForTYP'));
  557. Route::post('typ/updateOutcomeSemsters', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@typ_update_outcomes_semesters'));
  558. Route::post('typ/update', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@update_typ_outcomes_semesters'));
  559. Route::post('createAnnualPlan/{program_id}', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@createAnnualPlan'));
  560. Route::post('verifyAndCreate/{program_id}', array('before' => 'csrf', 'uses' => 'ThreeYearPlanController@verifyAndCreate'));
  561. });
  562. /**
  563. * Professor Routes
  564. */
  565. Route::group(array('prefix' => 'professor', 'before' => 'prof'), function () {
  566. Route::get('rubrics', 'TemplatesController@newTemplateProf');
  567. Route::get('templateForProfessor', 'TemplatesController@ProfIndex');
  568. Route::post('program', array('before' => 'csrf', 'uses' => 'ProfessorsController@program'));
  569. Route::get('activities/{activity_id}/rubrics', 'RubricsController@newRubric');
  570. Route::get('activities/{activity_id}/other_method', 'RubricsController@newOtherMethod');
  571. Route::get('activities/{activity_id}/rubric', 'RubricsController@show');
  572. Route::get('activities/{activity_id}/rubric/{rubric_id}/download', 'RubricsController@download');
  573. Route::get('activities/{activity_id}/rubric/{rubric_id}/print', 'RubricsController@printview');
  574. Route::get('activities/{activity_id}/assess', 'ActivitiesController@assess');
  575. Route::get('activities/{activity_id}/view_assessment', 'ActivitiesController@viewAssessment');
  576. Route::get('activities/{activity_id}/print_assessment', 'ActivitiesController@printAssessment');
  577. Route::post('activities/saveAssessment', array('before' => 'csrf', 'uses' => 'ActivitiesController@saveAssessment'));
  578. Route::post('activities/deleteAssessment', array('before' => 'csrf', 'uses' => 'ActivitiesController@deleteAssessment'));
  579. Route::delete('activities/{activity_id}/delete', 'ActivitiesController@destroy');
  580. Route::post('activities/{activity_id}/update', array('before' => 'csrf', 'uses' => 'ActivitiesController@update'));
  581. Route::get('courses/{id}', 'CoursesController@show');
  582. Route::get('courses/{semester}/{id}/students/{number}', 'StudentsController@show');
  583. Route::get('courses/{semester}/{id}/students/{number}/print_report', 'StudentsController@printStudentReport');
  584. Route::get('activities/{id}', 'ActivitiesController@show');
  585. Route::post('activities/{id}', array('before' => 'csrf', 'uses' => 'ActivitiesController@create'));
  586. Route::get('students', 'StudentsController@students');
  587. Route::get('program', 'ProfessorsController@program');
  588. Route::get("program_students/{program_id}", 'ProgramsController@studentsProgramAssessmentReportForProfessors');
  589. Route::get('personal-information', 'ProfessorsController@personalInformation');
  590. Route::get('manual', 'ProfessorsController@manual');
  591. Route::post('loadRubric', array('before' => 'csrf', 'uses' => 'RubricsController@fetch'));
  592. Route::post('saveRubric', array('before' => 'csrf', 'uses' => 'RubricsController@create'));
  593. Route::post('updateRubric', array('before' => 'csrf', 'uses' => 'RubricsController@update'));
  594. Route::post('deleteRubric', array('before' => 'csrf', 'uses' => 'RubricsController@destroy'));
  595. Route::get('learning-outcomes-criteria', 'CriteriaController@index');
  596. Route::get('learning-objectives-criteria', 'Objective2Controller@viewObjectives');
  597. Route::get('export_grades/{id}', 'CoursesController@exportGrades');
  598. Route::get('template/{template}', 'TemplatesController@show');
  599. Route::get('compare_activities/{activity_1}/{activity_2}', 'ActivitiesController@compareActivities');
  600. // Assessment reports
  601. //Route::get('professor-assessment-report/{outcome_id}', 'OutcomesController@professorAssessmentReport');
  602. Route::get('professor-assessment-reports', 'OutcomesController@professorAssessmentReport');
  603. Route::get('general-studies-overview', 'ProfessorsController@generalStudiesOverview');
  604. Route::get('template/{template}', 'TemplatesController@profShow');
  605. });
  606. });