123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- @extends('layouts.master')
-
- @section('navigation')
- @if($role==1)
- @include('local.managers.admins._navigation')
- @elseif($role==2)
- @include('local.managers.sCoords._navigation')
- @elseif($role==3)
- @include('local.managers.pCoords._navigation')
- @else
- @include('local.professors._navigation')
- @endif
- @stop
-
- @section('main')
- <!-- View criterion info -->
- <div class="modal fade" id="modal-view-criterion">
- <div class="modal-dialog modal-lg">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
- <h4 class="modal-title"></h4>
- </div>
- <div class="modal-body">
- <table class="table table-bordered">
- <thead>
- @foreach($rubric->titles as $i=>$title)
- <th>{{$title}} ({{1+($i*($rubric->max_score/$rubric->num_scales))}}-{{(1+$i)*($rubric->max_score/$rubric->num_scales)}})</th>
- @endforeach
-
- <th>Notes</th>
- </thead>
- <tbody>
- <tr></tr>
- </tbody>
- </table>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal-dialog -->
- </div><!-- /.modal -->
-
- <div class="row">
- <div class="col-md-12">
-
- <div class="btn-group pull-right">
- {{ HTML::linkAction('ActivitiesController@show', 'Back to Activity', array($activity->id), array('class'=>'btn btn-default btn-sm')) }}
- {{ HTML::linkAction('ActivitiesController@printAssessment', 'Print', array($activity->id), array('class'=>'btn btn-default btn-sm')) }}
- </div>
- <p id="course">Course: {{{ $course->code }}} {{{ $course->number }}}</p>
- <p id="section">Section: {{{ $course->section }}}</p>
-
- <p id="activity" data-activity-id="{{{ $activity->id }}}">Activity: {{{ $activity->name}}} </p>
- <p>Passing Criteria: <span id="expected_percentage">{{{ $rubric->expected_percentage }}}% of students must obtain at least </span><span id="expected_points">{{{$rubric->expected_points}}}</span> points </p>
-
-
- <table id="assessment-table" class="table table-striped table-condensed table-bordered">
-
- <thead>
- <tr>
-
- <th>
-
- </th>
- @foreach ($rubric_criterion as $index => $criterion)
-
-
- <th data-criterion-id="{{{ $criterion->criterion_id }}}" id="weight-{{$index}}" data-weight = " {{$criterion->weight}}" data-activity-criterion-id="{{$criterion->activity_criterion_id}}">
- Weight: {{$criterion->weight}}
- </th>
-
-
- @endforeach
- <th></th>
- <th></th>
- <th></th>
- </tr>
- <tr>
- <th>Student</th>
- @foreach ($rubric_criterion as $criterion)
- <th class="criterion-field" data-criterion-id="{{{ $criterion->criterion_id }}}"><div class="th-box">{{ $criterion->name}}</div></th>
- @endforeach
- <th>Student Percentage</th>
- <th>Student % Per Weight</th>
- <th>Comments</th>
- </tr>
- </thead>
- <tbody>
-
- <!-- If the activity was assessed, load the assessment. Otherwise load empty sheet -->
- @if(sizeof($assessments)!=0)
- <!-- For each assessment -->
- @foreach ($students as $student)
- <tr class="student-row">
- <!-- Fetch student name -->
- <td class="student-field" data-student-id="{{ $student->id }}">
- {{{ $student->name }}}
- </td>
-
- <!-- For each criterion in the rubric, there's a score field -->
- @for ($i = 0; $i<sizeof($rubric_criterion); $i++)
- <td class="score-field text-center">
- @if(array_key_exists($student->id, $scores_array) && isset($scores_array[$student->id][$rubric_criterion[$i]->activity_criterion_id]))
- {{$scores_array[$student->id][$rubric_criterion[$i]->activity_criterion_id]}}
- @else
- N/A
- @endif
- </td>
-
- @endfor
- <td class="percentage text-center"></td>
- <td class="percentage-per-weight text-center"></td>
- <td class="">
- <textarea class="comments full-textarea" placeholder="Max. 255 characters" maxLength="255" disabled >
- @if(array_key_exists($student->id, $scores_array))
- {{ $scores_array[$student->id]["comments"] }}
- @endif
- </textarea>
- </td>
- </tr>
- @endforeach
-
- @endif
- </tbody>
- <tfoot>
- <tr>
- <td>
- <strong>Passed Criteria Percentage </strong>
- </td>
- @for ($i = 0; $i<sizeof($rubric_criterion); $i++)
- <td class="total text-center"><strong><span class="total-value"></span>%</strong>
- </td>
- @endfor
- <td></td>
-
- </tr>
- </tfoot>
- </table>
- </div>
- </div>
- <input type='hidden' value = {{$rubric->max_score}} id = "max">
-
- <script>
-
-
-
- </script>
- @stop
-
- @section('included-js')
-
- <!-- StickyTableHeaders js -->
- <script src="{{ asset('vendor/stickyTableHeaders/js/jquery.stickytableheaders.min.js') }}"></script>
-
- @stop
-
- @section ('javascript')
-
- // --------------------------------------------------------------------------
- // Page load
- // --------------------------------------------------------------------------
-
- // Enable fixed headers
- $('table').stickyTableHeaders();
-
-
- $('.total').each(function(index)
- {
- percentagePerCriterionPlain(index+1);
- });
-
- $('.student-row').each(function(index)
- {
- percentagePerStudentPlain($(this));
- });
-
- // --------------------------------------------------------------------------
- // Functions
- // --------------------------------------------------------------------------
-
- // Calculate average of students that passed a specific criterion
- function percentagePerCriterionPlain(columnIndex)
- {
- // Object to hold the score sum of each criterion
- var sum = 0 ;
- var total = 0;
-
- columnIndex+=1;
-
- // Iterate through rows of column
- $('table tbody tr td:nth-child('+columnIndex+')').each(function( index )
- {
- var val = parseInt($(this).text());
-
- /* Check if number is integer. If N/A or 0 are chosen, they are ignored in the calculation. */
- if(val % 1 === 0 && val!=0)
- {
- if(val >= parseInt($('#expected_points').text()))
- {
- sum+=1;
- }
-
- total+=1;
- }
- });
-
- var percentage= (sum/total*100).toFixed(2);
-
- // If no criteria were assessed, set the percentage to 0.
- // This is to avoid show NaN%
- if(total==0)
- percentage="0.00";
-
- $('.total:nth-child('+columnIndex+') span').html(percentage);
-
- }
-
-
- // Calculate total for a specific student
- function percentagePerStudentPlain(row)
- {
- /* // Object to hold the score student's total score
- var sum = 0 ;
- var total = 0;
- var percentage = 0;
-
- row.find('td.score-field').each(function(index)
- {
- var val = parseInt($(this).text());
- if(val % 1 === 0) // Check if number is an integer
- {
- sum += val;
- total+=1;
- }
- });
-
- percentage =((sum/(total*8))*100).toFixed(2);
-
- //If percentage is not a number, set it to 0.
- if(isNaN(percentage))
- percentage="0.00";
-
- row.find('.percentage').html('<strong>'+percentage+'%</strong>');
- */
-
- var sum = 0 ;
- var total = 0;
- var percentage = 0;
- var max_score = parseInt($('#max').val());
- sum_of_weight = 0;
- per_of_weight =0;
-
- row.find('td.score-field').each(function(index)
- {
- var val = parseInt($(this).text());
- if(val % 1 === 0) //If number is integer
- {
- sum += val;
- total+=1;
- per_of_weight += val * parseInt($('#weight-'+index).data("weight"));
- sum_of_weight += parseInt($('#weight-'+index).data("weight"));
- }
-
- });
- percentage_per_weight = (100 *(per_of_weight/(max_score*sum_of_weight))).toFixed(2);
- percentage =((sum/(total*max_score))*100).toFixed(2);
-
- //If percentage is not a number, set it to 0.
- if(isNaN(percentage))
- {
- percentage="N/A";
- row.find('.percentage').html('<strong>'+percentage+'</strong>');
- }
- else
- {
- row.find('.percentage').html('<strong>'+percentage+'%</strong>');
- }
- if(isNaN(percentage_per_weight)){
- percentage_per_weight="N/A";
- row.find('.percentage-per-weight').html('<strong>'+percentage_per_weight+'</strong>');
- }
- else{
- row.find('.percentage-per-weight').html('<strong>'+percentage_per_weight+'%</strong>');
- }
-
-
- }
-
-
-
- // --------------------------------------------------------------------------
- // Events
- // --------------------------------------------------------------------------
-
-
- // Criterion name is clicked
- $('.criterion-field').on('click', function()
- {
- $.ajax({
- type: 'POST',
- url: "{{ URL::action('RubricsController@fetchRubricCriterion') }}",
- data: { criterion_id: $(this).data('criterion-id') },
- success: function(data)
- {
- data = JSON.parse(data);
- $('.modal-title').html(data.criteria.name);
- descriptions = '';
- $('.modal-body tbody tr').empty();
- for(i =0; i<{{$rubric->num_scales}}; i++){
- descriptions += '<td>'+data[i].description+'</td>'
- }
- $('.modal-body tbody tr').append
- (
- descriptions
- );
-
- if(data.criteria.notes!=null)
- $('.modal-body tbody tr').append('<td>'+data.criteria.notes+'</td>');
- else
- $('.modal-body tbody tr').append('<td></td>');
-
- },
- async:true
- });
- $('#modal-view-criterion').modal();
- });
-
-
- @stop
|