Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-35127 Assignment - declare the variables in the outer scope (for …

…readability)
  • Loading branch information...
commit 73646066a48291d60be589d77f3508c36f47ac61 1 parent 5075073
Damyon Wiese damyon authored

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. +4 1 mod/assign/lib.php
5 mod/assign/lib.php
@@ -329,6 +329,8 @@ function assign_print_overview($courses, &$htmlarray) {
329 329 // NOTE: we do all possible database work here *outside* of the loop to ensure this scales
330 330 //
331 331 list($sqlassignmentids, $assignmentidparams) = $DB->get_in_or_equal($assignmentids);
  332 + $mysubmissions = null;
  333 + $unmarkedsubmissions = null;
332 334
333 335 foreach ($assignments as $assignment) {
334 336 // Do not show assignments that are not open
@@ -395,7 +397,8 @@ function assign_print_overview($courses, &$htmlarray) {
395 397 $link = new moodle_url('/mod/assign/view.php', array('id'=>$assignment->coursemodule, 'action'=>'grading'));
396 398 $str .= '<div class="details"><a href="'.$link.'">'.get_string('submissionsnotgraded', 'assign', $submissions).'</a></div>';
397 399 }
398   - } if (has_capability('mod/assign:submit', $context)) {
  400 + }
  401 + if (has_capability('mod/assign:submit', $context)) {
399 402 if (!isset($mysubmissions)) {
400 403 // get all user submissions, indexed by assignment id
401 404 $mysubmissions = $DB->get_records_sql("SELECT a.id AS assignment, a.nosubmissions AS nosubmissions, g.timemodified

0 comments on commit 7364606

Please sign in to comment.
Something went wrong with that request. Please try again.