소스 검색

subir y matricular estudiantes

부모
커밋
e05e0e02c5

+ 207
- 35
app/controllers/CoursesController.php 파일 보기

@@ -1,5 +1,7 @@
1 1
 <?php
2 2
 
3
+use Illuminate\Support\Facades\Log;
4
+
3 5
 class
4 6
 CoursesController extends \BaseController
5 7
 {
@@ -50,6 +52,176 @@ CoursesController extends \BaseController
50 52
         return View::make('local.professors.course', compact('title', 'course', 'activities', 'students', 'outcomes', 'outcomes_achieved', 'outcomes_attempted', 'active_semesters'));
51 53
     }
52 54
 
55
+    public function editView()
56
+    {
57
+        $title = 'Create/Edit Course';
58
+        switch (Auth::user()->role) {
59
+            case 1:
60
+
61
+                $programs = Program::with('school')->orderBy('name', 'asc')->get();
62
+                $professors = User::select(array('id', 'first_name', 'surnames'))->orderBy('surnames', 'asc')->orderBy('first_name', 'asc')->get();
63
+                break;
64
+            case 2:
65
+                $programs = Program::where("school_id", Auth::user()->school->id);
66
+                $professors = User::fromSchool(Auth::user()->school->id)->select(array('id', 'first_name', 'surnames'))->orderBy('surnames', 'asc')->orderBy('first_name', 'asc')->get();
67
+                break;
68
+            case 3:
69
+                $programs = Auth::user()->programs;
70
+                $program_ids = Program::join('program_user', 'program_user.program_id', '=', 'programs.id')
71
+                    ->where('program_user.user_id', Auth::user()->id)
72
+                    ->lists('programs.id');
73
+
74
+                $professors = User::fromPrograms($program_ids)->select(array('id', 'first_name', 'surnames'))->orderBy('surnames', 'asc')->orderBy('first_name', 'asc')->get();
75
+                break;
76
+        }
77
+        //$users = User::select(array('id', 'first_name', 'surnames'))->orderBy('surnames', 'asc')->orderBy('first_name', 'asc')->get();
78
+        $semesters = Semester::where('is_visible', '1')->orderBy('start', 'desc')->get();
79
+        $modalities = DB::table("courses")
80
+            ->groupBy("modality")
81
+            ->lists("modality");
82
+
83
+        return View::make('local.managers.shared.course_edit', compact('title', 'programs', 'professors', 'modalities', 'semesters'));
84
+    }
85
+
86
+    public function create()
87
+    {
88
+
89
+        $all_input = Input::all();
90
+        $name = $all_input['name'];
91
+        $code = $all_input['code'];
92
+        $number = $all_input['number'];
93
+        $section = $all_input['section'];
94
+        $program = $all_input['program'];
95
+        $professor_id = $all_input['professor_id'];
96
+        $semester_id = $all_input['semester_id'];
97
+        //Input::file('students')//->move('course_student/', 'test.txt');
98
+
99
+
100
+
101
+        Log::info($all_input);
102
+
103
+        /** Instantiate new Objective */
104
+        $course = new Course;
105
+        $course->name = $name;
106
+        $course->code = $code;
107
+        $course->number = $number;
108
+        $course->section = $section;
109
+        $course->program_id = $program;
110
+        $course->user_id = $professor_id;
111
+        $course->semester_id = $semester_id;
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+        /** If Objective is saved, send success message */
120
+        if ($course->save()) {
121
+
122
+            //$students->move('./course_student', 'test.txt');
123
+            $student_nums = file(Input::file('students'));
124
+
125
+            if ($student_nums) {
126
+                foreach ($student_nums as $stu_num) {
127
+                    Log::info($stu_num);
128
+                    Log::info("Stunum");
129
+                    $student_id = DB::select("select id from students where number = " . $stu_num);
130
+                    /*DB::table("students")
131
+                        ->where('number', '=', $stu_num)
132
+                        ->first();
133
+                    */
134
+                    if ($student_id) {
135
+                        $student_id = $student_id[0]->id;
136
+                        DB::table("course_student")
137
+                            ->insert(array(
138
+                                'course_id' => $course->id,
139
+                                'student_id' => $student_id,
140
+                                'semester_id' => $course->semester_id
141
+                            ));
142
+                    } else {
143
+                        $course->forceDelete();
144
+                        Session::flash('status', 'danger');
145
+                        Session::flash('message', '<p>Error Enrolling students. Please try again later.</p>');
146
+                        return Redirect::to('editCourses')->withInput();
147
+                    }
148
+                }
149
+
150
+                Session::flash('status', 'success');
151
+                Session::flash('message', 'Course created: "' . $course->name . '".');
152
+                return Redirect::to('editCourses');
153
+
154
+
155
+
156
+                //fclose($student_nums);
157
+            } else {
158
+                $course->forceDelete();
159
+                Session::flash('status', 'danger');
160
+                Session::flash('message', '<p>Error creating course. Please try again later.</p>');
161
+                return Redirect::to('editCourses')->withInput();
162
+            }
163
+            /*$objectiveId = $objective->id;
164
+
165
+            Log::info($clean_input['outcome_id']);
166
+
167
+
168
+
169
+
170
+            foreach ($clean_input['program_id'] as $program_id) {
171
+                DB::insert("insert into objective_program (objective_id, program_id) values({$objectiveId},{$program_id})");
172
+            }
173
+            foreach ($clean_input['outcome_id'] as $outcome_id) {
174
+                DB::insert("insert into `objective_outcome` (objective_id, outcome_id) values ({$objectiveId}, {$outcome_id})");
175
+                //DB::raw("insert ignore into `objective_outcome` (objective_id, outcome_id) values ({$objectiveId}, {$outcome_id})");
176
+                /*if (!($objectiveOutcome->save())) {
177
+                    Session::flash('status', 'danger');
178
+                    Session::flash('message', '<p>Error creating objective. Please try again later.</p>');
179
+                    return Redirect::to('objective')->withInput();
180
+                }
181
+            }
182
+            DB::table('criterion_objective_outcome')
183
+                ->join('program_criterion', 'criterion_objective_outcome.criterion_id', "=", 'program_criterion.criterion_id')
184
+                ->whereIn('program_id', $clean_input['program_id'])
185
+                ->whereIn('outcome_id', $clean_input['outcome_id'])
186
+                ->where('objective_id', '=', 0)
187
+                ->update(array('objective_id' => $objectiveId));
188
+            // 				update("update criterion_objective_outcome coo join program_criterion pc on coo.criterion_id=pc.criterion_id set 
189
+            // 				objective_id= {$objectiveId} where program_id in (".$clean_input['program_id'].") and objective_id=0 and outcome_id in (".$clean_input['outcome_id'].")");
190
+            */
191
+
192
+            /*$role = Auth::user()['role'];
193
+            switch ($role) {
194
+                case 1:
195
+                    return Redirect::to('objective')->withInput(Input::only('outcome_id'));
196
+
197
+                case 2:
198
+                    return Redirect::to('school-objective')->withInput(Input::only('outcome_id'));
199
+
200
+                case 3:
201
+                    return Redirect::to('program-objective')->withInput(Input::only('outcome_id'));
202
+            }*/
203
+        }
204
+
205
+        /** If saving fails, send error message and old data */
206
+        else {
207
+            Session::flash('status', 'danger');
208
+            Session::flash('message', '<p>Error creating course. Please try again later.</p>');
209
+            return Redirect::to('editCourse')->withInput();
210
+            /*$role = Auth::user()['role'];
211
+            switch ($role) {
212
+                case 1:
213
+                    return Redirect::to('objective')->withInput();
214
+
215
+                case 2:
216
+                    return Redirect::to('school-objective')->withInput();
217
+
218
+                case 3:
219
+                    return Redirect::to('program-objective')->withInput();
220
+            }*/
221
+        }
222
+    }
223
+
224
+
53 225
     public function newShow($id)
