Browse Source

Resultados de programas por estudiantes y varios bugs de 3 year plan y anual

parent
commit
808b41e151

+ 1
- 3
app/controllers/CriteriaController.php View File

75
         }
75
         }
76
         $json_to_send['outcomes'] = $outcomeStr;
76
         $json_to_send['outcomes'] = $outcomeStr;
77
 
77
 
78
-
79
-
80
-
81
         return json_encode($json_to_send);
78
         return json_encode($json_to_send);
82
     }
79
     }
80
+    
83
     public function fetchCriterion()
81
     public function fetchCriterion()
84
     {
82
     {
85
         $json_to_send = array();
83
         $json_to_send = array();

+ 4
- 1
app/controllers/Objective2Controller.php View File

122
 
122
 
123
 		$json['assoc_criteria'] = DB::select("select name from criteria where id in(select criterion_id from criterion_objective_outcome where objective_id =?)", array(Input::get('id')));
123
 		$json['assoc_criteria'] = DB::select("select name from criteria where id in(select criterion_id from criterion_objective_outcome where objective_id =?)", array(Input::get('id')));
124
 		Log::info('is here');
124
 		Log::info('is here');
125
+// 		Log::info(json_encode($json));
125
 		return json_encode($json);
126
 		return json_encode($json);
126
 	}
127
 	}
127
 	public function fetchAllobjectives()
128
 	public function fetchAllobjectives()
131
 		$json = array();
132
 		$json = array();
132
 
133
 
133
 
134
 
134
-		$json['objective'] = DB::select("SELECT * FROM `objectives` where id in (select objective_id from objective_outcome where outcome_id ={$outcome_id}) and id in (select objective_id from objective_program where program_id = {$program_id})");
135
+		$json['objective'] = DB::select("SELECT * FROM `objectives` where id in (select objective_id from objective_outcome where outcome_id ={$outcome_id}) and id in (select objective_id from objective_program where program_id = {$program_id} and objective_id <> 0)");
135
 		Log::info('En mi sueño');
136
 		Log::info('En mi sueño');
136
 		Log::info($json);
137
 		Log::info($json);
137
 		return json_encode($json);
138
 		return json_encode($json);
138
 	}
139
 	}
140
+	
139
 	public function delete()
141
 	public function delete()
140
 	{
142
 	{
141
 		DB::delete("delete from objectives where id = ?", array(Input::get('deleteObj')));
143
 		DB::delete("delete from objectives where id = ?", array(Input::get('deleteObj')));
339
 		$objectives_from_school = DB::table('programs')
341
 		$objectives_from_school = DB::table('programs')
340
 			->join('objective_program', 'objective_program.program_id', '=', 'programs.id')
342
 			->join('objective_program', 'objective_program.program_id', '=', 'programs.id')
341
 			->where('programs.school_id', $userSchool)
343
 			->where('programs.school_id', $userSchool)
344
+			->where('objective_program.objective_id', "<>" , 0)
342
 			->lists('objective_id');
345
 			->lists('objective_id');
343
 		$objectives = Objective::withTrashed()->orderBy('text', 'ASC')->whereIn('id', $objectives_from_school)->get();
346
 		$objectives = Objective::withTrashed()->orderBy('text', 'ASC')->whereIn('id', $objectives_from_school)->get();
344
 		$programs = Program::where("school_id", "=", $userSchool)->orderBy('name', 'ASC')->get();
347
 		$programs = Program::where("school_id", "=", $userSchool)->orderBy('name', 'ASC')->get();

+ 2
- 1
app/controllers/ProgramsController.php View File

263
 		$schools = School::all();
263
 		$schools = School::all();
264
 		$outcomeCount = Outcome::all()->count();
264
 		$outcomeCount = Outcome::all()->count();
265
 		
265
 		
266
+// 		var_dump(json_encode($outcomes));
266
 		$role=Auth::user()->role;
267
 		$role=Auth::user()->role;
267
 
268
 
268
 		$programs_ids=array($program->id);
269
 		$programs_ids=array($program->id);
845
    */
846
    */
846
   public function fetch()
847
   public function fetch()
847
   {
848
   {
848
-    //Log::info('id:' . Input::get('id'));
849
+    Log::info('id:' . Input::get('id'));
849
     return School::find(Input::get('id'))->programs;
850
     return School::find(Input::get('id'))->programs;
850
   }
851
   }
851
 }
852
 }

