|
@@ -13,35 +13,43 @@
|
13
|
13
|
Create
|
14
|
14
|
</div>
|
15
|
15
|
<div class="panel-body">
|
16
|
|
- {{ Form::open(array('action' => 'CriteriaController@create')) }}
|
17
|
|
- <div id='outcomeGroup' data-value = "1">
|
|
16
|
+ {{ Form::open(array('action' => 'CriteriaController@create', 'id'=> 'create_criterion')) }}
|
|
17
|
+ <div id ='allOutcomes'>
|
|
18
|
+ <div id='outcomeGroup0' data-value = "1">
|
|
19
|
+ <div class="form-group col-md-12">
|
|
20
|
+ <label>Outcome 1</label>
|
|
21
|
+
|
|
22
|
+ {{ Form::select('outcome[]', $outcomes, reset($outcomes), ['class'=>'form-control selectpicker', 'id' =>'outcome0', 'onchange'=>'fetchObjectiveForSelect("outcome0", "objectiveGroupFor0")']) }}
|
|
23
|
+ </div>
|
|
24
|
+
|
|
25
|
+ <div id='objectiveGroupFor0' data-value = '1'>
|
18
|
26
|
<div class="form-group col-md-11">
|
19
|
|
- <label>Associated Outcomes</label>
|
|
27
|
+ <label>Associated Objectives for Outcome 1</label>
|
|
28
|
+ <select id="objective_0_counter_1" name="objective[]" class="form-control selectpicker">
|
|
29
|
+ </select>
|
20
|
30
|
|
21
|
|
- {{ Form::select('outcome[]', $outcomes, reset($outcomes), ['class'=>'form-control selectpicker', 'id' =>'outcome0', 'onchange'=>'fetchObjectiveForSelect("outcomeGroup", "objectiveGroup")']) }}
|
|
31
|
+ </div>
|
|
32
|
+ <div class = "col-md-1">
|
22
|
33
|
</div>
|
23
|
34
|
</div>
|
24
|
|
- <input type='hidden' name='counterOutcome' id='counterOutcome' value=1>
|
25
|
|
- <button id='button-add-outcome' class='btn btn-md btn-secondary' onclick='addOutcomeTest()'>
|
|
35
|
+ <input type='hidden' name='counterObjective' id='counterObjective' value=1>
|
|
36
|
+ <button class='btn btn-md btn-secondary button-add-objective' onclick='addObjectiveTest("objectiveGroupFor0", "objective_0")'>
|
26
|
37
|
<span class='glyphicon glyphicon-plus'>
|
27
|
38
|
|
28
|
39
|
</span>
|
29
|
|
- Add another Outcome
|
|
40
|
+ Add another Objective
|
30
|
41
|
</button>
|
31
|
|
- <div id='objectiveGroup' data-value = '1'>
|
32
|
|
- <div class="form-group">
|
33
|
|
- <label>Associated Objectives</label>
|
34
|
|
- <select id="objective_0" name="objective[]" class="form-control selectpicker">
|
35
|
|
- </select>
|
36
|
|
-
|
37
|
|
- </div>
|
|
42
|
+
|
|
43
|
+ <br></div><hr>
|
38
|
44
|
</div>
|
39
|
|
- <input type='hidden' name='counterObjective' id='counterObjective' value=1>
|
40
|
|
- <button id='button-add-objective' class='btn btn-md btn-secondary' onclick='addObjectiveTest()'>
|
|
45
|
+
|
|
46
|
+ <input type='hidden' name='counterOutcome' id='counterOutcome' value=1>
|
|
47
|
+
|
|
48
|
+ <button id='button-add-outcome' class='btn btn-md btn-secondary' onclick='addOutcomeTest()'>
|
41
|
49
|
<span class='glyphicon glyphicon-plus'>
|
42
|
50
|
|
43
|
51
|
</span>
|
44
|
|
- Add another Objective
|
|
52
|
+ Add another Outcome
|
45
|
53
|
</button>
|
46
|
54
|
|
47
|
55
|
<!-- Associated Program -->
|
|
@@ -92,7 +100,7 @@
|
92
|
100
|
{{ Form::textarea('notes', '', array('class' => 'form-control', 'rows'=>2, 'placeholder'=>'(optional)', 'aria-labelledby'=>'notes')) }}
|
93
|
101
|
</div>
|
94
|
102
|
|
95
|
|
- {{ Form::submit('Create', array('class' => 'btn btn-primary btn-block')) }}
|
|
103
|
+ {{ Form::submit('Create', array('class' => 'btn btn-primary btn-block', 'id'=>'create_the_criterion')) }}
|
96
|
104
|
{{ Form::close() }}
|
97
|
105
|
</div>
|
98
|
106
|
</div>
|
|
@@ -104,7 +112,7 @@
|
104
|
112
|
Edit
|
105
|
113
|
</div>
|
106
|
114
|
<div class="panel-body">
|
107
|
|
- {{ Form::open(array('action' => 'CriteriaController@update')) }}
|
|
115
|
+ {{ Form::open(array('action' => 'CriteriaController@update', 'id'=>'update_criterion')) }}
|
108
|
116
|
|
109
|
117
|
<button class="btn btn-md btn-secondary filterButton">
|
110
|
118
|
<span class="glyphicon glyphicon-plus">
|
|
@@ -126,6 +134,7 @@
|
126
|
134
|
|
127
|
135
|
</div>
|
128
|
136
|
</div>
|
|
137
|
+ <hr>
|
129
|
138
|
|
130
|
139
|
<div class="form-group">
|
131
|
140
|
{{ Form::label('criterion_id', 'Criterion') }}
|
|
@@ -144,38 +153,41 @@
|
144
|
153
|
@endforeach
|
145
|
154
|
</select>
|
146
|
155
|
</div>
|
147
|
|
-
|
|
156
|
+ <div id ='allAssocOutcomes'>
|
148
|
157
|
<!-- Associated Outcome -->
|
149
|
|
- <div id='assocOutcomeGroup' data-value="1">
|
150
|
|
- <div class="form-group">
|
151
|
|
- <label>Associated Outcome</label>
|
152
|
|
- {{ Form::select('assoc_outcome[]', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcome_0', 'onchange'=>'fetchAssocObjective("assoc_outcome_0")']) }}
|
|
158
|
+ <div id='assocOutcomeGroup0' data-value="1">
|
|
159
|
+ <div class="form-group col-md-12">
|
|
160
|
+ <label>Outcome 1</label>
|
|
161
|
+ {{ Form::select('outcome[]', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcome_0', 'onchange'=>'fetchAssocObjective("assoc_outcome_0")']) }}
|
153
|
162
|
|
154
|
163
|
</div>
|
155
|
|
- </div>
|
156
|
|
- <button id='button-add-objective-assoc' class='btn btn-md btn-secondary' onclick='addAssocOutcome()'>
|
157
|
|
- <span class='glyphicon glyphicon-plus'>
|
158
|
|
-
|
159
|
|
- </span>
|
160
|
|
- Add another Outcome
|
161
|
|
- </button>
|
162
|
|
-
|
163
|
|
- <div id='assoc_objectiveGroup' data-value="1">
|
164
|
|
- <div class="form-group">
|
165
|
|
- <label>Associated Objectives</label>
|
166
|
|
- <select id="assoc_objective_0" name="assoc_objective[]" class="form-control selectpicker">
|
|
164
|
+<div id='assoc_objectiveGroupFor0' data-value="1">
|
|
165
|
+ <div class="form-group col-md-11">
|
|
166
|
+ <label>Associated Objectives for Outcome 1</label>
|
|
167
|
+ <select id="assoc_objective_0_counter_1" name="objective[]" class="form-control selectpicker">
|
167
|
168
|
<option value="0">No associated objectives</option>
|
168
|
169
|
</select>
|
169
|
170
|
|
170
|
|
- </div>
|
|
171
|
+ </div> <div class ='col-md-1'></div>
|
171
|
172
|
</div>
|
172
|
|
- <button id='button-add-outcome-assoc' class='btn btn-md btn-secondary' onclick='addAssocObjective()'>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+ <button id='button-add-objective-assoc' class='btn btn-md btn-secondary' onclick='addAssocObjective("assoc_objectiveGroupFor0", "assoc_objective_0")'>
|
173
|
176
|
<span class='glyphicon glyphicon-plus'>
|
174
|
177
|
|
175
|
178
|
</span>
|
176
|
179
|
Add another Objective
|
|
180
|
+ </button> </div><hr></div>
|
|
181
|
+ <button class='btn btn-md btn-secondary button-add-outcome-assoc' onclick='addAssocOutcome()'>
|
|
182
|
+ <span class='glyphicon glyphicon-plus'>
|
|
183
|
+
|
|
184
|
+ </span>
|
|
185
|
+ Add another Outcome
|
177
|
186
|
</button>
|
178
|
187
|
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
179
|
191
|
<!-- Associated Program -->
|
180
|
192
|
<div class="form-group">
|
181
|
193
|
|
|
@@ -213,8 +225,8 @@
|
213
|
225
|
{{ Form::textarea('subcriteria', '', array('class' => 'form-control', 'rows'=>3, 'id' => 'criterion_subcriteria')) }}
|
214
|
226
|
</div>
|
215
|
227
|
<div class="form-group">
|
216
|
|
- {{ Form::label('assoc_maximum_score', 'Maximum Score') }}
|
217
|
|
- {{ Form::text('assoc_maximum_score', '', array('class' => 'form-control', 'id'=>'assoc_maximum_score', 'oninput'=>'addOptions("Num_assoc_scale", "assoc_maximum_score", "Assoc_Scales")')) }}
|
|
228
|
+ {{ Form::label('maximum_score', 'Maximum Score') }}
|
|
229
|
+ {{ Form::text('maximum_score', '', array('class' => 'form-control', 'id'=>'assoc_maximum_score', 'oninput'=>'addOptions("Num_assoc_scale", "assoc_maximum_score", "Assoc_Scales")')) }}
|
218
|
230
|
</div>
|
219
|
231
|
|
220
|
232
|
|
|
@@ -241,7 +253,7 @@
|
241
|
253
|
{{ Form::textarea('notes', Input::old('notes'), array('class' => 'form-control', 'rows'=>2, 'id'=>'criterion_notes', 'placeholder'=>'(optional)')) }}
|
242
|
254
|
</div>
|
243
|
255
|
|
244
|
|
- {{ Form::submit('Update', array('class' => 'btn btn-primary btn-block')) }}
|
|
256
|
+ {{ Form::submit('Update', array('class' => 'btn btn-primary btn-block', 'id'=>'update_the_criterion')) }}
|
245
|
257
|
{{ Form::close() }}
|
246
|
258
|
{{ Form::open(array('action' => 'CriteriaController@delete')) }}
|
247
|
259
|
|
|
@@ -265,6 +277,19 @@
|
265
|
277
|
numberOfScales('Num_scale', 'Scales');
|
266
|
278
|
});
|
267
|
279
|
|
|
280
|
+ $(document).on('submit', '#create_criterion', function(e){
|
|
281
|
+
|
|
282
|
+ if(e.originalEvent.submitter.id != "create_the_criterion")
|
|
283
|
+ e.preventDefault();
|
|
284
|
+ })
|
|
285
|
+
|
|
286
|
+ $(document).on('submit', '#update_criterion', function(e){
|
|
287
|
+
|
|
288
|
+if(e.originalEvent.submitter.id != "update_the_criterion")
|
|
289
|
+e.preventDefault();
|
|
290
|
+})
|
|
291
|
+
|
|
292
|
+
|
268
|
293
|
function addOptions(select, max, scaleDiv) {
|
269
|
294
|
|
270
|
295
|
|
|
@@ -297,11 +322,11 @@
|
297
|
322
|
|
298
|
323
|
fullDiv = '';
|
299
|
324
|
if(division ==1){
|
300
|
|
- for (var i = dataValue; i < amountOfScale; i++) {
|
|
325
|
+ for (var i = 0; i < amountOfScale; i++) {
|
301
|
326
|
div = '<div id="assoc_eval' + i.toString() + Scales + '">' +
|
302
|
327
|
'<div class ="form-group">' +
|
303
|
328
|
'<label for ="assoc_descripcion' + i.toString() + '">Scale Description ('+(i+1)+')</label>' +
|
304
|
|
- '<textarea class="form-control" rows="2" aria-labelledby="assoc_descripcion' + i.toString() + '" name="assoc_scales[]" cols="50" ></textarea></div></div>';
|
|
329
|
+ '<textarea id = "assoc_scale_'+i+'" class="form-control" rows="2" aria-labelledby="assoc_descripcion' + i.toString() + '" name="Scales[]" cols="50" ></textarea></div></div>';
|
305
|
330
|
fullDiv += div;
|
306
|
331
|
|
307
|
332
|
|
|
@@ -311,7 +336,7 @@
|
311
|
336
|
div = '<div id="assoc_eval' +0 + Scales + '">' +
|
312
|
337
|
'<div class ="form-group">' +
|
313
|
338
|
'<label for ="assoc_descripcion' + 0 + '">Scale Description ('+1+' - '+maximum+') </label>' +
|
314
|
|
- '<textarea class="form-control" rows="2" aria-labelledby="assoc_descripcion' + 0 + '" name="assoc_scales[]" cols="50" ></textarea></div></div>';
|
|
339
|
+ '<textarea id = "assoc_scale_'+0+'" class="form-control" rows="2" aria-labelledby="assoc_descripcion' + 0 + '" name="Scales[]" cols="50" ></textarea></div></div>';
|
315
|
340
|
fullDiv += div;
|
316
|
341
|
}
|
317
|
342
|
else{
|
|
@@ -320,7 +345,7 @@
|
320
|
345
|
div = '<div id="assoc_eval' + i.toString() + Scales + '">' +
|
321
|
346
|
'<div class ="form-group">' +
|
322
|
347
|
'<label for ="assoc_descripcion' + i.toString() + '">Scale Description ('+(1+(i*division))+' - '+((1+i)*division)+')</label>' +
|
323
|
|
- '<textarea class="form-control" rows="2" aria-labelledby="assoc_descripcion' + i.toString() + '" name="assoc_scales[]" cols="50" ></textarea></div></div>';
|
|
348
|
+ '<textarea id = "assoc_scale_'+i+'" class="form-control" rows="2" aria-labelledby="assoc_descripcion' + i.toString() + '" name="Scales[]" cols="50" ></textarea></div></div>';
|
324
|
349
|
fullDiv += div;
|
325
|
350
|
}
|
326
|
351
|
}
|
|
@@ -346,11 +371,13 @@
|
346
|
371
|
var amountOfScale = parseInt($('#' + string).val());
|
347
|
372
|
var dataValue = parseInt($('#' + Scales).attr('data-value'));
|
348
|
373
|
var division = maximum/amountOfScale;
|
349
|
|
- //add
|
350
|
|
-
|
351
|
374
|
|
352
|
375
|
|
353
|
376
|
|
|
377
|
+
|
|
378
|
+ //add
|
|
379
|
+
|
|
380
|
+
|
354
|
381
|
fullDiv = '';
|
355
|
382
|
if(division ==1){
|
356
|
383
|
for (var i = 0; i < amountOfScale; i++) {
|
|
@@ -403,18 +430,20 @@ $('.filterSection').hide();
|
403
|
430
|
|
404
|
431
|
//Add outcome Button
|
405
|
432
|
function addOutcomeTest() {
|
406
|
|
- counter = parseInt($('#outcomeGroup').data("value"));
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+ counter = parseInt($('#outcomeGroup0').data("value"));
|
407
|
436
|
var $select = $('<select/>', {
|
408
|
437
|
'class': "selectpicker form-control",
|
409
|
438
|
'name': "outcome[]",
|
410
|
439
|
'data-live-search': 'true',
|
411
|
440
|
'id': 'outcome' + counter.toString(),
|
412
|
|
- 'onchange': 'fetchObjectiveForSelect("outcomeGroup", "objectiveGroup")'
|
|
441
|
+ 'onchange': 'fetchObjectiveForSelect("outcome'+counter+'", "objectiveGroupFor'+counter+'")'
|
413
|
442
|
|
414
|
443
|
});
|
415
|
444
|
var $div = $('<div/>', {
|
416
|
445
|
'id': 'outcomeForm' + counter.toString(),
|
417
|
|
- 'class': 'form-group col-md-11'
|
|
446
|
+ 'class': 'form-group col-md-11 '
|
418
|
447
|
});
|
419
|
448
|
|
420
|
449
|
var $divForButton = $('<div/>', {
|
|
@@ -425,20 +454,68 @@ $('.filterSection').hide();
|
425
|
454
|
var $button = $('<button/>', {
|
426
|
455
|
'type': 'button',
|
427
|
456
|
'class': 'btn btn-primary',
|
428
|
|
- 'onclick': 'deleteLast("outcomeForm'+counter.toString()+'", "outcomeGroup", "close' + counter.toString() + '", "objectiveGroup")'
|
429
|
|
- });
|
|
457
|
+ 'onclick': '$(this).parent().parent().remove();'
|
|
458
|
+ });
|
|
459
|
+ var divForGroup = $('<div/>', {
|
|
460
|
+ 'id' : 'outcomeGroup'+counter.toString(),
|
|
461
|
+ }).html("<label>Outcome "+(counter+1)+"</label>");
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+ var objectiveGroup = $('<div/>', {
|
|
465
|
+ 'id' : 'objectiveGroupFor'+counter,
|
|
466
|
+ 'data-value': '1'
|
|
467
|
+ });
|
|
468
|
+
|
|
469
|
+ var form_group_for_objective = $('<div/>', {
|
|
470
|
+ 'class': 'form-group col-md-11'
|
|
471
|
+ }).html('<label>Associated Objectives for Outcome '+(counter+1)+'</label>');
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+ var $select_objective = $('<select/>', {
|
|
475
|
+ 'class': "selectpicker form-control",
|
|
476
|
+ 'name': "objective[]",
|
|
477
|
+ 'data-live-search': 'true',
|
|
478
|
+ 'id': 'objective_'+counter +'_counter_1'
|
|
479
|
+ });
|
|
480
|
+
|
|
481
|
+ var empty_div = $('<div/>',{
|
|
482
|
+ 'class': 'col-md-1'
|
|
483
|
+ });
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+ var button_for_add = $('<button/>', {
|
|
488
|
+ 'class': 'btn btn-md btn-secondary button-add-objective',
|
|
489
|
+ 'onclick': 'addObjectiveTest("objectiveGroupFor'+counter+'", "objective_'+counter+'")'
|
|
490
|
+ }).html("<span class='glyphicon glyphicon-plus'></span>Add another Objective");
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+ divForGroup.append($div)
|
430
|
494
|
|
431
|
495
|
$button.append('X');
|
432
|
496
|
$divForButton.append($button);
|
433
|
|
-
|
434
|
|
- $div.appendTo('#outcomeGroup')
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+ $('#allOutcomes').append(divForGroup);
|
435
|
500
|
$select.append(selectOptions);
|
436
|
501
|
|
437
|
502
|
$select.appendTo('#outcomeForm' + counter.toString()).selectpicker('refresh');
|
438
|
|
- $('#outcomeGroup').data("value", (counter +1));
|
439
|
|
- fetchObjectiveForSelect('outcomeGroup', "objectiveGroup");
|
440
|
|
- counter += 1;
|
441
|
|
- $divForButton.appendTo('#outcomeGroup');
|
|
503
|
+ $('#outcomeGroup0').data("value", (counter +1));
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+ divForGroup.append($divForButton);
|
|
507
|
+
|
|
508
|
+ form_group_for_objective.append($select_objective)
|
|
509
|
+ objectiveGroup.append(form_group_for_objective);
|
|
510
|
+ objectiveGroup.append(empty_div);
|
|
511
|
+ //objectiveGroup.append(button_for_add);
|
|
512
|
+
|
|
513
|
+ divForGroup.append(objectiveGroup);
|
|
514
|
+ divForGroup.append(button_for_add);
|
|
515
|
+ divForGroup.append('<hr>');
|
|
516
|
+ fetchObjectiveForSelect('outcome'+counter, "objectiveGroupFor"+counter);
|
|
517
|
+ $select_objective.selectpicker('refresh');
|
|
518
|
+
|
442
|
519
|
|
443
|
520
|
|
444
|
521
|
|
|
@@ -466,91 +543,96 @@ $('.filterSection').hide();
|
466
|
543
|
$div.remove();
|
467
|
544
|
$div = document.getElementById(closeObj);
|
468
|
545
|
$div.remove();
|
469
|
|
- counter = parseInt($('#'+objectiveGroup).data("value"));
|
470
|
|
- $('#'+objectiveGroup).data("value", counter-1);
|
|
546
|
+ //counter = parseInt($('#'+objectiveGroup).data("value"));
|
|
547
|
+ // $('#'+objectiveGroup).data("value", counter-1);
|
471
|
548
|
|
472
|
549
|
|
473
|
550
|
}
|
474
|
551
|
|
475
|
552
|
//Add objective when editing
|
476
|
553
|
|
477
|
|
- function addAssocObjective() {
|
478
|
|
- selectObj = document.getElementById('assoc_objective_0').innerHTML;
|
479
|
|
- assocObjectiveCounter = parseInt($('#assoc_objectiveGroup').data('value'));
|
|
554
|
+ function addAssocObjective(objForGroup, originalObjective) {
|
|
555
|
+ counter = $("#"+objForGroup).data('value');
|
|
556
|
+
|
|
557
|
+ selectObj = document.getElementById(originalObjective+'_counter_1').innerHTML;
|
|
558
|
+ assocObjectiveCounter = parseInt($('#'+objForGroup).data('value'));
|
480
|
559
|
var $select = $('<select/>', {
|
481
|
560
|
'class': "selectpicker form-control",
|
482
|
|
- 'name': "assoc_objective[]",
|
|
561
|
+ 'name': "objective[]",
|
483
|
562
|
'data-live-search': 'true',
|
484
|
|
- 'id': 'assoc_objective_' + assocObjectiveCounter.toString(),
|
|
563
|
+ 'id': originalObjective+'_counter_' + (assocObjectiveCounter+1).toString(),
|
485
|
564
|
|
486
|
565
|
|
487
|
566
|
});
|
488
|
567
|
var $div = $('<div/>', {
|
489
|
|
- 'id': 'assoc_objectiveForm' + assocObjectiveCounter.toString(),
|
490
|
|
- 'class': 'form-group col-md-11'
|
|
568
|
+ 'id': 'assoc_objectiveForm_'+objForGroup +'_' + assocObjectiveCounter.toString(),
|
|
569
|
+ 'class': 'form-group col-md-10'
|
491
|
570
|
});
|
492
|
571
|
var $divForButton = $('<div/>', {
|
493
|
|
- 'class': 'col-md-1',
|
494
|
|
- 'id': 'assoc_closeObj' + assocObjectiveCounter.toString()
|
|
572
|
+ 'class': 'col-md-2',
|
|
573
|
+ 'id': 'assoc_closeObj_'+objForGroup+'_' + assocObjectiveCounter.toString()
|
495
|
574
|
|
496
|
575
|
});
|
497
|
576
|
var $button = $('<button/>', {
|
498
|
577
|
'type': 'button',
|
499
|
578
|
'class': 'btn btn-primary',
|
500
|
|
- 'onclick': 'deleteObjective("assoc_objectiveForm' + assocObjectiveCounter.toString() + '", "assoc_closeObj' + assocObjectiveCounter.toString() + ', "assoc_objectiveGroup")'
|
|
579
|
+ 'onclick': 'deleteObjective("assoc_objectiveForm_'+objForGroup+'_' + assocObjectiveCounter.toString() + '", "assoc_closeObj_' +objForGroup+'_' + assocObjectiveCounter.toString() + '", "'+objForGroup+'")'
|
501
|
580
|
});
|
502
|
581
|
|
503
|
582
|
$button.append('X');
|
504
|
583
|
$divForButton.append($button);
|
505
|
584
|
|
506
|
|
- $div.appendTo('#assoc_objectiveGroup')
|
|
585
|
+ $div.appendTo('#'+objForGroup)
|
507
|
586
|
$select.append(selectObj);
|
508
|
587
|
|
509
|
|
- $select.appendTo('#assoc_objectiveForm' + assocObjectiveCounter.toString()).selectpicker('refresh');
|
510
|
|
- $('#assoc_objectiveGroup').data("value", assocObjectiveCounter +1);
|
|
588
|
+ $select.appendTo($div).selectpicker('refresh');
|
|
589
|
+ //$('#assoc_objectiveGroup').data("value", assocObjectiveCounter +1);
|
511
|
590
|
|
512
|
|
- $divForButton.appendTo('#assoc_objectiveGroup');
|
|
591
|
+ $divForButton.appendTo('#'+objForGroup);
|
|
592
|
+ $('#'+ objForGroup).data('value', counter +1);
|
513
|
593
|
|
514
|
594
|
}
|
515
|
595
|
|
516
|
596
|
|
517
|
597
|
//Add objective when creating a criteria
|
518
|
|
- function addObjectiveTest() {
|
519
|
|
- selectObj = document.getElementById('objective_0').innerHTML;
|
520
|
|
- counter = parseInt($("#objectiveGroup").data('value'));
|
|
598
|
+ function addObjectiveTest(objForGroup, originalObjective) {
|
|
599
|
+
|
|
600
|
+ counter =$('#'+objForGroup).data('value');
|
|
601
|
+
|
|
602
|
+ selectObj = document.getElementById(originalObjective+'_counter_1').innerHTML;
|
|
603
|
+
|
521
|
604
|
var $select = $('<select/>', {
|
522
|
605
|
'class': "selectpicker form-control",
|
523
|
606
|
'name': "objective[]",
|
524
|
607
|
'data-live-search': 'true',
|
525
|
|
- 'id': 'objective_' + counter.toString()
|
526
|
|
-
|
|
608
|
+ 'id': originalObjective +'_counter_' + (counter+1).toString()
|
527
|
609
|
});
|
528
|
610
|
var $div = $('<div/>', {
|
529
|
|
- 'id': 'objectiveForm' + counter.toString(),
|
530
|
|
- 'class': 'form-group col-md-11'
|
|
611
|
+ 'id': 'objectiveForm_'+objForGroup + '_' + counter.toString(),
|
|
612
|
+ 'class': 'form-group col-md-10'
|
531
|
613
|
});
|
532
|
614
|
var $divForButton = $('<div/>', {
|
533
|
|
- 'class': 'col-md-1',
|
534
|
|
- 'id': 'closeObj' + counter.toString()
|
|
615
|
+ 'class': 'col-md-2',
|
|
616
|
+ 'id': 'closeObj_'+objForGroup+'_' + counter.toString()
|
535
|
617
|
|
536
|
618
|
});
|
537
|
619
|
var $button = $('<button/>', {
|
538
|
620
|
'type': 'button',
|
539
|
621
|
'class': 'btn btn-primary',
|
540
|
|
- 'onclick': 'deleteObjective("objectiveForm' + counter.toString() + '", "closeObj' + counter.toString() + '")'
|
|
622
|
+ 'onclick': 'deleteObjective("objectiveForm_' +objForGroup +'_' + counter.toString() + '", "closeObj_'+objForGroup+'_' + counter.toString() + '", "'+objForGroup+'")'
|
541
|
623
|
});
|
542
|
624
|
|
543
|
625
|
$button.append('X');
|
544
|
626
|
$divForButton.append($button);
|
545
|
627
|
|
546
|
|
- $div.appendTo('#objectiveGroup')
|
|
628
|
+ $div.appendTo('#'+objForGroup)
|
547
|
629
|
$select.append(selectObj);
|
548
|
630
|
|
549
|
|
- $select.appendTo('#objectiveForm' + counter.toString()).selectpicker('refresh');
|
|
631
|
+ $select.appendTo($div).selectpicker('refresh');
|
550
|
632
|
|
551
|
633
|
|
552
|
|
- $divForButton.appendTo('#objectiveGroup');
|
553
|
|
- $('#objectiveGroup').data('value', counter +1);
|
|
634
|
+ $divForButton.appendTo('#'+objForGroup);
|
|
635
|
+ $('#'+ objForGroup).data('value', counter +1);
|
554
|
636
|
}
|
555
|
637
|
|
556
|
638
|
//Create outcome for editing
|
|
@@ -558,14 +640,14 @@ $('.filterSection').hide();
|
558
|
640
|
var assocOutcomeCounter = 0;
|
559
|
641
|
|
560
|
642
|
|
561
|
|
- function addAssocOutcome() {
|
562
|
|
- assocOutcomeCounter = parseInt($('#assocOutcomeGroup').data('value'));
|
|
643
|
+ function addAssocOutcome(depends= null) {
|
|
644
|
+ assocOutcomeCounter = parseInt($('#assocOutcomeGroup0').data('value'));
|
563
|
645
|
var $select = $('<select/>', {
|
564
|
646
|
'class': "selectpicker form-control",
|
565
|
|
- 'name': "assoc_outcome[]",
|
|
647
|
+ 'name': "outcome[]",
|
566
|
648
|
'data-live-search': 'true',
|
567
|
649
|
'id': 'assoc_outcome_' + assocOutcomeCounter.toString(),
|
568
|
|
- 'onchange': 'fetchAssocObjective("assoc_outcome_' + assocOutcomeCounter.toString() + '")'
|
|
650
|
+ 'onchange': 'fetchAssocObjective("assoc_outcome_' + assocOutcomeCounter.toString() + '", "assoc_objectiveGroupFor'+assocOutcomeCounter+'")'
|
569
|
651
|
|
570
|
652
|
});
|
571
|
653
|
var $div = $('<div/>', {
|
|
@@ -581,20 +663,67 @@ $('.filterSection').hide();
|
581
|
663
|
var $button = $('<button/>', {
|
582
|
664
|
'type': 'button',
|
583
|
665
|
'class': 'btn btn-primary',
|
584
|
|
- 'onclick': 'deleteLast("assoc_outcomeForm' + assocOutcomeCounter.toString() + '", "assocOutcomeGroup", "assoc_close' + assocOutcomeCounter.toString() + '","assoc_objectiveGroup")'
|
|
666
|
+ 'id': 'assoc_close_button'+assocOutcomeCounter,
|
|
667
|
+ 'onclick': '$(this).parent().parent().remove()'
|
585
|
668
|
});
|
586
|
669
|
|
|
670
|
+ var divForGroup = $('<div/>', {
|
|
671
|
+ 'id' : 'assocOutcomeGroup'+assocOutcomeCounter.toString(),
|
|
672
|
+ }).html("<label>Outcome "+(assocOutcomeCounter+1)+"</label>");
|
|
673
|
+
|
|
674
|
+ var objectiveGroup = $('<div/>', {
|
|
675
|
+ 'id' : 'assoc_objectiveGroupFor'+assocOutcomeCounter,
|
|
676
|
+ 'data-value': '1'
|
|
677
|
+ });
|
|
678
|
+ var form_group_for_objective = $('<div/>', {
|
|
679
|
+ 'class': 'form-group col-md-11'
|
|
680
|
+ }).html('<label>Associated Objectives for Outcome '+(assocOutcomeCounter+1)+'</label>');
|
|
681
|
+
|
|
682
|
+ var $select_objective = $('<select/>', {
|
|
683
|
+ 'class': "selectpicker form-control",
|
|
684
|
+ 'name': "objective[]",
|
|
685
|
+ 'data-live-search': 'true',
|
|
686
|
+ 'id': 'assoc_objective_'+assocOutcomeCounter +'_counter_1'
|
|
687
|
+ });
|
|
688
|
+
|
|
689
|
+ var empty_div = $('<div/>',{
|
|
690
|
+ 'class': 'col-md-1'
|
|
691
|
+ });
|
|
692
|
+
|
|
693
|
+ var button_for_add = $('<button/>', {
|
|
694
|
+ 'class': 'btn btn-md btn-secondary button-add-objective',
|
|
695
|
+ 'onclick': 'addAssocObjective("assoc_objectiveGroupFor'+assocOutcomeCounter+'", "assoc_objective_'+assocOutcomeCounter+'")'
|
|
696
|
+ }).html("<span class='glyphicon glyphicon-plus'></span>Add another Objective");
|
|
697
|
+
|
|
698
|
+ divForGroup.append($div)
|
587
|
699
|
$button.append('X');
|
588
|
700
|
$divForButton.append($button);
|
589
|
701
|
|
590
|
|
- $div.appendTo('#assocOutcomeGroup')
|
|
702
|
+ $('#allAssocOutcomes').append(divForGroup);
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+ //$div.appendTo('#assocOutcomeGroup')
|
591
|
706
|
$select.append(selectOptions);
|
592
|
707
|
|
593
|
708
|
$select.appendTo('#assoc_outcomeForm' + assocOutcomeCounter.toString()).selectpicker('refresh');
|
594
|
|
- assocOutcomeCounter += 1;
|
595
|
|
- $divForButton.appendTo('#assocOutcomeGroup');
|
|
709
|
+ //assocOutcomeCounter += 1;
|
|
710
|
+ $('#assocOutcomeGroup0').data('value', assocOutcomeCounter+1);
|
|
711
|
+ //$divForButton.appendTo('#assocOutcomeGroup');
|
|
712
|
+ divForGroup.append($divForButton);
|
|
713
|
+
|
|
714
|
+ form_group_for_objective.append($select_objective)
|
|
715
|
+ objectiveGroup.append(form_group_for_objective);
|
|
716
|
+ objectiveGroup.append(empty_div);
|
|
717
|
+ //objectiveGroup.append(button_for_add);
|
|
718
|
+
|
|
719
|
+ divForGroup.append(objectiveGroup);
|
|
720
|
+ divForGroup.append(button_for_add);
|
|
721
|
+ divForGroup.append('<hr>');
|
|
722
|
+ if(!depends)fetchObjectiveForSelect('assoc_outcome_'+assocOutcomeCounter, 'assoc_objectiveGroupFor'+assocOutcomeCounter);
|
|
723
|
+ $select_objective.selectpicker('refresh');
|
|
724
|
+
|
596
|
725
|
|
597
|
|
- $('#assocOutcomeGroup').data('value', assocOutcomeCounter);
|
|
726
|
+
|
598
|
727
|
|
599
|
728
|
|
600
|
729
|
}
|
|
@@ -673,13 +802,10 @@ $('.filterSection').hide();
|
673
|
802
|
//Fetch objective at creating criteria
|
674
|
803
|
counterForPost = 0;
|
675
|
804
|
|
676
|
|
- function fetchObjectiveForSelect(outcomeDiv, objectiveGroup) {
|
677
|
|
- var count = $("#" + outcomeDiv).data('value');
|
678
|
|
- var allOutcomes = [];
|
679
|
|
- $("#" + outcomeDiv + ' select').each(function() {
|
680
|
|
- allOutcomes.push( this.value);
|
|
805
|
+
|
681
|
806
|
|
682
|
|
- })
|
|
807
|
+ function fetchObjectiveForSelect(outcome, objectiveGroup) {
|
|
808
|
+ outcomeID = $('#'+outcome).val();
|
683
|
809
|
var allObjectives = [];
|
684
|
810
|
$("#" + objectiveGroup + ' select').each(function() {
|
685
|
811
|
var temp = {
|
|
@@ -691,11 +817,18 @@ $('.filterSection').hide();
|
691
|
817
|
|
692
|
818
|
$.post(
|
693
|
819
|
"{{ URL::action('CriteriaController@fetchObjectivesForSelect') }}", {
|
694
|
|
- allOutcomes: allOutcomes
|
|
820
|
+ outcomeID: outcomeID
|
695
|
821
|
},
|
696
|
822
|
function(varArray) {
|
697
|
823
|
counterOutcome =0;
|
698
|
824
|
optionName = '<option value ="0">Nothing Selected</option>';
|
|
825
|
+ for(index in varArray){
|
|
826
|
+ objectiveObject = varArray[index];
|
|
827
|
+ optionName += '<option value ="('+objectiveObject.outcome_id+','+objectiveObject.objective_id+')">'+
|
|
828
|
+ objectiveObject.text+'</option>';
|
|
829
|
+
|
|
830
|
+ }
|
|
831
|
+ /*
|
699
|
832
|
for(outcome in varArray.outcomes){
|
700
|
833
|
optionName += '<optgroup label="' + varArray.outcomes[outcome][0].name + '">';
|
701
|
834
|
var objectiveForOutcome = varArray.objectives;
|
|
@@ -708,12 +841,17 @@ $('.filterSection').hide();
|
708
|
841
|
optionName += (option);
|
709
|
842
|
}
|
710
|
843
|
optionName += "</optgroup>";
|
711
|
|
- }
|
|
844
|
+ }*/
|
712
|
845
|
|
713
|
|
-
|
|
846
|
+ for(index in allObjectives){
|
|
847
|
+
|
|
848
|
+ id = allObjectives[index].id
|
|
849
|
+ $('#'+id).html(optionName);
|
|
850
|
+ $('#'+id).selectpicker('refresh');
|
|
851
|
+ }
|
714
|
852
|
|
715
|
853
|
|
716
|
|
- $('#objective_0').html(optionName);
|
|
854
|
+ /*$('#objective_0').html(optionName);
|
717
|
855
|
$('#objective_0').selectpicker('refresh');
|
718
|
856
|
if($("#objective_0 option[value='"+allObjectives[0].value+"']").length>0){
|
719
|
857
|
$("#objective_0").val(allObjectives[0].value);
|
|
@@ -731,7 +869,7 @@ $('.filterSection').hide();
|
731
|
869
|
$("#objective_"+i.toString()).val(allObjectives[i].value);
|
732
|
870
|
$("#objective_"+i.toString()).selectpicker("refresh");
|
733
|
871
|
}
|
734
|
|
- }
|
|
872
|
+ }*/
|
735
|
873
|
|
736
|
874
|
|
737
|
875
|
|
|
@@ -794,11 +932,17 @@ $('.filterSection').hide();
|
794
|
932
|
|
795
|
933
|
if (!(json.activity_criterion.length)) {
|
796
|
934
|
|
797
|
|
-$('#DeleteButton').prop('enabled', true);
|
|
935
|
+ $('#DeleteButton').prop('disabled', false);
|
|
936
|
+ $("#update_the_criterion").val('Update');
|
|
937
|
+ $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@update')}}")
|
798
|
938
|
|
799
|
|
-} else {
|
800
|
|
-$('#DeleteButton').prop('disabled', true);
|
801
|
|
-}
|
|
939
|
+ } else {
|
|
940
|
+ $('#DeleteButton').prop('disabled', true);
|
|
941
|
+ $("#update_the_criterion").val("Create New")
|
|
942
|
+ $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@create')}}")
|
|
943
|
+ alert("The criterion is already used in assessments. Editting the criterion will actually create a new criterion");
|
|
944
|
+
|
|
945
|
+ }
|
802
|
946
|
|
803
|
947
|
if (!(json.criteria.length)) {
|
804
|
948
|
name = ' ';
|
|
@@ -832,8 +976,19 @@ $('#DeleteButton').prop('disabled', true);
|
832
|
976
|
$('#status').val(0);
|
833
|
977
|
else
|
834
|
978
|
$('#status').val(1);
|
835
|
|
- $('#assoc_maximum_score').val(json.criteria[0].maximum_score);
|
836
|
|
- var maximum = json.criteria[0].maximum_score;
|
|
979
|
+ $('#assoc_maximum_score').val(json.criteria[0].max_score);
|
|
980
|
+ var maximum = json.criteria[0].max_score;
|
|
981
|
+
|
|
982
|
+ addOptions("Num_assoc_scale", "assoc_maximum_score", "Assoc_Scales");
|
|
983
|
+ $('#Num_assoc_scale').val(json.criteria[0].num_scales)
|
|
984
|
+ $('#Num_assoc_scale').selectpicker('refresh');
|
|
985
|
+ $('#Num_assoc_scale').trigger('change');
|
|
986
|
+
|
|
987
|
+ for(i=0; i<json.criteria[0].num_scales;i++){
|
|
988
|
+ $('#assoc_scale_'+i).val(json.scales[i].description);
|
|
989
|
+ }
|
|
990
|
+
|
|
991
|
+
|
837
|
992
|
|
838
|
993
|
// If copyright or notes aren't empty, load them
|
839
|
994
|
|
|
@@ -854,10 +1009,11 @@ $('#DeleteButton').prop('disabled', true);
|
854
|
1009
|
|
855
|
1010
|
// Select associated outcome
|
856
|
1011
|
try {
|
857
|
|
- assocOutcomeCounter= parseInt($("#assocOutcomeGroup").data('value'));
|
|
1012
|
+ assocOutcomeCounter= parseInt($("#assocOutcomeGroup0").data('value'));
|
858
|
1013
|
for (var i = assocOutcomeCounter - 1; i > 0; i--) {
|
859
|
|
- deleteLast("assoc_outcomeForm" + i.toString() , "assocOutcomeGroup", "assoc_close" + i.toString() ,"assoc_objectiveGroup");
|
|
1014
|
+ $('#assoc_close_button'+i).click();
|
860
|
1015
|
}
|
|
1016
|
+ $('#assocOutcomeGroup0').data('value', 1);
|
861
|
1017
|
} catch (err) {
|
862
|
1018
|
var Notran = true;
|
863
|
1019
|
}
|
|
@@ -865,36 +1021,102 @@ $('#DeleteButton').prop('disabled', true);
|
865
|
1021
|
if (json.outcomes.length) {
|
866
|
1022
|
$('#assoc_outcome_0').val(json.outcomes[0].id);
|
867
|
1023
|
$('#assoc_outcome_0').selectpicker('refresh');
|
|
1024
|
+
|
|
1025
|
+ var first_outcome_id = json.outcomes[0].id;
|
|
1026
|
+ options = "<option value ='0'>Nothing Selected</option>";
|
|
1027
|
+
|
|
1028
|
+ for(objective_index in json.objectives_assoc[first_outcome_id]){
|
|
1029
|
+ objective = json.objectives_assoc[first_outcome_id][objective_index]
|
|
1030
|
+ options += '<option value ="('+first_outcome_id+','+objective.objective_id+')">'+
|
|
1031
|
+ objective.text+'</option>';
|
|
1032
|
+ }
|
|
1033
|
+ $('#assoc_objective_0_counter_1').html(options);
|
|
1034
|
+ $('#assoc_objective_0_counter_1').selectpicker('refresh');
|
|
1035
|
+
|
|
1036
|
+ if(json.objectives[first_outcome_id].length){
|
|
1037
|
+ objective_id = json.objectives[first_outcome_id][0].objective_id;
|
|
1038
|
+ value = '('+first_outcome_id+','+objective_id+')';
|
|
1039
|
+ $('#assoc_objective_0_counter_1').val(value);
|
|
1040
|
+ $('#assoc_objective_0_counter_1').selectpicker('refresh');
|
|
1041
|
+
|
|
1042
|
+ }
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+ for(var i =1; i<json.objectives[first_outcome_id].length; i++ ){
|
|
1046
|
+ addAssocObjective("assoc_objectiveGroupFor0", "assoc_objective_0");
|
|
1047
|
+ objective_id = json.objectives[first_outcome_id][i].objective_id;
|
|
1048
|
+ value = "("+first_outcome_id+","+objective_id+")";
|
|
1049
|
+ $('#assoc_objective_0_counter_'+(i+1)).val(value);
|
|
1050
|
+ $('#assoc_objective_0_counter_'+(i+1)).selectpicker('refresh');
|
|
1051
|
+
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+ }
|
|
1055
|
+
|
868
|
1056
|
} else {
|
869
|
1057
|
$('#assoc_outcome_0').val($('#assoc_outcomes_fetch').find(':selected').val());
|
870
|
1058
|
$('#assoc_outcome_0').selectpicker('refresh');
|
|
1059
|
+
|
871
|
1060
|
}
|
872
|
1061
|
|
873
|
1062
|
|
874
|
1063
|
|
875
|
1064
|
for (var i = 1; i < json.outcomes.length; i++) {
|
876
|
|
- addAssocOutcome();
|
|
1065
|
+ addAssocOutcome(true);
|
|
1066
|
+
|
|
1067
|
+
|
877
|
1068
|
$('#assoc_outcome_' + i.toString()).val(json.outcomes[i].id);
|
878
|
1069
|
$('#assoc_outcome_' + i.toString()).selectpicker('refresh');
|
879
|
1070
|
|
|
1071
|
+ var outcome_id = json.outcomes[i].id;
|
|
1072
|
+ options = "<option value ='0'>Nothing Selected</option>";
|
|
1073
|
+
|
|
1074
|
+ for(objective_index in json.objectives_assoc[outcome_id]){
|
|
1075
|
+ objective = json.objectives_assoc[outcome_id][objective_index]
|
|
1076
|
+ options += '<option value ="('+outcome_id+','+objective.objective_id+')">'+
|
|
1077
|
+ objective.text+'</option>';
|
|
1078
|
+ }
|
|
1079
|
+ $('#assoc_objective_'+i+'_counter_1').html(options);
|
|
1080
|
+ $('#assoc_objective_'+i+'_counter_1').selectpicker('refresh');
|
|
1081
|
+ if(json.objectives[outcome_id].length){
|
|
1082
|
+ objective_id = json.objectives[outcome_id][0].objective_id;
|
|
1083
|
+ value = "("+outcome_id+","+objective_id+")"
|
|
1084
|
+ $('#assoc_objective_'+i+'_counter_1').val(value);
|
|
1085
|
+ $('#assoc_objective_'+i+'_counter_1').selectpicker('refresh')
|
|
1086
|
+ }
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+ for(var j =1; i<json.objectives[outcome_id].length; i++ ){
|
|
1090
|
+ addAssocObjective("assoc_objectiveGroupFor"+i, "assoc_objective_"+i);
|
|
1091
|
+ objective_id = json.objectives[outcome_id][j].objective_id;
|
|
1092
|
+ value = "("+outcome_id+","+objective_id+")";
|
|
1093
|
+ $('#assoc_objective_'+i+'_counter_'+(j+1)).val(value);
|
|
1094
|
+ $('#assoc_objective_'+i+'_counter_'+(j+1)).selectpicker('refresh');
|
|
1095
|
+
|
|
1096
|
+
|
|
1097
|
+ }
|
|
1098
|
+
|
880
|
1099
|
}
|
881
|
1100
|
|
882
|
|
- counterObj =$('#assoc_objectiveGroup').data('value');
|
|
1101
|
+
|
883
|
1102
|
|
884
|
1103
|
|
885
|
|
- try {
|
|
1104
|
+ /*try {
|
886
|
1105
|
for (var i = counterObj - 1; i > 0; i--) {
|
887
|
1106
|
deleteObjective('assoc_objectiveForm' + i.toString(), 'assoc_closeObj' + i.toString(), 'assoc_objectiveGroup')
|
888
|
1107
|
}
|
889
|
1108
|
} catch (err) {
|
890
|
1109
|
var noEntro = true;
|
891
|
|
- }
|
892
|
|
- $('#assoc_objectiveGroup').data('value', 1);
|
|
1110
|
+ }*/
|
893
|
1111
|
|
894
|
1112
|
|
|
1113
|
+ //$('#assoc_objectiveGroup').data('value', 1);
|
|
1114
|
+ //counterObj =$('#assoc_objectiveGroup').data('value');
|
895
|
1115
|
|
896
|
1116
|
|
897
|
1117
|
|
|
1118
|
+
|
|
1119
|
+ /*
|
898
|
1120
|
assocOutcomeCounter = 0;
|
899
|
1121
|
var i = 0;
|
900
|
1122
|
optionName = '<option value ="0">Nothing Selected</option>';
|
|
@@ -945,7 +1167,7 @@ $('#DeleteButton').prop('disabled', true);
|
945
|
1167
|
|
946
|
1168
|
|
947
|
1169
|
|
948
|
|
-
|
|
1170
|
+ */
|
949
|
1171
|
|
950
|
1172
|
|
951
|
1173
|
|
|
@@ -977,7 +1199,7 @@ $('.panel-group .panel-body').hide();
|
977
|
1199
|
$('#outcome-display').parent().hide();
|
978
|
1200
|
|
979
|
1201
|
fetchCriterionForEditing();
|
980
|
|
-fetchObjectiveForSelect('outcomeGroup', 'objectiveGroup');
|
|
1202
|
+fetchObjectiveForSelect('outcome0', 'objectiveGroupFor0');
|
981
|
1203
|
// setCriterionStatus();
|
982
|
1204
|
|
983
|
1205
|
|
|
@@ -1000,7 +1222,7 @@ $('.filterButton').on('click', function(e) {
|
1000
|
1222
|
|
1001
|
1223
|
return false;
|
1002
|
1224
|
});
|
1003
|
|
-$('#button-add-objective-assoc').on('click', function(e) {
|
|
1225
|
+$('.button-add-objective-assoc').on('click', function(e) {
|
1004
|
1226
|
// Prevent the default action of the clicked item. In this case that is submit
|
1005
|
1227
|
e.preventDefault();
|
1006
|
1228
|
|
|
@@ -1014,7 +1236,7 @@ e.preventDefault();
|
1014
|
1236
|
|
1015
|
1237
|
return false;
|
1016
|
1238
|
});
|
1017
|
|
-$('#button-add-objective').on('click', function(e) {
|
|
1239
|
+$('.button-add-objective').on('click', function(e) {
|
1018
|
1240
|
// Prevent the default action of the clicked item. In this case that is submit
|
1019
|
1241
|
e.preventDefault();
|
1020
|
1242
|
|