54 226
     {
55 227
         $course = Course::findOrFail($id);
@@ -231,8 +403,8 @@ CoursesController extends \BaseController
231 403
             ->where('semester_id', $semester->id)
232 404
             ->groupBy(array('code', 'number'))->get();
233 405
 
234
-//         Log::info($grouped_courses[0]->id);
235
-// exit();
406
+        //         Log::info($grouped_courses[0]->id);
407
+        // exit();
236 408
         $level = DB::table('courses')
237 409
             ->join('programs', 'programs.id', '=', 'courses.program_id')
238 410
             ->where('courses.id', $grouped_courses[0]->id)
@@ -242,7 +414,7 @@ CoursesController extends \BaseController
242 414
         $outcomes = Outcome::active_by_semesters(array($semester), $level->is_graduate);
243 415
 
244 416
 
245
-//         $outcomes = Outcome::orderBy('name', 'asc')->get();
417
+        //         $outcomes = Outcome::orderBy('name', 'asc')->get();
246 418
         $outcomeCount = Outcome::all()->count();
247 419
 
248 420
         foreach ($grouped_courses as $index => $grouped_course) {
@@ -258,30 +430,30 @@ CoursesController extends \BaseController
258 430
 
259 431
             // For each of the sections, add the attempted and achieved criteria per outcome
260 432
             foreach ($sections as &$section) {
261
-                        if ($section->outcomes_ach()) {
262
-						$section->outcomes_attempted=true;
263
-						$course_outcomes_achieved = $section->outcomes_ach();
264
-						$course_outcomes_attempted = $section->outcomes_att();
265
-						foreach ($course_outcomes_achieved as $outcome => $score) {
266
-							if (array_key_exists($outcome, $outcomes_achieved))
267
-								$outcomes_achieved[$outcome] += $score;
268
-							else $outcomes_achieved[$outcome] = $score;
269
-						}
270
-						foreach ($course_outcomes_attempted as $outcome => $score) {
271
-							if (array_key_exists($outcome, $outcomes_attempted))
272
-								$outcomes_attempted[$outcome] += $score;
273
-							else $outcomes_attempted[$outcome] = $score;
274
-						}
275
-					}
276
-            
277
-//                 if ($section->outcomes_achieved != NULL) {
278
-//                     $section_outcomes_achieved = json_decode($section->outcomes_achieved, true);
279
-//                     $section_outcomes_attempted = json_decode($section->outcomes_attempted, true);
280
-//                     for ($i = 1; $i <= count($outcomes_attempted); $i++) {
281
-//                         $outcomes_achieved[$i] += $section_outcomes_achieved[$i];
282
-//                         $outcomes_attempted[$i] += $section_outcomes_attempted[$i];
283
-//                     }
284
-//                 }
433
+                if ($section->outcomes_ach()) {
434
+                    $section->outcomes_attempted = true;
435
+                    $course_outcomes_achieved = $section->outcomes_ach();
436
+                    $course_outcomes_attempted = $section->outcomes_att();
437
+                    foreach ($course_outcomes_achieved as $outcome => $score) {
438
+                        if (array_key_exists($outcome, $outcomes_achieved))
439
+                            $outcomes_achieved[$outcome] += $score;
440
+                        else $outcomes_achieved[$outcome] = $score;
441
+                    }
442
+                    foreach ($course_outcomes_attempted as $outcome => $score) {
443
+                        if (array_key_exists($outcome, $outcomes_attempted))
444
+                            $outcomes_attempted[$outcome] += $score;
445
+                        else $outcomes_attempted[$outcome] = $score;
446
+                    }
447
+                }
448
+
449
+                //                 if ($section->outcomes_achieved != NULL) {
450
+                //                     $section_outcomes_achieved = json_decode($section->outcomes_achieved, true);
451
+                //                     $section_outcomes_attempted = json_decode($section->outcomes_attempted, true);
452
+                //                     for ($i = 1; $i <= count($outcomes_attempted); $i++) {
453
+                //                         $outcomes_achieved[$i] += $section_outcomes_achieved[$i];
454
+                //                         $outcomes_attempted[$i] += $section_outcomes_attempted[$i];
455
+                //                     }
456
+                //                 }
285 457
             }
286 458
         }
287 459
 
@@ -291,7 +463,7 @@ CoursesController extends \BaseController
291 463
             ->lists('id');
292 464
 
293 465
         // Activities with transforming actions
294
-//         $activities = Activity::with('course')->whereNotNull('transforming_actions')->whereIn('course_id', $section_ids)->orderBy('name')->groupBy('transforming_actions')->get();
466
+        //         $activities = Activity::with('course')->whereNotNull('transforming_actions')->whereIn('course_id', $section_ids)->orderBy('name')->groupBy('transforming_actions')->get();
295 467
         $activities = Activity::with('course')->whereIn('course_id', $section_ids)->orderBy('name')->get();
296 468
 
297 469
         return View::make('local.managers.shared.print_course', compact('role', 'title', 'grouped_courses', 'outcomes', 'outcomes_attempted', 'outcomes_achieved', 'sections', 'activities'));
@@ -334,14 +506,14 @@ CoursesController extends \BaseController
334 506
             fputcsv($file, array($activity_name));
335 507
 
336 508
             // Get assessments
337
-//             $assessments = DB::table('assessments')
338
-//             	->join('students', 'assessments.student_id', '=', 'students.id')
339
-//             	->where('activity_id', '=', $activity->id)->orderBy('assessments.id', 'asc')->get();
509
+            //             $assessments = DB::table('assessments')
510
+            //             	->join('students', 'assessments.student_id', '=', 'students.id')
511
+            //             	->where('activity_id', '=', $activity->id)->orderBy('assessments.id', 'asc')->get();
340 512
 
341 513
             $assessments = DB::table('assessments')
342
-            	->join('students', 'assessments.student_id', '=', 'students.id')
343
-            	->join('activity_criterion', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
344
-            	->where('activity_criterion.activity_id', '=', $activity->id)->orderBy('assessments.id', 'asc')->get();
514
+                ->join('students', 'assessments.student_id', '=', 'students.id')
515
+                ->join('activity_criterion', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
516
+                ->where('activity_criterion.activity_id', '=', $activity->id)->orderBy('assessments.id', 'asc')->get();
345 517
 
346 518
             // Get rubric contents
347 519
             $rubric_contents = json_decode($activity->rubric->contents);
@@ -542,4 +714,4 @@ CoursesController extends \BaseController
542 714
         } else {
543 715
         }
544 716
     }
545
-}
717
+}

