Skip to content

Commit

Permalink
MDL-47746 gradebook: Visual bug fix for Scales in Singleview.
Browse files Browse the repository at this point in the history
  • Loading branch information
zbdd committed Oct 30, 2014
1 parent b7ff403 commit 7c5721f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
6 changes: 6 additions & 0 deletions grade/report/singleview/classes/local/screen/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ public function format_line($item) {
$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))
Expand Down
2 changes: 1 addition & 1 deletion grade/report/singleview/classes/local/ui/finalgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public function determine_format() {
return new dropdown_attribute(
$this->get_name(),
$options,
$this->get_value(),
$this->get_label(),
$this->get_value(),
$this->is_disabled(),
$this->get_tabindex()
);
Expand Down
19 changes: 17 additions & 2 deletions grade/report/singleview/tests/behat/singleview.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 7c5721f

Please sign in to comment.