Index: test/unit/submission_rule_test.rb
===================================================================
--- test/unit/submission_rule_test.rb	(revision 1156)
+++ test/unit/submission_rule_test.rb	(revision 1183)
@@ -2,7 +2,7 @@
 require 'shoulda'
 
 class SubmissionRuleTest < ActiveSupport::TestCase
-  fixtures :assignments, :submission_rules
+  fixtures :all
 
   def setup
     setup_group_fixture_repos
Index: test/unit/no_late_submission_rule_test.rb
===================================================================
--- test/unit/no_late_submission_rule_test.rb	(revision 1156)
+++ test/unit/no_late_submission_rule_test.rb	(revision 1183)
@@ -1,7 +1,7 @@
 require File.dirname(__FILE__) + '/../test_helper'
 require 'shoulda'
 class NoLateSubmissionRuleTest < ActiveSupport::TestCase
-
+  fixtures :all
   should "be able to create NoLateSubmissionRule" do
     rule = NoLateSubmissionRule.new
     rule.assignment = assignments(:assignment_1)
Index: test/unit/grouping_test.rb
===================================================================
--- test/unit/grouping_test.rb	(revision 1156)
+++ test/unit/grouping_test.rb	(revision 1183)
@@ -2,9 +2,8 @@
 require 'shoulda'
 
 class GroupingTest < ActiveSupport::TestCase
-  fixtures :groups
-  fixtures :assignments
-  fixtures :groupings
+  fixtures :all
+  
   should_belong_to :group
   should_belong_to :assignment
   should_have_many :memberships
Index: test/unit/rubric_criteria_test.rb
===================================================================
--- test/unit/rubric_criteria_test.rb	(revision 1156)
+++ test/unit/rubric_criteria_test.rb	(revision 1183)
@@ -3,7 +3,7 @@
 require 'mocha'
 
 class RubricCriterionTest < ActiveSupport::TestCase
-  fixtures :assignments, :rubric_criteria
+  fixtures :all
   set_fixture_class :rubric_criteria => RubricCriterion
   
   #Test that Criteria with no names are not valid
Index: test/unit/assignment_test.rb
===================================================================
--- test/unit/assignment_test.rb	(revision 1156)
+++ test/unit/assignment_test.rb	(revision 1183)
@@ -3,7 +3,7 @@
 
 class AssignmentTest < ActiveSupport::TestCase
   
-  fixtures :assignments, :users, :submission_rules, :submissions, :groups, :rubric_criteria, :marks, :results, :groupings
+  fixtures :all
   set_fixture_class :rubric_criteria => RubricCriterion
   
   should_validate_presence_of :marking_scheme_type
@@ -382,10 +382,9 @@
   end
   
   context "An assignment instance" do
-    
     should "be able to generate a detailed CSV report of marks (including criteria)" do
-      a = assignments(:assignment_6) # we require assignment_6 here
-      assert_equal "A6", a.short_identifier, "We need assignment 6 for this test!"
+      a = assignments(:assignment_1) # we require assignment_1 here
+      assert_equal "Captain Nemo", a.short_identifier, "We need assignment 6 for this test!"
       out_of = a.total_mark
       rubric_criteria = a.rubric_criteria
       expected_string = ""
@@ -405,7 +404,7 @@
           submission = grouping.get_submission_used
           fields.push(submission.result.total_mark / out_of * 100)
           rubric_criteria.each do |rubric_criterion|
-            mark = submission.result.marks.find_by_rubric_criterion_id(rubric_criterion.id)
+            mark = submission.result.marks.find_by_markable_id_and_markable_type(rubric_criterion.id, "RubricCriterion")
             if mark.nil?
               fields.push('')
             else
Index: test/unit/flexible_criterion_test.rb
===================================================================
--- test/unit/flexible_criterion_test.rb	(revision 1156)
+++ test/unit/flexible_criterion_test.rb	(revision 1183)
@@ -2,6 +2,7 @@
 require 'shoulda'
 
 class FlexibleCriterionTest < ActiveSupport::TestCase
+  fixtures :all
   should_belong_to :assignment
   
   # Not yet functional
Index: test/unit/grade_entry_student_test.rb
===================================================================
--- test/unit/grade_entry_student_test.rb	(revision 1156)
+++ test/unit/grade_entry_student_test.rb	(revision 1183)
@@ -3,6 +3,7 @@
 
 # Tests for GradeEntryStudents
 class GradeEntryStudentTest < ActiveSupport::TestCase
+  fixtures :all
   
   should_belong_to :grade_entry_form  
   should_belong_to :user
Index: test/unit/annotation_test.rb
===================================================================
--- test/unit/annotation_test.rb	(revision 1156)
+++ test/unit/annotation_test.rb	(revision 1183)
@@ -1,6 +1,7 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
 class AnnotationTest < ActiveSupport::TestCase
+  fixtures :all
   # Test that Annotation without line_start are not valid
   def test_no_line_start
     no_line_start = create_no_attr(:line_start);
Index: test/unit/test_result_test.rb
===================================================================
--- test/unit/test_result_test.rb	(revision 1156)
+++ test/unit/test_result_test.rb	(revision 1183)
@@ -3,7 +3,7 @@
 
 class TestResultTest < ActiveSupport::TestCase
 
-  fixtures :submissions, :test_results
+  fixtures :all
 
   # Basic testing: create, delete, update
 
Index: test/unit/user_test.rb
===================================================================
--- test/unit/user_test.rb	(revision 1156)
+++ test/unit/user_test.rb	(revision 1183)
@@ -3,7 +3,7 @@
 
 class UserTest < ActiveSupport::TestCase
   
-  fixtures :users
+  fixtures :all
   should_have_many :memberships
   should_have_many :notes
   should_have_many :groupings, :through => :memberships
Index: test/unit/result_test.rb
===================================================================
--- test/unit/result_test.rb	(revision 1156)
+++ test/unit/result_test.rb	(revision 1183)
@@ -4,6 +4,7 @@
 class ResultTest < ActiveSupport::TestCase
   # set_fixture_class is required here, since we don't use Rails'
   # standard pluralization for rubric criteria
+  fixtures :all
   set_fixture_class :rubric_criteria => RubricCriterion 
 	# Set to false to blow away fixtures cache and ensure our fixtures are loaded
 	# and thus takes into account our set_fixture_class
Index: test/unit/penalty_period_submission_rule_test.rb
===================================================================
--- test/unit/penalty_period_submission_rule_test.rb	(revision 1156)
+++ test/unit/penalty_period_submission_rule_test.rb	(revision 1183)
@@ -3,7 +3,7 @@
 
 class PenaltyPeriodSubmissionRuleTest < ActiveSupport::TestCase
   # Replace this with your real tests.
-  
+  fixtures :all
   context "Assignment has a single grace period of 24 hours after due date" do
     setup do
       setup_group_fixture_repos
Index: test/unit/grade_entry_item_test.rb
===================================================================
--- test/unit/grade_entry_item_test.rb	(revision 1156)
+++ test/unit/grade_entry_item_test.rb	(revision 1183)
@@ -3,7 +3,7 @@
 
 # Tests for GradeEntryItems
 class GradeEntryItemTest < ActiveSupport::TestCase
-  
+  fixtures :all
   should_belong_to :grade_entry_form
   
   # Not yet
Index: test/unit/grace_period_submission_rule_test.rb
===================================================================
--- test/unit/grace_period_submission_rule_test.rb	(revision 1156)
+++ test/unit/grace_period_submission_rule_test.rb	(revision 1183)
@@ -2,6 +2,7 @@
 require 'shoulda'
 
 class GracePeriodSubmissionRuleTest < ActiveSupport::TestCase
+  fixtures :all
   context "Assignment has two grace periods of 24 hours each after due date" do
     setup do
       setup_group_fixture_repos
Index: test/unit/grade_entry_form_test.rb
===================================================================
--- test/unit/grade_entry_form_test.rb	(revision 1156)
+++ test/unit/grade_entry_form_test.rb	(revision 1183)
@@ -3,7 +3,7 @@
 
 # Tests for GradeEntryForms
 class GradeEntryFormTest < ActiveSupport::TestCase
-
+  fixtures :all
   # Basic validation tests
   should_have_many :grade_entry_items, :grade_entry_students
   should_validate_presence_of :short_identifier
Index: test/unit/student_test.rb
===================================================================
--- test/unit/student_test.rb	(revision 1156)
+++ test/unit/student_test.rb	(revision 1183)
@@ -3,7 +3,7 @@
 require 'mocha'
 
 class StudentTest < ActiveSupport::TestCase
-
+  fixtures :all
   should_have_many :accepted_groupings
   should_have_many :pending_groupings
   should_have_many :rejected_groupings
Index: test/unit/mark_test.rb
===================================================================
--- test/unit/mark_test.rb	(revision 1156)
+++ test/unit/mark_test.rb	(revision 1183)
@@ -2,7 +2,7 @@
 require 'shoulda'
 
 class MarkTest < ActiveSupport::TestCase
-  fixtures :rubric_criteria, :flexible_criteria, :results, :marks
+  fixtures :all
   should_belong_to :markable
   should_belong_to :result
   should_validate_presence_of :result_id, :markable_id, :markable_type
Index: test/unit/membership_test.rb
===================================================================
--- test/unit/membership_test.rb	(revision 1156)
+++ test/unit/membership_test.rb	(revision 1183)
@@ -2,9 +2,7 @@
 require 'shoulda'
 
 class MembershipTest < ActiveSupport::TestCase
-  fixtures :memberships
-  fixtures :users
-  fixtures :groupings
+  fixtures :all
 
   should_belong_to :user
   should_belong_to :grouping
Index: test/unit/submission_test.rb
===================================================================
--- test/unit/submission_test.rb	(revision 1156)
+++ test/unit/submission_test.rb	(revision 1183)
@@ -1,7 +1,7 @@
 require File.dirname(__FILE__) + '/../test_helper'
 require 'shoulda'
 class SubmissionTest < ActiveSupport::TestCase
-  
+  fixtures :all
   should_have_many :submission_files
 
   should "automatically create a result" do
Index: test/unit/group_test.rb
===================================================================
--- test/unit/group_test.rb	(revision 1156)
+++ test/unit/group_test.rb	(revision 1183)
@@ -2,7 +2,7 @@
 require 'shoulda'
 
 class GroupTest < ActiveSupport::TestCase
-  fixtures :users, :groupings, :groups
+  fixtures :all
   should_have_many :groupings
   should_have_many :submissions, :through => :groupings
   should_have_many :assignments, :through => :groupings
