Permalink
Browse files

Merge branch 'master' into edit_groups

  • Loading branch information...
2 parents b05c958 + afa7275 commit 8e016d257d18f46d50381af1dd2df8c3709fe97e @baadshah02 committed Mar 5, 2012
View
11 app/models/user.rb
@@ -144,15 +144,20 @@ def self.upload_user_list(user_class, user_list, encoding)
result[:invalid_lines] = [] # store lines that were not processed
# read each line of the file and update classlist
if encoding != nil
- user_list = StringIO.new(Iconv.iconv('UTF-8', encoding, user_list.read).join)
+ user_list = StringIO.new(Iconv.iconv('UTF-8',
+ encoding,
+ user_list.read).join)
end
User.transaction do
processed_users = []
- FasterCSV.parse(user_list.read, :skip_blanks => true, :row_sep => :auto) do |row|
+ FasterCSV.parse(user_list.read,
+ :skip_blanks => true,
+ :row_sep => :auto) do |row|
# don't know how to fetch line so we concat given array
next if FasterCSV.generate_line(row).strip.empty?
if processed_users.include?(row[0])
- result[:invalid_lines] = I18n.t('csv_upload_user_duplicate', {:user_name => row[0]})
+ result[:invalid_lines] = I18n.t('csv_upload_user_duplicate',
+ {:user_name => row[0]})
else
if User.add_user(user_class, row).nil?
result[:invalid_lines] << row.join(",")
View
7 app/views/assignments/_file_fields.html.erb
@@ -1,7 +0,0 @@
-<p id="assignment_file_<%=h(assignment_file.id)%>">
- <%= link_to 'x ',
- :url => { :action => "remove_assignment_file", :id => assignment_file.id },
- :remote => true %>
- <%= h(assignment_file.filename) %>
-</p>
-
View
6 app/views/graders/_boot.js.erb
@@ -205,10 +205,10 @@ document.observe("dom:loaded", function() {
@assignment),
:complete => "$('loading_list').hide();" %>
<% else %>
- <%= remote_function populate_assignment_graders_path(
+ <%= remote_function :url => populate_assignment_graders_path(
@assignment),
- :complete => "$('loading_list').hide();" %>
- <%= remote_function populate_criteria_assignment_graderspath(
+ :complete => "$('loading_list').hide();" %>
+ <%= remote_function :url => populate_criteria_assignment_graders_path(
@assignment) %>
<% end %>
});
View
7 app/views/graders/modal_dialogs/_groups_coverage.html.erb
@@ -20,9 +20,10 @@
<br />
<%= I18n.t('graders.possible_graders') %>:
<% criterion.tas.each do |ta|%>
- <%= link_to_remote ta.user_name,
- :url => { :action => 'add_grader_to_grouping', :id => @assignment.id,
- :grouping_id => @grouping.id, :grader_id => ta.id } %>
+ <%= link_to ta.user_name,
+ add_grader_to_grouping_assignment_graders_path(
+ :id => @assignment.id, :grouping_id => @grouping.id, :grader_id => ta.id),
+ :remote => true %>
<% end %>
<% end %>
<% end %>
View
7 app/views/graders/table_row/_filter_table_grader_row.erb
@@ -4,10 +4,11 @@
<td>
<% if @assignment.assign_graders_to_criteria %>
<%= h(grader.get_criterion_associations_count_by_assignment(@assignment)) %>
- <%= link_to_remote image_tag("icons/comment.png", :alt => I18n.t('criteria'),
+ <%= link_to image_tag("icons/comment.png", :alt => I18n.t('criteria'),
:title => I18n.t('criteria')),
- :url => { :action => 'grader_criteria_dialog',
- :id => @assignment.id, :grader => grader.id } %>
+ grader_criteria_dialog_assignment_graders_path(
+ :id => @assignment.id, :grader => grader.id),
+ :remote => true %>
<% else %>
<%= I18n.t('all') %>
<% end %>
View
10 app/views/graders/table_row/_filter_table_row.html.erb
@@ -19,13 +19,15 @@
<span class="table_menu">
<% assigned_count = grouping.criteria_coverage_count %>
<% if assigned_count == total_criteria_count %>
- <%= link_to_remote image_tag("icons/tick.png", :alt => I18n.t('graders.covered'),
+ <%= link_to image_tag("icons/tick.png", :alt => I18n.t('graders.covered'),
:title => I18n.t('graders.covered')),
- :url => { :action => 'groups_coverage_dialog', :id => @assignment.id, :grouping => grouping.id } %>
+ groups_coverage_dialog_assignment_graders_path(:id => @assignment.id, :grouping => grouping.id),
+ :remote => true %>
<% else %>
- <%= link_to_remote image_tag("icons/cross.png", :alt => I18n.t('graders.not_covered'),
+ <%= link_to image_tag("icons/cross.png", :alt => I18n.t('graders.not_covered'),
:title => I18n.t('graders.not_covered')),
- :url => { :action => 'groups_coverage_dialog', :id => @assignment.id, :grouping => grouping.id } %>
+ groups_coverage_dialog_assignment_graders_path(:id => @assignment.id, :grouping => grouping.id),
+ :remote => true %>
<% end %>
</span>
(<%= assigned_count %>/<%= total_criteria_count %>)
View
20 app/views/results/common/_submission_selector.html.erb
@@ -13,17 +13,15 @@
<span class="middle">
<%= link_to raw(I18n.t("marker.notes",
:notes => @grouping.notes.size)),
- :url => {:controller => 'note',
- :action => 'notes_dialog',
- :id => @grouping.assignment_id,
- :noteable_id => group.grouping_ids,
- :noteable_type => 'Grouping',
- :action_to => 'note_message',
- :controller_to => 'results',
- :highlight_field => 'notes_dialog_link',
- :number_of_notes_field => 'number_of_notes'},
- :html => {:id => 'notes_dialog_link'},
- :remote => true %>
+ notes_dialog_note_path(:id => @grouping.assignment_id,
+ :noteable_id => group.grouping_ids,
+ :noteable_type => 'Grouping',
+ :action_to => 'note_message',
+ :controller_to => 'results',
+ :highlight_field => 'notes_dialog_link',
+ :number_of_notes_field => 'number_of_notes'),
+ :id => 'notes_dialog_link',
+ :remote => true %>
|
(<%=label_tag "marking_state", h(I18n.t("marker.marking_status")), :class => "inline_label" %>
<% old_result_id = nil %>
View
24 app/views/rubrics/_criterion_editor.html.erb
@@ -1,7 +1,7 @@
<%= remote_form_for criterion,
:as => :rubric_criterion,
:url => {:action => 'update',
- :id => criterion.id} do |f| %>
+ :id => criterion.id} do |f| %>
<h2>
<span id="selected_criterion_name">
@@ -14,17 +14,6 @@
</div>
<div class="main_rubric_criteria_edit">
- <div class="align_text_right">
- <%= link_to_remote I18n.t(:delete),
- :url => {:action => 'destroy',
- :id => criterion.id},
- :method => 'delete',
- :html => {:class => 'delete',
- :title => I18n.t(:remove_criteria_title)},
- :confirm => I18n.t(:remove_criteria_message),
- :remote => true %>
- </div>
-
<span id="<%="criterion_inputs_#{criterion.id}"%>">
<%= f.label :rubric_criterion_name, I18n.t(:criterion), :class => "bold_inline_label" %>
<%= f.text_field :rubric_criterion_name, :class => "fit_to_space" %>
@@ -41,9 +30,18 @@
<%= f.submit t("rubric_criteria.save")%>
</div>
-
<div class="rubric_criteria_levels">
<%= render :partial => 'rubric_criterion_levels', :locals => {:criterion => criterion, :f => f} %>
</div>
<% end %>
+
+<div class="float_right">
+ <%= button_to I18n.t(:delete),
+ assignment_rubric_path(:id => criterion.id),
+ :confirm => I18n.t(:remove_criteria_message),
+ :method => :delete,
+ :class => 'delete',
+ :title => I18n.t(:remove_criteria_title),
+ :remote => true %>
+</div>
View
3 config/routes.rb
@@ -43,6 +43,7 @@
resources :rubrics do
member do
+ delete 'destroy'
get 'move_criterion'
end
@@ -180,7 +181,7 @@
post 'populate_graders'
post 'populate'
post 'populate_criteria'
- get 'set_assign_criteria'
+ post 'set_assign_criteria'
get 'random_assign'
get 'upload_dialog'
get 'unassign'

0 comments on commit 8e016d2

Please sign in to comment.