@extends('layouts.master') @section('navigation') @if($role==1) @include('local.managers.admins._navigation') @elseif($role==2) @include('local.managers.sCoords._new_navigation') @elseif($role==3) @include('local.managers.pCoords._new_navigation') @else @include('local.professors._navigation') @endif @stop @section('main')

Instructions:

  1. Fill in the scores per criterion for each student. You can see the student's final score in the last column.
  2. Click 'Publish Assessment' if you are done. Click 'Save as Draft' if you have not finished assessing the activity. You can come back later if you need to make any updates.
  3. Unpublished results will be isolated. That is, they will not be aggregated to other results.

Notes:

  • If a particular criterion cannot be assessed for a student, select "N/A" (Not Applicable). This will not affect the student's score.
  • If a particular criterion was assessed but the student did not complete the necessary work, you must select "0". This will affect the student's score.
  • If a student did not complete any work for this activity, select "0" for all columns in that student's row.
  • If a student dropped the class, select "N/A" (Not Applicable) for all columns in that student's row.
  • Cells with "N/A" will not be used to determine whether a criterion is achieved. Only scores from 0 to 8 will be considered for this purpose.
  • At least one score must be from 1-8. Otherwise, the 'Publish Assessment' and 'Save as Draft' buttons will be disabled. If you want to delete previously saved scores, go back to the activity and click the "Delete Assessment" button.

Instrucciones:

  1. Seleccione la puntuación por criterio para cada estudiante. Puede ver la puntuación final en la última columna.
  2. Oprima 'Publish Assessment' una vez termine. Si no ha terminado, oprima 'Save as Draft' (guardar como borrador). Puede volver a esta página luego si desea hacer cambios.
  3. Los resultados guardados como borrador estarán asilados. Es decir, no se agregarán a los demás resultados.

Notas:

  • Si un criterio particular no puede ser evaluado, seleccione "N/A" (No Aplica). Esto no afectará la puntuación final del estudiante.
  • Si un criterio particular fue evaluado, pero el estudiante no completó el trabajo necesario, debe seleccionar "0". Esto afectará la puntuación final del estudiante.
  • Si un estudiante no completó el trabajo para esta actividad, seleccione "0" en todas las columnas de la fila de ese estudiante.
  • Si un estudiante se dio de baja, seleccione "N/A" (No Aplica) en todas las columnas de la fila de ese estudiante.
  • Las celdas con "N/A" no serán utilizadas para determinar si un criterio se alcanzó o no. Solamente las puntuaciones del 0 al 8 serán consideradas.
  • Al menos una puntuación deber ser del 1 al 8. De otra manera, el botón para guardar se desactivará. Si quiere borrar los resultados del avalúo, vuelva a la actividad y oprima el botón que dice "Delete Assessment".

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

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

