mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-62533 assign: Show assign hidden status on grading summary page
This commit is contained in:
parent
f61ee4e857
commit
a8f7818beb
4 changed files with 55 additions and 5 deletions
|
@ -5326,12 +5326,14 @@ class assign {
|
||||||
public function get_assign_grading_summary_renderable($activitygroup = null) {
|
public function get_assign_grading_summary_renderable($activitygroup = null) {
|
||||||
|
|
||||||
$instance = $this->get_instance();
|
$instance = $this->get_instance();
|
||||||
|
$cm = $this->get_course_module();
|
||||||
|
|
||||||
$draft = ASSIGN_SUBMISSION_STATUS_DRAFT;
|
$draft = ASSIGN_SUBMISSION_STATUS_DRAFT;
|
||||||
$submitted = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
|
$submitted = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
|
||||||
|
$isvisible = $cm->visible;
|
||||||
|
|
||||||
if ($activitygroup === null) {
|
if ($activitygroup === null) {
|
||||||
$activitygroup = groups_get_activity_group($this->get_course_module());
|
$activitygroup = groups_get_activity_group($cm);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($instance->teamsubmission) {
|
if ($instance->teamsubmission) {
|
||||||
|
@ -5349,7 +5351,8 @@ class assign {
|
||||||
$this->count_submissions_need_grading($activitygroup),
|
$this->count_submissions_need_grading($activitygroup),
|
||||||
$instance->teamsubmission,
|
$instance->teamsubmission,
|
||||||
$warnofungroupedusers,
|
$warnofungroupedusers,
|
||||||
$this->can_grade());
|
$this->can_grade(),
|
||||||
|
$isvisible);
|
||||||
} else {
|
} else {
|
||||||
// The active group has already been updated in groups_print_activity_menu().
|
// The active group has already been updated in groups_print_activity_menu().
|
||||||
$countparticipants = $this->count_participants($activitygroup);
|
$countparticipants = $this->count_participants($activitygroup);
|
||||||
|
@ -5364,8 +5367,8 @@ class assign {
|
||||||
$this->count_submissions_need_grading($activitygroup),
|
$this->count_submissions_need_grading($activitygroup),
|
||||||
$instance->teamsubmission,
|
$instance->teamsubmission,
|
||||||
false,
|
false,
|
||||||
$this->can_grade());
|
$this->can_grade(),
|
||||||
|
$isvisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $summary;
|
return $summary;
|
||||||
|
|
|
@ -750,6 +750,8 @@ class assign_grading_summary implements renderable {
|
||||||
public $warnofungroupedusers = false;
|
public $warnofungroupedusers = false;
|
||||||
/** @var boolean cangrade - Can the current user grade students? */
|
/** @var boolean cangrade - Can the current user grade students? */
|
||||||
public $cangrade = false;
|
public $cangrade = false;
|
||||||
|
/** @var boolean isvisible - Is the assignment's context module visible to students? */
|
||||||
|
public $isvisible = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
|
@ -765,6 +767,7 @@ class assign_grading_summary implements renderable {
|
||||||
* @param int $submissionsneedgradingcount
|
* @param int $submissionsneedgradingcount
|
||||||
* @param bool $teamsubmission
|
* @param bool $teamsubmission
|
||||||
* @param bool $cangrade
|
* @param bool $cangrade
|
||||||
|
* @param bool $isvisible
|
||||||
*/
|
*/
|
||||||
public function __construct($participantcount,
|
public function __construct($participantcount,
|
||||||
$submissiondraftsenabled,
|
$submissiondraftsenabled,
|
||||||
|
@ -777,7 +780,8 @@ class assign_grading_summary implements renderable {
|
||||||
$submissionsneedgradingcount,
|
$submissionsneedgradingcount,
|
||||||
$teamsubmission,
|
$teamsubmission,
|
||||||
$warnofungroupedusers,
|
$warnofungroupedusers,
|
||||||
$cangrade = true) {
|
$cangrade = true,
|
||||||
|
$isvisible = true) {
|
||||||
$this->participantcount = $participantcount;
|
$this->participantcount = $participantcount;
|
||||||
$this->submissiondraftsenabled = $submissiondraftsenabled;
|
$this->submissiondraftsenabled = $submissiondraftsenabled;
|
||||||
$this->submissiondraftscount = $submissiondraftscount;
|
$this->submissiondraftscount = $submissiondraftscount;
|
||||||
|
@ -790,6 +794,7 @@ class assign_grading_summary implements renderable {
|
||||||
$this->teamsubmission = $teamsubmission;
|
$this->teamsubmission = $teamsubmission;
|
||||||
$this->warnofungroupedusers = $warnofungroupedusers;
|
$this->warnofungroupedusers = $warnofungroupedusers;
|
||||||
$this->cangrade = $cangrade;
|
$this->cangrade = $cangrade;
|
||||||
|
$this->isvisible = $isvisible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -267,6 +267,10 @@ class mod_assign_renderer extends plugin_renderer_base {
|
||||||
$o .= $this->output->box_start('boxaligncenter gradingsummarytable');
|
$o .= $this->output->box_start('boxaligncenter gradingsummarytable');
|
||||||
$t = new html_table();
|
$t = new html_table();
|
||||||
|
|
||||||
|
// Visibility Status.
|
||||||
|
$this->add_table_row_tuple($t, get_string('hiddenfromstudents'),
|
||||||
|
(!$summary->isvisible) ? get_string('yes') : get_string('no'));
|
||||||
|
|
||||||
// Status.
|
// Status.
|
||||||
if ($summary->teamsubmission) {
|
if ($summary->teamsubmission) {
|
||||||
if ($summary->warnofungroupedusers) {
|
if ($summary->warnofungroupedusers) {
|
||||||
|
|
38
mod/assign/tests/behat/assign_hidden.feature
Normal file
38
mod/assign/tests/behat/assign_hidden.feature
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
@mod @mod_assign @javascript
|
||||||
|
Feature: When a Teacher hides an assignment from view for students it should consistently indicate it is hidden.
|
||||||
|
|
||||||
|
Scenario: Grade multiple students on one page
|
||||||
|
Given the following "courses" exist:
|
||||||
|
| fullname | shortname | category | groupmode |
|
||||||
|
| Course 1 | C1 | 0 | 1 |
|
||||||
|
And the following "users" exist:
|
||||||
|
| username | firstname | lastname | email |
|
||||||
|
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||||
|
| student1 | Student | 1 | student1@example.com |
|
||||||
|
And the following "course enrolments" exist:
|
||||||
|
| user | course | role |
|
||||||
|
| teacher1 | C1 | editingteacher |
|
||||||
|
| student1 | C1 | student |
|
||||||
|
When I log in as "teacher1"
|
||||||
|
And I am on "Course 1" course homepage with editing mode on
|
||||||
|
And I add a "Assignment" to section "1" and I fill the form with:
|
||||||
|
| Assignment name | Test hidden assignment |
|
||||||
|
And I open "Test hidden assignment" actions menu
|
||||||
|
And I choose "Hide" in the open action menu
|
||||||
|
And I follow "Test hidden assignment"
|
||||||
|
And I should see "Test hidden assignment"
|
||||||
|
And I should see "Yes" in the "Hidden from students" "table_row"
|
||||||
|
And I log out
|
||||||
|
And I log in as "teacher1"
|
||||||
|
And I am on "Course 1" course homepage with editing mode on
|
||||||
|
And I add a "Assignment" to section "2" and I fill the form with:
|
||||||
|
| Assignment name | Test visible assignment |
|
||||||
|
And I follow "Test visible assignment"
|
||||||
|
And I should see "Test visible assignment"
|
||||||
|
And I should see "No" in the "Hidden from students" "table_row"
|
||||||
|
And I log out
|
||||||
|
And I log in as "student1"
|
||||||
|
And I am on "Course 1" course homepage
|
||||||
|
And I should not see "Test hidden assignment"
|
||||||
|
And I should see "Test visible assignment"
|
||||||
|
And I log out
|
Loading…
Add table
Add a link
Reference in a new issue