%-# 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. -%>
<% scholastic = @report.scholastic %>
<% cgpa=0.0 %>
<% count=0 %>
:
:
:
:
Scholastic Areas
<% if @exam_groups.empty? %>
No Exams
<% else %>
Sl no
<% @exam_groups.each do |eg| %>
<%= eg.cce_exam_category.name %>
<% end %>
<% if @exam_groups.count==2 %>
Overall
<% end %>
Subjects
<% @exam_groups.each_with_index do |eg,i| %>
<%= "FA#{2*i+1}" %>
<%= "FA#{2*i+2}" %>
<%= "SA#{i+1}" %>
<%= "FA#{2*i+1}+ FA#{2*i+2}+ SA#{i+1}" %>
<% end %>
<% if @exam_groups.count==2 %>
FA1+ FA2+ FA3+ FA4
SA1+ SA2
Overall
Grade Point
<% end %>
<% @subjects.each_with_index do |s,i| %>
<%= i+1 %>
<%= s.name %>
<% sub=scholastic.find{|c| c.subject_id==s.id} %>
<% @exam_groups.each do |eg|
se=sub.exams.find{|g| g.exam_group_id==eg.id} if sub %>
<% if se %>
<%= se.fa[se.fa_group_ids[0]] if se.fa_group_ids[0] %>
<%= se.fa[se.fa_group_ids[1]] if se.fa_group_ids[1] %>
<%= se.sa %>
<%= se.overall %>
<% else %>
-
-
-
-
<% end %>
<% end %>
<% if @exam_groups.count==2 %>
<% if sub %>
<%= sub.fa %>
<%= sub.sa %>
<%= sub.overall %>
<%= sub.grade_point %>
<% if s.elective_group_id.blank? %>
<% cgpa += sub.grade_point.to_f %>
<% count += 1 %>
<% end %>
<% else %>
-
-
-
-
<% end %>
<% end %>
<% end %>
<% end %>
<% if @exam_groups.count==2 %>
Cumulative Grade Point Average(CGPA) : <%= cgpa/count unless count==0 %>