%-# Fedena
#Copyright 2010 Foradian Technologies Private Limited
#
#This product includes software developed at
#Project Fedena - http://www.projectfedena.org/
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing,
#software distributed under the License is distributed on an
#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
#KIND, either express or implied. See the License for the
#specific language governing permissions and limitations
#under the License. -%>
<% unless flash[:notice].nil? %>
<%= flash[:notice] %>
<% end %>
<%= @student.batch.full_name %> - <%= @exam_group.name %>
<% exam_score = [] %>
<% @exams.each do |exam| %>
<% exam_score.push exam.exam_scores.find_by_student_id(@student.id) unless exam.exam_scores.find_by_student_id(@student.id).nil? %>
<% end %>
<% if @batch.cwa_enabled? %>
<% total_credits=0 %>
<% total_weighted_marks=0 %>
<%= t('subject_code') %> |
<%= t('title') %> |
<%= t('marks') %> |
<%= t('credit') %> |
<%= t('grade') %> |
<%= t('weighted_marks') %> |
<% exam_score.each do |es| %>
<%= es.exam.subject.code %> |
<%= es.exam.subject.name %> |
<%= es.marks.present? ? mark=(es.marks.to_f/es.exam.maximum_marks.to_f)*100 : '-' %> |
<%= es.exam.subject.credit_hours %> |
<% total_credits = total_credits + es.exam.subject.credit_hours.to_f %>
<%= es.grading_level.present? ? es.grading_level : "-" %> |
<% weighted_mark=0 %>
<% weighted_mark = mark.to_f * es.exam.subject.credit_hours.to_f if es.marks.present? %>
<% total_weighted_marks = total_weighted_marks + weighted_mark %>
<%= weighted_mark %> |
<% end %>
<%= t('total') %> |
<%= total_credits %> |
- |
<%= total_weighted_marks %> |
<%= t('weighted_average') %> =
<% unless total_credits==0 %>
<%= "%.2f" %(total_weighted_marks.to_f/total_credits.to_f) %>
<% else %>
-
<% end %>
<% elsif @batch.gpa_enabled? %>
<% total_credit_points=0 %>
<% total_credit_hours=0 %>
<%= t('subject_code') %> |
<%= t('subject_title') %> |
<%= t('credits') %> |
<%= t('marks') %> |
<%= t('remarks') %> |
<% exam_score.each do |es| %>
<%= es.exam.subject.code %> |
<%= es.exam.subject.name %> |
<%= es.exam.subject.credit_hours %> |
<% total_credit_hours = total_credit_hours + es.exam.subject.credit_hours.to_f %>
<%= es.grading_level.present? ? es.grading_level : "-" %> |
<% points=0 %>
<% points = (es.grading_level.credit_points.to_f) * (es.exam.subject.credit_hours.to_f) if es.grading_level.present? %>
<% total_credit_points = total_credit_points + points %>
<%= es.grading_level.present? ? (es.grading_level.description.present? ? es.grading_level.description : "-") : "-" %> |
<% end %>
<%= t('total') %> |
<%= total_credit_hours %> |
- |
- |
<%= t('grade_point_average_gpa') %> =
<% unless total_credit_hours==0 %>
<%= "%.2f" %(total_credit_points.to_f/total_credit_hours.to_f) %>
<% else %>
-
<% end %>
<% else %>
<% total_marks_attained = 0 %>
<% total_max_marks = 0 %>
<%= t('subject') %> |
<% if @exam_group.exam_type == 'Marks' %>
<%= t('marks_obtained') %> |
<%= t('max') %> |
<%= t('percentage') %>(%) |
<% elsif @exam_group.exam_type == 'Grades' %>
<%= t('grades') %> |
<% else %>
<%= t('marks_obtained') %> |
<%= t('max') %> |
<%= t('grades') %> |
<%= t('percentage') %>(%) |
<% end %>
<% exam_score.each do |es| %>
<%= es.exam.subject.name %> |
<% if @exam_group.exam_type == 'Marks' %>
<%= es.marks || '-' %> |
<% total_marks_attained = total_marks_attained+(es.marks || 0) %>
<%= es.exam.maximum_marks %> |
<% total_max_marks = total_max_marks+es.exam.maximum_marks%>
<%= es.calculate_percentage %> |
<% elsif @exam_group.exam_type == 'Grades' %>
<%= es.grading_level || "-" %> |
<% else %>
<%= es.marks || "-" %> |
<% total_marks_attained = total_marks_attained+(es.marks || 0) %>
<%= es.exam.maximum_marks %> |
<% total_max_marks = total_max_marks+es.exam.maximum_marks%>
<%= es.grading_level || "-" %> |
<%= es.calculate_percentage %> |
<% end %>
<% end %>
<% if @exam_group.exam_type == 'Marks' or @exam_group.exam_type == 'MarksAndGrades' %>
<%= t('total_marks') %>: |
<%= total_marks_attained %> | <%= total_max_marks %> |
<% if @exam_group.exam_type == 'MarksAndGrades' %>
- |
<% end %>
<%= "%.2f" %(total_marks_attained*100/total_max_marks) unless total_max_marks == 0 %> |
<% end %>
<% if @exam_group.exam_type == 'Marks' or @exam_group.exam_type == 'MarksAndGrades' %>
<% end %>
<% end %>
<% unless @batch.gpa_enabled? %>
<% if @exam_group.exam_type == 'Marks' or @exam_group.exam_type == 'MarksAndGrades' %>
<%= @graph %>
<% end %>
<% end %>