<%-# 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. -%>
<%= image_tag("/images/examination/show_exam.png") %>

<%= t('exams_text') %>

<%= t('generated_report') %>

<%= link_to_function image_tag("/images/buttons/back.png",:border => 0), "history.back()" %>
<% 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 %>
<%= "#{@student.full_name} - #{@student.admission_no}" %>
<% exam_score.each do |es| %> <% total_credits = total_credits + es.exam.subject.credit_hours.to_f %> <% 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 %> <% end %>
<%= t('subject_code') %> <%= t('title') %> <%= t('marks') %> <%= t('credit') %> <%= t('grade') %> <%= t('weighted_marks') %>
<%= 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 %><%= es.grading_level.present? ? es.grading_level : "-" %><%= weighted_mark %>
<%= 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 %>
<%= "#{@student.full_name} - #{@student.admission_no}" %>
<% exam_score.each do |es| %> <% total_credit_hours = total_credit_hours + es.exam.subject.credit_hours.to_f %> <% 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 %> <% end %>
<%= t('subject_code') %> <%= t('subject_title') %> <%= t('credits') %> <%= t('marks') %> <%= t('remarks') %>
<%= es.exam.subject.code %> <%= es.exam.subject.name %> <%= es.exam.subject.credit_hours %><%= es.grading_level.present? ? es.grading_level : "-" %><%= es.grading_level.present? ? (es.grading_level.description.present? ? es.grading_level.description : "-") : "-" %>
<%= 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 %>
<%= "#{@student.full_name} - #{@student.admission_no}" %>
<% if @exam_group.exam_type == 'Marks' %> <% elsif @exam_group.exam_type == 'Grades' %> <% else %> <% end %> <% exam_score.each do |es| %> <% if @exam_group.exam_type == 'Marks' %> <% total_marks_attained = total_marks_attained+(es.marks || 0) %> <% total_max_marks = total_max_marks+es.exam.maximum_marks%> <% elsif @exam_group.exam_type == 'Grades' %> <% else %> <% total_marks_attained = total_marks_attained+(es.marks || 0) %> <% total_max_marks = total_max_marks+es.exam.maximum_marks%> <% end %> <% end %> <% if @exam_group.exam_type == 'Marks' or @exam_group.exam_type == 'MarksAndGrades' %> <% if @exam_group.exam_type == 'MarksAndGrades' %> <% end %> <% end %>
<%= t('subject') %><%= t('marks_obtained') %> <%= t('max') %> <%= t('percentage') %>(%)<%= t('grades') %><%= t('marks_obtained') %> <%= t('max') %> <%= t('grades') %> <%= t('percentage') %>(%)
<%= es.exam.subject.name %><%= es.marks || '-' %><%= es.exam.maximum_marks %><%= es.calculate_percentage %><%= es.grading_level || "-" %><%= es.marks || "-" %><%= es.exam.maximum_marks %><%= es.grading_level || "-" %> <%= es.calculate_percentage %>
<%= t('total_marks') %>: <%= total_marks_attained %><%= total_max_marks %>-<%= "%.2f" %(total_marks_attained*100/total_max_marks) unless total_max_marks == 0 %>
<% if @exam_group.exam_type == 'Marks' or @exam_group.exam_type == 'MarksAndGrades' %>
<%= t('class_average_marks') %> : <%= "%.2f" %@exam_group.batch_average_marks('marks') unless total_max_marks == 0%> | <%= t('class_average') %> % : <%= "%.2f" %(@exam_group.batch_average_marks('marks')*100/total_max_marks) unless total_max_marks == 0 %>
<% end %>
<% end %> <% unless @batch.gpa_enabled? %> <% if @exam_group.exam_type == 'Marks' or @exam_group.exam_type == 'MarksAndGrades' %> <%= @graph %> <% end %> <% end %>