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

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

<%= flash[:notice] %>

<% end %>
<% if permitted_to? :edit, :exams %>

> <%= in_place_editor_field :exam_group, :name %>

<% else %>

<%= @exam_group.name %>

<% end %>

<%= image_tag("loader.gif",:align => "absmiddle", :border => 0, :id => "loader", :style =>"display: none;" ) %>

<% @employee_subjects=[] %> <% @employee_subjects= @current_user.employee_record.subjects.map { |n| n.id} if @current_user.employee? %> <% privilege = Privilege.find_by_name("EnterResults") %> <% unless @exam_group.exam_type == 'Grades' %> <% if permitted_to? :edit, :exams %> <% end %> <% @exam_group.exams.each do |exam| %> <% @exam = exam %> <% if @employee_subjects.include?(exam.subject.id) or @current_user.admin? or @user_privileges.map{|p| p.name}.include?('ExaminationControl') or @user_privileges.map{|p| p.name}.include?('EnterResults') %> <% @exam = exam %> <% if permitted_to? :edit, :exams %> <% else %> <% end %> <% end %> <% end %>
<%= t('subject') %> <%= t('max_mark') %> <%= t('min_mark') %><%= t('manage') %>
<%= link_to exam.subject.name, [@exam_group, exam] %>
> <%= in_place_editor_field :exam, :maximum_marks,{},{:cols=>1} %>
> <%= in_place_editor_field :exam, :minimum_marks,{},{:cols=>1} %>
<% if @exam_group.result_published %> <%= t('edit_text') %> <% else %> <%= link_to t('edit_text'), edit_exam_group_exam_path(@exam_group, exam) %> <% end %> <% if @exam.removable? %> <%= link_to t('delete_text'), [@exam_group, exam], :method => 'delete', :confirm => t('delete_confirm_msg') %> <% else %> <%= t('delete_text') %> <% end %> <%= exam.maximum_marks %> <%= exam.minimum_marks %>
<% else %> <% if permitted_to? :edit, :exams %> <% end %> <% @exam_group.exams.each do |exam| %> <% if @employee_subjects.include?("#{exam.subject.id}") or @current_user.admin? or @current_user.privileges.map{|p| p.name}.include?("ExaminationControl") or @current_user.privileges.map{|p| p.name}.include?("EnterResults") %> <% @exam = exam %> <% if permitted_to? :edit, :exams %> <% end %> <% end %> <% end %>
<%= t('subject') %><%= t('manage') %>
<%= link_to exam.subject.name, [@exam_group, exam] %> <%= link_to t('edit_text'), edit_exam_group_exam_path(@exam_group, exam) %> <% if @exam.removable? %> <%= link_to t('delete_text'), [@exam_group, exam], :method => 'delete', :confirm => t('delete_confirm_msg') %> <% else %> <%= t('delete_text') %> <% end %>
<% end %>