+ 3
- 2
app/controllers/ThreeYearPlanController.php View File

365
             ->join('objective_program', 'objective_program.objective_id', '=', 'objectives.id')
365
             ->join('objective_program', 'objective_program.objective_id', '=', 'objectives.id')
366
             ->where('objective_program.program_id', $program_id)
366
             ->where('objective_program.program_id', $program_id)
367
             ->where('objective_outcome.outcome_id', $outcome_id)
367
             ->where('objective_outcome.outcome_id', $outcome_id)
368
+            ->where('objective_outcome.objective_id', "<>",0)
368
             ->select('objectives.id', 'objectives.text', 'outcomes.name as outcome_name')
369
             ->select('objectives.id', 'objectives.text', 'outcomes.name as outcome_name')
369
             ->orderBy('objectives.text', 'asc')
370
             ->orderBy('objectives.text', 'asc')
370
             ->get();
371
             ->get();
445
           foreach ($result_objectives as $objectives_) {
446
           foreach ($result_objectives as $objectives_) {
446
             $result_courses = DB::table('courses')
447
             $result_courses = DB::table('courses')
447
               ->where('courses.program_id', $program_id)
448
               ->where('courses.program_id', $program_id)
448
-              ->select('courses.id as course_id', 'courses.name', 'courses.code', 'courses.program_id')
449
-              ->orderBy('courses.name', 'asc')
449
+              ->select('courses.id as course_id', 'courses.name', 'courses.code', 'courses.number', 'courses.program_id')
450
+              ->orderBy('courses.number', 'asc')
450
               ->groupBy('courses.name', 'courses.code')
451
               ->groupBy('courses.name', 'courses.code')
451
               ->get();
452
               ->get();
452
             #los cursos resultantes creo que deberian ser: todos los que se estan dando en mi programa
453
             #los cursos resultantes creo que deberian ser: todos los que se estan dando en mi programa

+ 1
- 1
app/views/global/view-three-year-plan.blade.php View File

739
 
739
 
740
                       var option_value = outcome_id+'-'+semester_id+'-'+objective_id+'-'+course_id;
740
                       var option_value = outcome_id+'-'+semester_id+'-'+objective_id+'-'+course_id;
741
 
741
 
742
-                      var option_name = '['+course.code+'] '+course.name;
742
+                      var option_name = '['+course.code+course.number+'] '+course.name;
743
 
743
 
744
                       var new_option = new_select.find('.default-option').clone(true);
744
                       var new_option = new_select.find('.default-option').clone(true);
745
                       new_option.html(option_name);
745
                       new_option.html(option_name);

+ 1
- 1
app/views/local/managers/sCoords/_navigation.blade.php View File

19
                 <ul class="dropdown-menu" role="menu">
19
                 <ul class="dropdown-menu" role="menu">
20
                     <li>{{ HTML::linkAction('Objective2Controller@editSchool', 'Objectives') }}</li>
20
                     <li>{{ HTML::linkAction('Objective2Controller@editSchool', 'Objectives') }}</li>
21
                     <li>{{ HTML::linkAction('CriteriaController@editSchool', 'Criteria') }}</li>
21
                     <li>{{ HTML::linkAction('CriteriaController@editSchool', 'Criteria') }}</li>
22
-                    <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubrics') }}</li>
22
+                    <li>{{ HTML::linkAction('TemplatesController@newTemplate_new', 'Rubrics') }}</li>
23
                     <li>{{ HTML::linkAction('TemplatesController@index', 'Rubric List') }}</li>
23
                     <li>{{ HTML::linkAction('TemplatesController@index', 'Rubric List') }}</li>
24
 
24
 
25
                     <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}
25
                     <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}

