@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')
{{ 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')) }}

Course: {{{ $course->code }}} {{{ $course->number }}}

Section: {{{ $course->section }}}

Activity: {{{ $activity->name}}}

Passing Criteria: {{{ $rubric->expected_percentage }}}% of students must obtain at least {{{$rubric->expected_points}}} points

@foreach ($rubric_contents as $criterion) @endforeach @if(sizeof($assessments)!=0) @foreach ($assessments as $assessment) @for ($i = 0; $i {{ $scores_array[$assessment->id][$rubric_contents[$i]->id] }} @endfor @endforeach @endif @for ($i = 0; $i% @endfor
Student
{{ $criterion->name}}
Student Percentage
{{{ Student::find($assessment->student_id)->name }}} {{{ $assessment->percentage }}}
Passed Criteria Percentage
@stop @section('included-js') @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(''+percentage+'%'); } // -------------------------------------------------------------------------- // Events // -------------------------------------------------------------------------- // Criterion name is clicked $('.criterion-field').on('click', function() { $.ajax({ type: 'POST', url: "{{ URL::action('CriteriaController@fetchCriterionWithTrashed') }}", data: { id: $(this).data('criterion-id') }, success: function(data) { $('.modal-title').html(data.name); $('.modal-body tbody tr').empty(); $('.modal-body tbody tr').append ( ''+data.description12+'' +''+data.description34+'' +''+data.description56+'' +''+data.description78+'' ); if(data.notes!=null) $('.modal-body tbody tr').append(''+data.notes+''); else $('.modal-body tbody tr').append(''); }, async:true }); $('#modal-view-criterion').modal(); }); @stop