Fill in the scores per criterion for each student. You can see the student's final score in the last column.
Click 'Save Assessment' to save your assessment. You can come back later if you need to make any updates.
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 "0" or "N/A" will not be used to determine whether a criterion is achieved. Only scores from 1 to 8 will be considered for this purpose.
Instrucciones:
Seleccione la puntuación por criterio para cada estudiante. Puede ver la puntuación final en la última columna.
Oprima 'Save Assessment' para guardar las puntuaciones. Puede volver a esta página luego si desea hacer cambios.
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 sí 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 "0" o "N/A" no serán utilizadas para determinar si un criterio se alcanzó o no. Solamente las puntuaciones del 1 al 8 serán consideradas.
Passing Criteria: {{{ $rubric->expected_percentage }}}% of students must obtain at least {{{$rubric->expected_points}}} points
Student
@foreach ($rubric_contents as $criterion)
{{ $criterion->name}}
@endforeach
Student Percentage
@if(sizeof($assessments)!=0)
@foreach ($assessments as $assessment)
{{{ $assessment->name }}}
@for ($i = 0; $i
@endfor
{{{ $assessment->percentage }}}
@endforeach
@else
@foreach ($students as $student)
id }}>{{{ $student->name }}}
@for ($i = 0; $i
@endfor
@endforeach
@endif
Passed Criteria Percentage
@for ($i = 0; $i%
@endfor
@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));
});
// --------------------------------------------------------------------------
// 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).children('select').find(':selected').val());
/* If N/A or 0 are chosen, they are ignored in the calculation. */
if(Number.isInteger(val) && 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 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).children('select').find(':selected').val());
if(Number.isInteger(val))
{
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
// --------------------------------------------------------------------------
// When any score changes, calculate percentages
$('select').on('change', function(e)
{
percentagePerCriterion($(this).parent().index());
percentagePerStudent($(this).closest('tr'));
});
// Submit button is clicked
$('#button-submit-assessment').on('click', function(e)
{
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.children('select').find(':selected').val();
// 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();
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
{
CriteriaAchievedResults[id]=0;
}
});
console.log('criteria results: '+JSON.stringify(CriteriaAchievedResults));
console.log('criteria percentages: '+JSON.stringify(CriteriaAchievedPercentage));
// Save activity to the database
$.post
(
"{{ URL::action('ActivitiesController@saveAssessment') }}",
{
activity_id: activity_id,
criteria_achieved_percentage: JSON.stringify(CriteriaAchievedPercentage),
criteria_achievement: JSON.stringify(CriteriaAchievedResults),
student_scores: JSON.stringify(studentAssessments),
},
function(data)
{
location.reload();
window.scrollTo(0, 0);
}
);
});
// 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('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
(
'