Index: test/unit/extra_mark_test.rb
===================================================================
--- test/unit/extra_mark_test.rb	(revision 1156)
+++ test/unit/extra_mark_test.rb	(revision 1183)
@@ -1,7 +1,8 @@
 require File.dirname(__FILE__) + '/../test_helper'
 require 'shoulda'
 
-class ExtraMarkTest < Test::Unit::TestCase
+class ExtraMarkTest < ActiveSupport::TestCase
+  fixtures :all
   should_belong_to :result
-	should_validate_presence_of :result_id
+  should_validate_presence_of :result_id
 end
Index: test/unit/student_membership_test.rb
===================================================================
--- test/unit/student_membership_test.rb	(revision 1156)
+++ test/unit/student_membership_test.rb	(revision 1183)
@@ -2,6 +2,7 @@
 require 'shoulda'
 
 class StudentMembershipTest < ActiveSupport::TestCase
+  fixtures :all
   should_belong_to :user
   should_belong_to :grouping
 
Index: test/unit/ta_test.rb
===================================================================
--- test/unit/ta_test.rb	(revision 1156)
+++ test/unit/ta_test.rb	(revision 1183)
@@ -2,7 +2,7 @@
 require "shoulda"
 
 class TATest < ActiveSupport::TestCase
-  fixtures :users, :memberships, :assignments, :groups
+  fixtures :all
   
   def setup
     setup_group_fixture_repos
Index: test/unit/annotation_category_test.rb
===================================================================
--- test/unit/annotation_category_test.rb	(revision 1156)
+++ test/unit/annotation_category_test.rb	(revision 1183)
@@ -2,7 +2,7 @@
 require 'shoulda'
 
 class AnnotationCategoryTest < ActiveSupport::TestCase
-   fixtures :assignments
+   fixtures :all
    should_validate_presence_of :annotation_category_name
    should_validate_presence_of :assignment_id
 
Index: test/unit/assignment_file_test.rb
===================================================================
--- test/unit/assignment_file_test.rb	(revision 1156)
+++ test/unit/assignment_file_test.rb	(revision 1183)
@@ -2,11 +2,12 @@
 
 class AssignmentFileTest < ActiveSupport::TestCase
   # Replace this with your real tests.
+  fixtures :all
   def test_presence_of_filename
     assignmentfile = AssignmentFile.new
     assignmentfile.assignment_id = 1
     assert !assignmentfile.save
- end
+  end
 
  def test_uniqueness_of_filename
     assignmentfile = AssignmentFile.new
Index: test/test_helper.rb
===================================================================
--- test/test_helper.rb	(revision 1156)
+++ test/test_helper.rb	(revision 1183)
@@ -33,7 +33,6 @@
   #
   # Note: You'll currently still have to declare fixtures explicitly in integration tests
   # -- they do not yet inherit this setting
-  fixtures :all
   set_fixture_class :rubric_criteria => RubricCriterion
   set_fixture_class :flexible_criteria => FlexibleCriterion
 
@@ -64,3 +63,5 @@
   end
   
 end
+
+
Index: test/functional/admins_controller_test.rb
===================================================================
--- test/functional/admins_controller_test.rb	(revision 1156)
+++ test/functional/admins_controller_test.rb	(revision 1183)
@@ -3,7 +3,9 @@
 require 'admins_controller'
 
 class AdminsControllerTest < AuthenticatedControllerTest
-   fixtures :users
+
+   fixtures :all
+
    def setup
      @admin = users(:olm_admin_1)
      setup_group_fixture_repos
Index: test/functional/flexible_criteria_controller_test.rb
===================================================================
--- test/functional/flexible_criteria_controller_test.rb	(revision 1156)
+++ test/functional/flexible_criteria_controller_test.rb	(revision 1183)
@@ -4,6 +4,8 @@
 
 class FlexibleCriteriaControllerTest < AuthenticatedControllerTest
   
+  fixtures :all
+  
   FLEXIBLE_CRITERIA_CSV_STRING = "criterion1,10.0,\"description1, for criterion 1\"\ncriterion2,10.0,\"description2, \"\"with quotes\"\"\"\n"
   FLEXIBLE_CRITERIA_UPLOAD_CSV_STRING = "criterion3,10.0,\"description3, for criterion 3\"\ncriterion4,10.0,\"description4, \"\"with quotes\"\"\"\n"
   FLEXIBLE_CRITERIA_INCOMPLETE_UPLOAD_CSV_STRING = "criterion5\ncriterion6\n"
@@ -382,4 +384,4 @@
     
   end
 
-end
\ No newline at end of file
+end
Index: test/functional/submissions_controller_test.rb
===================================================================
--- test/functional/submissions_controller_test.rb	(revision 1156)
+++ test/functional/submissions_controller_test.rb	(revision 1183)
@@ -4,9 +4,9 @@
 
 class SubmissionsControllerTest < AuthenticatedControllerTest
 
-  fixtures  :users, :assignments, :rubric_criteria, :marks, :submission_rules
+  fixtures  :all
   set_fixture_class :rubric_criteria => RubricCriterion
-
+  
   def setup
     @controller = SubmissionsController.new
     @request = ActionController::TestRequest.new
@@ -37,19 +37,21 @@
   end
   
   def test_students_can_use_file_manager
-    get_as(@student, :file_manager, {:id => Assignment.first.id})
+    assignment = assignments(:assignment_5)
+    get_as(@student, :file_manager, {:id => assignment.id})
     assert_response :success
   end
   
   def test_students_can_populate_file_manager
-    get_as(@student, :populate_file_manager, {:id => Assignment.first.id})
+    assignment = assignments(:assignment_5)
+    get_as(@student, :populate_file_manager, {:id => assignment.id})
     assert_response :success
   end
   
   def test_students_can_add_files
     file_1 = fixture_file_upload('files/Shapes.java', 'text/java')
     file_2 = fixture_file_upload('files/TestShapes.java', 'text/java')
-    assignment = Assignment.first
+    assignment = assignments(:assignment_5)
     assert @student.has_accepted_grouping_for?(assignment.id)
     post_as(@student, :update_files, {:id => assignment.id, :new_files => [file_1, file_2]})
     assert_redirected_to :action => 'file_manager'
@@ -62,7 +64,7 @@
   end
   
   def test_students_can_replace_files
-    assignment = Assignment.first
+    assignment = assignments(:assignment_5)
     assert @student.has_accepted_grouping_for?(assignment.id)
     grouping = @student.accepted_grouping_for(assignment.id)
      
@@ -102,7 +104,7 @@
   end 
   
   def test_students_can_delete_files
-    assignment = Assignment.first
+    assignment = assignments(:assignment_5)
     assert @student.has_accepted_grouping_for?(assignment.id)
     grouping = @student.accepted_grouping_for(assignment.id)
      
@@ -126,7 +128,7 @@
   end
   
   def test_student_cant_add_file_that_exists
-    assignment = Assignment.first
+    assignment = assignments(:assignment_5)
     assert @student.has_accepted_grouping_for?(assignment.id)
     grouping = @student.accepted_grouping_for(assignment.id)
      
@@ -138,12 +140,13 @@
   
     file_1 = fixture_file_upload('files/Shapes.java', 'text/java')
     file_2 = fixture_file_upload('files/TestShapes.java', 'text/java')
-    assignment = Assignment.first
+    assignment = assignments(:assignment_5)
     assert @student.has_accepted_grouping_for?(assignment.id)
     post_as(@student, :update_files, {:id => assignment.id, :new_files => [file_1, file_2]})
-    assert_redirected_to :action => 'file_manager'
     # Check to see if the file was added
+    assert_redirected_to :action => 'file_manager', :id => assignment.id
     grouping = @student.accepted_grouping_for(assignment.id)
+    assert grouping.is_valid?
     revision = grouping.group.repo.get_latest_revision
     files = revision.files_at_path(assignment.repository_folder)
     assert_not_nil files['Shapes.java']
@@ -151,14 +154,11 @@
     assert_not_nil flash[:update_conflicts]
   end
   
-  def test_student_cant_replace_file_if_out_of_sync
-    assert false
-  end
+  # TODO:  Test that a student can't replace file if out of sync
   
-  def test_student_cant_replace_file_with_diff_name_file
-    assert false
-  end
-
+  # TODO:  Test that a student can't replace a file if the new file
+  # has a different name
+  
   def test_students_cant_use_repo_browser
     get_as(@student, :repo_browser, {:id => Grouping.last.id})
     assert_response :missing
@@ -191,40 +191,11 @@
     assert_response :success
   end
   
-  # TODO: TEST POPULATE REPO BROWSER HERE
+  # TODO:
   
-  def test_can_release_completed_results
-    assert false
-  end
+  # Test whether or not an Instructor can release/unrelease results correctly
+  # Test whether or not an Instructor can download files from student repos
   
-  def test_can_release_multiple_results
-    assert false
-  end
-  
-  def test_cant_release_non_completed_results
-    assert false
-  end
-  
-  def test_cant_release_non_existent_results
-    assert false
-  end
-  
-  def test_can_unrelease_any_results
-    assert false
-  end
-  
-  def test_can_download_file_from_root
-    assert false
-  end
-  
-  def test_can_download_file_from_subdirectory
-    assert false
-  end
-  
-  def test_can_download_file_from_previous_revision
-    assert false
-  end
-  
   context "A logged in student doing a GET" do
     
     setup do
Index: test/functional/annotation_categories_controller_test.rb
===================================================================
--- test/functional/annotation_categories_controller_test.rb	(revision 1156)
+++ test/functional/annotation_categories_controller_test.rb	(revision 1183)
@@ -4,6 +4,8 @@
 
 class AnnotationCategoriesControllerTest < AuthenticatedControllerTest
 
+  fixtures :all
+
   context "An unauthenticated and unauthorized user doing a GET" do
 
     # Since we are not authenticated and authorized, we should be redirected
Index: test/functional/groups_controller_test.rb
===================================================================
--- test/functional/groups_controller_test.rb	(revision 1156)
+++ test/functional/groups_controller_test.rb	(revision 1183)
@@ -3,9 +3,9 @@
 require 'fastercsv'
 
 class GroupsControllerTest < AuthenticatedControllerTest
-  
+  fixtures :all
+
   context "An authenticated and authorized student doing a " do
-    fixtures :users, :assignments
     
     setup do
       @student = users(:student1)
@@ -97,7 +97,6 @@
   end #student context
   
   context "An authenticated and authorized admin doing a " do
