Browse Source

Merge branch 'Merge_gabriel_mayo' of https://git.ccom.uprrp.edu/CDCC/OLAS into Merge_gabriel_mayo

parent
commit
e0ecd9fbbd

+ 74
- 0
app/controllers/OutcomesController.php View File

@@ -724,6 +724,80 @@ class OutcomesController extends \BaseController
724 724
         return View::make('local.managers.admins.assessment_report', compact('title', 'outcome', 'schools'));
725 725
     }
726 726
 
727
+    public function totalAssessmentReport()
728
+    {
729
+    	//SELECT sm.name, s.name, p.name, p.code, a.outcomes_attempted, stu.number, ass.scores, c.code, c.number, r.expected_points 
730
+//     	FROM students stu, schools s, programs p, courses c, activities a, assessments ass, rubrics r, semesters sm 
731
+//     	where stu.id=ass.student_id and sm.id=c.semester_id and s.id=p.school_id and p.id=c.program_id and a.course_id=c.id and ass.activity_id=a.id and a.rubric_id=r.id 
732
+//     	and c.semester_id in (12,13) and a.outcomes_attempted is not null
733
+    ini_set('memory_limit', -1);
734
+	ini_set('max_execution_time', 300);
735
+// 		$total_assessments_temp = DB::table('assessments')
736
+//          						->join('students', 'students.id', '=', 'assessments.student_id')
737
+//          						->join('activities', 'activities.id', '=', 'assessments.activity_id')
738
+//          						->join('rubrics', 'rubrics.id', '=', 'activities.rubric_id')
739
+//          						->join('courses', 'courses.id', '=', 'activities.course_id')
740
+//          						->join('programs', 'programs.id', '=', 'courses.program_id')
741
+//          						->join('schools', 'schools.id', '=', 'programs.school_id')
742
+//           						->join('semesters', 'semesters.id', '=', 'courses.semester_id')
743
+//                    			   	->whereIn('courses.semester_id', Session::get('semesters_ids'))
744
+//                     			->whereRaw('activities.outcomes_attempted is not null')
745
+//                     			->select('activities.id as activity_id','semesters.name as semester','schools.name as school','programs.name as program','programs.id as program_id','programs.code as program_code','students.number as student_number','students.conc_code as student_conc_code','assessments.scores as results','courses.name as course','courses.code as course_code','courses.number as course_number','rubrics.expected_points as expected_result')
746
+//                     			->orderBy('semesters.id','school','program','course','student_number')
747
+// 								->distinct()
748
+//                     			->get();
749
+//                     			    
750
+//         $total_assessments=array();
751
+// 		foreach($total_assessments_temp as $total_assessment)
752
+// 		{
753
+// 			$results=json_decode($total_assessment->results, TRUE);
754
+// 			$total_assessment->course=$total_assessment->course_code.$total_assessment->course_number." ".$total_assessment->course;
755
+// 			foreach($results as $criterion_id => $result)
756
+// 			{	
757
+// 				if($result and $result!="N/A")
758
+// 				{
759
+// 					$trans_temp=clone $total_assessment;
760
+// 					$criterion=Criterion::find($criterion_id);
761
+// 					if($criterion)
762
+// 					{
763
+// 	// 					var_dump($total_assessment->activity_id);
764
+// 	// 					var_dump($criterion_id);
765
+// 						if($criterion_id==1398)var_dump($criterion);
766
+// 	// 					exit();
767
+// 						$trans_temp->result=$result;
768
+// 						$trans_temp->criterion=$criterion->name;
769
+// 						$trans_temp->outcome=Outcome::find($criterion->outcome_id)->name;
770
+// 						$total_assessments[]=$trans_temp;
771
+// 					}
772
+// 				}
773
+// 			}
774
+// 		
775
+// 		}
776
+		$total_assessments = DB::table('assessments')
777
+         						->join('students', 'students.id', '=', 'assessments.student_id')
778
+         						->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
779
+         						->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
780
+         						->join('criteria', 'criteria.id', '=', 'activity_criterion.criterion_id')
781
+         						->join('criterion_objective_outcome', 'criteria.id', '=', 'criterion_objective_outcome.criterion_id')
782
+         						->join('outcomes', 'outcomes.id', '=', 'criterion_objective_outcome.outcome_id')
783
+         						->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
784
+         						->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
785
+         						->join('courses', 'courses.id', '=', 'activities.course_id')
786
+         						->join('programs', 'programs.id', '=', 'courses.program_id')
787
+         						->join('schools', 'schools.id', '=', 'programs.school_id')
788
+          						->join('semesters', 'semesters.id', '=', 'courses.semester_id')
789
+                   			   	->whereIn('courses.semester_id', Session::get('semesters_ids'))
790
+                    			->select('criteria.name as criterion','outcomes.name as outcome','activities.id as activity_id','semesters.name as semester','schools.name as school','programs.name as program','programs.id as program_id','programs.code as program_code','students.number as student_number','students.conc_code as student_conc_code','assessments.score as result','courses.name as course','courses.code as course_code','courses.number as course_number','rubrics.expected_points as expected_result')
791
+                    			->orderBy('semesters.id','school','program','course','student_number')
792
+								->distinct()
793
+                    			->get();
794
+
795
+
796
+       $title = "Total Assessment Report";
797
+		
798
+        return View::make('local.managers.admins.total_assessment', compact('title', 'total_assessments'));
799
+    }
800
+
727 801
     // TODO: Change later
