|
@@ -524,7 +524,7 @@
|
524
|
524
|
annual_plan_id:$(select).val()
|
525
|
525
|
},
|
526
|
526
|
function(semesters){
|
527
|
|
- console.log(semesters);
|
|
527
|
+ //console.log(semesters);
|
528
|
528
|
|
529
|
529
|
options_for_semesters = makeOptionsForSemesters(semesters);
|
530
|
530
|
$("#select-semester-plans").html(options_for_semesters);
|
|
@@ -552,7 +552,7 @@
|
552
|
552
|
semester_id:$(semesters).val()
|
553
|
553
|
},
|
554
|
554
|
function(courses){
|
555
|
|
- console.log(courses);
|
|
555
|
+ //console.log(courses);
|
556
|
556
|
options = makeOptionsForCourses(courses);
|
557
|
557
|
$("#select-courses-plans").html(options);
|
558
|
558
|
$('.selectpicker').selectpicker('refresh');
|
|
@@ -582,7 +582,7 @@
|
582
|
582
|
number_of_scales:$(number_of_scales).val()
|
583
|
583
|
},
|
584
|
584
|
function(criteria){
|
585
|
|
- console.log(criteria);
|
|
585
|
+ //console.log(criteria);
|
586
|
586
|
options_criteria = makeOptionsForCriteria(criteria)
|
587
|
587
|
|
588
|
588
|
$('#select-criteria-plans').html(options);
|
|
@@ -666,7 +666,7 @@
|
666
|
666
|
annual_plan_id:annual_plan_id
|
667
|
667
|
},
|
668
|
668
|
function(outcomes){
|
669
|
|
- console.log(outcomes);
|
|
669
|
+ //console.log(outcomes);
|
670
|
670
|
|
671
|
671
|
options_for_select = makeOptionsForOutcomes(outcomes);
|
672
|
672
|
$("#select-outcomes-plans").html(options_for_select);
|
|
@@ -679,11 +679,11 @@
|
679
|
679
|
|
680
|
680
|
|
681
|
681
|
function fetchObjectives(select_outcome){
|
682
|
|
- console.log($(select_outcome).find('option:selected').html())
|
|
682
|
+ //console.log($(select_outcome).find('option:selected').html())
|
683
|
683
|
option_selected = $(select_outcome).find('option:selected');
|
684
|
|
- console.log($(select_outcome).find('option:selected').data('objectives'))
|
685
|
|
- console.log($(select_outcome).val())
|
686
|
|
- console.log(option_selected.val())
|
|
684
|
+ //console.log($(select_outcome).find('option:selected').data('objectives'))
|
|
685
|
+ //console.log($(select_outcome).val())
|
|
686
|
+ //console.log(option_selected.val())
|
687
|
687
|
$.post(
|
688
|
688
|
"{{URL::action('AnnualPlansController@fetchObjectivesFromPlan')}}",
|
689
|
689
|
{
|
|
@@ -700,7 +700,7 @@ function fetchObjectives(select_outcome){
|
700
|
700
|
}
|
701
|
701
|
|
702
|
702
|
function makeOptionsForObjectives(objectives){
|
703
|
|
- console.log(objectives);
|
|
703
|
+ //console.log(objectives);
|
704
|
704
|
|
705
|
705
|
option_selected = '';
|
706
|
706
|
|
|
@@ -787,8 +787,8 @@ function saveTemplate(){
|
787
|
787
|
}
|
788
|
788
|
else
|
789
|
789
|
{
|
790
|
|
- console.log('school', $('#select-school').find(':selected').data('school-id') );
|
791
|
|
- console.log('program', $('#select-program').find(':selected').data('program-id') );
|
|
790
|
+ //console.log('school', $('#select-school').find(':selected').data('school-id') );
|
|
791
|
+ //console.log('program', $('#select-program').find(':selected').data('program-id') );
|
792
|
792
|
|
793
|
793
|
// Update database
|
794
|
794
|
$.post
|
|
@@ -911,7 +911,7 @@ function addCriterion(select)
|
911
|
911
|
|
912
|
912
|
|
913
|
913
|
str +='<th><span class="glyphicon glyphicon-remove icon-btn" aria-hidden="true"></span></th></tr>';
|
914
|
|
- console.log(str);
|
|
914
|
+ //console.log(str);
|
915
|
915
|
|
916
|
916
|
$('table tbody').append(str);
|
917
|
917
|
|
|
@@ -962,7 +962,7 @@ function buildCopyrightList()
|
962
|
962
|
|
963
|
963
|
copyrightNumber = Number.parseInt($(this).find('sup').text());
|
964
|
964
|
|
965
|
|
- console.log('a: '+copyrightNumber);
|
|
965
|
+ //console.log('a: '+copyrightNumber);
|
966
|
966
|
|
967
|
967
|
criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
|
968
|
968
|
found =true;
|
|
@@ -978,8 +978,8 @@ function buildCopyrightList()
|
978
|
978
|
{
|
979
|
979
|
var copyrightNumber = $('#copyright-list li').length+1;
|
980
|
980
|
|
981
|
|
- console.log('b: '+copyrightNumber);
|
982
|
|
- console.log(criterion.children('td:nth-child(2)').find('sup').length);
|
|
981
|
+ //console.log('b: '+copyrightNumber);
|
|
982
|
+ //console.log(criterion.children('td:nth-child(2)').find('sup').length);
|
983
|
983
|
|
984
|
984
|
criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
|
985
|
985
|
$('#copyright-list').append('<li><sup>'+copyrightNumber+' </sup><span>'+copyright+'<span></li>');
|
|
@@ -1058,7 +1058,7 @@ function fetchCriteria(outcome, objective)
|
1058
|
1058
|
function(data)
|
1059
|
1059
|
{
|
1060
|
1060
|
$('#select-criterion').empty();
|
1061
|
|
- console.log(data);
|
|
1061
|
+ //console.log(data);
|
1062
|
1062
|
// Append criteria
|
1063
|
1063
|
data.forEach( function (arrayItem)
|
1064
|
1064
|
{
|
|
@@ -1137,7 +1137,7 @@ function fetchCriterion(criterion)
|
1137
|
1137
|
|
1138
|
1138
|
copyrightNumber = Number.parseInt($(this).find('sup').text());
|
1139
|
1139
|
|
1140
|
|
- console.log('a: '+copyrightNumber);
|
|
1140
|
+ //console.log('a: '+copyrightNumber);
|
1141
|
1141
|
|
1142
|
1142
|
criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
|
1143
|
1143
|
found =true;
|
|
@@ -1153,8 +1153,8 @@ function fetchCriterion(criterion)
|
1153
|
1153
|
{
|
1154
|
1154
|
var copyrightNumber = $('#copyright-list li').length+1;
|
1155
|
1155
|
|
1156
|
|
- console.log('b: '+copyrightNumber);
|
1157
|
|
- console.log(criterion.children('td:nth-child(2)').find('sup').length);
|
|
1156
|
+ //console.log('b: '+copyrightNumber);
|
|
1157
|
+ //console.log(criterion.children('td:nth-child(2)').find('sup').length);
|
1158
|
1158
|
|
1159
|
1159
|
criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
|
1160
|
1160
|
$('#copyright-list').append('<li><sup>'+copyrightNumber+' </sup><span>'+copyright+'<span></li>');
|
|
@@ -1195,6 +1195,7 @@ function refreshSelects()
|
1195
|
1195
|
// Fetch programs associated to a specific school
|
1196
|
1196
|
function fetchPrograms(school)
|
1197
|
1197
|
{
|
|
1198
|
+ //console.log(school.find(':selected'));
|
1198
|
1199
|
$.ajax({
|
1199
|
1200
|
type: 'POST',
|
1200
|
1201
|
url: "{{ URL::action('ProgramsController@fetch') }}",
|
|
@@ -1238,25 +1239,27 @@ function loadTemplate()
|
1238
|
1239
|
//Set the name of the rubric
|
1239
|
1240
|
$('#rubric-name').val(data.template.name);
|
1240
|
1241
|
|
1241
|
|
-console.log(data.template.school_id);
|
1242
|
|
-console.log($('#select-school'));
|
|
1242
|
+//console.log($('#select-school'));
|
1243
|
1243
|
// Set school id to 0, then to the saved value if it exists
|
1244
|
1244
|
$('#select-school option[data-school-id="0"]').prop('selected', true);
|
1245
|
1245
|
$('#select-school option[data-school-id="'+data.template.school_id+'"]').prop('selected', true);
|
1246
|
|
-console.log($('#select-school'));
|
|
1246
|
+console.log("name"+data.template.name);
|
|
1247
|
+console.log("school"+data.template.school_id);
|
|
1248
|
+console.log("name"+data.template.name);
|
1247
|
1249
|
|
1248
|
1250
|
// Fetch programs associated to that school
|
1249
|
1251
|
fetchPrograms($('#select-school'));
|
|
1252
|
+ // fetchPrograms(data.template.school_id);
|
1250
|
1253
|
|
1251
|
1254
|
// Set program id to 0, then to the saved value if it exists
|
1252
|
1255
|
$('#select-program option[data-program-id="0"]').prop('selected', true);
|
1253
|
1256
|
$('#select-program option[data-program-id="'+data.template.program_id+'"]').prop('selected', true);
|
1254
|
1257
|
|
1255
|
1258
|
// Set expected values
|
1256
|
|
- console.log(data.template.expected_percentage);
|
|
1259
|
+ // console.log(data.template.expected_percentage);
|
1257
|
1260
|
|
1258
|
|
- console.log(data.template.expected_points);
|
1259
|
|
- console.log(data.template.max_score);
|
|
1261
|
+ // console.log(data.template.expected_points);
|
|
1262
|
+ // console.log(data.template.max_score);
|
1260
|
1263
|
|
1261
|
1264
|
$('#max_score').val(data.template.max_score);
|
1262
|
1265
|
|
|
@@ -1271,28 +1274,30 @@ console.log($('#select-school'));
|
1271
|
1274
|
changeTable();
|
1272
|
1275
|
// Set visibility
|
1273
|
1276
|
var is_visible = data.template.is_visible;
|
1274
|
|
- if(is_visible)
|
|
1277
|
+ console.log("is_visible",is_visible);
|
|
1278
|
+ if(is_visible==1)
|
1275
|
1279
|
{
|
|
1280
|
+ console.log("entro?")
|
1276
|
1281
|
$('#is_visible0').prop('checked', false);
|
1277
|
1282
|
$('#is_visible1').prop('checked', true);
|
1278
|
1283
|
}
|
1279
|
1284
|
else
|
1280
|
1285
|
{
|
1281
|
|
- $('#is_visible1').prop('checked', false);
|
1282
|
1286
|
$('#is_visible0').prop('checked', true);
|
|
1287
|
+ $('#is_visible1').prop('checked', false);
|
1283
|
1288
|
}
|
1284
|
1289
|
|
1285
|
1290
|
|
1286
|
1291
|
// Set the contents of the rubric
|
1287
|
1292
|
var temp_criterion = data.criterion;
|
1288
|
|
- console.log(temp_criterion);
|
|
1293
|
+ // console.log(temp_criterion);
|
1289
|
1294
|
for(temp_c in temp_criterion){
|
1290
|
1295
|
current_criterion = temp_criterion[temp_c]
|
1291
|
|
- console.log(current_criterion.program_ids);
|
|
1296
|
+ // console.log(current_criterion.program_ids);
|
1292
|
1297
|
objectives = JSON.stringify(current_criterion.objectives);
|
1293
|
1298
|
//var str = '<tr data-assoc-objectives= '+"'"+objectives+"'"+' data-program_ids = "'+current_criterion.program_ids+'" data-criterion-name = "'+current_criterion.name+'" data-criterion-id="'+temp_criterion[temp_c].criterion_id+'" data-criterion-copyright="'+temp_criterion[temp_c].copyright+'" data-criterion-notes="'+temp_criterion[temp_c].notes+'" data-outcomes = "'+temp_criterion[temp_c].outcomes+'"><th><span class="glyphicon glyphicon-move"></span></th><td>';
|
1294
|
1299
|
var str = "<tr data-program_ids = '"+current_criterion.program_ids+"' data-criterion-name = '"+current_criterion.name+"' data-criterion-id='"+temp_criterion[temp_c].criterion_id+"' data-criterion-copyright='"+temp_criterion[temp_c].copyright+"' data-criterion-notes='"+temp_criterion[temp_c].notes+"' data-outcomes = '"+temp_criterion[temp_c].outcomes+"'><th><span class='glyphicon glyphicon-move'></span></th><td>";
|
1295
|
|
- console.log(str);
|
|
1300
|
+ // console.log(str);
|
1296
|
1301
|
|
1297
|
1302
|
var subcriteria ='';
|
1298
|
1303
|
if(current_criterion.subcriteria){
|
|
@@ -1323,7 +1328,7 @@ console.log($('#select-school'));
|
1323
|
1328
|
str+= '<td>'+current_criterion.outcomes+'</td>'
|
1324
|
1329
|
|
1325
|
1330
|
str+='<th><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></th></tr>';
|
1326
|
|
- console.log(str);
|
|
1331
|
+ // console.log(str);
|
1327
|
1332
|
|
1328
|
1333
|
$('table tbody').append(str);
|
1329
|
1334
|
|
|
@@ -1421,14 +1426,13 @@ console.log($('#select-school'));
|
1421
|
1426
|
|
1422
|
1427
|
var template_program = selected.data('template-program-id');
|
1423
|
1428
|
// console.log(selected.data('template-program-id'));
|
1424
|
|
- // console.log(programs.includes(selected.data('template-program-id').toString()));
|
|
1429
|
+ console.log("**"+programs.indexOf(selected.data('template-program-id').toString()));
|
1425
|
1430
|
|
1426
|
1431
|
if(
|
1427
|
1432
|
{{ Auth::user()->role }}==1
|
1428
|
1433
|
|| ({{ Auth::user()->role }}==2 && selected.data('admin')!=1)
|
1429
|
1434
|
|| ({{ Auth::user()->role }}==3
|
1430
|
|
- && programs.includes(selected.data('template-program-id'))
|
1431
|
|
-
|
|
1435
|
+ && programs.indexOf(selected.data('template-program-id'))
|
1432
|
1436
|
&& selected.data('admin')!=1
|
1433
|
1437
|
)
|
1434
|
1438
|
)
|
|
@@ -1543,7 +1547,6 @@ $('#select-template').on('change', function()
|
1543
|
1547
|
$('#button-confirm-update-rubric').prop('disabled', true);
|
1544
|
1548
|
$('#button-print-rubric').prop('disabled', true);
|
1545
|
1549
|
}
|
1546
|
|
-
|
1547
|
1550
|
// Otherwise, load the selected template
|
1548
|
1551
|
else
|
1549
|
1552
|
{
|
|
@@ -1556,13 +1559,16 @@ $('#select-template').on('change', function()
|
1556
|
1559
|
|
1557
|
1560
|
var template_program = selected.data('template-program-id');
|
1558
|
1561
|
<!-- var dataset = selected.dataSet.templateProgramId; -->
|
|
1562
|
+// console.log("***"+({{ Auth::user()->role }}==3
|
|
1563
|
+ // && programs.indexOf(selected.data('template-program-id'))
|
|
1564
|
+ // && selected.data('admin')!=1
|
|
1565
|
+ // )+programs+template_program+{{ json_encode(Auth::user()->programs->lists('id')) }});
|
1559
|
1566
|
|
1560
|
1567
|
if(
|
1561
|
1568
|
{{ Auth::user()->role }}==1
|
1562
|
1569
|
|| ({{ Auth::user()->role }}==2 && selected.data('admin')!=1)
|
1563
|
1570
|
|| ({{ Auth::user()->role }}==3
|
1564
|
|
- && programs.includes(selected.data('template-program-id'))
|
1565
|
|
-
|
|
1571
|
+ && programs.indexOf(selected.data('template-program-id'))
|
1566
|
1572
|
&& selected.data('admin')!=1
|
1567
|
1573
|
)
|
1568
|
1574
|
)
|
|
@@ -1798,7 +1804,7 @@ $('.save').on('click', function(e)
|
1798
|
1804
|
console.log(program_ids);
|
1799
|
1805
|
|
1800
|
1806
|
// program_ids = $(this).data('program_ids')
|
1801
|
|
- if(!program_ids.includes(program_id) ){
|
|
1807
|
+ if(!program_ids.indexOf(program_id) ){
|
1802
|
1808
|
title = "<h6>The following criteria and objectives will be matched with this program</h6>"
|
1803
|
1809
|
htmlString += "<ol style='list-style-position: inside'>"
|
1804
|
1810
|
|