<%-# 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('consolidated_report') %>

<%= link_to_function image_tag("/images/buttons/back.png",:border => 0), "history.back()" %>
<% unless flash[:notice].nil? %>

<%= flash[:notice] %>

<% end %>

<%= @batch.course.full_name %> <%= @batch.name %> | <%= @exam_group.name %>

<% grade_type = "normal" %> <% grade_type = "GPA" if @batch.gpa_enabled? %> <% grade_type = "CWA" if @batch.cwa_enabled? %>
<% if grade_type=="GPA" or grade_type=="CWA" %> <% @exam_group.exams.each do |exam| %> <% end %> <% if grade_type=="CWA" %> <% else %> <% end %> <% else %> <% @exam_group.exams.each do |exam| %> <% end %> <% unless @exam_group.exam_type == "Grades" %> <% end %> <% end %> <% @exam_group.batch.students.each do |student|%> <% if grade_type=="GPA" %> <% total_credits = 0 %> <% total_credit_points=0 %> <% @exam_group.exams.each do |exam| %> <% exam_score = ExamScore.find_by_student_id_and_exam_id(student.id,exam.id) %> <% unless exam_score.nil? %> <% total_credits = total_credits + exam.subject.credit_hours.to_f unless exam.subject.credit_hours.nil? %> <% total_credit_points = total_credit_points + (exam_score.grading_level.credit_points.to_f * exam.subject.credit_hours.to_f) unless exam_score.grading_level.nil? %> <% else %> <% end %> <% end %> <% elsif grade_type=="CWA" %> <% total_credits = 0 %> <% total_weighted_marks=0 %> <% @exam_group.exams.each do |exam| %> <% exam_score = ExamScore.find_by_student_id_and_exam_id(student.id,exam.id) %> <% unless exam_score.nil? %> <% total_credits = total_credits + exam.subject.credit_hours.to_f unless exam.subject.credit_hours.nil? %> <% total_weighted_marks = total_weighted_marks + ((exam_score.marks.to_f/exam.maximum_marks.to_f)*100)*(exam.subject.credit_hours.to_f) unless exam_score.marks.nil? %> <% else %> <% end %> <% end %> <% else %> <% total_marks = 0 %> <% total_max_marks = 0 %> <% @exam_group.exams.each do |exam| %> <% exam_score = ExamScore.find_by_student_id_and_exam_id(student.id,exam.id) %> <% unless @exam_group.exam_type == "Grades" %> <% total_marks = total_marks+(exam_score.marks || 0) unless exam_score.nil? %> <% total_max_marks = total_max_marks+exam.maximum_marks unless exam_score.nil? %> <% else %> <% end %> <% end %> <% unless @exam_group.exam_type == "Grades" %> <% end %> <% end %> <% end %>
<%= t('name') %><%= exam.subject.code %><%= "(" + exam.subject.credit_hours.to_s + ")" unless exam.subject.credit_hours.nil? %><%= t('weighted_average') %><%= t('gpa') %><%= exam.subject.code %><%= "(" + exam.maximum_marks.to_s + ")" unless exam.maximum_marks.nil? %><%= t('percentage') %>(%)
<%= student.full_name %><%= exam_score.grading_level.present? ? exam_score.grading_level : "-" %>-<%= "%.2f" %(total_credit_points.to_f/total_credits.to_f) %><%= exam_score.marks.present? ? "%.2f" %((exam_score.marks.to_f/exam.maximum_marks.to_f)*100) : "-" %>-<%= "%.2f" %(total_weighted_marks.to_f/total_credits.to_f) %> <% if @exam_group.exam_type == "MarksAndGrades" %> <%= exam_score.nil? ? '-' : "#{(exam_score.marks || "-")}" + "(#{(exam_score.grading_level || "-")})" %> <% else %> <%= exam_score.nil? ? '-' : exam_score.marks || "-" %> <% end %> <%= exam_score.nil? ? '-' : exam_score.grading_level || "-" %><% percentage = total_marks*100/total_max_marks.to_f unless total_max_marks == 0%> <%= "%.2f" %percentage unless total_max_marks == 0 %>