728 802
     public function newAssessmentReport($outcome_id)
729 803
     {

+ 1
- 0
app/routes.php View File

@@ -334,6 +334,7 @@ Route::group(array('before' => 'auth|has_access'), function () {
334 334
         Route::post('courses/update', array('before' => 'csrf', 'uses' => 'CoursesController@update'));
335 335
 
336 336
         Route::get('activities/create', 'ActivitiesController@newCreate');
337
+        Route::get('total_assessment-report', 'OutcomesController@totalAssessmentReport');
337 338
     });
338 339
 
339 340
     /**

+ 6
- 9
app/views/local/managers/admins/_navigation.blade.php View File

@@ -52,7 +52,8 @@
52 52
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Reports<span class="caret"></span></a>
53 53
         <ul class="dropdown-menu" role="menu">
54 54
           <li>{{ HTML::linkAction('OutcomesController@managerAssessmentReports', 'Campus Reports') }}</li>
55
-          @if(count(Auth::user()->courses))
55
+          <li>{{ HTML::linkAction('OutcomesController@totalAssessmentReport', 'Total Assessment Reports') }}</li>
56
+         @if(count(Auth::user()->courses))
56 57
           <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReports', 'My Courses\' Reports') }}</li>
57 58
 
58 59
           @endif
@@ -71,18 +72,14 @@
71 72
       </li>
72 73
       <li class="dropdown">
73 74
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Account<span class="caret"></span></a>
74
-        <ul class="dropdown-menu" role="menu">
75
+{{--         <ul class="dropdown-menu" role="menu">
75 76
           <li>{{ HTML::linkAction('UsersController@edit', 'Profile') }}</li>
76 77
           <li>{{ HTML::linkAction('AuthController@logout', 'Log out ('.Auth::user()->email.')') }}</li>
77 78
         </ul>
78 79
       </li>
79
-      <li class="dropdown">
80
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">NEW<span class="caret"></span></a>
81
-        <ul class="dropdown-menu" role="menu">
82
-          <li>{{ HTML::linkAction('OutcomesController@newIndex', 'New Index') }}</li>
83
-          {{-- <li>{{ HTML::linkAction('AuthController@logout', 'Log out ('.Auth::user()->email.')') }}
84
-      </li>--}}
85
-    </ul>
80
+          <li>{{ HTML::linkAction('AuthController@logout', 'Log out ('.Auth::user()->email.')') }}
81
+      </li>
82
+    </ul>--}}
86 83
     </li>
87 84
     </ul>
88 85
   </div>