Няма описание

view_rubric_limited.blade.php 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. <th>Beginning (1-2)</th>
  27. <th>In Progress (3-4)</th>
  28. <th>Good (5-6)</th>
  29. <th>Excellent (7-8)</th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. @foreach(json_decode($rubric->contents) as $index => $criterion)
  34. <tr data-criterion-copyright="{{ $criterion->copyright }}" data-criterion-notes="{{ $criterion->notes }}">
  35. @if(isset($criterion->notes))
  36. <td>{{ $index + 1 }}.</td>
  37. <td>{{ Outcome::find($criterion->outcome_id)->name }} </td>
  38. <td>
  39. <span><em data-toggle="tooltip" data-placement="top" title="{{ $criterion->notes }}">{{{ $criterion->name }}}</em></span>
  40. <sup></sup>
  41. </td>
  42. @else
  43. <td>{{ $index + 1 }}.</td>
  44. <td>{{ Outcome::find($criterion->outcome_id)->name }} </td>
  45. <td>
  46. <span>{{{ $criterion->name }}}</span> <sup></sup>
  47. </td>
  48. @endif
  49. <td>{{{ $criterion->description12 }}}</td>
  50. <td>{{{ $criterion->description34 }}}</td>
  51. <td>{{{ $criterion->description56 }}}</td>
  52. <td>{{{ $criterion->description78 }}}</td>
  53. </tr>
  54. @endforeach
  55. </tbody>
  56. </table>
  57. <div id="copyright-info">
  58. <hr>
  59. <p class="small"><strong>Copyright Information</strong></p>
  60. <ul id="copyright-list" class="list-unstyled small">
  61. </ul>
  62. <hr>
  63. </div>
  64. </div>
  65. </div>
  66. @stop
  67. @section('javascript')
  68. // --------------------------------------------------------------------------
  69. // Page load
  70. // --------------------------------------------------------------------------
  71. buildCopyrightList();
  72. // --------------------------------------------------------------------------
  73. // Functions
  74. // --------------------------------------------------------------------------
  75. // Build list from copyright info in rubric
  76. function buildCopyrightList()
  77. {
  78. // Empty the copyright list
  79. $('#copyright-list').empty();
  80. $('tbody tr').each(function( index )
  81. {
  82. var criterion = $(this);
  83. // If there's copyright info (in this particular view, it checks for empty strings)
  84. if(criterion.data('criterion-copyright')!='')
  85. {
  86. console.log('Copyright for index '+index+' not null.');
  87. var copyright = criterion.data('criterion-copyright');
  88. // If there is anything in the copyright list
  89. if($('#copyright-list li').length>0)
  90. {
  91. console.log('In index '+index+', copyright list not empty.');
  92. // Check copyright list for the same copyright text
  93. var found = false;
  94. $('#copyright-list li').each(function()
  95. {
  96. // If found, give the string its number
  97. if(copyright==$(this).find('span').text())
  98. {
  99. console.log('In index '+index+', matching copyright test found.');
  100. copyrightNumber = Number.parseInt($(this).find('sup').text());
  101. console.log('In index '+index+', the matching number is '+copyrightNumber);
  102. console.log('In index '+index+', text is'+ criterion.children('td:nth-child(1)').text());
  103. criterion.children('td:nth-child(1)').find('sup').text(copyrightNumber);
  104. found =true;
  105. //to break
  106. return false;
  107. }
  108. });
  109. // Otherwise, give it the next number and append a new item to the
  110. // list
  111. if(!found)
  112. {
  113. console.log('In index '+index+', matching copyright test NOT found.');
  114. var copyrightNumber = $('#copyright-list li').length+1;
  115. criterion.children('td:nth-child(1)').find('sup').text(copyrightNumber);
  116. $('#copyright-list').append('<li><sup>'+copyrightNumber+' </sup><span>'+copyright+'<span></li>');
  117. }
  118. }
  119. // Otherwise, give it number 1 and append it
  120. else
  121. {
  122. console.log('In index '+index+', copyright list is empty.');
  123. criterion.children('td:nth-child(1)').find('sup').text('1');
  124. $('#copyright-list').append('<li><sup>1 </sup><span>'+copyright+'<span></li>');
  125. }
  126. }
  127. });
  128. if($('#copyright-info li').length>0)
  129. {
  130. $('#copyright-info').show();
  131. }
  132. else
  133. {
  134. $('#copyright-info').hide();
  135. }
  136. }
  137. @stop