+ 15
- 1
app/models/User.php 파일 보기

@@ -44,6 +44,20 @@ class User extends Eloquent implements UserInterface, RemindableInterface
44 44
 		],
45 45
 	];
46 46
 
47
+	public function scopeFromSchool($query, $school_id)
48
+	{
49
+		return $query->join('program_user', 'program_user.user_id', '=', 'users.id')
50
+			->join('programs', 'program_user.program_id', '=', 'programs.id')
51
+			->where('programs.school_id', $school_id)
52
+			->select('users.*');
53
+	}
54
+
55
+	public function scoreFromPrograms($query, $program_ids)
56
+	{
57
+		return $query->join("program_user", 'users.id', '=', 'program_user.user_id')
58
+			->whereIn('program_user.program_id', $program_ids)
59
+			->select('users.*');
60
+	}
47 61
 
48 62
 	public function program()
49 63
 	{
@@ -70,4 +84,4 @@ class User extends Eloquent implements UserInterface, RemindableInterface
70 84
 	{
71 85
 		return $this->belongsToMany('Program')->select('programs.id', 'programs.name', 'programs.school_id', 'programs.is_graduate');
72 86
 	}
73
-}
87
+}

+ 6
- 0
app/routes.php 파일 보기

@@ -215,6 +215,12 @@ Route::group(array('before' => 'auth|has_access'), function () {
215 215
         'uses' => 'AnnualPlansController@fetchAnnualReport'
216 216
     ));
