Brak opisu

assessment.blade.php 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. @extends('layouts.master')
  2. @section('navigation')
  3. @if($role==1)
  4. @include('local.managers.admins._new_navigation')
  5. @elseif($role==2)
  6. @include('local.managers.sCoords._new_navigation')
  7. @elseif($role==3)
  8. @include('local.managers.pCoords._new_navigation')
  9. @else
  10. @include('local.professors._navigation')
  11. @endif
  12. @stop
  13. @section('main')
  14. <!-- View criterion info -->
  15. <div class="modal fade" id="modal-view-criterion">
  16. <div class="modal-dialog modal-lg">
  17. <div class="modal-content">
  18. <div class="modal-header">
  19. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  20. <h4 class="modal-title"></h4>
  21. </div>
  22. <div class="modal-body">
  23. <table class="table table-bordered">
  24. <thead id = "criteria-header">;
  25. @for($i=0; $i<$rubric->num_scales; $i++)
  26. <th>{{$rubric->titles[$i]}} ({{1+($i*($rubric->max_score/$rubric->num_scales))}} - {{(1+$i)*($rubric->max_score/$rubric->num_scales)}})</th>
  27. @endfor
  28. <th>Notes</th>
  29. </thead>
  30. <tbody>
  31. <tr>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </div>
  36. </div><!-- /.modal-content -->
  37. </div><!-- /.modal-dialog -->
  38. </div><!-- /.modal -->
  39. <div class="row">
  40. <div class="col-md-12">
  41. <div class="well">
  42. <button id="button-language" class="btn btn-default btn-sm pull-right">Change language / Cambiar idioma</button>
  43. <div id="english-instructions">
  44. <h4>Instructions:</h4>
  45. <ol>
  46. <li>Fill in the scores per criterion for each student. You can see the student's final score in the last column.</li>
  47. <li>Click 'Publish Assessment' if you are done. Click 'Save as Draft' if you have not finished assessing the activity. You can come back later if you need to make any updates.
  48. <li>Unpublished results will be isolated. That is, they <strong>will not</strong> be aggregated to other results.</li>
  49. </ol>
  50. <h4>Notes:</h4>
  51. <ul>
  52. <li>If a particular criterion cannot be assessed for a student, select "N/A" (Not Applicable). This <strong>will not</strong> affect the student's score.</li>
  53. <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>
  54. <li>If a student did not complete any work for this activity, select "0" for all columns in that student's row.</li>
  55. <li>If a student dropped the class, select "N/A" (Not Applicable) for all columns in that student's row.</li>
  56. <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>
  57. <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>
  58. <li>If some criterion has more weight on the student's final percentage, you can add it in the 'Weight' box above the criterion but be sure that the sum of criteria weights is equal to 100 (or aproximates it).
  59. </ul>
  60. </div>
  61. <div id="spanish-instructions">
  62. <h4>Instrucciones:</h4>
  63. <ol>
  64. <li>Seleccione la puntuación por criterio para cada estudiante. Puede ver la puntuación final en la última columna.</li>
  65. <li>Oprima 'Publish Assessment' una vez termine. Si no ha terminado, oprima 'Save as Draft' (guardar como borrador). Puede volver a esta página luego si desea hacer cambios.</li>
  66. <li>Los resultados guardados como borrador estarán asilados. Es decir, <strong>no</strong> se agregarán a los demás resultados.</li>
  67. </ol>
  68. <h4>Notas:</h4>
  69. <ul>
  70. <li>Si un criterio particular no puede ser evaluado, seleccione "N/A" (No Aplica). Esto <strong>no</strong> afectará la puntuación final del estudiante.</li>
  71. <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>
  72. <li>Si un estudiante no completó el trabajo para esta actividad, seleccione "0" en todas las columnas de la fila de ese estudiante.</li>
  73. <li>Si un estudiante se dio de baja, seleccione "N/A" (No Aplica) en todas las columnas de la fila de ese estudiante.</li>
  74. <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>
  75. <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>
  76. <li>Si algún criterio tiene más peso en el porcentaje final del estudiante, puedes añadirlo en la caja de "Weight" arriba del criterio deseado, pero debe asegurarse que la suma de los criterios sea igual a cien, o se aproxime.
  77. </ul>
  78. </div>
  79. </div>
  80. <input type='hidden' id='max' name= 'max' value='{{$rubric->max_score}}'>
  81. <input type ='hidden' id='num_of_scales' name ='num_of_scales' value ='{{$rubric->num_scales}}'>
  82. <p id="course">Course: {{{ $course->code }}} {{{ $course->number }}}</p>
  83. <p id="section">Section: {{{ $course->section }}}</p>
  84. {{ HTML::linkAction('ActivitiesController@show', 'Back to Activity', array($activity->id), array('class'=>'btn btn-default btn-sm pull-right')) }}
  85. <p id="activity" data-activity-id="{{{ $activity->id }}}">Activity: {{{ $activity->name}}} </p>
  86. <p>Passing Criteria: <span id="expected_percentage">{{{ $rubric->expected_percentage }}}% of students must obtain at least </span><span id="expected_points">{{{$rubric->expected_points}}}</span> points </p>
  87. <table data-rubric-id="{{{ $rubric->id }}}" id="assessment-table" class="table table-striped table-condensed table-bordered">
  88. <thead>
  89. <tr>
  90. <th>
  91. </th>
  92. @foreach ($rubric_criterion as $index => $criterion)
  93. <th data-criterion-id="{{{ $criterion->criterion_id }}}" ><div class="th-box">
  94. Weight<input class="form-control" id="weight-{{$index}}" name='weight[]' type="text" value="{{$criterion->weight}}" data-activity-criterion-id="{{$criterion->activity_criterion_id}}">
  95. </div></th>
  96. @endforeach
  97. <th colspan=3>
  98. <div class="th-box">
  99. Total<input class="form-control" id="total" name='total' type="text" value="{{$total_weights}}" readonly>
  100. </div>
  101. </th>
  102. </tr>
  103. <tr>
  104. <th>
  105. <div class="th-box">
  106. Student
  107. </div>
  108. </th>
  109. @foreach ($rubric_criterion as $criterion)
  110. <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>
  111. @endforeach
  112. <th>Student Percentage</th>
  113. <th>Student % per Weight</th>
  114. <th>Comments</th>
  115. </tr>
  116. </thead>
  117. <tbody>
  118. <!-- If the activity was assessed, load the assessment. Otherwise load empty sheet -->
  119. @if(sizeof($assessments)!=0)
  120. <!-- For each assessment -->
  121. @foreach ($students as $student)
  122. <tr class="student-row">
  123. <!-- Fetch student name -->
  124. <td class="student-field" data-student-id="{{ $student->id }}">
  125. {{{ $student->name }}}
  126. </td>
  127. <!-- For each criterion in the rubric, there's a score field -->
  128. @for ($i = 0; $i<sizeof($rubric_criterion); $i++)
  129. <td class="score-field">
  130. <select name="" id="" class="form-control" data-toggle="tooltip" data-placement="right" title="{{{ $student->name }}}
  131. {{{ $rubric_criterion[$i]->name }}}">
  132. <!-- Option from 0-8 -->
  133. @for ($j=0; $j<=$rubric->max_score; $j++)
  134. <!-- If the decoded scores with index as the assessment id and second index as criterion id equals the loop index, mark it as selected -->
  135. @if(array_key_exists($student->id, $scores_array) && isset($scores_array[$student->id][$rubric_criterion[$i]->activity_criterion_id]) && $j == $scores_array[$student->id][$rubric_criterion[$i]->activity_criterion_id])
  136. <option value="{{$j}}" selected="selected">{{ $j }}</option>
  137. @else
  138. <option value="{{$j}}">{{ $j }}</option>
  139. @endif
  140. @endfor
  141. <!-- N/A option -->
  142. @if( !array_key_exists($student->id, $scores_array)|| !isset($scores_array[$student->id][$rubric_criterion[$i]->activity_criterion_id]))
  143. <option value="N/A" selected="selected">N/A</option>
  144. @else
  145. <option value="N/A">N/A</option>
  146. @endif
  147. </select>
  148. </td>
  149. @endfor
  150. <td class="percentage"></td>
  151. <td class="percentage-per-weight"></td>
  152. <td class="">
  153. <textarea class="comments full-textarea" placeholder="Max. 255 characters" maxLength="255" >
  154. @if(array_key_exists($student->id, $scores_array))
  155. {{ $scores_array[$student->id]["comments"] }}
  156. @endif
  157. </textarea>
  158. </td>
  159. </tr>
  160. @endforeach
  161. @else
  162. @foreach ($students as $student)
  163. <tr class="student-row">
  164. <td class="student-field" data-student-id={{ $student->id }}>{{{ $student->name }}}</td>
  165. @for ($i = 0; $i<sizeof($rubric_criterion); $i++)
  166. <td class="score-field" data-weight = '1'>
  167. <select name="" id="" class="form-control" data-toggle="tooltip" data-placement="right" title="{{{ $student->name }}}">
  168. @for($j=0; $j<=$rubric->max_score; $j++)
  169. <option value ='{{$j}}'>{{$j}}</option>
  170. @endfor
  171. <option selected="selected" value="N/A">N/A</option>
  172. </select>
  173. </td>
  174. @endfor
  175. <td class="percentage"></td>
  176. <td class="percentage-per-weight"></td>
  177. <td class="comments"><textarea class="comments full-textarea" placeholder="Max. 255 characters" maxLength="255" ></textarea></td>
  178. </tr>
  179. @endforeach
  180. @endif
  181. </tbody>
  182. <tfoot>
  183. <tr>
  184. <td>
  185. <strong>Passed Criteria Percentage </strong>
  186. </td>
  187. @for ($i = 0; $i<sizeof($rubric_criterion); $i++)
  188. <td class="total"><strong><span class="total-value"></span><span class="percent-sign">%</span></strong>
  189. </td>
  190. @endfor
  191. <td></td>
  192. </tr>
  193. </tfoot>
  194. </table>
  195. <div class="text-center">
  196. <button id="button-submit-assessment" class="btn btn-primary btn-lg publish">Publish Assessment</button>
  197. <button id="button-diagnostic-assessment" class="btn btn-primary btn-lg diagnostic">Save as Diagnostic Test</button>
  198. <button id="button-draft-assessment" class="btn btn-primary btn-lg draft">Save as Draft</button>
  199. </div>
  200. </div>
  201. </div>
  202. <script>
  203. $('#button-submit-assessment, #button-draft-assessment, #button-diagnostic-assessment').on('click', function(e)
  204. {
  205. var draft = 0;
  206. var diagnostic=0
  207. if($(this).hasClass('draft'))
  208. draft = 1;
  209. if($(this).hasClass('diagnostic'))
  210. diagnostic = 1;
  211. var expected_points = parseInt($('#expected_points').text());
  212. var expected_percentage = parseInt($('#expected_percentage').text());
  213. //Prevent page refresh
  214. e.preventDefault();
  215. // Row in the database
  216. var activity_id = $('#activity').data('activity-id');
  217. var student_info = new Object();
  218. // Object to hold the score sum of each criterion
  219. var criteriaSumObject = new Object();
  220. // Object to hold % of students that passed each criterion
  221. var CriteriaAchievedPercentage = new Object();
  222. // Object to hold all student evaluations
  223. var studentAssessments = new Array();
  224. var weights = new Object();
  225. $('input[name="weight[]"]').each(function (index){
  226. activity_criterion_id = $(this).data('activity-criterion-id');
  227. weight = $(this).val();
  228. weights[activity_criterion_id] = weight;
  229. });
  230. // Iterate through all students
  231. $('#assessment-table tbody tr').each(function( index )
  232. {
  233. student_info[index] = new Object()
  234. student_info[index].studentId = $(this).find('.student-field').data('student-id');
  235. student_info[index].activity_crit_id = new Object();
  236. /* var ScoresObject = new Object(); // Scores column in database
  237. var CriterionObject = new Object(); // Objects inside ScoresObject
  238. var SingleStudentAssessment = new Object();
  239. SingleStudentAssessment.student_id = $(this).find('.student-field').data('student-id');
  240. */
  241. // For each criterion, store the score in array
  242. $(this).children('td.score-field').each(function(index2)
  243. {
  244. // Table cell with a score
  245. var scoreField = $(this);
  246. // Criterion being evaluated in current iteration
  247. activity_criterion_id = $('.criterion-field').eq(index2).data('activity-criterion-id');
  248. score = scoreField.children('select').find(':selected').val();
  249. if(score != "N/A")
  250. student_info[index].activity_crit_id[activity_criterion_id] = score;
  251. // Score in the cell
  252. //var score = scoreField.children('select').find(':selected').val();
  253. // Store the score in the scores Object
  254. //ScoresObject[criterion_id]=score;
  255. // Initialize the index for the sum object, if it's undefined
  256. //if(typeof(criteriaSumObject[criterion_id]) == 'undefined')
  257. //{
  258. // criteriaSumObject[criterion_id]=0;
  259. //}
  260. // Add to this criterion's total
  261. //criteriaSumObject[criterion_id]+=parseInt(score);
  262. });
  263. student_info[index].comments = $.trim($(this).find('.comments').val());
  264. //SingleStudentAssessment.scores = ScoresObject;
  265. //SingleStudentAssessment.percentage = $(this).find('.percentage').text();
  266. //SingleStudentAssessment.comments = $.trim($(this).find('.comments').val());
  267. // console.log('comment '+index+': '+SingleStudentAssessment.comments);
  268. // console.log('student object: '+JSON.stringify(SingleStudentAssessment));
  269. //var clone = jQuery.extend({}, SingleStudentAssessment);
  270. //studentAssessments.push(clone);
  271. });
  272. // console.log('students: '+JSON.stringify(studentAssessments));
  273. // console.log('total points per criteria: '+JSON.stringify(criteriaSumObject));
  274. // Iterate through all evaluated criteria, determining which were achieved
  275. // by comparing the completion percentage to the expected percentage
  276. /*var CriteriaAchievedResults = new Object();
  277. $('.total').each(function(index)
  278. {
  279. var id = $('.criterion-field').eq(index).data('criterion-id');
  280. CriteriaAchievedPercentage[id] = parseFloat($(this).find('span').text());
  281. //Set whether criterion was achieved (1) or not (0)
  282. if(CriteriaAchievedPercentage[id] >= expected_percentage)
  283. {
  284. CriteriaAchievedResults[id]=1;
  285. }
  286. else if (CriteriaAchievedPercentage[id] < expected_percentage)
  287. {
  288. CriteriaAchievedResults[id]=0;
  289. }
  290. else
  291. {
  292. CriteriaAchievedResults[id]=null;
  293. }
  294. });
  295. */
  296. // console.log('criteria percentages: '+JSON.stringify(CriteriaAchievedPercentage));
  297. // console.log('criteria achieved results: '+JSON.stringify(CriteriaAchievedResults));
  298. // Save activity to the database
  299. $.post
  300. (
  301. "{{ URL::action('ActivitiesController@saveAssessment') }}",
  302. {
  303. activity_id: activity_id,
  304. draft: draft,
  305. weights: JSON.stringify(weights),
  306. student_info: JSON.stringify(student_info),
  307. diagnostic:diagnostic
  308. },
  309. function(data)
  310. {
  311. location.replace(data);
  312. }
  313. );
  314. });
  315. </script>
  316. @stop
  317. @section('included-js')
  318. <!-- StickyTableHeaders js -->
  319. <script src="{{ asset('vendor/stickyTableHeaders/js/jquery.stickytableheaders.min.js') }}"></script>
  320. @stop
  321. @section ('javascript')
  322. // --------------------------------------------------------------------------
  323. // Page load
  324. // --------------------------------------------------------------------------
  325. // Enable fixed headers
  326. //$('#assessment-table').stickyTableHeaders();
  327. // Hide spanish instructions by default
  328. $('#spanish-instructions').toggle();
  329. $('.total').each(function(index)
  330. {
  331. percentagePerCriterion(index+1);
  332. });
  333. $('.student-row').each(function(index)
  334. {
  335. percentagePerStudent($(this));
  336. });
  337. // Highlight student names on hover
  338. $('.student-row td').on('mouseover', function()
  339. {
  340. $('.student-field').css(
  341. {
  342. 'color': 'black',
  343. });
  344. $(this).siblings('.student-field').css(
  345. {
  346. 'color': '#DD0026',
  347. });
  348. });
  349. toggleSaveButton();
  350. // --------------------------------------------------------------------------
  351. // Functions
  352. // --------------------------------------------------------------------------
  353. // Calculate average of students that passed a specific criterion
  354. function percentagePerCriterion(columnIndex)
  355. {
  356. // Object to hold the score sum of each criterion
  357. var sum = 0 ;
  358. var total = 0;
  359. columnIndex+=1;
  360. // Iterate through rows of column
  361. $('table tbody tr td:nth-child('+columnIndex+')').each(function( index )
  362. {
  363. var val = parseInt($(this).children('select').find(':selected').val());
  364. /* If N/A or 0 are chosen, they are ignored in the calculation. */
  365. if(val % 1 === 0)
  366. {
  367. if(val >= parseInt($('#expected_points').text()))
  368. {
  369. sum+=1;
  370. }
  371. total+=1;
  372. }
  373. });
  374. var percentage= (sum/total*100).toFixed(2);
  375. // If no criteria were assessed, set the percentage to 0.
  376. // This is to avoid show NaN%
  377. if(total==0)
  378. {
  379. percentage="N/A";
  380. $('.total:nth-child('+columnIndex+') span.total-value').html(percentage);
  381. $('.total:nth-child('+columnIndex+') span.percent-sign').hide();
  382. }
  383. else
  384. {
  385. $('.total:nth-child('+columnIndex+') span.total-value').html(percentage);
  386. $('.total:nth-child('+columnIndex+') span.percent-sign').show();
  387. }
  388. }
  389. // Calculate total for a specific student
  390. function percentagePerStudent(row)
  391. {
  392. // Object to hold the score student's total score
  393. var sum = 0 ;
  394. var total = 0;
  395. var percentage = 0;
  396. var max_score = parseInt($('#max').val());
  397. sum_of_weight = 0;
  398. per_of_weight =0;
  399. var sum_of_weight_fixed=0.0;
  400. row.find('td.score-field').each(function(index)
  401. {
  402. sum_of_weight_fixed+=parseFloat($('#weight-'+index).val());
  403. var val = parseInt($(this).children('select').find(':selected').val());
  404. if(val % 1 === 0) //If number is integer
  405. {
  406. sum += val;
  407. total+=1;
  408. per_of_weight += val * parseInt($('#weight-'+index).val());
  409. sum_of_weight += parseInt($('#weight-'+index).val());
  410. }
  411. });
  412. $('#total').val(sum_of_weight_fixed.toFixed(2));
  413. <!-- console.log(sum_of_weight_fixed); -->
  414. percentage_per_weight = (100 *(per_of_weight/(max_score*sum_of_weight))).toFixed(2);
  415. percentage =((sum/(total*max_score))*100).toFixed(2);
  416. //If percentage is not a number, set it to 0.
  417. if(isNaN(percentage))
  418. {
  419. percentage="N/A";
  420. row.find('.percentage').html('<strong>'+percentage+'</strong>');
  421. }
  422. else
  423. {
  424. row.find('.percentage').html('<strong>'+percentage+'%</strong>');
  425. }
  426. if(isNaN(percentage_per_weight)){
  427. percentage_per_weight="N/A";
  428. row.find('.percentage-per-weight').html('<strong>'+percentage_per_weight+'</strong>');
  429. }
  430. else{
  431. row.find('.percentage-per-weight').html('<strong>'+percentage_per_weight+'%</strong>');
  432. }
  433. }
  434. function toggleSaveButton()
  435. {
  436. // Check at least one total criterion percentage is not zero
  437. var all_zeros_criteria = true;
  438. $('.total-value').each(function(index)
  439. {
  440. if(Number($(this).text())>0.00)
  441. all_zeros_criteria = false;
  442. });
  443. // Check at least one total student percentage is not zero
  444. var all_zeros_students = true;
  445. $('.percentage').each(function(index)
  446. {
  447. var value = $(this).text().replace('%', '');
  448. if(Number(value)>0.00)
  449. all_zeros_students = false;
  450. });
  451. if(all_zeros_criteria && all_zeros_students)
  452. {
  453. $('#button-submit-assessment').prop('disabled', true);
  454. $('#button-draft-assessment').prop('disabled', true);
  455. }
  456. else
  457. {
  458. $('#button-submit-assessment').prop('disabled', false);
  459. $('#button-draft-assessment').prop('disabled', false);
  460. }
  461. return;
  462. }
  463. // --------------------------------------------------------------------------
  464. // Events
  465. // --------------------------------------------------------------------------
  466. $('input[name="weight[]"]').on('change', function(e){
  467. $('.student-row').each(function(index)
  468. {
  469. percentagePerStudent($(this));
  470. });
  471. });
  472. // When any score changes, calculate percentages
  473. $('select').on('change', function(e)
  474. {
  475. percentagePerCriterion($(this).parent().index());
  476. percentagePerStudent($(this).closest('tr'));
  477. toggleSaveButton();
  478. });
  479. //LA LINEA DONDE VA, 410
  480. // Submit button is clicked
  481. // Language button is clicked
  482. $('#button-language').on('click', function(e)
  483. {
  484. $('#english-instructions').stop().toggle();
  485. $('#spanish-instructions').stop().toggle();
  486. });
  487. // Criterion name is clicked
  488. $('.criterion-field').on('click', function()
  489. {
  490. $.ajax({
  491. type: 'POST',
  492. url: "{{ URL::action('RubricsController@fetchRubricCriterion') }}",
  493. data: {
  494. criterion_id: $(this).data('criterion-id')
  495. },
  496. success: function(data)
  497. {
  498. data = JSON.parse(data);
  499. $('.modal-title').html(data.criteria.name);
  500. descriptions = '';
  501. $('.modal-body tbody tr').empty();
  502. for(i =0; i<{{$rubric->num_scales}}; i++){
  503. descriptions += '<td>'+data[i].description+'</td>'
  504. }
  505. $('.modal-body tbody tr').append
  506. (
  507. descriptions
  508. );
  509. if(data.criteria.notes!=null)
  510. $('.modal-body tbody tr').append('<td>'+data.criteria.notes+'</td>');
  511. else
  512. $('.modal-body tbody tr').append('<td></td>');
  513. },
  514. async:true
  515. });
  516. $('#modal-view-criterion').modal();
  517. });
  518. $(window).load(function(){
  519. $(".tableFloatingHeader").each(function(){
  520. $(this).remove();
  521. })
  522. });
  523. @stop