|
@@ -5,6 +5,36 @@
|
5
|
5
|
@stop
|
6
|
6
|
@section('main')
|
7
|
7
|
|
|
8
|
+ <!-- New Rubric Modal -->
|
|
9
|
+ <div class="modal fade" id="newRubricModal" tabindex="-1" role="dialog" aria-labelledby="newRubricModalLabel" aria-hidden="true">
|
|
10
|
+ <div class="modal-dialog modal-sm">
|
|
11
|
+ <div class="modal-content">
|
|
12
|
+ <div class="modal-header">
|
|
13
|
+ <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
|
14
|
+ <h4 class="modal-title" id="newRubricModalLabel">New Instrument</h4>
|
|
15
|
+ </div>
|
|
16
|
+ <div class="modal-body">
|
|
17
|
+ {{ Form::open(array('action' => array('RubricsController@create'))) }}
|
|
18
|
+ <div class="form-group">
|
|
19
|
+ {{ Form::label('name', 'Name') }}
|
|
20
|
+ {{ Form::text('name', Input::old('name'), array('class' => 'form-control')) }}
|
|
21
|
+ </div>
|
|
22
|
+ <div class="form-group">
|
|
23
|
+ {{ Form::label('criteria', 'Criteria') }}
|
|
24
|
+ <select id="criteria" name="criteria" class="form-control" multiple required>
|
|
25
|
+ </select>
|
|
26
|
+ {{ Form::textarea('criteria', Input::old('description'), array('class' => 'form-control', 'rows'=> 5, 'placeholder'=>'Minimum 10 characters')) }}
|
|
27
|
+ </div>
|
|
28
|
+ <div class="btn-group" role="group">
|
|
29
|
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
30
|
+ <button type="submit" class="btn btn-default btn-primary">Submit</button>
|
|
31
|
+ </div>
|
|
32
|
+ {{ Form::close() }}
|
|
33
|
+ </div>
|
|
34
|
+ </div>
|
|
35
|
+ </div>
|
|
36
|
+ </div>
|
|
37
|
+
|
8
|
38
|
<div class="row">
|
9
|
39
|
<div class="col-md-12">
|
10
|
40
|
<div class="panel panel-default panel-button">
|
|
@@ -12,10 +42,7 @@
|
12
|
42
|
Create new activity
|
13
|
43
|
</div>
|
14
|
44
|
<div class="panel-body">
|
15
|
|
-
|
16
|
|
-
|
17
|
|
- {{ Form::open(array('action' => 'CoursesController@update')) }}
|
18
|
|
-
|
|
45
|
+ {{ Form::open(array('action' => 'ActivitiesController@update')) }}
|
19
|
46
|
<div class="form-group">
|
20
|
47
|
{{ Form::label('activity_type', 'Activity Type') }}
|
21
|
48
|
<select id="activity_type" name="activity_type" class="form-control">
|
|
@@ -30,25 +57,13 @@
|
30
|
57
|
{{-- {{ Form::text('activity_type', Input::old('activity_Type'), array('class' => 'form-control', 'placeholder'=>'TEST', 'maxLength'=>5)) }}--}}
|
31
|
58
|
</div>
|
32
|
59
|
|
33
|
|
- <div class="form-group">
|
34
|
|
- {{ Form::label('instrument', 'Instrument') }}
|
35
|
|
- <select id="instrument" name="instrument" class="form-control">
|
36
|
|
- @foreach ($instruments as $instrument)
|
37
|
|
- {{-- @if(Input::old('instrument')!=$instrument)--}}
|
38
|
|
- {{-- <option value="{{ $instrument }}">{{ $instrument }} ({{ $program->school->name }})</option>--}}
|
39
|
|
- {{-- @else--}}
|
40
|
|
- {{-- <option selected value="{{ $program->id }}">{{ $program->name }} ({{ $program->school->name }})</option>--}}
|
41
|
|
- {{-- @endif--}}
|
42
|
|
- @endforeach
|
43
|
|
- </select>
|
44
|
|
- {{-- {{ Form::text('instrument', Input::old('instrument'), array('class' => 'form-control', 'placeholder'=>'TEST', 'maxLength'=>5)) }}--}}
|
45
|
|
- </div>
|
|
60
|
+
|
46
|
61
|
<div class="form-group">
|
47
|
62
|
{{ Form::label('outcome', 'Learning Outcome') }}
|
48
|
63
|
<select id="outcome" name="outcome" class="form-control">
|
49
|
64
|
@foreach ($outcomes as $outcome)
|
50
|
65
|
@if(Input::old('outcome')!=$outcome->id)
|
51
|
|
- <option value="{{ $outcome->id }}">{{ $outcome->name }})</option>
|
|
66
|
+ <option value="{{ $outcome->id }}">{{ $outcome->name }}</option>
|
52
|
67
|
@else
|
53
|
68
|
<option selected value="{{ $outcome->id }}">{{ $outcome->name }}</option>
|
54
|
69
|
@endif
|
|
@@ -57,17 +72,38 @@
|
57
|
72
|
</div>
|
58
|
73
|
<div class="form-group">
|
59
|
74
|
{{ Form::label('objective', 'Learning Objective') }}
|
60
|
|
- <select id="objective" name="objective[]" class="form-control" multiple>
|
61
|
|
- @foreach ($objectives as $objective)
|
62
|
|
- @if(Input::old('objective')!=$objective->id)
|
63
|
|
- <option value="{{ $objective->id }}">{{ $objective->name }}</option>
|
|
75
|
+ <select id="objective" name="objective[]" class="form-control" multiple required>
|
|
76
|
+ @if(Input::old('outcome')!=null)
|
|
77
|
+ @foreach ($objectives_by_outcome[Input::old('outcome')] as $objective)
|
|
78
|
+ @if(Input::old('objective')!=$objective->id)
|
|
79
|
+ <option value="{{ $objective->id }}">{{ $objective->text }}</option>
|
|
80
|
+ @else
|
|
81
|
+ <option selected value="{{ $objective->id }}">{{ $objective->text }}</option>
|
|
82
|
+ @endif
|
|
83
|
+ @endforeach
|
|
84
|
+ @else
|
|
85
|
+ @foreach ($objectives_by_outcome[$outcomes->first()->id] as $objective)
|
|
86
|
+ <option value="{{ $objective->id }}">{{ $objective->text }}</option>
|
|
87
|
+ @endforeach
|
|
88
|
+ @endif
|
|
89
|
+ </select>
|
|
90
|
+ </div>
|
|
91
|
+ <div class="form-group">
|
|
92
|
+ {{ Form::label('instrument', 'Instrument') }}
|
|
93
|
+ <select id="instrument" name="instrument" class="form-control">
|
|
94
|
+ @foreach ($instruments as $instrument)
|
|
95
|
+ @if(Input::old('instrument')!=$instrument->id)
|
|
96
|
+ <option value="{{ $instrument->id }}">{{ $instrument->name }}</option>
|
64
|
97
|
@else
|
65
|
|
- <option selected value="{{ $objective->id }}">{{ $objective->name }}</option>
|
|
98
|
+ <option selected value="{{ $instrument->id }}">{{ $instrument->name }}</option>
|
66
|
99
|
@endif
|
67
|
100
|
@endforeach
|
68
|
101
|
</select>
|
69
|
102
|
</div>
|
70
|
103
|
<div class="form-group">
|
|
104
|
+ <button type="button" data-toggle="modal" data-target="#newRubricModal" class="btn btn-sm btn-default">New Instrument</button>
|
|
105
|
+ </div>
|
|
106
|
+ <div class="form-group">
|
71
|
107
|
{{ Form::label('transforming_action', 'Transforming Actions') }}
|
72
|
108
|
<select id="transforming_action" name="transforming_action[]" class="form-control" multiple>
|
73
|
109
|
@foreach ($transforming_actions as $transforming_action)
|
|
@@ -84,24 +120,6 @@
|
84
|
120
|
|
85
|
121
|
{{ Form::submit('Submit', array('class' => 'btn btn-primary btn-block', 'name'=>'create_activity')) }}
|
86
|
122
|
{{ Form::close() }}
|
87
|
|
-
|
88
|
|
- <br>
|
89
|
|
-
|
90
|
|
- @if(Session::has('courses'))
|
91
|
|
- <p><strong>The following courses were updated:</strong></p>
|
92
|
|
- <ul>
|
93
|
|
- @foreach(json_decode(Session::get('courses')) as $course)
|
94
|
|
- <li>
|
95
|
|
-
|
96
|
|
- @if(Session::has('show_sections'))
|
97
|
|
- {{ $course->code }}{{ $course->number }}-{{ $course->section }}
|
98
|
|
- @else
|
99
|
|
- {{ $course->code }}{{ $course->number }}
|
100
|
|
- @endif
|
101
|
|
- </li>
|
102
|
|
- @endforeach
|
103
|
|
- </ul>
|
104
|
|
- @endif
|
105
|
123
|
</div>
|
106
|
124
|
</div>
|
107
|
125
|
</div>
|
|
@@ -115,16 +133,39 @@
|
115
|
133
|
// --------------------------------------------------------------------------
|
116
|
134
|
// Page load
|
117
|
135
|
// --------------------------------------------------------------------------
|
118
|
|
-
|
|
136
|
+ const objectives = {{ $objectives_by_outcome->toJson() }};
|
|
137
|
+ const criteria = {{ $criteria_by_objective->toJson() }};
|
|
138
|
+ const outcomesSelect = document.getElementById('outcome');
|
|
139
|
+ const objectivesSelect = document.getElementById('objective');
|
|
140
|
+ const criteriaSelect = document.getElementById('criteria');
|
119
|
141
|
|
120
|
142
|
// --------------------------------------------------------------------------
|
121
|
143
|
// Functions
|
122
|
144
|
// --------------------------------------------------------------------------
|
123
|
145
|
|
124
|
|
-
|
125
|
|
-
|
126
|
146
|
// --------------------------------------------------------------------------
|
127
|
147
|
// Events
|
128
|
148
|
// --------------------------------------------------------------------------
|
|
149
|
+ outcomesSelect.addEventListener('change', (event) => {
|
|
150
|
+ var objectivesSelectOptions = [];
|
|
151
|
+ objectives[event.target.value].forEach((objective) => {
|
|
152
|
+ objectivesSelectOptions.push(`<option value="${objective.id}">${objective.text}</option>`);
|
|
153
|
+ });
|
|
154
|
+ objectivesSelect.innerHTML = objectivesSelectOptions.join();
|
|
155
|
+ });
|
|
156
|
+
|
|
157
|
+ objectivesSelect.addEventListener('change', (event) => {
|
|
158
|
+ var criteriaSelectOptions = [];
|
|
159
|
+ var selectedObjectives = Array.from(objectivesSelect.selectedOptions).map(v => value);
|
|
160
|
+ selectedObjectives.forEach((objectiveId) => {
|
|
161
|
+ criteria[objectiveId].forEach((criteriaArray) => {
|
|
162
|
+ criteriaArray.forEach((criteria) => {
|
|
163
|
+ criteriaSelectOptions.push(`<option value="${criteria.id}">${criteria.name}</option>`);
|
|
164
|
+ });
|
|
165
|
+ });
|
|
166
|
+ });
|
|
167
|
+ criteriaSelect.innerHTML = criteriaSelectOptions.join();
|
|
168
|
+ });
|
|
169
|
+
|
129
|
170
|
|
130
|
171
|
@stop
|