No Description

viewrubric.blade.php 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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. <div class="btn-group pull-right">
  17. {{ HTML::linkAction('ActivitiesController@show', 'Back to Activity', array($activity->id), array('class'=>'btn btn-default')) }}
  18. {{ HTML::linkAction('RubricsController@printview', 'Print', array($activity->id, $rubric->id), array('class'=>'btn btn-default')) }}
  19. </div>
  20. <p id="course">Course: {{{ $course->code }}} {{{ $course->number }}}</p>
  21. <p id="section">Section: {{{ $course->section }}}</p>
  22. <p id="activity" data-activity-id="{{{ $activity->id }}}">Activity: {{{ $activity->name}}} </p>
  23. <p>Passing Criteria:
  24. <span id="expected_percentage">{{{ $rubric->expected_percentage }}}% of students must obtain at least </span>
  25. <span id="expected_points">{{{$rubric->expected_points}}}</span> points
  26. </p>
  27. <table class="table table-striped table-condensed">
  28. <thead>
  29. <tr>
  30. <th></th>
  31. <th>Criterion</th>
  32. <th>Beginning (1-2)</th>
  33. <th>In Progress (3-4)</th>
  34. <th>Good (5-6)</th>
  35. <th>Excellent (7-8)</th>
  36. <th>Learning Outcome</th>
  37. </tr>
  38. </thead>
  39. <tbody>
  40. @foreach(json_decode($rubric->contents) as $index => $criterion)
  41. <tr data-criterion-copyright="{{ $criterion->copyright }}" data-criterion-notes="{{ $criterion->notes }}">
  42. <td>{{ $index + 1 }}.</td>
  43. @if(isset($criterion->notes))
  44. <td>
  45. <span><em data-toggle="tooltip" data-placement="top" title="{{ $criterion->notes }}">{{{ $criterion->name }}}</em></span>
  46. <sup></sup>
  47. @if(property_exists($criterion, 'subcriteria'))
  48. <ul class="list-unstyled">
  49. @foreach($criterion->subcriteria as $subcriterion)
  50. <li>{{ $subcriterion }}</li>
  51. @endforeach
  52. </ul>
  53. @endif
  54. </td>
  55. @else
  56. <td>
  57. <span>{{{ $criterion->name }}}</span><sup></sup>
  58. @if(property_exists($criterion, 'subcriteria'))
  59. <ul class="list-unstyled">
  60. @foreach($criterion->subcriteria as $subcriterion)
  61. <li>{{ $subcriterion }}</li>
  62. @endforeach
  63. </ul>
  64. @endif
  65. </td>
  66. @endif
  67. <td>{{ nl2br($criterion->description12) }}</td>
  68. <td>{{ nl2br($criterion->description34) }}</td>
  69. <td>{{ nl2br($criterion->description56) }}</td>
  70. <td>{{ nl2br($criterion->description78) }}</td>
  71. <td>{{ Outcome::where('id', $criterion->outcome_id)->first()->name }}</td>
  72. </tr>
  73. @endforeach
  74. </tbody>
  75. </table>
  76. <div id="copyright-info">
  77. <hr>
  78. <p class="small"><strong>Copyright Information</strong></p>
  79. <ul id="copyright-list" class="list-unstyled small">
  80. </ul>
  81. <hr>
  82. </div>
  83. </div>
  84. </div>
  85. @stop
  86. @section('javascript')
  87. // --------------------------------------------------------------------------
  88. // Page load
  89. // --------------------------------------------------------------------------
  90. buildCopyrightList();
  91. // --------------------------------------------------------------------------
  92. // Functions
  93. // --------------------------------------------------------------------------
  94. // Build list from copyright info in rubric
  95. function buildCopyrightList()
  96. {
  97. // Empty the copyright list
  98. $('#copyright-list').empty();
  99. $('tbody tr').each(function( index )
  100. {
  101. var criterion = $(this);
  102. // If there's copyright info (in this particular view, it checks for empty strings)
  103. if(criterion.data('criterion-copyright')!='')
  104. {
  105. // console.log('Copyright for index '+index+' not null.');
  106. var copyright = criterion.data('criterion-copyright');
  107. // If there is anything in the copyright list
  108. if($('#copyright-list li').length>0)
  109. {
  110. // console.log('In index '+index+', copyright list not empty.');
  111. // Check copyright list for the same copyright text
  112. var found = false;
  113. $('#copyright-list li').each(function()
  114. {
  115. // If found, give the string its number
  116. if(copyright==$(this).find('span').text())
  117. {
  118. // console.log('In index '+index+', matching copyright test found.');
  119. copyrightNumber = Number.parseInt($(this).find('sup').text());
  120. // console.log('In index '+index+', the matching number is '+copyrightNumber);
  121. // console.log('In index '+index+', text is'+ criterion.children('td:nth-child(1)').text());
  122. criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
  123. found =true;
  124. //to break
  125. return false;
  126. }
  127. });
  128. // Otherwise, give it the next number and append a new item to the
  129. // list
  130. if(!found)
  131. {
  132. // console.log('In index '+index+', matching copyright test NOT found.');
  133. var copyrightNumber = $('#copyright-list li').length+1;
  134. criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
  135. $('#copyright-list').append('<li><sup>'+copyrightNumber+' </sup><span>'+copyright+'<span></li>');
  136. }
  137. }
  138. // Otherwise, give it number 1 and append it
  139. else
  140. {
  141. // // console.log('In index '+index+', copyright list is empty.');
  142. criterion.children('td:nth-child(2)').find('sup').text('1');
  143. $('#copyright-list').append('<li><sup>1 </sup><span>'+copyright+'<span></li>');
  144. }
  145. }
  146. });
  147. if($('#copyright-info li').length>0)
  148. {
  149. $('#copyright-info').show();
  150. }
  151. else
  152. {
  153. $('#copyright-info').hide();
  154. }
  155. }
  156. @stop