<%-# 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. -%>
Exam

<%= 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 %>

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

<% @exam_group.exams.each do |exam| %> <% end %> <% if @archived_students.present? %> <% @archived_students.each do |student|%> <% total_marks = 0 %> <% total_max_marks = 0 %> <% @exam_group.exams.each do |exam| %> <% exam_score = ArchivedExamScore.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 %> <% end %> <% end %> <% if @active_students.present? %> <% @active_students.each do |student|%> <% 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 %> <% end %> <% end %>
<%= t('name') %><%= Subject.find(exam.subject_id).code %><%= "(" + exam.maximum_marks.to_s + ")" unless exam.maximum_marks.nil? %><%= t('percentage') %>(%)
<%= student.full_name %> <% 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 %>
<%= student.full_name %> <% 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 %>