<% unless flash[:notice].nil? %>
<%= flash[:notice] %>
<% end %>
<%#*
%>
<%#= t('select') %><%#: <%= link_to_function t('all'), "$$('input.right').each(function(checkbox) { checkbox.checked = true; });" %>
<%#= link_to_function t('none'), "$$('input.right').each(function(checkbox) { checkbox.checked = false; });" %>
<%#*
%>
<% unless @exam_groups.empty? %>
<%= t('connect_exams') %>
<% form_for :exam_grouping do |f| %>
<% count=@exam_groups.count.to_i - 1 %>
<% i=0 %>
<% total = 0 %>
<% @exam_groups.each do |e| %>
<% already_grouped = GroupedExam.find_by_batch_id_and_exam_group_id(@batch.id,e) %>
<% is_already_grouped = already_grouped.present? %>
<% if is_already_grouped==true %>
<% total += already_grouped.weightage if already_grouped.weightage.present? %>
<% else %>
<% end %>
<% i=i+1 %>
<% end %>
<%= check_box_tag 'chck1','yes', false,{:onClick=> "check_all_or_none(#{count})"} %> |
<%= t('exam_group') %>
|
<%= t('weightage') %>(%)
|
|
<%= check_box_tag "exam_grouping[exam_group_ids][]", e.id,is_already_grouped,{:class=>'right',:id=>"check#{i}",:onClick=>"set_weightage(this,#{count})"} %> |
<%= e.name %> | <%=text_field_tag 'weightage[]',already_grouped.weightage,:class=>'total-box',:id=>"weightage#{i}",:onchange=>"check_weightage(this,#{count})"%> | <%=text_field_tag 'weightage[]',"0",:class=>'total-box',:disabled=>true,:id=>"weightage#{i}",:onchange=>"check_weightage(this,#{count})"%> |
<%= t('total_weghtage') %>
|
<%=label_tag 'total',total,:id=>"tot"%>
|
<%#*
"right"%><%#
<%= e.name %><%#
%>
<%#*
%>
<%# end %>
<%= submit_tag "", :value => "#{t('save')}", :class => "submit_button" %>
<% end %>
<% else %>
No valid exams available to connect.
<% end %>