-    fixtures :users, :assignments, :groupings, :groups, :memberships
     
     setup do
       @admin = users(:olm_admin_1)
@@ -132,14 +131,21 @@
       
       context "on inviter" do
         setup do
-          membership = memberships(:membership1)
-          delete_as @admin, :remove_member, {:id => @assignment.id, :grouping_id  => @grouping.id, :mbr_id => membership.id}
+          # Find the inviter
+          @student = @grouping.inviter
+          @membership = @grouping.student_memberships.find_by_membership_status(StudentMembership::STATUSES[:inviter])
+          assert_not_nil @membership
+          delete_as @admin, :remove_member, {:id => @assignment.id, :grouping_id  => @grouping.id, :mbr_id => @membership.id}
         end
         should_respond_with :success
         should_render_template 'remove_member.rjs'
         should_assign_to :mbr_id, :assignment, :grouping
         should "assign @inviter accordingly" do
-          assert_nil assigns(:inviter)
+          @grouping.reload
+          if @grouping.accepted_student_memberships.length > 0
+            assert assigns(:inviter)
+            assert_not_nil @grouping.inviter
+          end
         end
       end
       
@@ -277,6 +283,113 @@
       
     end
     
+    context "POST on :global_actions on random_assign" do
+      setup do
+          # Remove TAs from all groupings used...
+          groupings(:grouping_2).remove_ta_by_id(users(:ta1).id)
+          groupings(:grouping_5).remove_ta_by_id(users(:ta3).id)
+          groupings(:grouping_6).remove_ta_by_id(users(:ta3).id)
+      end
+      
+      context "and no graders selected" do
+        setup do
+          post_as @admin, :global_actions, {:id => @assignment.id, :global_actions => "", :submit_type => "random_assign"}
+        end
+        should_assign_to(:error) { I18n.t( 'groups.no_graders_selected') }
+      end
+      
+      context "and no groups selected, at least one grader" do
+        setup do
+          post_as @admin, :global_actions, {:id => @assignment.id, :global_actions => "", :submit_type => "random_assign", :graders => [users(:ta1).id]}
+        end
+        should_assign_to(:error) { I18n.t( 'groups.no_groups_selected') }
+      end
+      
+      context "and one grader and one group is selected" do
+        setup do
+          post_as @admin, :global_actions, {:id => @assignment.id, :global_actions => "", :submit_type => "random_assign", :groupings => [groupings(:grouping_1).id], :graders => [users(:ta1).id]}
+        end
+        should "assign grader to group accordingly" do
+          assert_same_elements groupings(:grouping_1).get_ta_names, [users(:ta1).user_name]
+        end
+        should "not assign that grader to non selected groups" do
+          assert_same_elements groupings(:grouping_2).get_ta_names, []
+          assert_same_elements groupings(:grouping_3).get_ta_names, []
+          assert_same_elements groupings(:grouping_4).get_ta_names, []
+          assert_same_elements groupings(:grouping_5).get_ta_names, []
+          assert_same_elements groupings(:grouping_6).get_ta_names, []
+        end
+      end
+      
+      context "and one grader and multiple groups are selected" do
+        setup do
+          post_as @admin, :global_actions, {:id => @assignment.id, :global_actions => "", :submit_type => "random_assign", :groupings => [groupings(:grouping_1).id,groupings(:grouping_2).id,groupings(:grouping_3).id], :graders => [users(:ta1).id]}
+        end
+        should "assign that grader to all groups accordingly" do
+          assert_same_elements groupings(:grouping_1).get_ta_names, [users(:ta1).user_name]
+          assert_same_elements groupings(:grouping_2).get_ta_names, [users(:ta1).user_name]
+          assert_same_elements groupings(:grouping_3).get_ta_names, [users(:ta1).user_name]
+        end
+        should "not assign that grader to non selected groups" do
+          assert_same_elements groupings(:grouping_4).get_ta_names, []
+          assert_same_elements groupings(:grouping_5).get_ta_names, []
+          assert_same_elements groupings(:grouping_6).get_ta_names, []
+        end
+      end
+      
+      context "and two graders and one group is selected" do
+        setup do
+          post_as @admin, :global_actions, {:id => @assignment.id, :global_actions => "", :submit_type => "random_assign", :groupings => [groupings(:grouping_3).id], :graders => [users(:ta1).id,users(:ta2).id]}
+        end
+        should "assign one grader to selected group" do
+          # Getting count as graders are assigned randomly. Should only have one grader.
+          assert_equal groupings(:grouping_3).get_ta_names.size, 1
+        end
+        should "not assign that grader to non-selected groups" do
+          assert_same_elements groupings(:grouping_1).get_ta_names, []
+          assert_same_elements groupings(:grouping_2).get_ta_names, []
+          assert_same_elements groupings(:grouping_4).get_ta_names, []
+          assert_same_elements groupings(:grouping_5).get_ta_names, []
+          assert_same_elements groupings(:grouping_6).get_ta_names, []
+        end
+      end
+      
+      context "and two graders and multiple groups are selected" do
+        setup do
+          post_as @admin, :global_actions, {:id => @assignment.id, :global_actions => "", :submit_type => "random_assign", :groupings => [groupings(:grouping_2).id,groupings(:grouping_4).id,groupings(:grouping_5).id], :graders => [users(:ta1).id,users(:ta2).id]}
+        end
+        should "assign one grader to each selected group" do
+          # Getting count as graders are assigned randomly. Should only have one grader each.
+          assert_equal groupings(:grouping_2).get_ta_names.size, 1
+          assert_equal groupings(:grouping_4).get_ta_names.size, 1
+          assert_equal groupings(:grouping_5).get_ta_names.size, 1
+        end
+        should "not assign that grader to non-selected groups" do
+          assert_same_elements groupings(:grouping_1).get_ta_names, []
+          assert_same_elements groupings(:grouping_3).get_ta_names, []
+          assert_same_elements groupings(:grouping_6).get_ta_names, []
+        end
+      end
+      
+      context "and multiple graders and multiple groups are selected" do
+        setup do
+          post_as @admin, :global_actions, {:id => @assignment.id, :global_actions => "", :submit_type => "random_assign", :groupings => [groupings(:grouping_1).id,groupings(:grouping_2).id,groupings(:grouping_4).id,groupings(:grouping_5).id,groupings(:grouping_6).id], :graders => [users(:ta1).id,users(:ta2).id,users(:ta2).id]}
+        end
+        should "assign one grader to each selected group" do
+          # Getting count as graders are assigned randomly. Should only have one grader each.
+          assert_equal groupings(:grouping_1).get_ta_names.size, 1
+          assert_equal groupings(:grouping_2).get_ta_names.size, 1
+          assert_equal groupings(:grouping_4).get_ta_names.size, 1
+          assert_equal groupings(:grouping_5).get_ta_names.size, 1
+          assert_equal groupings(:grouping_6).get_ta_names.size, 1
+        end
+        should "not assign graders to non selected groups" do
+          assert_same_elements groupings(:grouping_3).get_ta_names, []
+        end
+      end
+      
+    end
+    
     context "POST on :add_member" do
       
       context "with an empty username field" do
Index: test/functional/main_controller_test.rb
===================================================================
--- test/functional/main_controller_test.rb	(revision 1156)
+++ test/functional/main_controller_test.rb	(revision 1183)
@@ -5,14 +5,13 @@
 
 class MainControllerTest < AuthenticatedControllerTest
   
-  fixtures :users
+  fixtures :all
   
   # TODO need to change username and password for valid logins when 
   # actual authentication is in place (i.e. when User.verify is implemented)
   
-  
   def setup
-    @controller = CheckmarkController.new
+    @controller = MainController.new
     @request = ActionController::TestRequest.new
     @response = ActionController::TestResponse.new
   end
@@ -36,14 +35,14 @@
   def test_blank_login
     get :login
     post :login, :user_login => "", :user_password => "afds"
-    assert_equal "Your CDF login must not be blank.", flash[:login_notice]
+    assert_equal I18n.t(:username_not_blank), flash[:login_notice]
   end
   
   # Test if users see an error regarding missing information on login
   def test_blank_pwd
     get :login
     post :login, :user_login => "afds", :user_password => ""
-    assert_equal "Your password must not be blank.", flash[:login_notice]
+    assert_equal I18n.t(:password_not_blank), flash[:login_notice]
   end
   
   # Test if users with valid username and password can login and that 
@@ -61,7 +60,7 @@
   def test_second_try
     admin = users(:olm_admin_1)
     post :login, :user_login => "afds", :user_password => "lala"
-    assert_not_equal "", flash[:login_notice]
+    assert_equal I18n.t(:login_failed), flash[:login_notice]
     
     post :login, :user_login => admin.user_name, :user_password => "lala"
     assert_redirected_to :action => "index"
@@ -96,20 +95,10 @@
     assert_redirected_to :action => "index"
   end
   
-  # Authorization tests -------------------------------------------------
-   
-  # Test to make sure students or TAs cannot access students page
-  def test_authorized
+  def test_index
     user = users(:student1)
-    post :login, :user_login => user.user_name, :user_password => 'asfd'
-    get :students
-    assert_response 404
+    get_as user, :index
+    assert_redirected_to :controller => 'assignments', :action => 'index'
   end
-  
-  def test_index
-     user = users(:student1)
-     get_as user, :index
-     assert_response :success
-  end
-  
+    
 end
Index: test/functional/assignments_controller_test.rb
===================================================================
--- test/functional/assignments_controller_test.rb	(revision 1156)
+++ test/functional/assignments_controller_test.rb	(revision 1183)
@@ -4,7 +4,7 @@
 
 class AssignmentsControllerTest < AuthenticatedControllerTest
   
-  fixtures  :users, :assignments, :rubric_criteria, :marks, :submission_rules, :memberships
+  fixtures  :all
   set_fixture_class :rubric_criteria => RubricCriterion
   
   def setup
@@ -86,8 +86,6 @@
     grouping.id} )
     assert !student.has_accepted_grouping_for?(assignment.id), "should not
     have accepted groupings for this assignment"
-    assert !student.has_pending_groupings_for?(assignment.id), "should
-    not have pending groupings for this assignment"
   end
 
   def test_create_group_working_alone
@@ -288,10 +286,12 @@
     membership = memberships(:membership5)
     user = users(:student4)
     student = users(:student5)
+    original_grouping_num = student.pending_groupings.length
     post_as(user, :disinvite_member, {:id => assignment.id, :membership => membership.id})
+    student.reload
     assert_response :success
     assert_equal("Member disinvited", flash[:edit_notice])