217 217
 
218
+    //Shared course creation, ( por si School coordinator y Program coordinator
219
+    // van a poder crear luego)
220
+    Route::get('editCourses', 'CoursesController@editView');
221
+    Route::post("createCourse", 'CoursesController@create');
222
+
223
+
218 224
     //shared viewTransformativeActions
219 225
 
220 226
     Route::get('viewTransformativeActions', 'TransformativeActionsController@viewTransformativeActions');

+ 2
- 1
app/views/local/managers/admins/_new_navigation.blade.php 파일 보기

@@ -72,7 +72,8 @@
72 72
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
73 73
                     aria-expanded="false">Management<span class="caret"></span></a>
74 74
                 <ul class="dropdown-menu dropdown-menu-left" role="menu">
75
-                    <li>{{ HTML::linkAction('CoursesController@reassign', 'Courses') }}</li>
75
+                    <li>{{ HTML::linkAction('CoursesController@editView','Create Courses')}}</li>
76
+                    <li>{{ HTML::linkAction('CoursesController@reassign', 'Reassign Courses') }}</li>
76 77
 
77 78
                     <li>{{ HTML::linkAction('OutcomesController@index', 'Learning Outcomes') }}</li>
78 79
 

+ 205
- 0
app/views/local/managers/shared/course_edit.blade.php 파일 보기

