Permalink
Browse files

Merge branch 'MDL-58983-master' of git://github.com/damyon/moodle

  • Loading branch information...
dmonllao committed Dec 26, 2017
2 parents 4292318 + bf0a154 commit ffd392a17b71c52754fc696e599abfe76bf339cd
Showing with 15 additions and 6 deletions.
  1. +4 −2 mod/assign/locallib.php
  2. +6 −1 mod/assign/renderable.php
  3. +5 −3 mod/assign/renderer.php
@@ -5323,7 +5323,8 @@ public function get_assign_grading_summary_renderable() {
$this->get_course_module()->id,
$this->count_submissions_need_grading(),
$instance->teamsubmission,
$warnofungroupedusers);
$warnofungroupedusers,
$this->can_grade());
} else {
// The active group has already been updated in groups_print_activity_menu().
$countparticipants = $this->count_participants($activitygroup);
@@ -5337,7 +5338,8 @@ public function get_assign_grading_summary_renderable() {
$this->get_course_module()->id,
$this->count_submissions_need_grading(),
$instance->teamsubmission,
false);
false,
$this->can_grade());
}
@@ -748,6 +748,8 @@ class assign_grading_summary implements renderable {
public $teamsubmission = false;
/** @var boolean warnofungroupedusers - Do we need to warn people that there are users without groups */
public $warnofungroupedusers = false;
/** @var boolean cangrade - Can the current user grade students? */
public $cangrade = false;
/**
* constructor
@@ -762,6 +764,7 @@ class assign_grading_summary implements renderable {
* @param int $coursemoduleid
* @param int $submissionsneedgradingcount
* @param bool $teamsubmission
* @param bool $cangrade
*/
public function __construct($participantcount,
$submissiondraftsenabled,
@@ -773,7 +776,8 @@ public function __construct($participantcount,
$coursemoduleid,
$submissionsneedgradingcount,
$teamsubmission,
$warnofungroupedusers) {
$warnofungroupedusers,
$cangrade = true) {
$this->participantcount = $participantcount;
$this->submissiondraftsenabled = $submissiondraftsenabled;
$this->submissiondraftscount = $submissiondraftscount;
@@ -785,6 +789,7 @@ public function __construct($participantcount,
$this->submissionsneedgradingcount = $submissionsneedgradingcount;
$this->teamsubmission = $teamsubmission;
$this->warnofungroupedusers = $warnofungroupedusers;
$this->cangrade = $cangrade;
}
}
@@ -339,9 +339,11 @@ public function render_assign_grading_summary(assign_grading_summary $summary) {
$urlparams = array('id' => $summary->coursemoduleid, 'action' => 'grading');
$url = new moodle_url('/mod/assign/view.php', $urlparams);
$o .= '<a href="' . $url . '" class="btn btn-secondary">' . get_string('viewgrading', 'mod_assign') . '</a> ';
$urlparams = array('id' => $summary->coursemoduleid, 'action' => 'grader');
$url = new moodle_url('/mod/assign/view.php', $urlparams);
$o .= '<a href="' . $url . '" class="btn btn-primary">' . get_string('grade') . '</a>';
if ($summary->cangrade) {
$urlparams = array('id' => $summary->coursemoduleid, 'action' => 'grader');
$url = new moodle_url('/mod/assign/view.php', $urlparams);
$o .= '<a href="' . $url . '" class="btn btn-primary">' . get_string('grade') . '</a>';
}
$o .= $this->output->container_end();
// Close the container and insert a spacer.

0 comments on commit ffd392a

Please sign in to comment.