-    assert !student.has_pending_groupings_for?(assignment.id)
+    assert_equal original_grouping_num - 1, student.pending_groupings.length
   end
 
 
@@ -328,18 +328,36 @@
     assert_response :success
   end
 
-  def test_deletegroup
+  def test_cant_delete_group_if_submitted
     user = users(:student4)
     grouping = groupings(:grouping_2)
     assignment = grouping.assignment
     assignment.group_min = 4
     assignment.save
+    assert grouping.has_submission?
     assert !grouping.is_valid?
     post_as(user, :deletegroup, {:id => assignment.id, :grouping_id => grouping.id})
     assert_redirected_to :action => "student_interface", :id => assignment.id
+    assert_equal(I18n.t('groups.cant_delete_already_submitted'), flash[:fail_notice])
+    assert user.has_accepted_grouping_for?(assignment.id)
+  end
+
+  def test_can_delete_group_if_nothing_submitted
+    user = users(:student4)
+    grouping = groupings(:grouping_2)
+    # If there are any submissions for this Grouping, destroy
+    grouping.submissions.destroy_all
+    assert grouping.submissions.empty?
+    assignment = grouping.assignment
+    assignment.group_min = 4
+    assignment.save
+    assert !grouping.is_valid?
+    post_as(user, :deletegroup, {:id => assignment.id, :grouping_id => grouping.id})
+    assert_redirected_to :action => "student_interface", :id => assignment.id
     assert_equal("Group has been deleted", flash[:edit_notice])
     assert !user.has_accepted_grouping_for?(assignment.id)
   end
+
  
   context "A valid grouping if user is the inviter" do
 
@@ -350,15 +368,35 @@
       user = grouping.inviter
       assignment = grouping.assignment
       assignment.group_min = 1
+      assignment.group_max = 2
       assignment.save
       # we don't want submissions for this test
       grouping.submissions.destroy_all
+      assert grouping.submissions.empty?
       assert grouping.is_valid?
       post_as(user, :deletegroup, {:id => assignment.id, :grouping_id => grouping.id})
       assert_redirected_to :action => "student_interface", :id => assignment.id
       assert_equal("Group has been deleted", flash[:edit_notice])
       assert !user.has_accepted_grouping_for?(assignment.id)
     end
+    
+    should "not be possible to delete if assignment is not group assignment" do
+      student_membership = memberships(:membership6)
+      grouping = student_membership.grouping
+      user = grouping.inviter
+      assignment = grouping.assignment
+      assignment.group_min = 1
+      assignment.save
+      assignment.reload
+      assert !assignment.group_assignment?
+      # we don't want submissions for this test
+      grouping.submissions.destroy_all
+      assert grouping.is_valid?
+      post_as(user, :deletegroup, {:id => assignment.id, :grouping_id => grouping.id})
+      assert_redirected_to :action => "student_interface", :id => assignment.id
+      assert_equal(I18n.t('groups.cant_delete'), flash[:fail_notice])
+      assert user.has_accepted_grouping_for?(assignment.id)
+    end
 
     should "not be possible to delete if inviter is NOT the only member" do
       student_membership = memberships(:membership1)
@@ -371,7 +409,7 @@
       assert grouping.is_valid?
       post_as(user, :deletegroup, {:id => assignment.id, :grouping_id => grouping.id})
       assert_redirected_to :action => "student_interface", :id => assignment.id
-      assert_not_nil(flash[:fail_notice])
+      assert_equal I18n.t('groups.cant_delete'), flash[:fail_notice]
       assert user.has_accepted_grouping_for?(assignment.id)
     end
 
@@ -393,7 +431,7 @@
     assignment = grouping.assignment
     grouping.invite(users(:student6).user_name, set_membership_status=StudentMembership::STATUSES[:accepted])
     post_as(users(:student6), :deletegroup, {:id => assignment.id})
-    assert_equal("Only the inviter can delete the group", flash[:fail_notice])
+    assert_equal(I18n.t('groups.cant_delete'), flash[:fail_notice])
     assert user.has_accepted_grouping_for?(assignment.id)
   end  
   
@@ -401,16 +439,14 @@
     user = users(:student4)
     grouping = groupings(:grouping_2)
     assignment = grouping.assignment
-    assignment.group_min = 2
-    assignment.save
-    grouping.invite(users(:student6).user_name, set_membership_status=StudentMembership::STATUSES[:accepted])
     grouping.create_grouping_repository_folder
     assert grouping.is_valid?
     Submission.create_by_timestamp(grouping, Time.now)
     grouping = Grouping.find(grouping.id)
     assert grouping.has_submission?   
-    post_as(users(:student4), :deletegroup, {:id => assignment.id})
-    assert_equal("You already submitted something. You cannot delete your group.", flash[:fail_notice])
+    inviter = grouping.inviter
+    post_as(inviter, :deletegroup, {:id => assignment.id})
+    assert_equal(I18n.t('groups.cant_delete_already_submitted'), flash[:fail_notice])
     assert user.has_accepted_grouping_for?(assignment.id)
   end
 
@@ -449,7 +485,7 @@
         if final_mark.blank?
           if student.has_accepted_grouping_for?(assignments[index])
             grouping = student.accepted_grouping_for(assignments[index])
-            assert !grouping.has_submission?
+            assert !grouping.has_submission? || assignments[index].total_mark == 0
           else
             # Student didn't have a grouping, so it was OK that this
             # column was blank
@@ -461,7 +497,7 @@
           assert grouping.has_submission?
           submission = grouping.get_submission_used
           assert_not_nil submission.result
-          assert_equal final_mark.to_f, (submission.result.total_mark / out_of * 100).to_f
+          assert_equal final_mark.to_f.round, (submission.result.total_mark / out_of * 100).to_f.round
         end
       end
       
@@ -714,9 +750,6 @@
   
   # TODO:  A test to make sure that @a_id_results from index actually
   # does proper computing of averages/etc
-  def test_student_gets_accurate_average_per_assignment
-    assert false
-  end
   
   def test_on_index_grader_gets_assignment_list
     get_as(users(:ta1), :index)
@@ -794,7 +827,7 @@
     # Create some pending invitations for this student
     invitations = 0
     assignment.groupings.each do |some_grouping|
-      if some_grouping.student_memberships.length > 0
+      if !some_grouping.inviter.nil?
         invitations = invitations + 1
         some_grouping.invite(student.user_name)
       end
@@ -803,7 +836,9 @@
     get_as(users(:student1), :student_interface, :id => assignment.id)
     assert_response :success
     assert assigns(:pending_grouping)
+    assert invitations > 0
     assert_equal invitations, assigns(:pending_grouping).length
+
   end
   
   def test_should_get_student_interface_working_in_group_student
Index: test/functional/results_controller_test.rb
===================================================================
--- test/functional/results_controller_test.rb	(revision 1156)
+++ test/functional/results_controller_test.rb	(revision 1183)
@@ -3,7 +3,9 @@
 require 'mocha'
 
 class ResultsControllerTest < AuthenticatedControllerTest
-  
+
+  fixtures :all
+
   SAMPLE_ERR_MSG = "sample error message"
   
   context "An unauthenticated and unauthorized user doing a" do
@@ -372,12 +374,76 @@
     end
     
     context "GET on :edit with RubricCriterion" do
-      setup do
-        get_as @admin, :edit, :id => @released_result.id
+      context "with 2 partial and 1 released/completed results" do
+        setup do
+          @result_first = results(:result_1)
+          @result_second = results(:result_2)
+          # Don't ask me why the third one in the results is
+          # called result_4...I think our fixtures got messed up.
+          @result_third = results(:result_4)
+        end
+        context "when editing first result" do
+          setup do
+            get_as @admin, :edit, :id => @result_first.id
+          end
+          should "have set next_submission and prev_submission correctly" do
+            assert assigns(:next_grouping)
+            next_grouping = assigns(:next_grouping)
+            assert next_grouping.has_submission?
+            next_result = next_grouping.get_submission_used.result
+            assert_not_nil next_result
+            assert_equal next_result, @result_second
+            assert !next_result.released_to_students
+            assert_nil assigns(:previous_grouping)
+          end
+          should_not_set_the_flash 
+          should_render_template :edit
+          should_respond_with :success 
+        end
+        context "when editing second result" do
+          setup do
+            get_as @admin, :edit, :id => @result_second.id
+          end
+          should "have set next_submission and prev_submission correctly" do
+            assert assigns(:next_grouping)
+            assert assigns(:previous_grouping)
+            next_grouping = assigns(:next_grouping)
+            previous_grouping = assigns(:previous_grouping)
+            assert next_grouping.has_submission?
+            assert previous_grouping.has_submission?
+            next_result = next_grouping.get_submission_used.result
+            previous_result = previous_grouping.get_submission_used.result
+            assert_not_nil next_result
+            assert_not_nil previous_result
+            assert_equal next_result, @result_third
+            assert_equal previous_result, @result_first
+            assert next_result.released_to_students
+            assert !previous_result.released_to_students
+          end
+          should_not_set_the_flash 
+          should_render_template :edit
+          should_respond_with :success 
+        end
+        context "when editing third result" do
+          setup do
+            get_as @admin, :edit, :id => @result_third.id
+          end
+          should "have set next_submission and prev_submission correctly" do
+            assert_nil assigns(:next_grouping)
+            assert assigns(:previous_grouping)
+            previous_grouping = assigns(:previous_grouping)
+            assert previous_grouping.has_submission?
+            previous_result = previous_grouping.get_submission_used.result
+            assert_not_nil previous_result
+            assert_equal previous_result, @result_second
+            assert !previous_result.released_to_students
+          end
+          should_not_set_the_flash 
+          should_render_template :edit
+          should_respond_with :success 
+        end
+
       end
-      should_not_set_the_flash 
-      should_render_template :edit
-      should_respond_with :success
     end
     
     context "GET on :edit with FlexibleCriterion" do
Index: test/functional/api/test_results_controller_test.rb
===================================================================
--- test/functional/api/test_results_controller_test.rb	(revision 1156)
+++ test/functional/api/test_results_controller_test.rb	(revision 1183)
@@ -5,6 +5,8 @@
 # Tests the test results handlers (create, destroy, update, show)
 class Api::TestResultsControllerTest < ActionController::TestCase
 
+  fixtures :all
+
   context "An authenticated GET request to api/test_results" do
     setup do
       admin = users(:api_admin)
