Nav apraksta

view_template.blade.php 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. @extends('layouts.master')
  2. @section('navigation')
  3. @if(Auth::user()->role==1)
  4. @include('local.managers.admins._navigation')
  5. @elseif(Auth::user()->role==2)
  6. @include('local.managers.sCoords._navigation')
  7. @elseif(Auth::user()->role==3)
  8. @include('local.managers.pCoords._navigation')
  9. @endif
  10. @stop
  11. @section('main')
  12. <div class="row">
  13. <div class="col-md-12">
  14. <div class="btn-group pull-right">
  15. {{ HTML::linkAction('TemplatesController@printview', 'Print', array($template->id), array('class'=>'btn btn-default')) }}
  16. </div>
  17. <p>Passing Criteria:
  18. <span id="expected_percentage">{{{ $template->expected_percentage }}}% of students must obtain at least </span>
  19. <span id="expected_points">{{{$template->expected_points}}}</span> points
  20. </p>
  21. <table class="table datatable" id= "RubricTable">
  22. <thead>
  23. <tr>
  24. <th></th>
  25. <th>Criterion</th>
  26. @for($i = 0; $i <$template->num_scales; $i++)
  27. <th>{{$template->titles[$i]}} ({{1+($i*($template->max_score/$template->num_scales))}} - {{(1+$i)*($template->max_score/$template->num_scales)}})</th>
  28. @endfor
  29. <th>Learning Outcome</th>
  30. </tr>
  31. </thead>
  32. <tbody id ="bodyRubric">
  33. @foreach($template->criteria as $index=> $criterion)
  34. <tr data-criterion-copyright="{{$criterion->copyright}}" data-criterion-notes="{{$criterion->notes}}">
  35. <td>{{$index+1}}.</td>
  36. @if($criterion->notes)
  37. <td><span><em data-toggle="tooltip" data-placement="top" title="{{$criterion->notes}}">{{$criterion->name}}</em></span><sup></sup></td>
  38. @else
  39. <td><span>{{$criterion->name}}</span><sup></sup></td>
  40. @endif
  41. @foreach ($criterion->scales as $scale)
  42. <td>{{$scale}}</td>
  43. @endforeach
  44. <td><ol>
  45. @foreach ($criterion->outcomes as $outcome)
  46. <p>{{$outcome->name}}</p>
  47. @endforeach
  48. </ol></td>
  49. @endforeach
  50. </tbody>
  51. </table>
  52. <br>
  53. <br>
  54. <div id="copyright-info">
  55. <hr>
  56. <p class="small"><strong>Copyright Information</strong></p>
  57. <ul id="copyright-list" class="list-unstyled small">
  58. </ul>
  59. <hr>
  60. </div>
  61. <br>
  62. <br>
  63. <br>
  64. </div>
  65. </div>
  66. <script>
  67. /*
  68. function createTable(){
  69. $.post("{{URL::action('TemplatesController@onLoadFetch')}}",
  70. {id :{{$template->id}}},
  71. function (json){
  72. table = $('#RubricTable');
  73. for(criterionIndex in json.criteria ){
  74. criterion = json.criteria[criterionIndex];
  75. trFull = '<tr data-criterion-copyright="'+criterion.copyright+'" data-criterion-notes="'+criterion.notes+'">';
  76. trFull+= '<td>'+(parseInt(criterionIndex)+1)+'.</td>';
  77. if(criterion.notes){
  78. trFull+= '<td><span><em data-toggle="tooltip" data-placement="top" title="'+criterion.notes+'">'+criterion.name+'</em></span><sup></sup></td>';
  79. //if(criterion.subcriteria){
  80. //}
  81. }
  82. else{
  83. trFull+='<td><span>'+criterion.name+'</span><sup></sup></td>';
  84. }
  85. for(scalesIndex in json.scales[criterion.criterion_id]){
  86. scale = json.scales[criterion.criterion_id][scalesIndex];
  87. trFull += '<td>'+scale.description+'</td>';
  88. }
  89. trFull += '<td>Prueba</td>';
  90. trFull +='</tr>';
  91. $("#bodyRubric").append(trFull);
  92. }
  93. }, 'json'
  94. );
  95. }**/
  96. </script>
  97. @stop
  98. @section('included-js')
  99. @include('global._datatables_js')
  100. @stop
  101. @section('javascript')
  102. // --------------------------------------------------------------------------
  103. // Page load
  104. // --------------------------------------------------------------------------
  105. buildCopyrightList();
  106. // --------------------------------------------------------------------------
  107. // Functions
  108. // --------------------------------------------------------------------------
  109. // Build list from copyright info in template
  110. function buildCopyrightList()
  111. {
  112. // Empty the copyright list
  113. $('#copyright-list').empty();
  114. $('tbody tr').each(function( index )
  115. {
  116. var criterion = $(this);
  117. // If there's copyright info (in this particular view, it checks for empty strings)
  118. if(criterion.data('criterion-copyright')!='')
  119. {
  120. var copyright = criterion.data('criterion-copyright');
  121. // If there is anything in the copyright list
  122. if($('#copyright-list li').length>0)
  123. {
  124. // Check copyright list for the same copyright text
  125. var found = false;
  126. $('#copyright-list li').each(function()
  127. {
  128. // If found, give the string its number
  129. if(copyright==$(this).find('span').text())
  130. {
  131. copyrightNumber = Number.parseInt($(this).find('sup').text());
  132. criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
  133. found =true;
  134. //to break
  135. return false;
  136. }
  137. });
  138. // Otherwise, give it the next number and append a new item to the
  139. // list
  140. if(!found)
  141. {
  142. var copyrightNumber = $('#copyright-list li').length+1;
  143. criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
  144. $('#copyright-list').append('<li><sup>'+copyrightNumber+' </sup><span>'+copyright+'<span></li>');
  145. }
  146. }
  147. // Otherwise, give it number 1 and append it
  148. else
  149. {
  150. criterion.children('td:nth-child(2)').find('sup').text('1');
  151. $('#copyright-list').append('<li><sup>1 </sup><span>'+copyright+'<span></li>');
  152. }
  153. }
  154. });
  155. if($('#copyright-info li').length>0)
  156. {
  157. $('#copyright-info').show();
  158. }
  159. else
  160. {
  161. $('#copyright-info').hide();
  162. }
  163. }
  164. @stop