+ 21
- 12
app/views/local/managers/sCoords/objectives.blade.php View File

335
                     id: id
335
                     id: id
336
                 },
336
                 },
337
                 function(json) {
337
                 function(json) {
338
-
339
-                    var text = json.objective[0].text;
338
+// console.log(json.objective.length);
339
+					if((json.objective.length))
340
+                    {
341
+                    	var text = json.objective[0].text;
340
 
342
 
341
 
343
 
342
                     // Display info
344
                     // Display info
343
                     $('#objective-text').val(text);
345
                     $('#objective-text').val(text);
344
-
346
+					}
345
 
347
 
346
                     // Select associated outcome
348
                     // Select associated outcome
347
                     for (var i = counterAssoc; i != 1; i--) {
349
                     for (var i = counterAssoc; i != 1; i--) {
348
                         deleteLastAssoc(i);
350
                         deleteLastAssoc(i);
349
 
351
 
350
                     }
352
                     }
351
-                    $('#assoc_outcome0').val(json.outcome[0].outcome_id);
353
+					if((json.objective.length))
354
+                    {
355
+	                    $('#assoc_outcome0').val(json.outcome[0].outcome_id);
356
+    				}
352
                     $('#assoc_outcome0').selectpicker('refresh');
357
                     $('#assoc_outcome0').selectpicker('refresh');
353
                     counterAssoc = 1;
358
                     counterAssoc = 1;
354
                     for (var i = 1; i < json.outcome.length; i++) {
359
                     for (var i = 1; i < json.outcome.length; i++) {
399
                         $('#assoc_program_id_' + prog).prop("checked", true);
404
                         $('#assoc_program_id_' + prog).prop("checked", true);
400
                     }
405
                     }
401
 
406
 
407
+		// 			if((json.objective.length))
408
+//                     {
402
 
409
 
403
                     // Select status
410
                     // Select status
404
-                    if (json.objective[0].deleted_at)
411
+                    if (json.objective.length && json.objective[0].deleted_at)
405
                         $('#status').val(0);
412
                         $('#status').val(0);
406
                     else
413
                     else
407
                         $('#status').val(1);
414
                         $('#status').val(1);
413
                         modal =
420
                         modal =
414
                             '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
421
                             '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
415
                             'Delete' +
422
                             'Delete' +
416
-                            '</button>' +
417
-                            '<input type="hidden" value =' + json.objective[0].id + ' name="deleteObj">' +
423
+                            '</button>';
424
+                    if(json.objective.lenght)
425
+                            modal +='<input type="hidden" value =' + json.objective[0].id + ' name="deleteObj">';
418
 
426
 
419
-                            '<div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">' +
427
+                            modal +='<div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">' +
420
                             '<div class="modal-dialog" role="document">' +
428
                             '<div class="modal-dialog" role="document">' +
421
                             '<div class="modal-content">' +
429
                             '<div class="modal-content">' +
422
                             ' <div class="modal-header">' +
430
                             ' <div class="modal-header">' +
448
                         modal =
456
                         modal =
449
                             '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
457
                             '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
450
                             'Delete' +
458
                             'Delete' +
451
-                            '</button>' +
452
-                            '<input type="hidden" value =' + json.objective[0].id + ' name="deleteObj">' +
459
+                            '</button>';
460
+                        if(json.objective.length)
461
+                         modal += '<input type="hidden" value =' + json.objective[0].id + ' name="deleteObj">' ;
453
 
462
 
454
-                            '<div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">' +
463
+                        modal += '<div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">' +
455
                             '<div class="modal-dialog" role="document">' +
464
                             '<div class="modal-dialog" role="document">' +
456
                             '<div class="modal-content">' +
465
                             '<div class="modal-content">' +
457
                             ' <div class="modal-header">' +
466
                             ' <div class="modal-header">' +
599
 
608
 
600
     $('#outcome-display').parent().hide();
609
     $('#outcome-display').parent().hide();
601
 
610
 
602
-    fetchObjectiveForEditing();
611
+<!--     fetchObjectiveForEditing(); -->
603
     // setCriterionStatus();
612
     // setCriterionStatus();
604
 
613
 
605
     fetchAllObjectives("select-program", "assoc_outcomes_fetch")
614
     fetchAllObjectives("select-program", "assoc_outcomes_fetch")

+ 5
- 5
app/views/local/managers/shared/annual-plans.blade.php View File

300
                         });
