diff --git a/grade/report/singleview/classes/local/screen/user.php b/grade/report/singleview/classes/local/screen/user.php index c588d6e957c..cd9e4393e16 100644 --- a/grade/report/singleview/classes/local/screen/user.php +++ b/grade/report/singleview/classes/local/screen/user.php @@ -195,6 +195,12 @@ class user extends tablelike implements selectable_items { $itemlabel = $this->structure->get_element_header($gradetreeitem, true, false); $grade->label = $item->get_name(); + $itemlabel = $item->get_name(); + if (!empty($realmodid)) { + $url = new moodle_url('/mod/' . $item->itemmodule . '/view.php', array('id' => $realmodid)); + $itemlabel = html_writer::link($url, $item->get_name()); + } + $line = array( $OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', $iconstring)), $this->format_icon($item) . $lockicon, $itemlabel, $this->category($item), (new range($item)) diff --git a/grade/report/singleview/classes/local/ui/finalgrade.php b/grade/report/singleview/classes/local/ui/finalgrade.php index 58bf08b906c..b331d4e220f 100644 --- a/grade/report/singleview/classes/local/ui/finalgrade.php +++ b/grade/report/singleview/classes/local/ui/finalgrade.php @@ -114,8 +114,8 @@ class finalgrade extends grade_attribute_format implements unique_value, be_disa return new dropdown_attribute( $this->get_name(), $options, - $this->get_value(), $this->get_label(), + $this->get_value(), $this->is_disabled(), $this->get_tabindex() ); diff --git a/grade/report/singleview/tests/behat/singleview.feature b/grade/report/singleview/tests/behat/singleview.feature index 8683961ecec..0c90836685a 100644 --- a/grade/report/singleview/tests/behat/singleview.feature +++ b/grade/report/singleview/tests/behat/singleview.feature @@ -15,9 +15,15 @@ Feature: We can use Single view | student2 | Student | 2 | student1@asd.com | s2 | holly | | student3 | Student | 3 | student1@asd.com | s3 | anna | | student4 | Student | 4 | student1@asd.com | s4 | zac | + And the following "scales" exist: + | name | scale | + | Test Scale | Disappointing, Good, Very good, Excellent | And the following "grade items" exist: - | itemname | course | - | new grade item 1 | C1 | + | itemname | course | gradetype | scale | + | new grade item 1 | C1 | Scale | Test Scale | + And the following "scales" exist: + | name | scale | + | Test Scale | Disappointing, Good, Very good, Excellent | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | @@ -35,6 +41,9 @@ Feature: We can use Single view | assign | C1 | a2 | Test assignment two | Submit something! | 100 | | assign | C1 | a3 | Test assignment three | Submit something! | 150 | | assign | C1 | a4 | Test assignment four | Submit nothing! | 150 | + And the following "grade items" exist: + | itemname | course | gradetype | + | Test grade item | C1 | Scale | And I log in as "teacher1" And I follow "Course 1" And I follow "Grades" @@ -66,6 +75,12 @@ Feature: We can use Single view | Test assignment three | | 12.05 | | Excluded | + And I click on "Single view" "link" + And I click on "new grade item 1" "option" + And I click on "Very good" "option" + And I press "Update" + And the following should exist in the "generaltable" table: + | Grade for james (Student) 1 | "Very good" | Scenario: Single view links work on grade report. Given I follow "Single view for Test assignment one"