Index: test/functional/note_controller_test.rb
===================================================================
--- test/functional/note_controller_test.rb	(revision 1156)
+++ test/functional/note_controller_test.rb	(revision 1183)
@@ -2,7 +2,8 @@
 require 'shoulda'
 
 class NoteControllerTest < AuthenticatedControllerTest
-  fixtures :users, :assignments, :groupings
+
+  fixtures :all
   
   # Security test - these should all fail
   context "An authenticated and authorized student doing a " do    
@@ -152,7 +153,7 @@
     
     context "GET on :new_update_groupings" do
       setup do
-        get_as @ta, :new_update_groupings
+        get_as @ta, :new_update_groupings, :assignment_id => @assignment.id
       end
       should_respond_with :success
       should_render_template 'new_update_groupings.rjs'
@@ -294,7 +295,7 @@
     
     context "GET on :new_update_groupings" do
       setup do
-        get_as @admin, :new_update_groupings
+        get_as @admin, :new_update_groupings, :assignment_id => @assignment.id
       end
       should_respond_with :success
       should_render_template 'new_update_groupings.rjs'
Index: test/functional/grade_entry_forms_controller_test.rb
===================================================================
--- test/functional/grade_entry_forms_controller_test.rb	(revision 1156)
+++ test/functional/grade_entry_forms_controller_test.rb	(revision 1183)
@@ -2,7 +2,8 @@
 require 'shoulda'
 
 class GradeEntryFormsControllerTest < AuthenticatedControllerTest
-  fixtures :grade_entry_forms, :users
+
+  fixtures :all
   
   # Constants for :edit tests
   NEW_SHORT_IDENTIFIER = "NewSI"
Index: test/functional/rubrics_controller_test.rb
===================================================================
--- test/functional/rubrics_controller_test.rb	(revision 1156)
+++ test/functional/rubrics_controller_test.rb	(revision 1183)
@@ -4,6 +4,8 @@
 
 class RubricsControllerTest < AuthenticatedControllerTest
   
+  fixtures :all
+  
   RUBRIC_CRITERIA_CSV_STRING = "Algorithm Design,2.0,Horrible,Poor,Satisfactory,Good,Excellent,,,,,
 Documentation,2.7,Horrible,Poor,Satisfactory,Good,Excellent,,,,,
 Testing,2.2,Horrible,Poor,Satisfactory,Good,Excellent,,,,,
Index: test/functional/students_controller_test.rb
===================================================================
--- test/functional/students_controller_test.rb	(revision 1156)
+++ test/functional/students_controller_test.rb	(revision 1183)
@@ -1,6 +1,9 @@
 require File.dirname(__FILE__) + '/authenticated_controller_test'
 
 class StudentsControllerTest < AuthenticatedControllerTest
+
+  fixtures :all
+
   def setup
     @student = users(:student2)
     @admin = users(:olm_admin_1)
@@ -49,39 +52,6 @@
     assert_response :success
   end
 
-  def test_filter_all1
-    get_as(@admin, :filter)
-    assert_response :success
-  end
-
-  def test_filter_all2
-    get_as(@admin, :filter)
-    assert_equal(Student.all.count, @students.count, "should be the same
-    number")
-  end
-
-
-  def test_filter_hidden
-    get_as(@admin, :filter, :filter => "hidden")
-    assert_response :success
-  end
-
-  def test_filter_hidden2
-    get_as(@admin, :filter, :filter => "hidden")
-    assert_equal(1, @students.count, "should be equal to 1")
-  end
-
-  def test_filter_visible
-    get_as(@admin, :filter, :filter => "visible")
-    assert_response :success
-  end
-
-  def test_filter_visible2
-    student_number = Student.all.count - 1
-    get_as(@admin, :filter, :filter => "visible")
-    assert_equal(student_number, @students.count)
-  end
-
   def test_create
     student = users(:student1)
     post_as(@admin, :create, :user => {:user_name => 'Essai',:id => student.id, :last_name => 'ESSAI', :first_name => 'essai'})
@@ -100,6 +70,7 @@
     student = users(:student1)
     post_as(@admin, :update, :user => {:id => student.id, :last_name =>
     'ESSAI', :first_name => 'essai'})
+    student.reload
     assert_equal("ESSAI", student.last_name, 'should have been updated to ESSAI')
   end
 
Index: test/fixtures/assignments.yml
===================================================================
--- test/fixtures/assignments.yml	(revision 1156)
+++ test/fixtures/assignments.yml	(revision 1183)
@@ -206,3 +206,38 @@
    repository_folder: test_results1
    marking_scheme_type: "rubric"
    allow_web_submits: true
+   
+assignment_with_web_submit:
+   short_identifier: WS
+   description: "With Web Submit" 
+   message: 
+   due_date: <%= 30.days.from_now.to_s(:db)%>
+   group_min: 1
+   group_max: 1
+   student_form_groups: false
+   instructor_form_groups: true
+   group_name_autogenerated: true
+   group_name_displayed: false
+   created_at: <%= Time.now.to_s(:db)%>
+   updated_at: <%= Time.now.to_s(:db)%>
+   repository_folder: WithWebSubmit
+   marking_scheme_type: "rubric"
+   allow_web_submits: true
+
+assignment_without_web_submit:
+   short_identifier: NoWS
+   description: "Without Web Submit" 
+   message: 
+   due_date: <%= 30.days.from_now.to_s(:db)%>
+   group_min: 1
+   group_max: 1
+   student_form_groups: false
+   instructor_form_groups: true
+   group_name_autogenerated: true
+   group_name_displayed: false
+   created_at: <%= Time.now.to_s(:db)%>
+   updated_at: <%= Time.now.to_s(:db)%>
+   repository_folder: WithWebSubmit
+   marking_scheme_type: "rubric"
+   allow_web_submits: false
+
Index: test/fixtures/groupings.yml
===================================================================
--- test/fixtures/groupings.yml	(revision 1156)
+++ test/fixtures/groupings.yml	(revision 1183)
@@ -53,4 +53,3 @@
 grouping_test_result1:
    group_id: <%= Fixtures.identify(:group_test_result1) %>
    assignment_id: <%= Fixtures.identify(:assignment_test_result1) %>
-   
Index: test/fixtures/memberships.yml
===================================================================
--- test/fixtures/memberships.yml	(revision 1156)
+++ test/fixtures/memberships.yml	(revision 1183)
@@ -112,7 +112,8 @@
    type:               StudentMembership
    created_at:         <%= Time.now.to_s(:db)%>
    updated_at:         <%= Time.now.to_s(:db)%>
-   
+
+  
 membership_4:
    user_id:            <%= Fixtures.identify(:ta3) %>
    grouping_id:        <%= Fixtures.identify(:grouping_flexible_2) %>
@@ -137,7 +138,7 @@
    created_at:         <%= Time.now.to_s(:db)%>
    updated_at:         <%= Time.now.to_s(:db)%>   
 
-membership_2:
+membership_7:
    user_id:            <%= Fixtures.identify(:ta3) %>
    grouping_id:        <%= Fixtures.identify(:grouping_6) %>
    membership_status:
@@ -145,3 +146,11 @@
    created_at:         <%= Time.now.to_s(:db)%>
    updated_at:         <%= Time.now.to_s(:db)%>
 
+membership_8:
+   user_id:            <%= Fixtures.identify(:student2) %>
+   grouping_id:        <%= Fixtures.identify(:grouping_5) %>
+   membership_status:  accepted
+   type:               StudentMembership
+   created_at:         <%= Time.now.to_s(:db)%>
+   updated_at:         <%= Time.now.to_s(:db)%>
+
Index: app/helpers/groups_helper.rb
===================================================================
--- app/helpers/groups_helper.rb	(revision 1156)
+++ app/helpers/groups_helper.rb	(revision 1183)
@@ -1,14 +1,14 @@
 module GroupsHelper
 
   
-  def randomly_assign_graders(graders, groupings)
-    graders = params[:graders]
+  def randomly_assign_graders(grader_ids, grouping_ids)
     # Shuffle the groupings
+    groupings = Grouping.find(:all, :conditions => { :id => grouping_ids })
     groupings = groupings.sort_by{rand}
     # Now, deal them out like cards...
     groupings.each_with_index do |grouping, index|
       # Choose the next grader to deal out to...
-      grader = graders[index % graders.size]
+      grader = grader_ids[index % grader_ids.size]
       grouping.add_ta_by_id(grader) 
     end
   end
Index: app/helpers/main_helper.rb
===================================================================
--- app/helpers/main_helper.rb	(revision 1156)
+++ app/helpers/main_helper.rb	(revision 1183)
@@ -10,12 +10,14 @@
   def get_blank_message(blank_login, blank_password)
     return "" unless blank_login || blank_password
     
-    message = "Your "
-    message += "user name " if blank_login
-    message += "and " if blank_login && blank_password
-    message += "password " if blank_password
-    
-    message + "must not be blank."
+    if blank_login && blank_password
+      message = I18n.t(:username_and_password_not_blank)
+    elsif blank_login
+      message = I18n.t(:username_not_blank)
+    elsif blank_password
+      message = I18n.t(:password_not_blank)
+    end
+  
   end
   
 end
Index: app/models/submission_rule.rb
===================================================================
--- app/models/submission_rule.rb	(revision 1156)
+++ app/models/submission_rule.rb	(revision 1183)
@@ -63,6 +63,10 @@
     raise NotImplementedError.new("SubmissionRule:  description_of_rule not implemented")
   end
   
+  def grader_tab_partial(grouping)
+    raise NotImplementedError.new("SubmissionRule:  render_grader_tab not implemented")
+  end
+  
   private
   
   def calculate_overtime_hours_from(from_time)
Index: app/models/grace_period_submission_rule.rb
===================================================================
--- app/models/grace_period_submission_rule.rb	(revision 1156)
+++ app/models/grace_period_submission_rule.rb	(revision 1183)
@@ -94,6 +94,10 @@
     I18n.t 'submission_rules.grace_period_submission_rule.description'
   end
 
+  def grader_tab_partial
+    return 'submission_rules/grace_period/grader_tab'
+  end
+
   private 
   
   def hours_sum
Index: app/models/grouping.rb
===================================================================
--- app/models/grouping.rb	(revision 1156)
+++ app/models/grouping.rb	(revision 1183)
@@ -18,6 +18,7 @@
   has_many :pending_students, :class_name => 'Student', :through => :student_memberships, :conditions => {'memberships.membership_status' => StudentMembership::STATUSES[:pending]}, :source => :user
   
   has_many :submissions
+  has_many :grace_period_deductions, :through => :student_memberships
   
   named_scope :approved_groupings, :conditions => {:admin_approved => true}
     
@@ -27,11 +28,7 @@
   
   validates_presence_of   :group_id, :message => "needs an group id"
   validates_associated    :group,    :message => "associated group need to be valid"
-  
-  def inviter?
-    return membership_status == StudentMembership::STATUSES[:inviter]
-  end
-  
+    
   def group_name_with_student_user_names
     student_user_names = student_memberships.collect {|m| m.user.user_name }
     return group.group_name if student_user_names.size == 0
@@ -159,6 +156,10 @@
     end
     return total.min
   end
+  
+  def grace_period_deduction_sum
+    return grace_period_deductions.sum('deduction')
+  end
 
   # Submission Functions
   def has_submission?
@@ -184,14 +185,14 @@
       #   Corner case: members are removed by admins only.
       #   Hence, we do not require to check for validity of the group
       revoke_repository_permissions_for_membership(member)
+      member.destroy
       if member.membership_status == StudentMembership::STATUSES[:inviter]
-         if member.grouping.student_membership_number > 1
-            membership = member.grouping.accepted_students[1].memberships.find_by_grouping_id(member.grouping.id) 
+         if member.grouping.accepted_student_memberships.length > 0
+            membership = member.grouping.accepted_student_memberships.first
             membership.membership_status = StudentMembership::STATUSES[:inviter]
             membership.save
          end
       end
-      member.destroy
     end
   end
 
Index: app/models/assignment.rb
===================================================================
--- app/models/assignment.rb	(revision 1156)
+++ app/models/assignment.rb	(revision 1183)
@@ -397,7 +397,7 @@
           submission = grouping.get_submission_used
           final_result.push(submission.result.total_mark / out_of * 100)
           rubric_criteria.each do |rubric_criterion|
-            mark = submission.result.marks.find_by_rubric_criterion_id(rubric_criterion.id)
+            mark = submission.result.marks.find_by_markable_id_and_markable_type(rubric_criterion.id, "RubricCriterion")
             if mark.nil?
               final_result.push('')
             else
Index: app/models/penalty_period_submission_rule.rb
===================================================================
--- app/models/penalty_period_submission_rule.rb	(revision 1156)
+++ app/models/penalty_period_submission_rule.rb	(revision 1183)
@@ -52,6 +52,10 @@
   def description_of_rule
     I18n.t 'submission_rules.penalty_period_submission_rule.description'
   end
+  
+  def grader_tab_partial
+    return 'submission_rules/penalty_period/grader_tab'
+  end
 
   private 
   
Index: app/models/no_late_submission_rule.rb
===================================================================
--- app/models/no_late_submission_rule.rb	(revision 1156)
+++ app/models/no_late_submission_rule.rb	(revision 1183)
@@ -35,5 +35,8 @@
   def description_of_rule
     I18n.t 'submission_rules.no_late_submission_rule.description'
   end
-
+  
+  def grader_tab_partial
+    return 'submission_rules/no_late/grader_tab'
+  end
 end
Index: app/controllers/submissions_controller.rb
===================================================================
--- app/controllers/submissions_controller.rb	(revision 1156)
+++ app/controllers/submissions_controller.rb	(revision 1183)
@@ -41,6 +41,9 @@
                  return -1 if !a.has_submission?
                  return 1 if !b.has_submission?
                  return a.get_submission_used.result.total_mark <=> b.get_submission_used.result.total_mark
+               },
+               'grace_credits_used' => lambda { |a,b|
+                 return a.grace_period_deduction_sum <=> b.grace_period_deduction_sum
                }
              }
         }