{{ HTML::linkAction('ActivitiesController@show', 'Back to Activity', array($activity->id), array('class'=>'btn btn-default btn-sm pull-right')) }}

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 @else @foreach ($students as $student) @for ($i = 0; $i N/A @endfor @endforeach @endif @for ($i = 0; $i% @endfor
Student
{{ $criterion->name}}
Student Percentage Comments
{{{ $assessment->name }}} {{{ $assessment->percentage }}}
id }}>{{{ $student->name }}}
Passed Criteria Percentage
@stop @section('included-js') @stop @section ('javascript') // -------------------------------------------------------------------------- // Page load // -------------------------------------------------------------------------- // Enable fixed headers $('#assessment-table').stickyTableHeaders(); // Hide spanish instructions by default $('#spanish-instructions').toggle(); $('.total').each(function(index) { percentagePerCriterion(index+1); }); $('.student-row').each(function(index) { percentagePerStudent($(this)); }); // Highlight student names on hover $('.student-row td').on('mouseover', function() { $('.student-field').css( { 'color': 'black', 'font-weight': 'normal' }); $(this).siblings('.student-field').css( { 'color': '#DD0026', }); }); toggleSaveButton(); // -------------------------------------------------------------------------- // Functions // -------------------------------------------------------------------------- // Calculate average of students that passed a specific criterion function percentagePerCriterion(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().trim()); /* If N/A or 0 are chosen, they are ignored in the calculation. */ if(val % 1 === 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="N/A"; $('.total:nth-child('+columnIndex+') span.total-value').html(percentage); $('.total:nth-child('+columnIndex+') span.percent-sign').hide(); } else { $('.total:nth-child('+columnIndex+') span.total-value').html(percentage); $('.total:nth-child('+columnIndex+') span.percent-sign').show(); } } // Calculate total for a specific student function percentagePerStudent(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().trim()); if(val % 1 === 0) //If number is 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="N/A"; row.find('.percentage').html(''+percentage+''); } else { row.find('.percentage').html(''+percentage+'%'); } } function toggleSaveButton() { // Check at least one total criterion percentage is not zero var all_zeros_criteria = true; $('.total-value').each(function(index) { if(Number($(this).text())>0.00) all_zeros_criteria = false; }); // Check at least one total student percentage is not zero var all_zeros_students = true; $('.percentage').each(function(index) { var value = $(this).text().replace('%', ''); if(Number(value)>0.00) all_zeros_students = false; }); if(all_zeros_criteria && all_zeros_students) { $('#button-submit-assessment').prop('disabled', true); $('#button-draft-assessment').prop('disabled', true); } else { $('#button-submit-assessment').prop('disabled', false); $('#button-draft-assessment').prop('disabled', false); } return; } // -------------------------------------------------------------------------- // Events // -------------------------------------------------------------------------- $('td.score-field').on('focus', function() { $(this).addClass('active'); // See http://stackoverflow.com/a/6150060/145346 var cell = this; var range, selection; if (document.body.createTextRange) { range = document.body.createTextRange(); range.moveToElementText(cell); range.select(); } else if (window.getSelection) { selection = window.getSelection(); range = document.createRange(); range.selectNodeContents(cell); selection.removeAllRanges(); selection.addRange(range); } }); // When any score changes, calculate percentages $('td.score-field').on('blur', function() { var value = $(this).text().trim(); var allowed_values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', 'N/A']; console.log(value); if(allowed_values.indexOf(value) === -1) { $(this).text('N/A'); } else { $(this).text(value); } $(this).removeClass('active'); percentagePerCriterion($(this).index()); percentagePerStudent($(this).closest('tr')); toggleSaveButton(); }); // Submit button is clicked $('#button-submit-assessment, #button-draft-assessment').on('click', function(e) { var draft = 0; if($(this).hasClass('draft')) draft = 1; var expected_points = parseInt($('#expected_points').text()); var expected_percentage = parseInt($('#expected_percentage').text()); //Prevent page refresh e.preventDefault(); // Row in the database var activity_id = $('#activity').data('activity-id'); // Object to hold the score sum of each criterion var criteriaSumObject = new Object(); // Object to hold % of students that passed each criterion var CriteriaAchievedPercentage = new Object(); // Object to hold all student evaluations var studentAssessments = new Array(); // Iterate through all students $('#assessment-table tbody tr').each(function( index ) { var ScoresObject = new Object(); // Scores column in database var CriterionObject = new Object(); // Objects inside ScoresObject var SingleStudentAssessment = new Object(); SingleStudentAssessment.student_id = $(this).find('.student-field').data('student-id'); // For each criterion, store the score in array $(this).children('td.score-field').each(function(index) { // Table cell with a score var scoreField = $(this); // Criterion being evaluated in current iteration var criterion_id = $('.criterion-field').eq(index).data('criterion-id'); // Score in the cell var score = scoreField.text().trim(); // Store the score in the scores Object ScoresObject[criterion_id]=score; // Initialize the index for the sum object, if it's undefined if(typeof(criteriaSumObject[criterion_id]) == 'undefined') { criteriaSumObject[criterion_id]=0; } // Add to this criterion's total criteriaSumObject[criterion_id]+=parseInt(score); }); SingleStudentAssessment.scores = ScoresObject; SingleStudentAssessment.percentage = $(this).find('.percentage').text(); SingleStudentAssessment.comments = $.trim($(this).find('.comments').val()); console.log('comment '+index+': '+SingleStudentAssessment.comments); // console.log('student object: '+JSON.stringify(SingleStudentAssessment)); var clone = jQuery.extend({}, SingleStudentAssessment); studentAssessments.push(clone); }); // console.log('students: '+JSON.stringify(studentAssessments)); // console.log('total points per criteria: '+JSON.stringify(criteriaSumObject)); // Iterate through all evaluated criteria, determining which were achieved // by comparing the completion percentage to the expected percentage var CriteriaAchievedResults = new Object(); $('.total').each(function(index) { var id = $('.criterion-field').eq(index).data('criterion-id'); CriteriaAchievedPercentage[id] = parseFloat($(this).find('span').text()); //Set whether criterion was achieved (1) or not (0) if(CriteriaAchievedPercentage[id] >= expected_percentage) { CriteriaAchievedResults[id]=1; } else if (CriteriaAchievedPercentage[id] < expected_percentage) { CriteriaAchievedResults[id]=0; } else { CriteriaAchievedResults[id]=null; } }); // console.log('criteria percentages: '+JSON.stringify(CriteriaAchievedPercentage)); // console.log('criteria achieved results: '+JSON.stringify(CriteriaAchievedResults)); // Save activity to the database $.post ( "{{ URL::action('ActivitiesController@saveAssessment') }}", { activity_id: activity_id, draft: draft, criteria_achieved_percentage: JSON.stringify(CriteriaAchievedPercentage), criteria_achievement: JSON.stringify(CriteriaAchievedResults), student_scores: JSON.stringify(studentAssessments), }, function(data) { location.reload(); } ); }); // Language button is clicked $('#button-language').on('click', function(e) { $('#english-instructions').stop().toggle(); $('#spanish-instructions').stop().toggle(); }); // Criterion name is clicked $('.criterion-field').on('click', function() { $.ajax({ type: 'POST', url: "{{ URL::action('RubricsController@fetchRubricCriterion') }}", data: { rubric_id: $(this).closest('table').data('rubric-id'), criterion_id: $(this).data('criterion-id'), }, success: function(data) { data = JSON.parse(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