No Description

view_rubric_limited.blade.php 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. @extends('layouts.master')
  2. @section('navigation')
  3. @if($role==1)
  4. @include('local.managers.admins._navigation')
  5. @elseif($role==2)
  6. @include('local.managers.sCoords._navigation')
  7. @elseif($role==3)
  8. @include('local.managers.pCoords._navigation')
  9. @else
  10. @include('local.professors._navigation')
  11. @endif
  12. @stop
  13. @section('main')
  14. <div class="row">
  15. <div class="col-md-12">
  16. <p>Passing Criteria:
  17. <span id="expected_percentage">{{{ $rubric->expected_percentage }}}% of students must obtain at least </span>
  18. <span id="expected_points">{{{$rubric->expected_points}}}</span> points
  19. </p>
  20. <table class="table table-striped table-condensed">
  21. <thead>
  22. <tr>
  23. <th></th>
  24. <th>Learning Outcome</th>
  25. <th>Criterion</th>
  26. @foreach ($rubric->titles as $i=> $title)
  27. <th>{{$title}} ({{1+($i*($rubric->max_score/$rubric->num_scales))}} - {{(1+$i)*($rubric->max_score/$rubric->num_scales)}})
  28. @endforeach
  29. </tr>
  30. </thead>
  31. <tbody>
  32. @foreach($rubric_criterion as $index => $criterion)
  33. <tr data-criterion-copyright="{{ $criterion->copyright }}" data-criterion-notes="{{ $criterion->notes }}">
  34. @if(isset($criterion->notes))
  35. <td>{{ $index + 1 }}.</td>
  36. <td>@foreach($criterion->outcomes as $index => $outcome)
  37. <li>{{$outcome}}</li>
  38. @endforeach
  39. </td>
  40. <td>
  41. <span><em data-toggle="tooltip" data-placement="top" title="{{ $criterion->notes }}">{{{ $criterion->name }}}</em></span>
  42. <sup></sup>
  43. </td>
  44. @else
  45. <td>{{ $index + 1 }}.</td>
  46. <td>@foreach($criterion->outcomes as $index => $outcome)
  47. <li>{{$outcome}}</li>
  48. @endforeach
  49. </td>
  50. <td>
  51. <span>{{{ $criterion->name }}}</span> <sup></sup>
  52. </td>
  53. @endif
  54. @foreach($criterion->scales as $scale)
  55. <td>{{ nl2br($scale) }}</td>
  56. @endforeach
  57. </tr>
  58. @endforeach
  59. </tbody>
  60. </table>
  61. <div id="copyright-info">
  62. <hr>
  63. <p class="small"><strong>Copyright Information</strong></p>
  64. <ul id="copyright-list" class="list-unstyled small">
  65. </ul>
  66. <hr>
  67. </div>
  68. </div>
  69. </div>
  70. @stop
  71. @section('javascript')
  72. // --------------------------------------------------------------------------
  73. // Page load
  74. // --------------------------------------------------------------------------
  75. buildCopyrightList();
  76. // --------------------------------------------------------------------------
  77. // Functions
  78. // --------------------------------------------------------------------------
  79. // Build list from copyright info in rubric
  80. function buildCopyrightList()
  81. {
  82. // Empty the copyright list
  83. $('#copyright-list').empty();
  84. $('tbody tr').each(function( index )
  85. {
  86. var criterion = $(this);
  87. // If there's copyright info (in this particular view, it checks for empty strings)
  88. if(criterion.data('criterion-copyright')!='')
  89. {
  90. console.log('Copyright for index '+index+' not null.');
  91. var copyright = criterion.data('criterion-copyright');
  92. // If there is anything in the copyright list
  93. if($('#copyright-list li').length>0)
  94. {
  95. console.log('In index '+index+', copyright list not empty.');
  96. // Check copyright list for the same copyright text
  97. var found = false;
  98. $('#copyright-list li').each(function()
  99. {
  100. // If found, give the string its number
  101. if(copyright==$(this).find('span').text())
  102. {
  103. console.log('In index '+index+', matching copyright test found.');
  104. copyrightNumber = Number.parseInt($(this).find('sup').text());
  105. console.log('In index '+index+', the matching number is '+copyrightNumber);
  106. console.log('In index '+index+', text is'+ criterion.children('td:nth-child(1)').text());
  107. criterion.children('td:nth-child(1)').find('sup').text(copyrightNumber);
  108. found =true;
  109. //to break
  110. return false;
  111. }
  112. });
  113. // Otherwise, give it the next number and append a new item to the
  114. // list
  115. if(!found)
  116. {
  117. console.log('In index '+index+', matching copyright test NOT found.');
  118. var copyrightNumber = $('#copyright-list li').length+1;
  119. criterion.children('td:nth-child(1)').find('sup').text(copyrightNumber);
  120. $('#copyright-list').append('<li><sup>'+copyrightNumber+' </sup><span>'+copyright+'<span></li>');
  121. }
  122. }
  123. // Otherwise, give it number 1 and append it
  124. else
  125. {
  126. console.log('In index '+index+', copyright list is empty.');
  127. criterion.children('td:nth-child(1)').find('sup').text('1');
  128. $('#copyright-list').append('<li><sup>1 </sup><span>'+copyright+'<span></li>');
  129. }
  130. }
  131. });
  132. if($('#copyright-info li').length>0)
  133. {
  134. $('#copyright-info').show();
  135. }
  136. else
  137. {
  138. $('#copyright-info').hide();
  139. }
  140. }
  141. @stop