Pārlūkot izejas kodu

trabajando total assessment de administrador

Carlos J Corrada Bravo 3 gadus atpakaļ
vecāks
revīzija
dab90b6018

+ 74
- 0
app/controllers/OutcomesController.php Parādīt failu

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

+ 1
- 0
app/routes.php Parādīt failu

@@ -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 Parādīt failu

@@ -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>