|
@@ -92,7 +92,7 @@
|
92
|
92
|
<div class="modal-header">
|
93
|
93
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
94
|
94
|
aria-hidden="true">×</span></button>
|
95
|
|
- <h3 class="modal-title"></h3>
|
|
95
|
+ <h3 id ='transformative_modal_title' class="modal-title"></h3>
|
96
|
96
|
</div>
|
97
|
97
|
<div class="modal-body">
|
98
|
98
|
<h5 id="was_it_implemented"> </h5>
|
|
@@ -124,6 +124,28 @@
|
124
|
124
|
</div><!-- /.modal-content -->
|
125
|
125
|
</div><!-- /.modal-dialog -->
|
126
|
126
|
</div><!-- /.modal -->
|
|
127
|
+
|
|
128
|
+ <div class="modal fade" id="modal-future-trans-course">
|
|
129
|
+ <div class="modal-dialog modal-lg">
|
|
130
|
+ <div class="modal-content">
|
|
131
|
+ <div class="modal-header">
|
|
132
|
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
|
133
|
+ aria-hidden="true">×</span></button>
|
|
134
|
+ <h3 class="modal-title"></h3>
|
|
135
|
+ </div>
|
|
136
|
+ <div class="modal-body">
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+ </div>
|
|
142
|
+ <div class='modal-footer'>
|
|
143
|
+ <button type="button" class="btn btn-secondary" data-dismiss="modal" >Cancel</button>
|
|
144
|
+ <button type="button" class="btn btn-primary" id ="save_transformative_info" onclick ='saveTransReport()'>Save</button>
|
|
145
|
+ </div>
|
|
146
|
+ </div><!-- /.modal-content -->
|
|
147
|
+ </div><!-- /.modal-dialog -->
|
|
148
|
+ </div><!-- /.modal -->
|
127
|
149
|
<script>
|
128
|
150
|
function nextChar(c) {
|
129
|
151
|
return String.fromCharCode(c.charCodeAt(0) + 1);
|
|
@@ -370,6 +392,288 @@
|
370
|
392
|
}
|
371
|
393
|
}
|
372
|
394
|
|
|
395
|
+ function draw_transformative_future_course(course_code){
|
|
396
|
+
|
|
397
|
+ /* This is the modal
|
|
398
|
+ <div class="modal fade" id="modal-future-trans-course">
|
|
399
|
+ <div class="modal-dialog modal-lg">
|
|
400
|
+ <div class="modal-content">
|
|
401
|
+ <div class="modal-header">
|
|
402
|
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
|
403
|
+ aria-hidden="true">×</span></button>
|
|
404
|
+ <h3 class="modal-title"></h3>
|
|
405
|
+ </div>
|
|
406
|
+ <div class="modal-body">
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+ </div>
|
|
412
|
+ <div class='modal-footer'>
|
|
413
|
+ <button type="button" class="btn btn-secondary" data-dismiss="modal" >Cancel</button>
|
|
414
|
+ <button type="button" class="btn btn-primary" id ="save_transformative_info" onclick ='saveTransReport()'>Save</button>
|
|
415
|
+ </div>
|
|
416
|
+ </div><!-- /.modal-content -->
|
|
417
|
+ </div><!-- /.modal-dialog -->
|
|
418
|
+ </div><!-- /.modal --> */
|
|
419
|
+
|
|
420
|
+ return_complete_div = $('<div>');
|
|
421
|
+
|
|
422
|
+ typ_semester_course_id = course_code.typ_semester_course_id;
|
|
423
|
+ modalComplete = $('<div>',{
|
|
424
|
+ 'class':'modal fade',
|
|
425
|
+ 'id':'modal_for_future_trans_on_'+typ_semester_course_id
|
|
426
|
+ });
|
|
427
|
+ modalDialog = $('<div>',{
|
|
428
|
+ 'class':'modal-dialog modal-lg'
|
|
429
|
+ });
|
|
430
|
+ modalComplete.append(modalDialog);
|
|
431
|
+
|
|
432
|
+ modalContent = $('<div>',{
|
|
433
|
+ 'class':'modal-content'
|
|
434
|
+ });
|
|
435
|
+
|
|
436
|
+ modalDialog.append(modalContent);
|
|
437
|
+
|
|
438
|
+ modalHeader = $('<div>', {
|
|
439
|
+ 'class':'modal-header'
|
|
440
|
+ }).html('<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>'+
|
|
441
|
+ '<h3 class="modal-title">Future Transformative Actions for '+course_code.code+' '+course_code.number+'</h3>');
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+ modalContent.append(modalHeader);
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+ modalBody = $('<div>', {
|
|
449
|
+ 'class':'modal-body'
|
|
450
|
+ });
|
|
451
|
+ modalContent.append(modalBody);
|
|
452
|
+
|
|
453
|
+ div_for_name = $('<div>', {
|
|
454
|
+ 'class': 'form-group',
|
|
455
|
+
|
|
456
|
+ });
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+ input_name = $('<input>', {
|
|
461
|
+ 'class': 'form-control',
|
|
462
|
+
|
|
463
|
+ 'name': 'at_text',
|
|
464
|
+ 'id': 'at_text_for_'+typ_semester_course_id
|
|
465
|
+ });
|
|
466
|
+
|
|
467
|
+ div_for_name.html("<label> Name</label>");
|
|
468
|
+ div_for_name.append(input_name);
|
|
469
|
+ modalBody.append(div_for_name);
|
|
470
|
+
|
|
471
|
+ div_for_category = $('<div>', {
|
|
472
|
+ 'class': 'form-group'
|
|
473
|
+ }).html('<label>Type of Transformative Action</label>');
|
|
474
|
+
|
|
475
|
+ select_for_category = $('<select>', {
|
|
476
|
+ 'name': 'type_of_ta',
|
|
477
|
+ 'id': 'type_of_ta_of_'+typ_semester_course_id,
|
|
478
|
+ 'class': 'form-control selectpicker',
|
|
479
|
+ 'onchange': 'checkIfNew(this)'
|
|
480
|
+ }).html(GlobalTransCategories);
|
|
481
|
+
|
|
482
|
+ div_for_category.append(select_for_category);
|
|
483
|
+ modalBody.append(select_for_category);
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+ div_description = $('<div>', {
|
|
487
|
+ 'class': 'form-group',
|
|
488
|
+
|
|
489
|
+ }).html('<label> Description</label>');
|
|
490
|
+
|
|
491
|
+ textarea = $('<textarea>', {
|
|
492
|
+ 'class': 'form-control',
|
|
493
|
+ 'id': 'description_for_'+typ_semester_course_id,
|
|
494
|
+ 'name': 'description',
|
|
495
|
+ 'rows': '10'
|
|
496
|
+ });
|
|
497
|
+
|
|
498
|
+ div_description.append(textarea);
|
|
499
|
+ modalBody.append(div_description);
|
|
500
|
+ modalBody.append('<hr><label>Select when will this transformative action will be implemeneted</label>');
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+ selectpicker_for_semesters = $('<select>',{
|
|
505
|
+ 'name':'selected_semesters_for_'+typ_semester_course_id+'_[]',
|
|
506
|
+ 'id':'selected_semester_first_for_'+typ_semester_course_id,
|
|
507
|
+ 'class':'form-control selectpicker'
|
|
508
|
+ });
|
|
509
|
+ options_for_semesters='<option value = "0">Nothing Selected</option>';
|
|
510
|
+ $.each(course_code.future_typ_course_id, function(index, typ_future){
|
|
511
|
+ options_for_semesters +='<option value="'+typ_future.typ_future_course_id+'" data-semester-id ="'+typ_future.semester_id+'" data-objective-id = "'+typ_future.objective_id+'" >'+typ_future.semester_name+' ['+typ_future.semester_code+'] '+'</option>';
|
|
512
|
+ });
|
|
513
|
+ selectpicker_for_semesters.html(options_for_semesters);
|
|
514
|
+
|
|
515
|
+ modalBody.append(selectpicker_for_semesters);
|
|
516
|
+ modalBody.append('<br><br>');
|
|
517
|
+
|
|
518
|
+ button_for_more = $('<button>', {
|
|
519
|
+ 'class':'btn btn-secondary',
|
|
520
|
+ 'onclick':'addMoreSemesters('+typ_semester_course_id+', this)',
|
|
521
|
+ 'style':'float:right'
|
|
522
|
+ }).html('<span class="glyphicon glyphicon-plus">'+
|
|
523
|
+ '</span>Add another semester');
|
|
524
|
+
|
|
525
|
+ modalBody.append(button_for_more);
|
|
526
|
+ modalBody.append('<br><br>');
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+ modalFooter = $('<div>',{
|
|
534
|
+ 'class':'modal-footer'
|
|
535
|
+ });
|
|
536
|
+ modalContent.append(modalFooter);
|
|
537
|
+
|
|
538
|
+ close_button = $('<button>',{
|
|
539
|
+ 'type':'button',
|
|
540
|
+ 'class':'btn btn-secondary',
|
|
541
|
+ 'data-dismiss':'modal'
|
|
542
|
+ }).html('Cancel');
|
|
543
|
+ save_button = $('<button>',{
|
|
544
|
+ 'class':'btn btn-primary',
|
|
545
|
+ 'onclick':'saveFutureTrans('+typ_semester_course_id+', "'+course_code.code+'", "'+course_code.number+'")'
|
|
546
|
+ }).html('Save');
|
|
547
|
+
|
|
548
|
+ modalFooter.append(close_button);
|
|
549
|
+ modalFooter.append(save_button);
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+ return_complete_div.append(modalComplete);
|
|
553
|
+
|
|
554
|
+ return_complete_div.append('<h3>Future Transformative Actions for '+course_code.code+' '+course_code.number);
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+ return_complete_div.append('<hr><button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#modal_for_future_trans_on_'+typ_semester_course_id+'">' +
|
|
558
|
+ 'Add Transformative Actions' +
|
|
559
|
+ '</button><hr>')
|
|
560
|
+
|
|
561
|
+ return return_complete_div;
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+ }
|
|
568
|
+
|
|
569
|
+ function saveFutureTrans(typ_semester_course_id, course_code, course_number){
|
|
570
|
+ annual_plan_id = $('#annual_plan').val()
|
|
571
|
+ at_text = $('#at_text_for_'+typ_semester_course_id).val();
|
|
572
|
+ type_of_TA = $('#type_of_ta_of_'+typ_semester_course_id).val();
|
|
573
|
+ is_custom = $('#type_of_ta_of_'+typ_semester_course_id).find('option:selected').data('is-custom');
|
|
574
|
+ if(type_of_TA == "new"){
|
|
575
|
+ type_of_TA = $('#new_type_type_of_ta_of_'+typ_semester_course_id).val();
|
|
576
|
+ is_custom = 1;
|
|
577
|
+ }
|
|
578
|
+ description = $('#description_for_'+typ_semester_course_id).val();
|
|
579
|
+ future_typ_course_id =[];
|
|
580
|
+ future_semesters = [];
|
|
581
|
+ objective_id =0
|
|
582
|
+
|
|
583
|
+ $.each($('select[name="selected_semesters_for_'+typ_semester_course_id+'_[]"]'), function(index, select){
|
|
584
|
+ objective_id = $(select).find('option:selected').data('objective-id');
|
|
585
|
+ future_semesters.push($(select).find('option:selected').data('semester-id'));
|
|
586
|
+ future_typ_course_id.push($(select).val());
|
|
587
|
+ });
|
|
588
|
+ $.post(
|
|
589
|
+ "{{URL::action('AnnualPlansController@futureTransformative')}}",
|
|
590
|
+ {
|
|
591
|
+ at_text:at_text,
|
|
592
|
+ type_of_TA:type_of_TA,
|
|
593
|
+ description:description,
|
|
594
|
+ future_semesters:future_semesters,
|
|
595
|
+ future_typ_course_id:future_typ_course_id,
|
|
596
|
+ is_custom:is_custom,
|
|
597
|
+ program_id:{{$program->id}},
|
|
598
|
+ annual_plan_id:annual_plan_id,
|
|
599
|
+ course_code:course_code,
|
|
600
|
+ course_number:course_number,
|
|
601
|
+ objective_id:objective_id
|
|
602
|
+ },
|
|
603
|
+ function(data){
|
|
604
|
+ alert('estamos');
|
|
605
|
+ }
|
|
606
|
+ )
|
|
607
|
+
|
|
608
|
+ }
|
|
609
|
+
|
|
610
|
+ function addMoreSemesters(typ_semester_course_id, button_add_new_semester){
|
|
611
|
+ first_select_options = $('#selected_semester_first_for_'+typ_semester_course_id).html();
|
|
612
|
+ /*<div class="input-group">
|
|
613
|
+ <select class="form-control">
|
|
614
|
+ <option>Select option..</option>
|
|
615
|
+ <option>Option 1</option>
|
|
616
|
+ <option>Option 2</option>
|
|
617
|
+ </select>
|
|
618
|
+ <span class="input-group-btn">
|
|
619
|
+ <button class="btn btn-default" type="button" tabindex="-1"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>
|
|
620
|
+ </span>
|
|
621
|
+</div> */
|
|
622
|
+ input_group = $('<div>', {
|
|
623
|
+ 'class':'input-group'
|
|
624
|
+ });
|
|
625
|
+ newselect = $('<select>',{
|
|
626
|
+ 'name':'selected_semesters_for_'+typ_semester_course_id+'_[]',
|
|
627
|
+ //'id':'selected_semester_first_for_'+typ_semester_course_id,
|
|
628
|
+ 'class':'form-control selectpicker'
|
|
629
|
+ }).html(first_select_options);
|
|
630
|
+
|
|
631
|
+ span_group = $("<span>",{
|
|
632
|
+ 'class':'input-group-btn',
|
|
633
|
+
|
|
634
|
+ });
|
|
635
|
+ button_for_close = $('<button>',{
|
|
636
|
+ 'class':'btn btn-primary',
|
|
637
|
+ 'type':'button',
|
|
638
|
+ 'onclick': '$(this).parent().parent().remove()'
|
|
639
|
+
|
|
640
|
+ }).html('<span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>');
|
|
641
|
+ span_group.append(button_for_close);
|
|
642
|
+ input_group.append(newselect);
|
|
643
|
+ input_group.append(span_group);
|
|
644
|
+ input_group.insertBefore($(button_add_new_semester));
|
|
645
|
+ //input_group.prepend('<hr>');
|
|
646
|
+ $('.selectpicker').selectpicker('refresh');
|
|
647
|
+
|
|
648
|
+ }
|
|
649
|
+
|
|
650
|
+ function checkIfNew(select) {
|
|
651
|
+ id =$(select).attr('id');
|
|
652
|
+if ($(select).val() == "new") {
|
|
653
|
+ var new_div = $('<div/>', {
|
|
654
|
+ 'class': 'form-group new_type'
|
|
655
|
+ }).html("<label>New Type </label>");
|
|
656
|
+
|
|
657
|
+ var input = $("<input/>", {
|
|
658
|
+ 'type': 'text',
|
|
659
|
+ 'id': 'new_type_'+id,
|
|
660
|
+ 'name': "new_type",
|
|
661
|
+ 'class': 'form-control'
|
|
662
|
+ });
|
|
663
|
+ new_div.append(input);
|
|
664
|
+
|
|
665
|
+ $(select).parent().after(new_div)
|
|
666
|
+
|
|
667
|
+} else {
|
|
668
|
+ $(select).parent().next('.new_type').remove();
|
|
669
|
+}
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+}
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+ GlobalTransCategories= '';
|
|
676
|
+
|
373
|
677
|
function fetchEverything(li) {
|
374
|
678
|
var outcome_id = $(li).data('outcome-id');
|
375
|
679
|
var name = $(li).data('outcome-name');
|
|
@@ -398,6 +702,7 @@
|
398
|
702
|
} else {
|
399
|
703
|
outcome.outcome_program_goal = 'It has not been defined';
|
400
|
704
|
}
|
|
705
|
+ GlobalTransCategories = outcome.transformative_actions_categories_html;
|
401
|
706
|
var outcomeHTML = "<h4>Performance of Students by Learning Outcome</h4>" +
|
402
|
707
|
'<h5 style = "display: inline; margin:30px;">Target learning by learning outcome: </h5>' +
|
403
|
708
|
'<p style = "display: inline;"> <i>>= ' + outcome.expected_outcome +
|
|
@@ -538,8 +843,14 @@
|
538
|
843
|
table_for_transformative_actions.append(tbody_for_transformative_actions);
|
539
|
844
|
div.append('<hr><h4>Transformative actions for '+course_code.code+' '+course_code.number+'</h4>')
|
540
|
845
|
div.append(table_for_transformative_actions);
|
|
846
|
+ div.append('<hr>');
|
|
847
|
+
|
|
848
|
+
|
541
|
849
|
//table_for_transformative_actions.DataTable();
|
542
|
850
|
}
|
|
851
|
+ the_drawn_transformative_future_html = draw_transformative_future_course(course_code, outcome.transformative_actions_categories_html);
|
|
852
|
+ div.append(the_drawn_transformative_future_html);
|
|
853
|
+ $('.selectpicker').selectpicker('refresh');
|
543
|
854
|
|
544
|
855
|
|
545
|
856
|
table.DataTable();
|
|
@@ -670,7 +981,7 @@
|
670
|
981
|
success: function(transformative_action_with_status) {
|
671
|
982
|
transformative_action = transformative_action_with_status[0];
|
672
|
983
|
|
673
|
|
- $('.modal-title').html('<strong>'+transformative_action.at_text+'</strong>: '+transformative_action.description);
|
|
984
|
+ $('#transformative_modal_title').html('<strong>'+transformative_action.at_text+'</strong>: '+transformative_action.description);
|
674
|
985
|
|
675
|
986
|
|
676
|
987
|
$('input[name="implemented"]').prop('checked',false);
|