@@ -304,12 +307,11 @@
           m_logger.log(msg)
         end
       end
-      
+
       # Are we past collection time?    
       if assignment.submission_rule.can_collect_now?
         flash[:commit_notice] = assignment.submission_rule.commit_after_collection_message(grouping)
       end
-      
       redirect_to :action => "file_manager", :id => assignment_id
       
     rescue Exception => e
Index: app/controllers/groups_controller.rb
===================================================================
--- app/controllers/groups_controller.rb	(revision 1156)
+++ app/controllers/groups_controller.rb	(revision 1183)
@@ -82,16 +82,9 @@
     @assignment = Assignment.find(params[:id])
     @grouping = Grouping.find(params[:grouping_id])
     member = @grouping.student_memberships.find(@mbr_id)  # use group as scope
-    if member.membership_status == StudentMembership::STATUSES[:inviter]
-        @inviter = true
-    end
-    
     @grouping.remove_member(member)
-    if @inviter
-      @inviter = @grouping.student_memberships.find_by_membership_status(StudentMembership::STATUSES[:inviter])
-    else 
-      @inviter = false
-    end
+    @grouping.reload
+    @inviter = @grouping.accepted_student_memberships.find_by_user_id(@grouping.inviter.id)
   end
   
   def add_group
@@ -298,10 +291,13 @@
     if params[:submit_type] == 'random_assign'
       begin 
         if params[:graders].nil?
-          raise "You must select at least one grader for random assignment"
+          raise t('groups.no_graders_selected')
         end
-        randomly_assign_graders(params[:graders], @assignment.groupings)
-        @groupings_data = construct_table_rows(@assignment.groupings, @assignment)
+        if params[:groupings].nil?
+          raise t('groups.no_groups_selected')
+        end
+        randomly_assign_graders(params[:graders], params[:groupings])
+        @groupings_data = construct_table_rows(Grouping.find(params[:groupings]), @assignment)
         render :action => "modify_groupings"
         return
       rescue Exception => e
Index: app/controllers/assignments_controller.rb
===================================================================
--- app/controllers/assignments_controller.rb	(revision 1156)
+++ app/controllers/assignments_controller.rb	(revision 1183)
@@ -152,7 +152,12 @@
             if submission.nil?
               row.push('')
             else
-              row.push(submission.result.total_mark / out_of * 100)
+              total_mark_percentage = submission.result.total_mark / out_of * 100
+              if total_mark_percentage.nan?
+                row.push('')
+              else
+                row.push(total_mark_percentage)
+              end
             end
           end
         end
@@ -222,13 +227,13 @@
       if @grouping.nil?
         raise "You do not currently have a group"
       end
-      if @grouping.has_submission?
-        raise "You already submitted something. You cannot delete your group."
-      end
       # If grouping is not deletable for @current_user for whatever reason, fail.
       if !@grouping.deletable_by?(@current_user)
-        raise "You are not allowed to delete the group"
+        raise I18n.t('groups.cant_delete')
       end
+      if @grouping.has_submission?
+        raise I18n.t('groups.cant_delete_already_submitted')
+      end
       @grouping.student_memberships.all(:include => :user).each do |member|
         member.destroy
       end
@@ -240,7 +245,11 @@
     
     rescue RuntimeError => e
       flash[:fail_notice] = e.message
-      m_logger.log(I18n.t("markus_logger.student_delete_group_fail", :user_name => current_user.user_name, :group => @grouping.group.group_name, :error => e.message), MarkusLogger::ERROR)
+      if @grouping.nil?
+        m_logger.log(I18n.t("markus_logger.student_delete_group_fail_no_grouping", :user_name => current_user.user_name, :error => e.message), MarkusLogger::ERROR)
+      else
+        m_logger.log(I18n.t("markus_logger.student_delete_group_fail", :user_name => current_user.user_name, :group => @grouping.group.group_name, :error => e.message), MarkusLogger::ERROR)
+      end
     end
     redirect_to :action => 'student_interface', :id => params[:id]
   end
Index: app/controllers/results_controller.rb
===================================================================
--- app/controllers/results_controller.rb	(revision 1156)
+++ app/controllers/results_controller.rb	(revision 1183)
@@ -59,7 +59,7 @@
     collection_time = @assignment.submission_rule.calculate_collection_time.localtime
     
     groupings.delete_if do |grouping|
-      grouping != @grouping && (grouping.marking_completed? || (!grouping.has_submission? && (Time.now < collection_time)))
+      grouping != @grouping && ((!grouping.has_submission? && (Time.now < collection_time)))
     end
     
     # We sort by Group name by default
@@ -302,6 +302,12 @@
     render :partial => 'results/marker/expand_unmarked_criteria', :locals => {:nil_marks => @nil_marks}
   end
   
+  def delete_grace_period_deduction
+    @grouping = Grouping.find(params[:id])
+    grace_deduction = GracePeriodDeduction.find(params[:deduction_id])
+    grace_deduction.destroy
+  end
+  
   private
   
   def retrieve_file(file)
Index: app/controllers/students_controller.rb
===================================================================
--- app/controllers/students_controller.rb	(revision 1156)
+++ app/controllers/students_controller.rb	(revision 1183)
@@ -55,18 +55,6 @@
     end
   end
 
-  def filter
-  case params[:filter]
-    when "hidden"
-       @students = Student.all(:conditions => {:hidden => true}, :order => :user_name)
-    when "visible"
-       @students = Student.all(:conditions => {:hidden => false}, :order => :user_name)
-    else
-      @students = Student.all(:order => :user_name)
-    end
-
-  end
-
   def create
     return unless request.post?
     # Default attributes: role = TA or role = STUDENT
@@ -116,5 +104,13 @@
     end
     redirect_to :action => 'index'
   end  
+  
+  def delete_grace_period_deduction
+    grace_deduction = GracePeriodDeduction.find(params[:id])
+    student_id = grace_deduction.membership.user.id
+    grace_deduction.destroy
+    student = Student.find(student_id)
+    @grace_period_deductions = student.grace_period_deductions
+  end
  
 end
Index: app/MARKUS_VERSION
===================================================================
--- app/MARKUS_VERSION	(revision 1156)
+++ app/MARKUS_VERSION	(revision 1183)
@@ -1 +1 @@
-VERSION=0.6,PATCH_LEVEL=0
+VERSION=0.6,PATCH_LEVEL=1
Index: app/views/groups/remove_member.rjs
===================================================================
--- app/views/groups/remove_member.rjs	(revision 1156)
+++ app/views/groups/remove_member.rjs	(revision 1183)
@@ -7,9 +7,8 @@
   :locals => {:students => @assignment.ungrouped_students}      
  
 if @inviter
-  
   # update the inviter
   page.replace_html "mbr_#{@inviter.id}",
     :partial => 'groups/manage/member', 
     :locals => {:grouping => @grouping, :member => @inviter}
