|
@@ -61,7 +61,7 @@
|
61
|
61
|
<li>If a particular criterion was assessed but the student did not complete the necessary work, you must select "0". This <strong>will</strong> affect the student's score.</li>
|
62
|
62
|
<li>If a student did not complete any work for this activity, select "0" for all columns in that student's row.</li>
|
63
|
63
|
<li>If a student dropped the class, select "N/A" (Not Applicable) for all columns in that student's row.</li>
|
64
|
|
- <li>Cells with "N/A" <strong>will not</strong> be used to determine whether a criterion is achieved. Only scores from 0 to 8 will be considered for this purpose.</li>
|
|
64
|
+ <li>Cells with "N/A" <strong>will not</strong> be used to determine whether a criterion is achieved. Only scores from 0 to {{$rubric->max_score}} will be considered for this purpose.</li>
|
65
|
65
|
<li>For this activity, <strong>at least one score must be from 1-{{$rubric->max_score}}.</strong> Otherwise, the 'Publish Assessment' and 'Save as Draft' buttons will be <strong>disabled</strong>. If you want to delete previously saved scores, go back to the activity and click the "Delete Assessment" button.</li>
|
66
|
66
|
|
67
|
67
|
</ul>
|
|
@@ -82,7 +82,7 @@
|
82
|
82
|
<li>Si un criterio particular fue evaluado, pero el estudiante no completó el trabajo necesario, debe seleccionar "0". Esto <strong>sí</strong> afectará la puntuación final del estudiante.</li>
|
83
|
83
|
<li>Si un estudiante no completó el trabajo para esta actividad, seleccione "0" en todas las columnas de la fila de ese estudiante.</li>
|
84
|
84
|
<li>Si un estudiante se dio de baja, seleccione "N/A" (No Aplica) en todas las columnas de la fila de ese estudiante.</li>
|
85
|
|
- <li>Las celdas con "N/A" <strong>no</strong> serán utilizadas para determinar si un criterio se alcanzó o no. Solamente las puntuaciones del 0 al 8 serán consideradas.</li>
|
|
85
|
+ <li>Las celdas con "N/A" <strong>no</strong> serán utilizadas para determinar si un criterio se alcanzó o no. Solamente las puntuaciones del 0 al {{$rubric->max_score}} serán consideradas.</li>
|
86
|
86
|
<li>Para esta actividad, <strong>al menos una puntuación deber ser del 1 al {{$rubric->max_score}}.</strong> De otra manera, el botón para guardar <strong>se desactivará</strong>. Si quiere borrar los resultados del avalúo, vuelva a la actividad y oprima el botón que dice "Delete Assessment".</li>
|
87
|
87
|
|
88
|
88
|
|
|
@@ -105,13 +105,8 @@
|
105
|
105
|
</th>
|
106
|
106
|
@foreach ($criterion_rubric as $index => $criterion)
|
107
|
107
|
<th data-criterion-id="{{{ $criterion->criterion_id }}}" ><div class="th-box">
|
108
|
|
- <!--<div class="form-group row">
|
109
|
|
- <div class="col-xs-1">
|
110
|
|
- <label for="weight-{{$index}}">Weight</label>
|
111
|
|
- <input class="form-control" id="weight-{{$index}}" name='weight[]' type="text">
|
112
|
|
- </div>
|
113
|
|
- </div>-->
|
114
|
|
- Weight<input class="form-control" id="weight-{{$index}}" name='weight[]' type="text" style = "width: 50%">
|
|
108
|
+
|
|
109
|
+ Weight<input class="form-control" id="weight-{{$index}}" name='weight[]' type="text" value="{{$criterion->weight}}" data-activity-criterion-id="{{$criterion->activity_criterion_id}}">
|
115
|
110
|
</div></th>
|
116
|
111
|
@endforeach
|
117
|
112
|
</tr>
|
|
@@ -122,7 +117,7 @@
|
122
|
117
|
</div>
|
123
|
118
|
</th>
|
124
|
119
|
@foreach ($criterion_rubric as $criterion)
|
125
|
|
- <th class="criterion-field" data-criterion-id="{{{ $criterion->criterion_id }}}" ><div class="th-box">{{ $criterion->name}}</div></th>
|
|
120
|
+ <th class="criterion-field" data-activity-criterion-id = "{{$criterion->activity_criterion_id}}"data-rubric-criterion-id = "{{$criterion->rubric_criterion_id}}" data-criterion-id="{{{ $criterion->criterion_id }}}" ><div class="th-box">{{ $criterion->name}}</div></th>
|
126
|
121
|
@endforeach
|
127
|
122
|
<th>Student Percentage</th>
|
128
|
123
|
<th>Student % per Weight</th>
|
|
@@ -134,21 +129,21 @@
|
134
|
129
|
<!-- If the activity was assessed, load the assessment. Otherwise load empty sheet -->
|
135
|
130
|
@if(sizeof($assessments)!=0)
|
136
|
131
|
<!-- For each assessment -->
|
137
|
|
- @foreach ($assessments as $assessment)
|
|
132
|
+ @foreach ($students as $student)
|
138
|
133
|
<tr class="student-row">
|
139
|
134
|
<!-- Fetch student name -->
|
140
|
|
- <td class="student-field" data-student-id="{{ $assessment->student_id }}">
|
141
|
|
- {{{ $assessment->name }}}
|
|
135
|
+ <td class="student-field" data-student-id="{{ $student->id }}">
|
|
136
|
+ {{{ $student->name }}}
|
142
|
137
|
</td>
|
143
|
138
|
|
144
|
139
|
<!-- For each criterion in the rubric, there's a score field -->
|
145
|
140
|
@for ($i = 0; $i<sizeof($criterion_rubric); $i++)
|
146
|
141
|
<td class="score-field">
|
147
|
|
- <select name="" id="" class="form-control" data-toggle="tooltip" data-placement="right" title="{{{ $assessment->name }}}">
|
|
142
|
+ <select name="" id="" class="form-control" data-toggle="tooltip" data-placement="right" title="{{{ $student->name }}}">
|
148
|
143
|
<!-- Option from 0-8 -->
|
149
|
|
- @for ($j=0; $j<=8; $j++)
|
|
144
|
+ @for ($j=0; $j<=$rubric->max_score; $j++)
|
150
|
145
|
<!-- If the decoded scores with index as the assessment id and second index as criterion id equals the loop index, mark it as selected -->
|
151
|
|
- @if( $j == $scores_array[$assessment->id][$criterion_rubric[$i]->criterion_id])
|
|
146
|
+ @if( $j == $scores_array[$student->id][$i])
|
152
|
147
|
<option value="{{$j}}" selected="selected">{{ $j }}</option>
|
153
|
148
|
@else
|
154
|
149
|
<option value="{{$j}}">{{ $j }}</option>
|
|
@@ -156,7 +151,7 @@
|
156
|
151
|
@endfor
|
157
|
152
|
|
158
|
153
|
<!-- N/A option -->
|
159
|
|
- @if( $scores_array[$assessment->id][$criterion_rubric[$i]->criterion_id]=="N/A")
|
|
154
|
+ @if( $scores_array[$student->id][$i]=="N/A")
|
160
|
155
|
<option value="N/A" selected="selected">N/A</option>
|
161
|
156
|
@else
|
162
|
157
|
<option value="N/A">N/A</option>
|
|
@@ -164,9 +159,10 @@
|
164
|
159
|
</select>
|
165
|
160
|
</td>
|
166
|
161
|
@endfor
|
167
|
|
- <td class="percentage">{{{ $assessment->percentage }}}</td>
|
|
162
|
+ <td class="percentage"></td>
|
|
163
|
+ <td class="percentage-per-weight"></td>
|
168
|
164
|
<td class="">
|
169
|
|
- <textarea class="comments full-textarea" placeholder="Max. 255 characters" maxLength="255" >{{ $assessment->comments }}</textarea>
|
|
165
|
+ <textarea class="comments full-textarea" placeholder="Max. 255 characters" maxLength="255" >{{ $scores_array[$student->id]["comments"] }}</textarea>
|
170
|
166
|
</td>
|
171
|
167
|
</tr>
|
172
|
168
|
@endforeach
|
|
@@ -175,7 +171,7 @@
|
175
|
171
|
<tr class="student-row">
|
176
|
172
|
<td class="student-field" data-student-id={{ $student->id }}>{{{ $student->name }}}</td>
|
177
|
173
|
@for ($i = 0; $i<sizeof($criterion_rubric); $i++)
|
178
|
|
- <td class="score-field">
|
|
174
|
+ <td class="score-field" data-weight = '1'>
|
179
|
175
|
<select name="" id="" class="form-control" data-toggle="tooltip" data-placement="right" title="{{{ $student->name }}}">
|
180
|
176
|
@for($j=0; $j<=$rubric->max_score; $j++)
|
181
|
177
|
<option value ='{{$j}}'>{{$j}}</option>
|
|
@@ -185,7 +181,7 @@
|
185
|
181
|
</td>
|
186
|
182
|
@endfor
|
187
|
183
|
<td class="percentage"></td>
|
188
|
|
- <td class="percentage-per-w"></td>
|
|
184
|
+ <td class="percentage-per-weight"></td>
|
189
|
185
|
<td class="comments"><textarea class="comments full-textarea" placeholder="Max. 255 characters" maxLength="255" ></textarea></td>
|
190
|
186
|
</tr>
|
191
|
187
|
@endforeach
|
|
@@ -212,8 +208,147 @@
|
212
|
208
|
</div>
|
213
|
209
|
</div>
|
214
|
210
|
</div>
|
|
211
|
+<script>
|
|
212
|
+$('#button-submit-assessment, #button-draft-assessment').on('click', function(e)
|
|
213
|
+{
|
|
214
|
+
|
|
215
|
+ var draft = 0;
|
|
216
|
+
|
|
217
|
+ if($(this).hasClass('draft'))
|
|
218
|
+ draft = 1;
|
|
219
|
+
|
|
220
|
+ var expected_points = parseInt($('#expected_points').text());
|
|
221
|
+ var expected_percentage = parseInt($('#expected_percentage').text());
|
|
222
|
+
|
|
223
|
+ //Prevent page refresh
|
|
224
|
+ e.preventDefault();
|
|
225
|
+
|
|
226
|
+ // Row in the database
|
|
227
|
+ var activity_id = $('#activity').data('activity-id');
|
|
228
|
+
|
|
229
|
+ var student_info = new Object();
|
|
230
|
+
|
|
231
|
+ // Object to hold the score sum of each criterion
|
|
232
|
+ var criteriaSumObject = new Object();
|
|
233
|
+
|
|
234
|
+ // Object to hold % of students that passed each criterion
|
|
235
|
+ var CriteriaAchievedPercentage = new Object();
|
|
236
|
+
|
|
237
|
+ // Object to hold all student evaluations
|
|
238
|
+ var studentAssessments = new Array();
|
|
239
|
+
|
|
240
|
+ var weights = new Object();
|
|
241
|
+
|
|
242
|
+ $('input[name="weight[]"]').each(function (index){
|
|
243
|
+ activity_criterion_id = $(this).data('activity-criterion-id');
|
|
244
|
+ weights[activity_criterion_id] = $(this).val();
|
|
245
|
+ });
|
|
246
|
+
|
|
247
|
+ // Iterate through all students
|
|
248
|
+ $('#assessment-table tbody tr').each(function( index )
|
|
249
|
+ {
|
|
250
|
+
|
|
251
|
+ student_info[index] = new Object()
|
|
252
|
+ student_info[index].studentId = $(this).find('.student-field').data('student-id');
|
|
253
|
+ student_info[index].activity_crit_id = new Object();
|
|
254
|
+
|
|
255
|
+ /* var ScoresObject = new Object(); // Scores column in database
|
|
256
|
+ var CriterionObject = new Object(); // Objects inside ScoresObject
|
|
257
|
+ var SingleStudentAssessment = new Object();
|
|
258
|
+ SingleStudentAssessment.student_id = $(this).find('.student-field').data('student-id');
|
|
259
|
+ */
|
|
260
|
+ // For each criterion, store the score in array
|
|
261
|
+ $(this).children('td.score-field').each(function(index2)
|
|
262
|
+ {
|
|
263
|
+ // Table cell with a score
|
|
264
|
+ var scoreField = $(this);
|
|
265
|
+
|
|
266
|
+ // Criterion being evaluated in current iteration
|
|
267
|
+ activity_criterion_id = $('.criterion-field').eq(index2).data('activity-criterion-id');
|
|
268
|
+ student_info[index].activity_crit_id[activity_criterion_id] = scoreField.children('select').find(':selected').val();
|
|
269
|
+
|
|
270
|
+ // Score in the cell
|
|
271
|
+ //var score = scoreField.children('select').find(':selected').val();
|
|
272
|
+
|
|
273
|
+ // Store the score in the scores Object
|
|
274
|
+ //ScoresObject[criterion_id]=score;
|
|
275
|
+
|
|
276
|
+ // Initialize the index for the sum object, if it's undefined
|
|
277
|
+ //if(typeof(criteriaSumObject[criterion_id]) == 'undefined')
|
|
278
|
+ //{
|
|
279
|
+ // criteriaSumObject[criterion_id]=0;
|
|
280
|
+ //}
|
|
281
|
+
|
|
282
|
+ // Add to this criterion's total
|
|
283
|
+ //criteriaSumObject[criterion_id]+=parseInt(score);
|
|
284
|
+ });
|
|
285
|
+ student_info[index].comments = $.trim($(this).find('.comments').val());
|
|
286
|
+
|
|
287
|
+ //SingleStudentAssessment.scores = ScoresObject;
|
|
288
|
+ //SingleStudentAssessment.percentage = $(this).find('.percentage').text();
|
|
289
|
+ //SingleStudentAssessment.comments = $.trim($(this).find('.comments').val());
|
|
290
|
+ // console.log('comment '+index+': '+SingleStudentAssessment.comments);
|
|
291
|
+ // console.log('student object: '+JSON.stringify(SingleStudentAssessment));
|
|
292
|
+
|
|
293
|
+ //var clone = jQuery.extend({}, SingleStudentAssessment);
|
|
294
|
+ //studentAssessments.push(clone);
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+ });
|
|
298
|
+
|
|
299
|
+ // console.log('students: '+JSON.stringify(studentAssessments));
|
|
300
|
+ // console.log('total points per criteria: '+JSON.stringify(criteriaSumObject));
|
|
301
|
+
|
|
302
|
+ // Iterate through all evaluated criteria, determining which were achieved
|
|
303
|
+ // by comparing the completion percentage to the expected percentage
|
|
304
|
+ /*var CriteriaAchievedResults = new Object();
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+ $('.total').each(function(index)
|
|
308
|
+ {
|
|
309
|
+ var id = $('.criterion-field').eq(index).data('criterion-id');
|
|
310
|
+
|
|
311
|
+ CriteriaAchievedPercentage[id] = parseFloat($(this).find('span').text());
|
|
312
|
+
|
|
313
|
+ //Set whether criterion was achieved (1) or not (0)
|
|
314
|
+ if(CriteriaAchievedPercentage[id] >= expected_percentage)
|
|
315
|
+ {
|
|
316
|
+ CriteriaAchievedResults[id]=1;
|
|
317
|
+ }
|
|
318
|
+ else if (CriteriaAchievedPercentage[id] < expected_percentage)
|
|
319
|
+ {
|
|
320
|
+ CriteriaAchievedResults[id]=0;
|
|
321
|
+ }
|
|
322
|
+ else
|
|
323
|
+ {
|
|
324
|
+ CriteriaAchievedResults[id]=null;
|
|
325
|
+ }
|
|
326
|
+
|
|
327
|
+ });
|
|
328
|
+*/
|
|
329
|
+ // console.log('criteria percentages: '+JSON.stringify(CriteriaAchievedPercentage));
|
|
330
|
+ // console.log('criteria achieved results: '+JSON.stringify(CriteriaAchievedResults));
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+ // Save activity to the database
|
|
334
|
+ $.post
|
|
335
|
+ (
|
|
336
|
+ "{{ URL::action('ActivitiesController@saveAssessment') }}",
|
|
337
|
+ {
|
|
338
|
+ activity_id: activity_id,
|
|
339
|
+ draft: draft,
|
|
340
|
+ weights: JSON.stringify(weights),
|
|
341
|
+
|
|
342
|
+ student_info: JSON.stringify(student_info)
|
|
343
|
+ },
|
|
344
|
+ function(data)
|
|
345
|
+ {
|
|
346
|
+ location.replace(data);
|
|
347
|
+ }
|
|
348
|
+ );
|
215
|
349
|
|
216
|
|
-
|
|
350
|
+});
|
|
351
|
+ </script>
|
217
|
352
|
@stop
|
218
|
353
|
|
219
|
354
|
@section('included-js')
|
|
@@ -230,7 +365,7 @@
|
230
|
365
|
// Page load
|
231
|
366
|
// --------------------------------------------------------------------------
|
232
|
367
|
|
233
|
|
-changeTable();
|
|
368
|
+
|
234
|
369
|
// Enable fixed headers
|
235
|
370
|
$('#assessment-table').stickyTableHeaders();
|
236
|
371
|
|
|
@@ -322,6 +457,8 @@ function percentagePerStudent(row)
|
322
|
457
|
var total = 0;
|
323
|
458
|
var percentage = 0;
|
324
|
459
|
var max_score = parseInt($('#max').val());
|
|
460
|
+ sum_of_weight = 0;
|
|
461
|
+ per_of_weight =0;
|
325
|
462
|
|
326
|
463
|
row.find('td.score-field').each(function(index)
|
327
|
464
|
{
|
|
@@ -330,9 +467,12 @@ function percentagePerStudent(row)
|
330
|
467
|
{
|
331
|
468
|
sum += val;
|
332
|
469
|
total+=1;
|
|
470
|
+ per_of_weight += val * parseInt($('#weight-'+index).val());
|
|
471
|
+ sum_of_weight += parseInt($('#weight-'+index).val());
|
333
|
472
|
}
|
334
|
|
- });
|
335
|
473
|
|
|
474
|
+ });
|
|
475
|
+ percentage_per_weight = (100 *(per_of_weight/(max_score*sum_of_weight))).toFixed(2);
|
336
|
476
|
percentage =((sum/(total*max_score))*100).toFixed(2);
|
337
|
477
|
|
338
|
478
|
//If percentage is not a number, set it to 0.
|
|
@@ -345,6 +485,13 @@ function percentagePerStudent(row)
|
345
|
485
|
{
|
346
|
486
|
row.find('.percentage').html('<strong>'+percentage+'%</strong>');
|
347
|
487
|
}
|
|
488
|
+ if(isNaN(percentage_per_weight)){
|
|
489
|
+ percentage_per_weight="N/A";
|
|
490
|
+ row.find('.percentage-per-weight').html('<strong>'+percentage_per_weight+'</strong>');
|
|
491
|
+ }
|
|
492
|
+ else{
|
|
493
|
+ row.find('.percentage-per-weight').html('<strong>'+percentage_per_weight+'%</strong>');
|
|
494
|
+ }
|
348
|
495
|
|
349
|
496
|
|
350
|
497
|
}
|
|
@@ -398,131 +545,9 @@ $('select').on('change', function(e)
|
398
|
545
|
percentagePerStudent($(this).closest('tr'));
|
399
|
546
|
toggleSaveButton();
|
400
|
547
|
});
|
401
|
|
-
|
|
548
|
+//LA LINEA DONDE VA, 410
|
402
|
549
|
// Submit button is clicked
|
403
|
|
-$('#button-submit-assessment, #button-draft-assessment').on('click', function(e)
|
404
|
|
-{
|
405
|
|
-
|
406
|
|
- var draft = 0;
|
407
|
|
-
|
408
|
|
- if($(this).hasClass('draft'))
|
409
|
|
- draft = 1;
|
410
|
|
-
|
411
|
|
- var expected_points = parseInt($('#expected_points').text());
|
412
|
|
- var expected_percentage = parseInt($('#expected_percentage').text());
|
413
|
|
-
|
414
|
|
- //Prevent page refresh
|
415
|
|
- e.preventDefault();
|
416
|
|
-
|
417
|
|
- // Row in the database
|
418
|
|
- var activity_id = $('#activity').data('activity-id');
|
419
|
|
-
|
420
|
|
- // Object to hold the score sum of each criterion
|
421
|
|
- var criteriaSumObject = new Object();
|
422
|
|
-
|
423
|
|
- // Object to hold % of students that passed each criterion
|
424
|
|
- var CriteriaAchievedPercentage = new Object();
|
425
|
|
-
|
426
|
|
- // Object to hold all student evaluations
|
427
|
|
- var studentAssessments = new Array();
|
428
|
|
-
|
429
|
|
- // Iterate through all students
|
430
|
|
- $('#assessment-table tbody tr').each(function( index )
|
431
|
|
- {
|
432
|
|
- var ScoresObject = new Object(); // Scores column in database
|
433
|
|
- var CriterionObject = new Object(); // Objects inside ScoresObject
|
434
|
|
- var SingleStudentAssessment = new Object();
|
435
|
|
- SingleStudentAssessment.student_id = $(this).find('.student-field').data('student-id');
|
436
|
|
-
|
437
|
|
- // For each criterion, store the score in array
|
438
|
|
- $(this).children('td.score-field').each(function(index)
|
439
|
|
- {
|
440
|
|
- // Table cell with a score
|
441
|
|
- var scoreField = $(this);
|
442
|
|
-
|
443
|
|
- // Criterion being evaluated in current iteration
|
444
|
|
- var criterion_id = $('.criterion-field').eq(index).data('criterion-id');
|
445
|
|
-
|
446
|
|
- // Score in the cell
|
447
|
|
- var score = scoreField.children('select').find(':selected').val();
|
448
|
|
-
|
449
|
|
- // Store the score in the scores Object
|
450
|
|
- ScoresObject[criterion_id]=score;
|
451
|
|
-
|
452
|
|
- // Initialize the index for the sum object, if it's undefined
|
453
|
|
- if(typeof(criteriaSumObject[criterion_id]) == 'undefined')
|
454
|
|
- {
|
455
|
|
- criteriaSumObject[criterion_id]=0;
|
456
|
|
- }
|
457
|
|
-
|
458
|
|
- // Add to this criterion's total
|
459
|
|
- criteriaSumObject[criterion_id]+=parseInt(score);
|
460
|
|
- });
|
461
|
|
-
|
462
|
|
- SingleStudentAssessment.scores = ScoresObject;
|
463
|
|
- SingleStudentAssessment.percentage = $(this).find('.percentage').text();
|
464
|
|
- SingleStudentAssessment.comments = $.trim($(this).find('.comments').val());
|
465
|
|
- // console.log('comment '+index+': '+SingleStudentAssessment.comments);
|
466
|
|
- // console.log('student object: '+JSON.stringify(SingleStudentAssessment));
|
467
|
|
-
|
468
|
|
- var clone = jQuery.extend({}, SingleStudentAssessment);
|
469
|
|
- studentAssessments.push(clone);
|
470
|
|
-
|
471
|
|
-
|
472
|
|
- });
|
473
|
|
-
|
474
|
|
- // console.log('students: '+JSON.stringify(studentAssessments));
|
475
|
|
- // console.log('total points per criteria: '+JSON.stringify(criteriaSumObject));
|
476
|
|
-
|
477
|
|
- // Iterate through all evaluated criteria, determining which were achieved
|
478
|
|
- // by comparing the completion percentage to the expected percentage
|
479
|
|
- var CriteriaAchievedResults = new Object();
|
480
|
|
-
|
481
|
|
-
|
482
|
|
- $('.total').each(function(index)
|
483
|
|
- {
|
484
|
|
- var id = $('.criterion-field').eq(index).data('criterion-id');
|
485
|
|
-
|
486
|
|
- CriteriaAchievedPercentage[id] = parseFloat($(this).find('span').text());
|
487
|
|
-
|
488
|
|
- //Set whether criterion was achieved (1) or not (0)
|
489
|
|
- if(CriteriaAchievedPercentage[id] >= expected_percentage)
|
490
|
|
- {
|
491
|
|
- CriteriaAchievedResults[id]=1;
|
492
|
|
- }
|
493
|
|
- else if (CriteriaAchievedPercentage[id] < expected_percentage)
|
494
|
|
- {
|
495
|
|
- CriteriaAchievedResults[id]=0;
|
496
|
|
- }
|
497
|
|
- else
|
498
|
|
- {
|
499
|
|
- CriteriaAchievedResults[id]=null;
|
500
|
|
- }
|
501
|
|
-
|
502
|
|
- });
|
503
|
|
-
|
504
|
|
- // console.log('criteria percentages: '+JSON.stringify(CriteriaAchievedPercentage));
|
505
|
|
- // console.log('criteria achieved results: '+JSON.stringify(CriteriaAchievedResults));
|
506
|
|
-
|
507
|
|
-
|
508
|
|
- // Save activity to the database
|
509
|
|
- $.post
|
510
|
|
- (
|
511
|
|
- "{{ URL::action('ActivitiesController@saveAssessment') }}",
|
512
|
|
- {
|
513
|
|
- activity_id: activity_id,
|
514
|
|
- draft: draft,
|
515
|
|
- criteria_achieved_percentage: JSON.stringify(CriteriaAchievedPercentage),
|
516
|
|
- criteria_achievement: JSON.stringify(CriteriaAchievedResults),
|
517
|
|
- student_scores: JSON.stringify(studentAssessments),
|
518
|
|
- },
|
519
|
|
- function(data)
|
520
|
|
- {
|
521
|
|
- location.replace(data);
|
522
|
|
- }
|
523
|
|
- );
|
524
|
550
|
|
525
|
|
-});
|
526
|
551
|
|
527
|
552
|
// Language button is clicked
|
528
|
553
|
$('#button-language').on('click', function(e)
|
|
@@ -539,25 +564,24 @@ $('.criterion-field').on('click', function()
|
539
|
564
|
type: 'POST',
|
540
|
565
|
url: "{{ URL::action('RubricsController@fetchRubricCriterion') }}",
|
541
|
566
|
data: {
|
542
|
|
- rubric_id: $(this).closest('table').data('rubric-id'),
|
543
|
|
- criterion_id: $(this).data('criterion-id'),
|
|
567
|
+ rubric_criterion_id: $(this).data('rubric-criterion-id')
|
544
|
568
|
},
|
545
|
569
|
success: function(data)
|
546
|
570
|
{
|
547
|
571
|
data = JSON.parse(data);
|
548
|
|
- $('.modal-title').html(data.name);
|
549
|
|
-
|
|
572
|
+ $('.modal-title').html(data.criteria.name);
|
|
573
|
+ descriptions = '';
|
550
|
574
|
$('.modal-body tbody tr').empty();
|
|
575
|
+ for(i =0; i<{{$rubric->num_scales}}; i++){
|
|
576
|
+ descriptions += '<td>'+data[i].description+'</td>'
|
|
577
|
+ }
|
551
|
578
|
$('.modal-body tbody tr').append
|
552
|
579
|
(
|
553
|
|
- '<td>'+data.description12+'</td>'
|
554
|
|
- +'<td>'+data.description34+'</td>'
|
555
|
|
- +'<td>'+data.description56+'</td>'
|
556
|
|
- +'<td>'+data.description78+'</td>'
|
|
580
|
+ descriptions
|
557
|
581
|
);
|
558
|
582
|
|
559
|
|
- if(data.notes!=null)
|
560
|
|
- $('.modal-body tbody tr').append('<td>'+data.notes+'</td>');
|
|
583
|
+ if(data.criteria.notes!=null)
|
|
584
|
+ $('.modal-body tbody tr').append('<td>'+data.criteria.notes+'</td>');
|
561
|
585
|
else
|
562
|
586
|
$('.modal-body tbody tr').append('<td></td>');
|
563
|
587
|
|