No Description

view_template.blade.php 5.6KB

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