@@ -0,0 +1,205 @@
1
+@extends('layouts.master')
2
+
3
+@section('navigation')
4
+    @include('local.managers.admins._new_navigation')
5
+@stop
6
+@section('main')
7
+
8
+    <div class="row">
9
+        <div class="col-md-6">
10
+            <div class="panel panel-default panel-button">
11
+                <div class="panel-heading">
12
+                    Create a Course
13
+                </div>
14
+                <div class="panel-body">
15
+
16
+                    {{ Form::open(['action' => 'CoursesController@create','enctype'=>"multipart/form-data"]) }}
17
+                    <div class="form-group">
18
+                        {{ Form::label("name",'Name')}}
19
+                        {{ Form::text('name', Input::old('name'), ['class'=>'form-control', 'placeholder' => "Introducción a la ..."])}}
20
+                    </div>
21
+                    <div class="form-group">
22
+                        {{ Form::label('code', 'Code') }}
23
+                        {{ Form::text('code', Input::old('code'), ['class' => 'form-control', 'placeholder' => 'TEST', 'maxLength' => 4]) }}
24
+                    </div>
25
+
26
+                    <div class="form-group">
27
+                        {{ Form::label('number', 'Number') }}
28
+                        {{ Form::text('number', Input::old('number'), ['class' => 'form-control', 'placeholder' => '3001', 'maxLength' => 4]) }}
29
+                    </div>
30
+
31
+                    <div class="form-group">
32
+                        {{ Form::label('section', 'Section') }}
33
+                        {{ Form::text('section', Input::old('section'), ['class' => 'form-control', 'placeholder' => '001', 'maxLength' => 3]) }}
34
+                    </div>
35
+
36
+                    <!-- Program -->
37
+                    <div class="form-group">
38
+                        {{ Form::label('program', 'Program') }}
39
+                        <select id="program" name="program" class="form-control selectpicker">
40
+                            
41
+                            @foreach ($programs as $program)
42
+                                @if (Input::old('program') != $program->id)
43
+                                    <option value="{{ $program->id }}">{{ $program->name }}
44
+                                        ({{ $program->school->name }})</option>
45
+                                @else
46
+                                    <option selected value="{{ $program->id }}">{{ $program->name }}
47
+                                        ({{ $program->school->name }})</option>
48
+                                @endif
49
+                            @endforeach
50
+                        </select>
51
+                    </div>
52
+
53
+                    <div class="form-group">
54
+                        {{ Form::label('user_id', 'Professor') }}
55
+                        <select id="professor_id" name="professor_id" class="form-control selectpicker">
56
+                             @foreach ($professors as $professor)
57
+                                 @if (Input::old('professor_id') != $professor->id )
58
+                                    <option value="{{$professor->id}}">{{ $professor->surnames }}, {{$professor->first_name}}
59
+                                        {{-- $professor->program->name --}}</option>
60
+                                @else
61
+                                    <option selected value="{{ $professor->id }}">{{ $professor->name }}
62
+                                        {{-- $professor->program->name --}}</option>
63
+                               
64
+
65
+                                    
66
+                                @endif
67
+                            @endforeach
68
+                        </select>
69
+                    </div>
70
+
71
+                    <div class ="form-group">
72
+                        {{ Form::label("semester_id",'Semester')}}
73
+
74
+                        <select id ="semester_id" name="semester_id" class="form-control selectpicker">
75
+                            @foreach ($semesters as $semester)
76
+                                @if (Input::old('semester_prof') != $semester->id)
77
+                                    <option value="{{ $semester->id }}">{{ $semester->name }}</option>
78
+                                @else
79
+                                    <option selected value="{{ $semester->id }}">{{ $semester->name }}</option>
80
+                                @endif
81
+                            @endforeach
82
+                        </select>
83
+                    </div>
84
+
85
+                    <div class ="form-group">
86
+                        <label for="file">Choose student text file</label>
87
+                        <input type="file"
88
+                        id="students" class="form-control" name="students"
89
+                        accept=".txt">
90
+                    </div>
91
+
92
+                    <br>
93
+
94
+                    {{ Form::submit('Create Course', ['class' => 'btn btn-primary btn-block', 'name' => 'create_course']) }}
95
+                    {{ Form::close() }}
96
+
97
+                    <br>
98
+
99
+                    @if (Session::has('courses'))
100
+                        <p><strong>The following courses were updated:</strong></p>
101
+                        <ul>
102
+                            @foreach (json_decode(Session::get('courses')) as $course)
103
+                                <li>
104
+
105
+                                    @if (Session::has('show_sections'))
106
+                                        {{ $course->code }}{{ $course->number }}-{{ $course->section }}
107
+                                    @else
108
+                                        {{ $course->code }}{{ $course->number }}
109
+                                    @endif
110
+                                </li>
111
+                            @endforeach
112
+                        </ul>
113
+                    @endif
114
+                </div>
115
+            </div>
116
+        </div>
117
+
118
+        <div class="col-md-6">
119
+            <div class="panel panel-default panel-button">
120
+                <div class="panel-heading">
121
+                    Reassign Sections' Professors
122
+                </div>
123
+                <div class="panel-body">
124
+
125
+                    <p>Use this to reassign a section to a specific professor. Write down the code, number and section of
126
+                        the course. Then, choose a professor from the list. <strong>All fields are required.</strong></p>
127
+
128
+                    {{ Form::open(['action' => 'CoursesController@update']) }}
129
+
130
+                    <div class="form-group">
131
+                        {{ Form::label('code_prof', 'Code') }}
132
+                        {{ Form::text('code_prof', Input::old('code_prof'), ['class' => 'form-control', 'placeholder' => 'TEST', 'maxLength' => 4]) }}
133
+                    </div>
134
+
135
+                    <div class="form-group">
136
+                        {{ Form::label('number_prof', 'Number') }}
137
+                        {{ Form::text('number_prof', Input::old('number_prof'), ['class' => 'form-control', 'placeholder' => '3001', 'maxLength' => 4]) }}
138
+                    </div>
139
+
140
+                    <div class="form-group">
141
+                        {{ Form::label('section_prof', 'Section') }}
142
+                        {{ Form::text('section_prof', Input::old('section_prof'), ['class' => 'form-control', 'placeholder' => '001', 'maxLength' => 3]) }}
143
+                    </div>
144
+
145
+                    <!-- Program -->
146
+                    {{--
147
+                    <div class="form-group">
148
+                        {{ Form::label('user_prof', 'User') }}
149
+                        <select id="user_prof" name="user_prof" class="form-control">
150
+                            @foreach ($users as $user)
151
+                                @if (Input::old('user_prof') != $user->id)
152
+                                    <option value="{{ $user->id }}">{{ $user->surnames }},
153
+                                        {{ $user->first_name }}</option>
154
+                                @else
155
+                                    <option selected value="{{ $user->id }}">{{ $user->surnames }},
156
+                                        {{ $user->first_name }}</option>
157
+                                @endif
158
+                            @endforeach
159
+                        </select>
160
+                    </div>
161
+                    --}}
162
+
163
+                    <!-- Semester -->
164
+                    <div class="form-group">
165
+                        {{ Form::label('semester_prof', 'Semester') }}
166
+                        <select id="semester_prof" name="semester_prof" class="form-control selectpicker">
167
+                            @foreach ($semesters as $semester)
168
+                                @if (Input::old('semester_prof') != $semester->id)
169
+                                    <option value="{{ $semester->id }}">{{ $semester->name }}</option>
170
+                                @else
171
+                                    <option selected value="{{ $semester->id }}">{{ $semester->name }}</option>
172
+                                @endif
173
+                            @endforeach
174
+                        </select>
175
+                    </div>
176
+
177
+                    <br>
178
+
179
+                    {{ Form::submit('Create Course', ['class' => 'btn btn-primary btn-block', 'name' => 'create_professor']) }}
180
+                    {{ Form::close() }}
181
+
182
+                </div>
183
+            </div>
184
+        </div>
185
+    </div>
186
+@stop
187
+
188
+@section('javascript')
189
+
190
+    // --------------------------------------------------------------------------
191
+    // Page load
192
+    // --------------------------------------------------------------------------
193
+
194
+
195
+    // --------------------------------------------------------------------------
196
+    // Functions
197
+    // --------------------------------------------------------------------------
198
+
199
+
200
+
201
+    // --------------------------------------------------------------------------
202
+    // Events
203
+    // --------------------------------------------------------------------------
204
+
205
+@stop