-end
\ No newline at end of file
+end
Index: app/views/groups/manage.html.erb
===================================================================
--- app/views/groups/manage.html.erb	(revision 1156)
+++ app/views/groups/manage.html.erb	(revision 1183)
@@ -237,7 +237,7 @@
       </div>
       <div class="accordion-content">
 
-       <%= submit_tag "Randomly assign Graders", :id => "random_assign_graders", :name => "random_assign_graders", :confirm => "Are you sure you want to randomly assign selected graders to all groups?", :onclick => "$('submit_type').setValue('random_assign');" %>
+       <%= submit_tag  t('groups.randomly_assign_graders'), :id => "random_assign_graders", :name => "random_assign_graders", :confirm => t('groups.confirm_random_assign_graders'), :onclick => "$('submit_type').setValue('random_assign');" %>
        
        <%= render :partial => 'grader_list', :locals => {:tas => @tas} %>
 
Index: app/views/main/index.html.erb
===================================================================
--- app/views/main/index.html.erb	(revision 1156)
+++ app/views/main/index.html.erb	(revision 1183)
@@ -3,10 +3,10 @@
 <% end %>
 
 <div id="title_bar">
-   <h1>Dashboard</h1>
+   <h1><%= I18n.t(:dashboard) %></h1>
 </div>
 <div class="wrapLeft">
-  <p><%= h(@current_user.first_name) %>, welcome to <%= t(:markus) %>, the online marking tool.</p>
+  <p><%= h(@current_user.first_name) %>, <%= I18n.t(:welcome_to_markus) %></p>
   <div class="section">
     <%= render :partial => "api/key_display", :locals => { :user => @current_user } %>
   </div>
Index: app/views/main/login.html.erb
===================================================================
--- app/views/main/login.html.erb	(revision 1156)
+++ app/views/main/login.html.erb	(revision 1183)
@@ -1,5 +1,5 @@
 <div id="login">
-  <div id="login-greeting">Welcome to <%= t(:markus) %>!</div>
+  <div id="login-greeting"><%= I18n.t(:welcome_to) %></div>
 
   <div id="login-image">
     <%= image_tag("markus_logo_big.png", :alt => "[Logo] Markus Beta") %>
@@ -18,7 +18,7 @@
         <%= label_tag 'user_password', I18n.t(:password) %>
         <%= password_field_tag 'user_password', nil, :tabindex => 20 %><br />
   
-        <%= submit_tag "Log in", :disabled_with => 'Logging in...', :tabindex => 100, :class => 'button indent_button'%>
+        <%= submit_tag I18n.t(:log_in), :disable_with => I18n.t(:logging_in), :tabindex => 100, :class => 'button indent_button'%>
         
     <% end %>
   </div>
@@ -27,4 +27,4 @@
 <%# Try to put focus on the login text field on load %>
 <script type="text/javascript">
   try{ document.getElementById('user_login').focus(); } catch(e) {}
-</script>
\ No newline at end of file
+</script>
Index: app/views/assignments/student_interface.html.erb
===================================================================
--- app/views/assignments/student_interface.html.erb	(revision 1156)
+++ app/views/assignments/student_interface.html.erb	(revision 1183)
@@ -127,9 +127,9 @@
            @assignment.student_form_groups %>
 
           <h3>Form your own group</h3>
-          <p> The groups must be from <b>
-            <%= h(@assignment.group_min)%> </b>
-            to <b> <%= h(@assignment.group_max)%> </b> people.
+          <p> The groups must be from <strong>
+            <%= h(@assignment.group_min)%> </strong>
+            to <strong> <%= h(@assignment.group_max)%> </strong> people.
           </p>
 
           <% if @assignment.group_min == 1 %>
@@ -264,14 +264,17 @@
               @assignment.group_max > 1 %>
           <li> Students can form groups. </li>
           <li>
-            The groups must be from <b> <%= h(@assignment.group_min)%> </b>
-            to <b><%= h(@assignment.group_max)%></b> people.
+            The groups must be from <strong> <%= h(@assignment.group_min)%> </strong>
+            to <strong><%= h(@assignment.group_max)%></strong> people.
           </li>
         <% elsif @assignment.instructor_form_groups %>
           <li>Instructor forms groups.</li>
         <% else%>
           <li>Students work alone</li>
         <% end %>
+        <% if !@grouping.nil? %>
+        <li>Your group has <strong><%=@grouping.available_grace_credits%></strong> available grace credits</li>
+        <% end %>
       </ul>
     </div>    
   </div>
Index: app/views/assignments/_list.html.erb
===================================================================
--- app/views/assignments/_list.html.erb	(revision 1156)
+++ app/views/assignments/_list.html.erb	(revision 1183)
@@ -34,7 +34,7 @@
               <% end %>
             </td>
             <td style="width: 40%;">
-              <% if !@a_id_results.empty? && !@a_id_results[assignment.id].nil? %>
+              <% if !@a_id_results.empty? && !@a_id_results[assignment.id].nil? && !assignment.results_average.nil? %>
               <strong>Your mark:</strong>
               <%= # show results
 								("%.2f" % (@a_id_results[assignment.id].total_mark * 100 / assignment.total_mark)).to_s + "% (Class Average: " + ("%.2f" % (assignment.results_average)).to_s + "%)"
Index: app/views/results/delete_grace_period_deduction.rjs
===================================================================
--- app/views/results/delete_grace_period_deduction.rjs	(revision 0)
+++ app/views/results/delete_grace_period_deduction.rjs	(revision 1183)
@@ -0,0 +1,2 @@
+page.replace_html 'submission_rule_viewer', :partial => @grouping.assignment.submission_rule.grader_tab_partial, :locals => {:grouping => @grouping}
+
Index: app/views/results/marker/_marker_panes.html.erb
===================================================================
--- app/views/results/marker/_marker_panes.html.erb	(revision 1156)
+++ app/views/results/marker/_marker_panes.html.erb	(revision 1183)
@@ -43,6 +43,7 @@
     <ul id="rubric_tabs" class="subsection_tabs">
       <li class="tab"><a href="#rubric_viewer">Rubric</a></li>
       <li class="tab"><a href="#summary_viewer">Summary</a></li>
+      <li class="tab"><a href="#submission_rule_viewer">Submission Rule</a></li>
     </ul>  
     <div id="rubric_viewer" class="tabbedArea">
       <div class="rubric_tools">
@@ -64,6 +65,10 @@
     <div id="summary_viewer" class="marks_summary_pane tabbedArea">
     <%= render :partial => "results/marker/marker_summary", :locals => {:rubric_criteria => rubric_criteria, :marks_map => marks_map, :assignment => assignment, :result => result, :extra_marks_points => extra_marks_points, :extra_marks_percentage => extra_marks_percentage}%>
    </div>
+   
+   <div id="submission_rule_viewer" class="tabbedArea">
+     <%= render :partial => assignment.submission_rule.grader_tab_partial, :locals => {:grouping => result.submission.grouping} %>
+   </div>
   
   <div id="annotation_holder">
   </div>
Index: app/views/submission_rules/no_late/_grader_tab.html.erb
===================================================================
--- app/views/submission_rules/no_late/_grader_tab.html.erb	(revision 0)
+++ app/views/submission_rules/no_late/_grader_tab.html.erb	(revision 1183)
@@ -0,0 +1 @@
+<%= t('submission_rules.no_late_submission_rule.name') %>
Index: app/views/submission_rules/grace_period/_grader_tab.html.erb
===================================================================
--- app/views/submission_rules/grace_period/_grader_tab.html.erb	(revision 0)
+++ app/views/submission_rules/grace_period/_grader_tab.html.erb	(revision 1183)
@@ -0,0 +1,23 @@
+<% 
+  user_deductions = grouping.grace_period_deductions.group_by {|d| d.membership.user}
+%>
+
+<h3><%=t('submission_rules.grace_period_submission_rule.deductions')%></h3>
+<% user_deductions.each do |u| %>
+<table>
+  <thead>
+    <th colspan="2">
+      <%= u[0].user_name %> - (<%= u[0].first_name%> <%=u[0].last_name%>)
+    </th>
+  </thead>
+  <tr>
+    <td>
+      <%= u[1].first.deduction %> credits
+    </td>
+    <td>
+      <%= link_to_remote t('submission_rules.grace_period_submission_rule.remove_deduction'), :url => {:action => 'delete_grace_period_deduction', :id => grouping.id, :deduction_id => u[1].first.id }, :confirm => t('submission_rules.grace_period_submission_rule.confirm_remove_deduction') %>
+    </td>
+  </tr>
+</table>
+<% end %>
+
Index: app/views/submission_rules/penalty_period/_grader_tab.html.erb
===================================================================
--- app/views/submission_rules/penalty_period/_grader_tab.html.erb	(revision 0)
+++ app/views/submission_rules/penalty_period/_grader_tab.html.erb	(revision 1183)
@@ -0,0 +1 @@
+<%= t('submission_rules.penalty_period_submission_rule.name') %>

Property changes on: app/views/note
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk/app/views/note:r1135,1168

Index: app/views/students/edit.html.erb
===================================================================
--- app/views/students/edit.html.erb	(revision 1156)
+++ app/views/students/edit.html.erb	(revision 1183)
@@ -18,12 +18,18 @@
     
     <%= f.label(:grace_credits, I18n.t("user.grace_credits") ) %>
     <%= f.text_field :grace_credits %> <br />
-    
+           
     <%= f.hidden_field :id %>
     <%= f.submit 'Submit', :name => 'submit', :class => 'button indent_button' %>
     <%= link_to 'Cancel', {:controller => controller}, :class => "button" %>       
   <% end %>
 
+<h3><%= t('submission_rules.grace_period_submission_rule.deductions')%></h3>
+
+<div id="grace_period_deductions">
+  <%= render :partial => 'grace_period_deductions', :locals => {:grace_period_deductions => @user.grace_period_deductions}%>
 </div>
+
 </div>
+</div>
 
