%-# 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. -%>
<%= flash[:notice] %>
<% end %><%= t('name') %> | <% if grade_type=="GPA" or grade_type=="CWA" %> <% @exam_group.exams.each do |exam| %><%= exam.subject.code %><%= "(" + exam.subject.credit_hours.to_s + ")" unless exam.subject.credit_hours.nil? %> | <% end %> <% if grade_type=="CWA" %><%= t('weighted_average') %> | <% else %><%= t('gpa') %> | <% end %> <% else %> <% @exam_group.exams.each do |exam| %><%= exam.subject.code %><%= "(" + exam.maximum_marks.to_s + ")" unless exam.maximum_marks.nil? %> | <% end %> <% unless @exam_group.exam_type == "Grades" %><%= t('percentage') %>(%) | <% end %> <% end %>||||
<%= student.full_name %> | <% 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? %><%= exam_score.grading_level.present? ? exam_score.grading_level : "-" %> | <% 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 %><%= "%.2f" %(total_credit_points.to_f/total_credits.to_f) %> | <% 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? %><%= exam_score.marks.present? ? "%.2f" %((exam_score.marks.to_f/exam.maximum_marks.to_f)*100) : "-" %> | <% 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 %><%= "%.2f" %(total_weighted_marks.to_f/total_credits.to_f) %> | <% 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" %><% if @exam_group.exam_type == "MarksAndGrades" %> <%= exam_score.nil? ? '-' : "#{(exam_score.marks || "-")}" + "(#{(exam_score.grading_level || "-")})" %> <% else %> <%= exam_score.nil? ? '-' : exam_score.marks || "-" %> <% end %> | <% 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 %><%= exam_score.nil? ? '-' : exam_score.grading_level || "-" %> | <% end %> <% end %> <% unless @exam_group.exam_type == "Grades" %><% percentage = total_marks*100/total_max_marks.to_f unless total_max_marks == 0%> <%= "%.2f" %percentage unless total_max_marks == 0 %> | <% end %>