Skip to content

Commit

Permalink
MDL-58262 assign: Use unique sql parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmerrill committed Mar 14, 2017
1 parent 1034421 commit 28cdba9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mod/assign/gradingtable.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ public function __construct(assign $assignment,
$params['assignmentid2'] = (int)$this->assignment->get_instance()->id;
$params['assignmentid3'] = (int)$this->assignment->get_instance()->id;

$params['assignmentid5'] = (int)$this->assignment->get_instance()->id;
$params['assignmentid6'] = (int)$this->assignment->get_instance()->id;
$params['assignmentid7'] = (int)$this->assignment->get_instance()->id;
$params['assignmentid8'] = (int)$this->assignment->get_instance()->id;
$params['assignmentid9'] = (int)$this->assignment->get_instance()->id;

$extrauserfields = get_extra_user_fields($this->assignment->get_context());

$fields = user_picture::fields('u', $extrauserfields) . ', ';
Expand Down Expand Up @@ -187,6 +181,12 @@ public function __construct(assign $assignment,
$hasoverrides = $this->assignment->has_overrides();

if ($hasoverrides) {
$params['assignmentid5'] = (int)$this->assignment->get_instance()->id;
$params['assignmentid6'] = (int)$this->assignment->get_instance()->id;
$params['assignmentid7'] = (int)$this->assignment->get_instance()->id;
$params['assignmentid8'] = (int)$this->assignment->get_instance()->id;
$params['assignmentid9'] = (int)$this->assignment->get_instance()->id;

$fields .= ', priority.priority, ';
$fields .= 'effective.allowsubmissionsfromdate, ';
$fields .= 'effective.duedate, ';
Expand Down Expand Up @@ -252,8 +252,8 @@ public function __construct(assign $assignment,
if (!empty($this->assignment->get_instance()->blindmarking)) {
$from .= 'LEFT JOIN {assign_user_mapping} um
ON u.id = um.userid
AND um.assignment = :assignmentid5 ';
$params['assignmentid5'] = (int)$this->assignment->get_instance()->id;
AND um.assignment = :assignmentidblind ';
$params['assignmentidblind'] = (int)$this->assignment->get_instance()->id;
$fields .= ', um.id as recordid ';
}

Expand Down
19 changes: 19 additions & 0 deletions mod/assign/tests/behat/steps_blind_marking.feature
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,22 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I navigate to "User report" in the course gradebook
Then I should see "50"
And I should see "Great job! Lol, not really."

@javascript
Scenario: Submissions table visible with overrides and blind marking
When I follow "Test assignment name"
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
And I should see "In review" in the "I'm the student's first submission" "table_row"

0 comments on commit 28cdba9

Please sign in to comment.