Ingen beskrivning

viewrubric.blade.php 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. <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. @for($i = 0; $i<$rubric->num_scales; $i++)
  33. <th> {{$rubric->titles[$i]}} ({{1+($i*($rubric->max_score/$rubric->num_scales))}} - {{(1+$i)*($rubric->max_score/$rubric->num_scales)}})</th>
  34. @endfor
  35. <th>Learning Outcome</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. @foreach($rubric_criterion as $index => $criterion)
  40. <tr data-criterion-copyright="{{ $criterion->copyright }}" data-criterion-notes="{{ $criterion->notes }}">
  41. <td>{{ $index + 1 }}.</td>
  42. @if(isset($criterion->notes))
  43. <td>
  44. <span><em data-toggle="tooltip" data-placement="top" title="{{ $criterion->notes }}">{{{ $criterion->name }}}</em></span>
  45. <sup></sup>
  46. @if($criterion->subcriteria)
  47. <ul class="list-unstyled">
  48. @foreach(json_decode($criterion->subcriteria) as $subcriterion)
  49. <li>{{ $subcriterion }}</li>
  50. @endforeach
  51. </ul>
  52. @endif
  53. </td>
  54. @else
  55. <td>
  56. <span>{{{ $criterion->name }}}</span><sup></sup>
  57. @if($criterion->subcriteria)
  58. <ul class="list-unstyled">
  59. @foreach(json_decode($criterion->subcriteria) as $subcriterion)
  60. <li>{{ $subcriterion }}</li>
  61. @endforeach
  62. </ul>
  63. @endif
  64. </td>
  65. @endif
  66. @foreach(json_decode($criterion->scales) as $scale)
  67. <td>{{ nl2br($scale) }}</td>
  68. @endforeach
  69. <td>
  70. @foreach (json_decode($criterion->outcomes) as $index => $outcome)
  71. <!-- {{$index+1}}. {{$outcome}}<br> -->
  72. {{$outcome}}<br>
  73. @endforeach
  74. </td>
  75. </tr>
  76. @endforeach
  77. </tbody>
  78. </table>
  79. <div id="copyright-info">
  80. <hr>
  81. <p class="small"><strong>Copyright Information</strong></p>
  82. <ul id="copyright-list" class="list-unstyled small">
  83. </ul>
  84. <hr>
  85. </div>
  86. </div>
  87. </div>
  88. @stop
  89. @section('javascript')
  90. // --------------------------------------------------------------------------
  91. // Page load
  92. // --------------------------------------------------------------------------
  93. buildCopyrightList();
  94. // --------------------------------------------------------------------------
  95. // Functions
  96. // --------------------------------------------------------------------------
  97. // Build list from copyright info in rubric
  98. function buildCopyrightList()
  99. {
  100. // Empty the copyright list
  101. $('#copyright-list').empty();
  102. $('tbody tr').each(function( index )
  103. {
  104. var criterion = $(this);
  105. // If there's copyright info (in this particular view, it checks for empty strings)
  106. if(criterion.data('criterion-copyright')!='')
  107. {
  108. // console.log('Copyright for index '+index+' not null.');
  109. var copyright = criterion.data('criterion-copyright');
  110. // If there is anything in the copyright list
  111. if($('#copyright-list li').length>0)
  112. {
  113. // console.log('In index '+index+', copyright list not empty.');
  114. // Check copyright list for the same copyright text
  115. var found = false;
  116. $('#copyright-list li').each(function()
  117. {
  118. // If found, give the string its number
  119. if(copyright==$(this).find('span').text())
  120. {
  121. // console.log('In index '+index+', matching copyright test found.');
  122. copyrightNumber = Number.parseInt($(this).find('sup').text());
  123. // console.log('In index '+index+', the matching number is '+copyrightNumber);
  124. // console.log('In index '+index+', text is'+ criterion.children('td:nth-child(1)').text());
  125. criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
  126. found =true;
  127. //to break
  128. return false;
  129. }
  130. });
  131. // Otherwise, give it the next number and append a new item to the
  132. // list
  133. if(!found)
  134. {
  135. // console.log('In index '+index+', matching copyright test NOT found.');
  136. var copyrightNumber = $('#copyright-list li').length+1;
  137. criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
  138. $('#copyright-list').append('<li><sup>'+copyrightNumber+' </sup><span>'+copyright+'<span></li>');
  139. }
  140. }
  141. // Otherwise, give it number 1 and append it
  142. else
  143. {
  144. // // console.log('In index '+index+', copyright list is empty.');
  145. criterion.children('td:nth-child(2)').find('sup').text('1');
  146. $('#copyright-list').append('<li><sup>1 </sup><span>'+copyright+'<span></li>');
  147. }
  148. }
  149. });
  150. if($('#copyright-info li').length>0)
  151. {
  152. $('#copyright-info').show();
  153. }
  154. else
  155. {
  156. $('#copyright-info').hide();
  157. }
  158. }
  159. @stop