No Description

print_student_report.blade.php 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <?php
  2. echo '<html>';
  3. echo '<body>';
  4. //Inline styles (only for printing)
  5. echo
  6. '<style>
  7. body
  8. {
  9. font-family: "Arial", sans-serif;
  10. width:90%;
  11. margin: 0 auto;
  12. }
  13. .header-text
  14. {
  15. text-align:center;
  16. font-weight: bold;
  17. margin:0;
  18. }
  19. h1.header-text
  20. {
  21. margin: 15px 0;
  22. }
  23. table
  24. {
  25. border-collapse: collapse;
  26. border: 1px solid black;
  27. width: 100%;
  28. margin: 30px auto;
  29. }
  30. td, th
  31. {
  32. border: 1px solid black;
  33. padding: 5px;
  34. }
  35. .activity-name-row
  36. {
  37. background:black;
  38. color:white;
  39. }
  40. .activity-headers-row
  41. {
  42. background:lightgrey;
  43. font-weight:bold;
  44. }
  45. .active
  46. {
  47. background:lightgrey;
  48. }
  49. .report-info
  50. {
  51. margin:5px 0;
  52. font-size: 16px;
  53. }
  54. .criterion
  55. {
  56. width:45%;
  57. }
  58. .score
  59. {
  60. width:10%;
  61. text-align:center;
  62. }
  63. .reason
  64. {
  65. width:45%;
  66. }
  67. .header
  68. {
  69. margin: 30px 0;
  70. }
  71. .content
  72. {
  73. font-size: 12px;
  74. }
  75. .logo
  76. {
  77. position:absolute;
  78. right:0;
  79. top: 30px;
  80. width: 100px;
  81. }
  82. </style>';
  83. ?>
  84. <img class="logo" src="{{ asset('images/logo_uprrp_bw.png') }}" alt="UPRRP Logo">
  85. <div class="header">
  86. <p class="header-text">University of Puerto Rico, Río Piedras Campus</p>
  87. <p class="header-text">Online Learning Assessment System</p>
  88. <p class="header-text">{{$course->program->name}} Program</p>
  89. <h1 class="header-text">Student Report </h1>
  90. </div>
  91. <div class="content">
  92. <p class="student-name report-info">Student Name: {{{ $student->name}}}</p>
  93. <p class="report-info">Number: {{{ substr($student->number, 0, 3)}}}-{{{substr($student->number, 3, 2)}}}-{{{substr($student->number, 5, 4)}}}</p>
  94. <p class="report-info">Course: {{{ $course->code }}} {{{ $course->number }}}-{{{ $course->section }}} - {{$course->name}}</p>
  95. <p class="report-info">Professor: {{{ $course->user->surnames }}}, {{{ $course->user->first_name }}} </p>
  96. <p class="report-info">Report Date: {{ date('M/d/Y')}}</p>
  97. </div>
  98. @if($assessments!=NULL)
  99. @foreach($assessments as $assessment)
  100. <?php
  101. $activity = Activity::find($assessment->activity_id);
  102. // Used to get custom rubric criterion indicators
  103. $rubric_contents = json_decode(Rubric::find($activity->rubric_id)->contents, true);
  104. ?>
  105. <div class="panel panel-default">
  106. <div class="panel-heading">
  107. <h3 class="panel-title">{{ $activity->name }}</h3>
  108. </div>
  109. <div class="panel-body">
  110. <table class="table table-striped table-condensed">
  111. <thead>
  112. <tr>
  113. <th class="col-md-4">Criterion</th>
  114. <th class="col-md-2">Score</th>
  115. <th class="col-md-6">Reason</th>
  116. </tr>
  117. </thead>
  118. <tbody>
  119. <?php
  120. $scores = json_decode($assessment->scores, true);
  121. ?>
  122. @foreach($rubric_contents as $row)
  123. <?php $real_score = $scores[$row['id']]; ?>
  124. <tr>
  125. <td>{{{ $row['name'] }}}</td>
  126. <td>{{{ $real_score }}}</td>
  127. <td>
  128. @if($real_score == 1 || $real_score == 2)
  129. {{ nl2br($row['description12']) }}
  130. @elseif ($real_score == 3 || $real_score == 4)
  131. {{ nl2br($row['description34']) }}
  132. @elseif ($real_score == 5 || $real_score == 6)
  133. {{ nl2br($row['description56']) }}
  134. @elseif ($real_score == 7 || $real_score == 8)
  135. {{ nl2br($row['description78']) }}
  136. @else
  137. There is not enough information to assess this criterion, or the student did not complete the required work.
  138. @endif
  139. </td>
  140. </tr>
  141. @endforeach
  142. </tbody>
  143. </table>
  144. <p class="lead"><strong>Percentage:</strong> {{ $assessment->percentage }}%</p>
  145. <p class="lead"><strong>Comments:</strong> {{ $assessment->comments }}</p>
  146. </div>
  147. </div>
  148. @endforeach
  149. @else
  150. <p class="lead">No activities have been assessed.</p>
  151. @endif
  152. <?
  153. echo '</body>';
  154. echo '</html>';
  155. ?>
  156. <script type="text/javascript">
  157. window.print();
  158. </script>