300
                         });
301
 
301
 
302
 
302
 
303
-                        courseshtml = ' &#8226; [' + course.code + '] ' +
303
+                        courseshtml = ' &#8226; [' + course.code +  course.number + '] ' +
304
                             course.name + '<br>'
304
                             course.name + '<br>'
305
-                        courseTAhtml = ' &#8226; [' + course.code + '] ' +
305
+                        courseTAhtml = ' &#8226; [' + course.code + course.number + '] ' +
306
                             course.name + '<br>';
306
                             course.name + '<br>';
307
                         div_for_course_criteria.append(courseshtml);
307
                         div_for_course_criteria.append(courseshtml);
308
                         div_for_course_transformative.append(courseTAhtml);
308
                         div_for_course_transformative.append(courseTAhtml);
530
                             for (course in courses[objectives[objective].id]) {
530
                             for (course in courses[objectives[objective].id]) {
531
 
531
 
532
                                 courseshtml += ' &#8226; ' + courses[objectives[objective].id][course]
532
                                 courseshtml += ' &#8226; ' + courses[objectives[objective].id][course]
533
-                                    .code + ' ' +
533
+                                    .code + courses[objectives[objective].id][course].number + ' ' +
534
                                     courses[objectives[objective].id][course].name + '<br>'
534
                                     courses[objectives[objective].id][course].name + '<br>'
535
                                 courseTAhtml += ' &#8226; ' + courses[objectives[objective].id][course]
535
                                 courseTAhtml += ' &#8226; ' + courses[objectives[objective].id][course]
536
-                                    .code + ' ' +
536
+                                    .code + courses[objectives[objective].id][course].number + ' ' +
537
                                     courses[objectives[objective].id][course].name + '<br>'
537
                                     courses[objectives[objective].id][course].name + '<br>'
538
 
538
 
539
                                 $divForEach = $('<div/>', {
539
                                 $divForEach = $('<div/>', {
1250
                         'id': 'list'
1250
                         'id': 'list'
1251
                     });
1251
                     });
1252
                     var onclick = "";
1252
                     var onclick = "";
1253
-                    if (json.annual_plans.is_submitted)
1253
+                    if (json.annual_plans.is_submitted==1)
1254
                         onclick = "fetchEverythingSubmitted(this)";
1254
                         onclick = "fetchEverythingSubmitted(this)";
1255
                     else onclick = "fetchEverything(this)";
1255
                     else onclick = "fetchEverything(this)";
1256
                     if (json.outcomes.first) {
1256
                     if (json.outcomes.first) {

+ 3
- 1
app/views/local/managers/shared/program_student_result.blade.php View File

299
             @foreach($outcomes as $outcome)
299
             @foreach($outcomes as $outcome)
300
              @if(isset($outcomes_attempted[$outcome->id]))
300
              @if(isset($outcomes_attempted[$outcome->id]))
301
                 "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_attempted[$outcome->id] }}}, {{{ $outcomes_achieved[$outcome->id] }}})",
301
                 "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_attempted[$outcome->id] }}}, {{{ $outcomes_achieved[$outcome->id] }}})",
302
-            @endif
302
+             	@else
303
+                    "{{{ $outcome->name }}}<br>(N = 0, 0)",         	
304
+           @endif
303
             @endforeach
305
             @endforeach
304
         ],
306
         ],
305
         labels: {
307
         labels: {

+ 2
- 2
app/views/local/managers/shared/rubrics_new.blade.php View File

620
                 notes = data.criterion.notes;
620
                 notes = data.criterion.notes;
621
             }
621
             }
622
             objectives = JSON.stringify(objectives);
622
             objectives = JSON.stringify(objectives);
623
-            
624
             var str ='<tr data-criterion-name ="'+data.criterion.name+'" data-program-ids = "['+program_ids+']" data-assoc-objectives = '+"'"+objectives+"'"+' data-criterion-id="'+data.criterion.id+'" data-criterion-copyright="'+copyright+'" data-criterion-notes="'+notes+'" data-outcomes = "'+data.outcomes+'"><th><span class="glyphicon glyphicon-move"></span></th><td>';
623
             var str ='<tr data-criterion-name ="'+data.criterion.name+'" data-program-ids = "['+program_ids+']" data-assoc-objectives = '+"'"+objectives+"'"+' data-criterion-id="'+data.criterion.id+'" data-criterion-copyright="'+copyright+'" data-criterion-notes="'+notes+'" data-outcomes = "'+data.outcomes+'"><th><span class="glyphicon glyphicon-move"></span></th><td>';
625
 
624
 
626
             var subcriteria = '';
625
             var subcriteria = '';
1411
         $('tbody tr').each(function( index )
1410
         $('tbody tr').each(function( index )
1412
         {
1411
         {
1413
             htmlString = '';
1412
             htmlString = '';
1414
-            
1413
+            console.log($(this));
1414
+
1415
             program_ids = $(this).data('program-ids')
1415
             program_ids = $(this).data('program-ids')
1416
             if(!program_ids.includes(program_id) ){
1416
             if(!program_ids.includes(program_id) ){
1417
                 title = "<h6>The following criteria and objectives will be matched with this program</h6>"
1417
                 title = "<h6>The following criteria and objectives will be matched with this program</h6>"

+ 10
- 4
app/views/local/managers/shared/view-annual-plans.blade.php View File

300
                 courseHTML+= '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
300
                 courseHTML+= '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
301
                 courseTAhtml += '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
301
                 courseTAhtml += '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
302
 
302
 
303
-                for(criterion in json.first.criteria[theObj.id][theCourse.typ_course_id]){
304
-                  theCrit = json.first.criteria[theObj.id][theCourse.typ_course_id][criterion];
303
+//                 for(criterion in json.first.criteria[theObj.id][theCourse.typ_course_id]){
304
+                for(criterion in json.first.criteria[theObj.id][theCourse.course_id]){
305
+//                   theCrit = json.first.criteria[theObj.id][theCourse.typ_course_id][criterion];
306
+                  theCrit = json.first.criteria[theObj.id][theCourse.course_id][criterion];
305
                   courseHTML += '\t&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n\n<br>';
307
                   courseHTML += '\t&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n\n<br>';
306
                   
308
                   
307
                 }
309
                 }
441
                 var theCourse = json.second.courses[theObj.id][course];
443
                 var theCourse = json.second.courses[theObj.id][course];
442
                 courseHTML+= '&#8226'+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
444
                 courseHTML+= '&#8226'+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
443
                 courseTAhtml += '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
445
                 courseTAhtml += '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
444
-                for(criterion in json.second.criteria[theObj.id][theCourse.typ_course_id]){
445
-                  theCrit = json.second.criteria[theObj.id][theCourse.typ_course_id][criterion];
446
+                console.log(theCourse);
447
+                console.log(json.second.criteria[theObj.id][theCourse.course_id]);
448
+//                 for(criterion in json.second.criteria[theObj.id][theCourse.typ_course_id]){
449
+                for(criterion in json.second.criteria[theObj.id][theCourse.course_id]){
450
+                  theCrit = json.second.criteria[theObj.id][theCourse.course_id][criterion];
451
+//                   theCrit = json.second.criteria[theObj.id][theCourse.typ_course_id][criterion];
446
                   courseHTML += '&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n\n<br>';
452
                   courseHTML += '&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n\n<br>';
447
 
453
 
448
 
454