Revert "Make it so students see "My Grades" and teachers see "Gradebook" in course menu"

fixes CNVS-22235

This reverts commit e413f8292d.

Change-Id: I49ada900ceef526f82ef37b6ff5febfe7298eda5
Reviewed-on: https://gerrit.instructure.com/59572
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Erin Hallmark <erin@instructure.com>
This commit is contained in:
Jennifer Stern 2015-07-29 16:50:08 -05:00
parent ec6aedafbe
commit fb371b6be7
4 changed files with 6 additions and 23 deletions

View File

@ -29,22 +29,11 @@ class GradebooksController < ApplicationController
batch_jobs_in_actions :only => :update_submission, :batch => { :priority => Delayed::LOW_PRIORITY }
before_filter :add_grades_crumb
add_crumb(proc { t '#crumbs.grades', "Grades" }) { |c| c.send :named_context_url, c.instance_variable_get("@context"), :context_grades_url }
before_filter { |c| c.active_tab = "grades" }
MAX_POST_GRADES_TOOLS = 10
def add_grades_crumb
if @context.grants_any_right?(@current_user, :manage_grades, :view_all_grades) && !params[:id]
crumb_label = t "Gradebook"
else
crumb_label = t "My Grades"
end
add_crumb(crumb_label, named_context_url(@context, :context_grades_url))
end
private :add_grades_crumb
def grade_summary
@presenter = GradeSummaryPresenter.new(@context, @current_user, params[:id])
# do this as the very first thing, if the current user is a teacher in the course and they are not trying to view another user's grades, redirect them to the gradebook

View File

@ -2357,10 +2357,10 @@ class Course < ActiveRecord::Base
:icon => 'icon-discussion'
}, {
:id => TAB_GRADES,
:label => t("My Grades"),
:label => t('#tabs.grades', "Grades"),
:css_class => 'grades',
:href => :course_grades_path,
:screenreader => t("Course Grades")
:screenreader => t('#tabs.course_grades', "Course Grades")
}, {
:id => TAB_PEOPLE,
:label => t('#tabs.people', "People"),
@ -2528,12 +2528,6 @@ class Course < ActiveRecord::Base
tabs.delete_if { |t| t[:hidden] && t[:external] } unless opts[:api] && self.grants_right?(user, :read_as_admin)
tabs.delete_if { |t| t[:id] == TAB_GRADES } unless self.grants_any_right?(user, opts[:session], :read_grades, :view_all_grades, :manage_grades)
tabs.detect { |t| t[:id] == TAB_GRADES }[:manageable] = true if self.grants_any_right?(user, opts[:session], :view_all_grades, :manage_grades)
grades_tab = tabs.find { |t| t[:id] == TAB_GRADES }
if !grades_tab.nil? && self.grants_any_right?(user, opts[:session], :view_all_grades, :manage_grades)
grades_tab[:label] = t('Gradebook')
end
tabs.delete_if { |t| t[:id] == TAB_PEOPLE } unless self.grants_any_right?(user, opts[:session], :read_roster, :manage_students, :manage_admin_users)
tabs.detect { |t| t[:id] == TAB_PEOPLE }[:manageable] = true if self.grants_any_right?(user, opts[:session], :manage_students, :manage_admin_users)
tabs.delete_if { |t| t[:id] == TAB_FILES } unless self.grants_any_right?(user, opts[:session], :read, :manage_files)

View File

@ -80,7 +80,7 @@ describe TabsController, type: :request do
"full_url" => "#{HostUrl.protocol}://#{HostUrl.context_host(@course)}/courses/#{@course.id}/grades",
"position" => 5,
"visibility" => "public",
"label" => "Gradebook",
"label" => "Grades",
"type" => "internal"
},
{

View File

@ -40,7 +40,7 @@ describe "links", priority: "2" do
it "should navigate user to gradebook page after grades link is clicked" do
link = find_link('.grades')
validate_breadcrumb_link(link, 'Gradebook')
validate_breadcrumb_link(link, 'Grades')
end
it "should navigate user to users page after people link is clicked" do
@ -110,7 +110,7 @@ describe "links", priority: "2" do
end
it "should navigate user to gradebook page after grades link is clicked" do
validate_breadcrumb_link(f('#grades_menu_item a'), 'Gradebook')
validate_breadcrumb_link(f('#grades_menu_item a'), 'Grades')
end
it "should navigate user to the calendar page after calender link is clicked" do