Index: app/views/students/delete_grace_period_deduction.rjs
===================================================================
--- app/views/students/delete_grace_period_deduction.rjs	(revision 0)
+++ app/views/students/delete_grace_period_deduction.rjs	(revision 1183)
@@ -0,0 +1 @@
+page.replace_html 'grace_period_deductions', :partial => 'grace_period_deductions', :locals => {:grace_period_deductions => @grace_period_deductions}
Index: app/views/students/_grace_period_deductions.html.erb
===================================================================
--- app/views/students/_grace_period_deductions.html.erb	(revision 0)
+++ app/views/students/_grace_period_deductions.html.erb	(revision 1183)
@@ -0,0 +1,26 @@
+<table>
+  <thead>
+    <th>
+      <%= t('submission_rules.grace_period_submission_rule.credits') %>
+    </th>
+    <th colspan="2">
+      <%= t('short_identifier') %>
+    </th>
+  </thead>
+  <% grace_period_deductions.each do |grace_period_deduction| %>
+  <tr>
+    <td>
+      <%= grace_period_deduction.deduction %> credits
+    </td>
+    <td>
+      <% if grace_period_deduction.membership.grouping.has_submission? %>
+        <%= link_to h(grace_period_deduction.membership.grouping.assignment.short_identifier), :controller => 'results', :action => 'edit', :id => grace_period_deduction.membership.grouping.get_submission_used.result.id%>
+      <% end %>
+    </td>
+    <td>
+      <%= link_to_remote t('submission_rules.grace_period_submission_rule.remove_deduction'), :url => {:action => 'delete_grace_period_deduction', :id => grace_period_deduction.id }, :confirm => t('submission_rules.grace_period_submission_rule.confirm_remove_deduction') %>
+    </td>
+  </tr>
+  <% end %>
+</table>
+
Index: app/views/submissions/_submissions_table_sorting_links.html.erb
===================================================================
--- app/views/submissions/_submissions_table_sorting_links.html.erb	(revision 1156)
+++ app/views/submissions/_submissions_table_sorting_links.html.erb	(revision 1183)
@@ -16,6 +16,10 @@
     <th class="<%="ap_sorting_by" if (sort_by == 'marking_state')%> <%="ap_sorting_by_desc" if (sort_by == 'marking_state' && !desc.blank?)%>">
     <%= link_to_remote "Marking State", :url => {:action => 's_table_paginate', :id => assignment.id, :filter => filter, :page => page, :per_page => per_page, :sort_by => 'marking_state', :desc => (sort_by == 'marking_state' && desc.blank?)} %>
     </th>
+
+    <th class="<%="ap_sorting_by" if (sort_by == 'grace_credits_used')%> <%="ap_sorting_by_desc" if (sort_by == 'grace_credits_used' && !desc.blank?)%>">
+    <%= link_to_remote "Grace Credits Used", :url => {:action => 's_table_paginate', :id => assignment.id, :filter => filter, :page => page, :per_page => per_page, :sort_by => 'grace_credits_used', :desc => (sort_by == 'grace_credits_used' && desc.blank?)} %>
+    </th>
     
     <th class="<%="ap_sorting_by" if (sort_by == 'total_mark')%> <%="ap_sorting_by_desc" if (sort_by == 'total_mark' && !desc.blank?)%>">
     <%= link_to_remote "Final Grade", :url => {:action => 's_table_paginate', :id => assignment.id, :filter => filter, :page => page, :per_page => per_page, :sort_by => 'total_mark', :desc => (sort_by == 'total_mark' && desc.blank?)} %>
Index: app/views/submissions/browse.html.erb
===================================================================
--- app/views/submissions/browse.html.erb	(revision 1156)
+++ app/views/submissions/browse.html.erb	(revision 1183)
@@ -79,7 +79,7 @@
   <%= render :partial => 'submissions_table_sorting_links', :locals => {:assignment => @assignment, :filter => 'none', :page => @current_page, :per_page => @per_page, :sort_by => @sort_by, :desc => @desc} %>
   </thead>
   <tbody>
-    <tr><td id="thinking_table_row" colspan="6"><%= render :partial => 'ajax_paginate/thinking' %></td></tr>
+    <tr><td id="thinking_table_row" colspan="7"><%= render :partial => 'ajax_paginate/thinking' %></td></tr>
   </tbody>
   <%= render :partial => 'submissions_table_body', :locals => {:groupings => @groupings, :assignment => @assignment} %>
   <tfoot id="submissions_table_foot">
Index: app/views/submissions/submissions_table_row/_table_row.html.erb
===================================================================
--- app/views/submissions/submissions_table_row/_table_row.html.erb	(revision 1156)
+++ app/views/submissions/submissions_table_row/_table_row.html.erb	(revision 1183)
@@ -66,6 +66,9 @@
     <% end %>
   </td>
   <td>
+    <%= h(grouping.grace_period_deduction_sum) %>
+  </td>
+  <td>
   <% if !grouping.has_submission? %>
   -
 <% else %>

Property changes on: log
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk/log:r1135,1168

Index: NAMED_REVISIONS
===================================================================
--- NAMED_REVISIONS	(revision 1156)
+++ NAMED_REVISIONS	(revision 1183)
@@ -1,5 +1,6 @@
 --- MarkUs 0.6 ---
-Version 0.6.0 corresponds to Subversion revision 1155 in branches/release_0.6
+Version 0.6.1 corresponds to Subversion revision 1183 in branches/release_0.6
+Version 0.6.0 corresponds to Subversion revision 1156 in branches/release_0.6
 
 --- MarkUs 0.5 ---
 Version 0.5.10 corresponds to Subversion revision 1119 in branches/release_0.5

Property changes on: db
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk/db:r1135,1168

Index: Changelog
===================================================================
--- Changelog	(revision 1156)
+++ Changelog	(revision 1183)
@@ -1,3 +1,12 @@
+Changes for MarkUs 0.6.1:
+
+* Fixed trace on detailed CSV download for assignments (g9jerboa)
+* Random TA assignment now applies only to selected groups (rburke)
+* Next/Previous Submission links in grader view no longer skip submissions marked "completed" (c6conley)
+* The student edit form now accepts input properly
+* New UI in students editor and grader view to manage grace credit penalties
+* Functional tests now all pass (c6conley)
+
 Changes for MarkUs 0.6:
 
 * Submissions table is now paginated (c6conley)

Property changes on: vendor
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk/vendor:r1135,1168


Property changes on: tmp
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk/tmp:r1135,1168

Index: config/locales/en.yml
===================================================================
--- config/locales/en.yml	(revision 1156)
+++ config/locales/en.yml	(revision 1183)
@@ -2,8 +2,16 @@
     answer_yes:         "Yes"
     answer_no:          "No"
     markus:             "MarkUs"
+    welcome_to:         "Welcome to MarkUs!"
+    welcome_to_markus:     "welcome to MarkUs, the online marking tool." 
+    log_in:             "Log in"
+    logging_in:         "Logging in..."
     login:              "Login"
     login_failed:       "Login failed"
+    password_not_blank: "Your password must not be blank."
+    username_not_blank: "Your username must not be blank."
+    username_and_password_not_blank: "Your username and password must not be blank."
+    dashboard:          "Dashboard"
     password:           "Password"
     short_identifier:   "Short Identifier"
     description:        "Name"
@@ -111,6 +119,8 @@
         student_create_group_fail: "Failed to create group. User: '{{user_name}}', Error: '{{error}}'."
         student_deleted_group: "Student '{{user_name}}' deleted group '{{group}}'."
         student_delete_group_fail: "Failed to delete group '{{group}}'. User: '{{user_name}}', Error: '{{error}}'."
+        student_delete_group_fail_no_grouping: "Failed to delete group, since no accepted group for this user existed. User: '{{user_name}}', Error: '{{error}}'."
+
         annotation_created: "Annotation '{{annotation}}' created by '{{user_name}}'."
         ta_annotation_reused: "The annotation '{{annotation}}' was reused by '{{user_name}}'."
         user_viewed_submission: "User '{{user_name}}' viewed submission (id: {{submission_id}}) of assignment '{{assignment}}' for group '{{group_name}}'."
@@ -128,6 +138,12 @@
       rename_group:
         success: "Group name has been updated."
         already_in_use: "This name is already in use for this assignment."
+      randomly_assign_graders: "Randomly assign Graders"
+      confirm_random_assign_graders: "Are you sure you want to randomly assign selected graders to selected groups?"
+      no_graders_selected: "You must select at least one grader for random assignment"
+      no_groups_selected: "You must select at least one group for random assignment"
+      cant_delete: "You are not allowed to delete the group."
+      cant_delete_already_submitted: "You already submitted something. You cannot delete your group."
     
     results:
       results_name:  "Results"
@@ -216,11 +232,17 @@
         overtime_message:  "This message is displayed to students when they view their file manager after the assignment due date has passed."
         
       no_late_submission_rule:
+        name: "No Late Submission Rule"
         description: "No penalties will be applied to late assignments"
         commit_after_late_message: "The due date for this assignment has passed.  Your changes have been recorded, but will not be included in the grading"
         no_late_message: "The due date for this assignment has passed.  Only what was in your folder at the due date will be graded."
    
       grace_period_submission_rule:
+        name: "Grace Period Submission Rule"
+        deductions: "Grace Period Deductions"
+        remove_deduction: "Remove Deduction"
+        credits: "Credits"
+        confirm_remove_deduction: "Are you sure you want to delete this Grace Period Deduction?"
         description: "You may submit up to {{grace_day_limit}} day(s) past the due date, and will have that number of days subtracted from your allotted grace days"
         after_collection_message: "The maximum number of grace periods has passed for this assignment.  Any changes will be recorded, but not graded."
         commit_after_collection_message: "The due date for this assignment, plus the maximum number of allowed grace days, has passed.  Your changes have been recorded, but will not be included in the grading."
@@ -228,6 +250,7 @@
         overtime_message_without_days_left: "The due date for this assignment has passed, and you are no longer able to use any grace days."
 
       penalty_period_submission_rule:
+        name: "Penalty Period Submission Rule"
         description: "You may submit up to {{penalty_period_limit}} hour(s) past the due date, but will have the appropriate percentage deducted from your final result"
         after_collection_message: "The maximum number of penalty periods has passed for this assignment.  Any changes will be recorded, but not graded."
         commit_after_collection_message: "The due date for this assignment, plus the maximum number of allowed penalty periods, has passed.  Your changes have been recorded, but will not be included in the grading."

Property changes on: config
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk/config:r1135,1168


Property changes on: doc
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk/doc:r1135,1168

Index: INSTALL
===================================================================
--- INSTALL	(revision 1156)
+++ INSTALL	(revision 1183)
@@ -121,7 +121,7 @@
   * Extract the tarball to the desired location
       tar -xzvf markus-latest-stable.tar.gz
   * Change to MarkUs' application root
-      cd markus-0.6.0
+      cd markus-0.6.x
   * Set environment variable RAILS_ENV
       export RAILS_ENV="production"
   * In case you are using Rails > 2.3.2 comment out the line containing

Property changes on: lib/markus_configurator.rb
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk/lib/markus_configurator.rb:r1135,1168


Property changes on: .
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r1135,1168