+ 25
- 4
app/views/local/professors/program.blade.php 파일 보기

@@ -135,7 +135,21 @@ $(function () {
135 135
             max: 100,
136 136
             title: {
137 137
                 text: 'Percentage'
138
-            }
138
+            },
139
+			plotLines:[{
140
+                value:66.67,
141
+                color: '#000',
142
+                width:3,
143
+                zIndex:4,
144
+                label:{
145
+                    text: 'Goal (66.67%)',
146
+                    style: {
147
+                        color: '#000',
148
+                        fontSize: '14px',
149
+                    }
150
+        
151
+                }
152
+            }]
139 153
         },
140 154
         tooltip: {
141 155
             headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
@@ -176,7 +190,14 @@ $(function () {
176 190
                         is_array($outcomes_attempted)
177 191
                         && array_key_exists($outcome->id, $outcomes_attempted)
178 192
                         && $outcomes_attempted[$outcome->id]!=0)
179
-                        {{{ ($outcomes_achieved[$outcome->id]/$outcomes_attempted[$outcome->id])*100 }}},
193
+
194
+                        <?php
195
+                            if (isset($outcomes_achieved[$outcome->id])){
196
+                                $achieved = $outcomes_achieved[$outcome->id];
197
+                            }
198
+                            else $achieved = 0;
199
+                        ?>
200
+                        {{{ ($achieved/$outcomes_attempted[$outcome->id])*100 }}},
180 201
                     @else
181 202
                         0,
182 203
                     @endif
@@ -184,7 +205,7 @@ $(function () {
184 205
 
185 206
             ],
186 207
             pointPadding: 0,
187
-        }, {
208
+        } {{--, {
188 209
             name: 'Expected',
189 210
             color: '#555555',
190 211
             dataLabels: {
@@ -212,7 +233,7 @@ $(function () {
212 233
             ],
213 234
             pointPadding: 0,
214 235
 
215
-        }]
236
+        } --}}]
216 237
     });
217 238
 
218 239
     // Include dummy graph for outcomes

+ 4
- 0
course_student/test.txt 파일 보기

@@ -0,0 +1,4 @@
1
+801211047
2
+840080010
3
+401050006
4
+955970041