MDL-71912 mod_assign: Updating the activity to use the actionmenu.
Co-authored-by: Sujith Haridasan <[email protected]>
This commit is contained in:
co-authored by
Sujith Haridasan
parent
1fa136a9b4
commit
e75eb8481d
@@ -30,15 +30,16 @@ use core\navigation\views\secondary as core_secondary;
|
||||
*/
|
||||
class secondary extends core_secondary {
|
||||
protected function get_default_module_mapping(): array {
|
||||
return [
|
||||
self::TYPE_SETTING => [
|
||||
'modedit' => 1,
|
||||
"mod_{$this->page->activityname}_useroverrides" => 2, // Overrides are module specific.
|
||||
"mod_{$this->page->activityname}_groupoverrides" => 3,
|
||||
],
|
||||
self::TYPE_CUSTOM => [
|
||||
'advgrading' => 4,
|
||||
],
|
||||
];
|
||||
$defaultmaping = parent::get_default_module_mapping();
|
||||
$defaultmaping[self::TYPE_SETTING] = array_merge($defaultmaping[self::TYPE_SETTING], [
|
||||
'modedit' => 1,
|
||||
"mod_{$this->page->activityname}_useroverrides" => 2, // Overrides are module specific.
|
||||
"mod_{$this->page->activityname}_groupoverrides" => 3,
|
||||
]);
|
||||
|
||||
$defaultmaping[self::TYPE_CUSTOM] = array_merge($defaultmaping[self::TYPE_CUSTOM], [
|
||||
'advgrading' => 4,
|
||||
]);
|
||||
return $defaultmaping;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Output the actionbar for this activity.
|
||||
*
|
||||
* @package mod_assign
|
||||
* @copyright 2021 Adrian Greeve <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace mod_assign\output;
|
||||
|
||||
use templatable;
|
||||
use renderable;
|
||||
use moodle_url;
|
||||
|
||||
/**
|
||||
* Output the actionbar for this activity.
|
||||
*
|
||||
* @package mod_assign
|
||||
* @copyright 2021 Adrian Greeve <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class actionmenu implements templatable, renderable {
|
||||
|
||||
/** @var int The course module ID. */
|
||||
private $cmid;
|
||||
|
||||
/**
|
||||
* Constructor for this object.
|
||||
*
|
||||
* @param int $cmid The course module ID.
|
||||
*/
|
||||
public function __construct(int $cmid) {
|
||||
$this->cmid = $cmid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Data to be used for a template.
|
||||
*
|
||||
* @param \renderer_base $output renderer base output.
|
||||
* @return array Data to be used for a template.
|
||||
*/
|
||||
public function export_for_template(\renderer_base $output): array {
|
||||
return [
|
||||
'submissionlink' => (new moodle_url('/mod/assign/view.php', ['id' => $this->cmid, 'action' => 'grading']))->out(false),
|
||||
'gradelink' => (new moodle_url('/mod/assign/view.php', ['id' => $this->cmid, 'action' => 'grader']))->out(false)
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Output the grading actionbar for this activity.
|
||||
*
|
||||
* @package mod_assign
|
||||
* @copyright 2021 Adrian Greeve <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace mod_assign\output;
|
||||
|
||||
use templatable;
|
||||
use renderable;
|
||||
use moodle_url;
|
||||
|
||||
/**
|
||||
* Output the grading actionbar for this activity.
|
||||
*
|
||||
* @package mod_assign
|
||||
* @copyright 2021 Adrian Greeve <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class grading_actionmenu implements templatable, renderable {
|
||||
|
||||
/** @var int Course module ID. */
|
||||
protected $cmid;
|
||||
|
||||
/**
|
||||
* Constructor for this object.
|
||||
*
|
||||
* @param int $cmid Course module ID.
|
||||
*/
|
||||
public function __construct(int $cmid) {
|
||||
$this->cmid = $cmid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Data to render in a template.
|
||||
*
|
||||
* @param \renderer_base $output renderer base output.
|
||||
* @return array Data to render.
|
||||
*/
|
||||
public function export_for_template(\renderer_base $output): array {
|
||||
return [
|
||||
'back' => (new moodle_url('/mod/assign/view.php', ['id' => $this->cmid]))->out(false),
|
||||
'downloadall' => (new moodle_url('/mod/assign/view.php', ['id' => $this->cmid, 'action' => 'downloadall']))->out(false)
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Output the override actionbar for this activity.
|
||||
*
|
||||
* @package mod_assign
|
||||
* @copyright 2021 Adrian Greeve <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace mod_assign\output;
|
||||
|
||||
use core_availability\info_module;
|
||||
use moodle_url;
|
||||
use templatable;
|
||||
use renderable;
|
||||
use url_select;
|
||||
use single_button;
|
||||
|
||||
/**
|
||||
* Output the override actionbar for this activity.
|
||||
*
|
||||
* @package mod_assign
|
||||
* @copyright 2021 Adrian Greeve <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class override_actionmenu implements templatable, renderable {
|
||||
|
||||
/** @var moodle_url The current url for this page. */
|
||||
protected $currenturl;
|
||||
/** @var \cm_info course module information */
|
||||
protected $cm;
|
||||
/** @var int The activity group mode */
|
||||
protected $groupmode;
|
||||
/** @var bool Can all groups be accessed */
|
||||
protected $canaccessallgroups;
|
||||
/** @var array Groups related to this activity */
|
||||
protected $groups;
|
||||
|
||||
/**
|
||||
* Constructor for this action menu.
|
||||
*
|
||||
* @param moodle_url $currenturl The current url for this page.
|
||||
* @param \cm_info $cm course module information.
|
||||
*/
|
||||
public function __construct(moodle_url $currenturl, \cm_info $cm) {
|
||||
$this->currenturl = $currenturl;
|
||||
$this->cm = $cm;
|
||||
$this->groupmode = groups_get_activity_groupmode($this->cm);
|
||||
$this->canaccessallgroups = ($this->groupmode === NOGROUPS) ||
|
||||
has_capability('moodle/site:accessallgroups', $this->cm->context);
|
||||
$this->groups = $this->canaccessallgroups ? groups_get_all_groups($this->cm->course) :
|
||||
groups_get_activity_allowed_groups($this->cm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a select menu for overrides.
|
||||
*
|
||||
* @return url_select A url select object.
|
||||
*/
|
||||
protected function get_select_menu(): url_select {
|
||||
$userlink = new moodle_url('/mod/assign/overrides.php', ['cmid' => $this->cm->id, 'mode' => 'user']);
|
||||
$grouplink = new moodle_url('/mod/assign/overrides.php', ['cmid' => $this->cm->id, 'mode' => 'group']);
|
||||
$menu = [
|
||||
$userlink->out(false) => get_string('useroverrides', 'mod_assign'),
|
||||
$grouplink->out(false) => get_string('groupoverrides', 'mod_assign'),
|
||||
];
|
||||
return new url_select($menu, $this->currenturl->out(false), null, 'mod_assign_override_select');
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to show groups or not.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function show_groups(): bool {
|
||||
if ($this->groupmode == NOGROUPS) {
|
||||
return false;
|
||||
}
|
||||
return !empty($this->groups);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to enable/disable user override button or not.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function show_useroverride(): bool {
|
||||
global $DB;
|
||||
$users = [];
|
||||
$context = $this->cm->context;
|
||||
if ($this->canaccessallgroups) {
|
||||
$users = get_enrolled_users($context, '', 0, 'u.id');
|
||||
} else if ($this->groups) {
|
||||
$enrolledjoin = get_enrolled_join($context, 'u.id');
|
||||
list($ingroupsql, $ingroupparams) = $DB->get_in_or_equal(array_keys($this->groups), SQL_PARAMS_NAMED);
|
||||
$params = $enrolledjoin->params + $ingroupparams;
|
||||
$sql = "SELECT u.id
|
||||
FROM {user} u
|
||||
JOIN {groups_members} gm ON gm.userid = u.id
|
||||
{$enrolledjoin->joins}
|
||||
WHERE gm.groupid $ingroupsql
|
||||
AND {$enrolledjoin->wheres}";
|
||||
$users = $DB->get_records_sql($sql, $params);
|
||||
}
|
||||
|
||||
$info = new info_module($this->cm);
|
||||
$users = $info->filter_user_list($users);
|
||||
|
||||
return !empty($users);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data to be used in a template.
|
||||
*
|
||||
* @param \renderer_base $output renderer base output.
|
||||
* @return array The data to be used in a template.
|
||||
*/
|
||||
public function export_for_template(\renderer_base $output): array {
|
||||
|
||||
$type = $this->currenturl->get_param('mode');
|
||||
if ($type == 'user') {
|
||||
$text = get_string('addnewuseroverride', 'mod_assign');
|
||||
} else {
|
||||
$text = get_string('addnewgroupoverride', 'mod_assign');
|
||||
}
|
||||
$action = ($type == 'user') ? 'adduser' : 'addgroup';
|
||||
|
||||
$params = ['cmid' => $this->currenturl->get_param('cmid'), 'action' => $action];
|
||||
$url = new moodle_url('/mod/assign/overrideedit.php', $params);
|
||||
|
||||
$options = [];
|
||||
if ($action == 'addgroup' && !$this->show_groups()) {
|
||||
$options = ['disabled' => 'true'];
|
||||
} else if ($action === 'adduser' && !$this->show_useroverride()) {
|
||||
$options = ['disabled' => 'true'];
|
||||
}
|
||||
$overridebutton = new single_button($url, $text, 'post', true, $options);
|
||||
|
||||
$urlselect = $this->get_select_menu();
|
||||
return [
|
||||
'addoverride' => $overridebutton->export_for_template($output),
|
||||
'urlselect' => $urlselect->export_for_template($output)
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -247,7 +247,9 @@ class renderer extends \plugin_renderer_base {
|
||||
$this->page->set_heading($this->page->course->fullname);
|
||||
|
||||
$o .= $this->output->header();
|
||||
$o .= $this->output->heading($heading);
|
||||
if (!$this->page->has_secondary_navigation()) {
|
||||
$o .= $this->output->heading($heading);
|
||||
}
|
||||
|
||||
// Show the activity information output component.
|
||||
$modinfo = get_fast_modinfo($header->assign->course);
|
||||
@@ -373,21 +375,6 @@ class renderer extends \plugin_renderer_base {
|
||||
$o .= \html_writer::table($t);
|
||||
$o .= $this->output->box_end();
|
||||
|
||||
// Link to the grading page.
|
||||
$o .= \html_writer::start_tag('center');
|
||||
$o .= $this->output->container_start('submissionlinks');
|
||||
$urlparams = array('id' => $summary->coursemoduleid, 'action' => 'grading');
|
||||
$url = new \moodle_url('/mod/assign/view.php', $urlparams);
|
||||
$o .= \html_writer::link($url, get_string('viewgrading', 'mod_assign'),
|
||||
['class' => 'btn btn-secondary']);
|
||||
if ($summary->cangrade) {
|
||||
$urlparams = array('id' => $summary->coursemoduleid, 'action' => 'grader');
|
||||
$url = new \moodle_url('/mod/assign/view.php', $urlparams);
|
||||
$o .= \html_writer::link($url, get_string('gradeverb'),
|
||||
['class' => 'btn btn-primary ml-1']);
|
||||
}
|
||||
$o .= $this->output->container_end();
|
||||
|
||||
// Close the container and insert a spacer.
|
||||
$o .= $this->output->container_end();
|
||||
$o .= \html_writer::end_tag('center');
|
||||
@@ -716,7 +703,7 @@ class renderer extends \plugin_renderer_base {
|
||||
if (!$status->submissionsenabled) {
|
||||
$cell2content = get_string('noonlinesubmissions', 'assign');
|
||||
} else {
|
||||
$cell2content = get_string('noattempt', 'assign');
|
||||
$cell2content = get_string('nosubmissionyet', 'assign');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -892,65 +879,6 @@ class renderer extends \plugin_renderer_base {
|
||||
$o .= $warningmsg;
|
||||
$o .= \html_writer::table($t);
|
||||
$o .= $this->output->box_end();
|
||||
|
||||
// Links.
|
||||
if ($status->view == assign_submission_status::STUDENT_VIEW) {
|
||||
if ($status->canedit) {
|
||||
if (!$submission || $submission->status == ASSIGN_SUBMISSION_STATUS_NEW) {
|
||||
$o .= $this->output->box_start('generalbox submissionaction');
|
||||
$urlparams = array('id' => $status->coursemoduleid, 'action' => 'editsubmission');
|
||||
$o .= $this->output->single_button(new \moodle_url('/mod/assign/view.php', $urlparams),
|
||||
get_string('addsubmission', 'assign'), 'get');
|
||||
$o .= $this->output->box_start('boxaligncenter submithelp');
|
||||
$o .= get_string('addsubmission_help', 'assign');
|
||||
$o .= $this->output->box_end();
|
||||
$o .= $this->output->box_end();
|
||||
} else if ($submission->status == ASSIGN_SUBMISSION_STATUS_REOPENED) {
|
||||
$o .= $this->output->box_start('generalbox submissionaction');
|
||||
$urlparams = array('id' => $status->coursemoduleid,
|
||||
'action' => 'editprevioussubmission',
|
||||
'sesskey'=>sesskey());
|
||||
$o .= $this->output->single_button(new \moodle_url('/mod/assign/view.php', $urlparams),
|
||||
get_string('addnewattemptfromprevious', 'assign'), 'get');
|
||||
$o .= $this->output->box_start('boxaligncenter submithelp');
|
||||
$o .= get_string('addnewattemptfromprevious_help', 'assign');
|
||||
$o .= $this->output->box_end();
|
||||
$o .= $this->output->box_end();
|
||||
$o .= $this->output->box_start('generalbox submissionaction');
|
||||
$urlparams = array('id' => $status->coursemoduleid, 'action' => 'editsubmission');
|
||||
$o .= $this->output->single_button(new \moodle_url('/mod/assign/view.php', $urlparams),
|
||||
get_string('addnewattempt', 'assign'), 'get');
|
||||
$o .= $this->output->box_start('boxaligncenter submithelp');
|
||||
$o .= get_string('addnewattempt_help', 'assign');
|
||||
$o .= $this->output->box_end();
|
||||
$o .= $this->output->box_end();
|
||||
} else {
|
||||
$o .= $this->output->box_start('generalbox submissionaction');
|
||||
$urlparams = array('id' => $status->coursemoduleid, 'action' => 'editsubmission');
|
||||
$o .= $this->output->single_button(new \moodle_url('/mod/assign/view.php', $urlparams),
|
||||
get_string('editsubmission', 'assign'), 'get');
|
||||
$urlparams = array('id' => $status->coursemoduleid, 'action' => 'removesubmissionconfirm');
|
||||
$o .= $this->output->single_button(new \moodle_url('/mod/assign/view.php', $urlparams),
|
||||
get_string('removesubmission', 'assign'), 'get');
|
||||
$o .= $this->output->box_start('boxaligncenter submithelp');
|
||||
$o .= get_string('editsubmission_help', 'assign');
|
||||
$o .= $this->output->box_end();
|
||||
$o .= $this->output->box_end();
|
||||
}
|
||||
}
|
||||
|
||||
if ($status->cansubmit) {
|
||||
$urlparams = array('id' => $status->coursemoduleid, 'action'=>'submit');
|
||||
$o .= $this->output->box_start('generalbox submissionaction');
|
||||
$o .= $this->output->single_button(new \moodle_url('/mod/assign/view.php', $urlparams),
|
||||
get_string('submitassignment', 'assign'), 'get');
|
||||
$o .= $this->output->box_start('boxaligncenter submithelp');
|
||||
$o .= get_string('submitassignment_help', 'assign');
|
||||
$o .= $this->output->box_end();
|
||||
$o .= $this->output->box_end();
|
||||
}
|
||||
}
|
||||
|
||||
$o .= $this->output->container_end();
|
||||
return $o;
|
||||
}
|
||||
@@ -1488,4 +1416,47 @@ class renderer extends \plugin_renderer_base {
|
||||
return $this->render_from_template('mod_assign/grading_app', $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the submission action menu.
|
||||
*
|
||||
* @param \mod_assign\output\actionmenu $actionmenu The actionmenu
|
||||
* @return string Rendered action menu.
|
||||
*/
|
||||
public function submission_actionmenu(\mod_assign\output\actionmenu $actionmenu): string {
|
||||
$context = $actionmenu->export_for_template($this);
|
||||
return $this->render_from_template('mod_assign/submission_actionmenu', $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the user submission action menu.
|
||||
*
|
||||
* @param \mod_assign\output\user_submission_actionmenu $actionmenu The actionmenu
|
||||
* @return string The rendered action menu.
|
||||
*/
|
||||
public function render_user_submission_actionmenu(\mod_assign\output\user_submission_actionmenu $actionmenu): string {
|
||||
$context = $actionmenu->export_for_template($this);
|
||||
return $this->render_from_template('mod_assign/user_submission_actionmenu', $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the override action menu.
|
||||
*
|
||||
* @param \mod_assign\output\override_actionmenu $actionmenu The actionmenu
|
||||
* @return string The rendered override action menu.
|
||||
*/
|
||||
public function render_override_actionmenu(\mod_assign\output\override_actionmenu $actionmenu): string {
|
||||
$context = $actionmenu->export_for_template($this);
|
||||
return $this->render_from_template('mod_assign/override_actionmenu', $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the grading action menu.
|
||||
*
|
||||
* @param \mod_assign\output\grading_actionmenu $actionmenu The actionmenu
|
||||
* @return string The rendered grading action menu.
|
||||
*/
|
||||
public function render_grading_actionmenu(\mod_assign\output\grading_actionmenu $actionmenu): string {
|
||||
$context = $actionmenu->export_for_template($this);
|
||||
return $this->render_from_template('mod_assign/grading_actionmenu', $context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Output the user submission actionbar for this activity.
|
||||
*
|
||||
* @package mod_assign
|
||||
* @copyright 2021 Adrian Greeve <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace mod_assign\output;
|
||||
|
||||
use templatable;
|
||||
use renderable;
|
||||
use moodle_url;
|
||||
use help_icon;
|
||||
use single_button;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* Output the user submission actionbar for this activity.
|
||||
*
|
||||
* @package mod_assign
|
||||
* @copyright 2021 Adrian Greeve <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class user_submission_actionmenu implements templatable, renderable {
|
||||
|
||||
/** @var int The course module ID. */
|
||||
protected $cmid;
|
||||
/** @var bool Whether to show the submit button. */
|
||||
protected $showsubmit;
|
||||
/** @var bool Whether to show the edit button. */
|
||||
protected $showedit;
|
||||
/** @var stdClass A submission for this activity. */
|
||||
protected $submission;
|
||||
/** @var stdClass A team submission for this activity. */
|
||||
protected $teamsubmission;
|
||||
|
||||
/**
|
||||
* Constructor for this object.
|
||||
*
|
||||
* @param int $cmid The course module ID.
|
||||
* @param bool $showsubmit Whether to show the submit button.
|
||||
* @param bool $showedit Whether to show the edit button.
|
||||
* @param stdClass|null $submission A submission for this activity.
|
||||
* @param stdClass|null $teamsubmission A team submission for this activity.
|
||||
*/
|
||||
public function __construct(int $cmid, bool $showsubmit, bool $showedit, stdClass $submission = null,
|
||||
stdClass $teamsubmission = null) {
|
||||
|
||||
$this->cmid = $cmid;
|
||||
$this->showsubmit = $showsubmit;
|
||||
$this->showedit = $showedit;
|
||||
$this->submission = $submission;
|
||||
$this->teamsubmission = $teamsubmission;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the submission status.
|
||||
*
|
||||
* @return string The status of the submission.
|
||||
*/
|
||||
protected function get_current_status(): string {
|
||||
if (!is_null($this->teamsubmission)) {
|
||||
return $this->teamsubmission->status;
|
||||
} else if (!empty((array)$this->submission)) {
|
||||
return $this->submission->status;
|
||||
} else {
|
||||
return ASSIGN_SUBMISSION_STATUS_NEW;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export the submission buttons for the page.
|
||||
*
|
||||
* @param \renderer_base $output renderer base output.
|
||||
* @return array The data to be rendered.
|
||||
*/
|
||||
public function export_for_template(\renderer_base $output): array {
|
||||
$data = ['edit' => false, 'submit' => false, 'remove' => false, 'previoussubmission' => false];
|
||||
if ($this->showedit) {
|
||||
$url = new moodle_url('/mod/assign/view.php', ['id' => $this->cmid, 'action' => 'editsubmission']);
|
||||
$button = new single_button($url, get_string('editsubmission', 'mod_assign'), 'get');
|
||||
$data['edit'] = [
|
||||
'button' => $button->export_for_template($output),
|
||||
];
|
||||
$status = $this->get_current_status();
|
||||
if ($status !== ASSIGN_SUBMISSION_STATUS_NEW && $status !== ASSIGN_SUBMISSION_STATUS_REOPENED) {
|
||||
$url = new moodle_url('/mod/assign/view.php', ['id' => $this->cmid, 'action' => 'removesubmissionconfirm']);
|
||||
$button = new single_button($url, get_string('removesubmission', 'mod_assign'), 'get');
|
||||
$data['remove'] = ['button' => $button->export_for_template($output)];
|
||||
}
|
||||
if ($status === ASSIGN_SUBMISSION_STATUS_REOPENED) {
|
||||
$params = ['id' => $this->cmid, 'action' => 'editprevioussubmission', 'sesskey' => sesskey()];
|
||||
$url = new moodle_url('/mod/assign/view.php', $params);
|
||||
$button = new single_button($url, get_string('addnewattemptfromprevious', 'mod_assign'), 'get');
|
||||
$help = new help_icon('addnewattemptfromprevious', 'mod_assign');
|
||||
$data['previoussubmission'] = [
|
||||
'button' => $button->export_for_template($output),
|
||||
'help' => $help->export_for_template($output)
|
||||
];
|
||||
$url = new moodle_url('/mod/assign/view.php', ['id' => $this->cmid, 'action' => 'editsubmission']);
|
||||
$newattemptbutton = new single_button($url, get_string('addnewattempt', 'mod_assign'), 'get');
|
||||
$newattempthelp = new help_icon('addnewattempt', 'mod_assign');
|
||||
$data['edit']['button'] = $newattemptbutton->export_for_template($output);
|
||||
$data['edit']['help'] = $newattempthelp->export_for_template($output);
|
||||
}
|
||||
if ($status === ASSIGN_SUBMISSION_STATUS_NEW) {
|
||||
$newattemptbutton = new single_button($url, get_string('addsubmission', 'mod_assign'), 'get');
|
||||
$data['edit']['button'] = $newattemptbutton->export_for_template($output);
|
||||
$data['edit']['help'] = '';
|
||||
}
|
||||
}
|
||||
if ($this->showsubmit) {
|
||||
$url = new moodle_url('/mod/assign/view.php', ['id' => $this->cmid, 'action' => 'submit']);
|
||||
$button = new single_button($url, get_string('submitassignment', 'mod_assign'), 'get', true);
|
||||
$help = new help_icon('submitassignment', 'mod_assign');
|
||||
$data['submit'] = [
|
||||
'button' => $button->export_for_template($output),
|
||||
'help' => $help->export_for_template($output)
|
||||
];
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ Feature: In an assignment, teachers can provide feedback comments on student sub
|
||||
| assign | user | onlinetext |
|
||||
| Test assignment name | student1 | I'm the student1 submission |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I click on "Quick grading" "checkbox"
|
||||
And I set the field "Feedback comments" to "Feedback from teacher."
|
||||
And I press "Save all quick grading changes"
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ Feature: Check that any changes to assignment feedback comments are not lost
|
||||
| activity | name | course | assignfeedback_comments_enabled |
|
||||
| assign | Test assignment name | C1 | 1 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
When I set the following fields to these values:
|
||||
| Grade out of 100 | 101 |
|
||||
|
||||
@@ -46,7 +46,7 @@ Feature: In an assignment, teacher can annotate PDF files during grading
|
||||
And I log out
|
||||
|
||||
When I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
|
||||
Then I should see "Page 1 of 3"
|
||||
And I click on ".navigate-next-button" "css_element"
|
||||
@@ -116,7 +116,7 @@ Feature: In an assignment, teacher can annotate PDF files during grading
|
||||
| file | mod/assign/feedback/editpdf/tests/fixtures/submission.pdf |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I open the action menu in "Student 2" "table_row"
|
||||
And I click on "Grade" "link" in the "Student 2" "table_row"
|
||||
And I wait for the complete PDF to load
|
||||
@@ -126,5 +126,5 @@ Feature: In an assignment, teacher can annotate PDF files during grading
|
||||
And I should see "The changes to the grade and feedback were saved"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "View annotated PDF..." in the "student2@example.com" "table_row"
|
||||
|
||||
@@ -32,7 +32,7 @@ Feature: Ensure that a comment remains visible if its popup menu is open
|
||||
| file | mod/assign/feedback/editpdf/tests/fixtures/submission.pdf |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
|
||||
And I wait for the complete PDF to load
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Feature: In a group assignment, teacher can annotate PDF files for all users
|
||||
| file | mod/assign/feedback/editpdf/tests/fixtures/submission.pdf |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
|
||||
And I wait for the complete PDF to load
|
||||
And I click on ".navigate-next-button" "css_element"
|
||||
|
||||
@@ -35,7 +35,7 @@ Feature: In an assignment, teacher can view the feedback for a previous attempt.
|
||||
| file | mod/assign/feedback/editpdf/tests/fixtures/submission.pdf, mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf |
|
||||
|
||||
When I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
|
||||
Then I should see "Page 1 of 3"
|
||||
And I click on ".navigate-next-button" "css_element"
|
||||
|
||||
@@ -95,6 +95,7 @@ $string['attemptreopenmethod_manual'] = 'Manually';
|
||||
$string['attemptreopenmethod_none'] = 'Never';
|
||||
$string['attemptreopenmethod_untilpass'] = 'Automatically until pass';
|
||||
$string['availability'] = 'Availability';
|
||||
$string['back'] = 'Back';
|
||||
$string['backtoassignment'] = 'Back to assignment';
|
||||
$string['batchoperationsdescription'] = 'With selected...';
|
||||
$string['batchoperationconfirmlock'] = 'Lock all selected submissions?';
|
||||
@@ -382,6 +383,7 @@ $string['noopen'] = 'No open date';
|
||||
$string['nooverridedata'] = 'You must override at least one of the assignment settings.';
|
||||
$string['nosavebutnext'] = 'Next';
|
||||
$string['nosubmission'] = 'Nothing has been submitted for this assignment';
|
||||
$string['nosubmissionyet'] = 'No submissions have been made yet';
|
||||
$string['noteam'] = 'Not a member of any group';
|
||||
$string['noteam_desc'] = 'This assignment requires submission in groups. You are not a member of any group, so you cannot create a submission. Please contact your teacher to be added to a group.';
|
||||
$string['noteamgrader'] = 'Not a member of any group, so unable to make submissions.';
|
||||
|
||||
+3
-15
@@ -432,13 +432,9 @@ function assign_extend_settings_navigation(settings_navigation $settings, naviga
|
||||
|
||||
if (has_capability('mod/assign:manageoverrides', $PAGE->cm->context)) {
|
||||
$url = new moodle_url('/mod/assign/overrides.php', array('cmid' => $PAGE->cm->id));
|
||||
$node = navigation_node::create(get_string('groupoverrides', 'assign'),
|
||||
new moodle_url($url, array('mode' => 'group')),
|
||||
navigation_node::TYPE_SETTING, null, 'mod_assign_groupoverrides');
|
||||
$navref->add_node($node, $beforekey);
|
||||
|
||||
$node = navigation_node::create(get_string('useroverrides', 'assign'),
|
||||
new moodle_url($url, array('mode' => 'user')),
|
||||
$node = navigation_node::create(get_string('overrides', 'assign'),
|
||||
$url,
|
||||
navigation_node::TYPE_SETTING, null, 'mod_assign_useroverrides');
|
||||
$navref->add_node($node, $beforekey);
|
||||
}
|
||||
@@ -449,15 +445,7 @@ function assign_extend_settings_navigation(settings_navigation $settings, naviga
|
||||
$link = new moodle_url('/grade/report/grader/index.php', array('id' => $course->id));
|
||||
$linkname = get_string('viewgradebook', 'assign');
|
||||
$node = $navref->add($linkname, $link, navigation_node::TYPE_SETTING);
|
||||
}
|
||||
|
||||
// Link to download all submissions.
|
||||
if (has_any_capability(array('mod/assign:grade', 'mod/assign:viewgrades'), $context)) {
|
||||
$link = new moodle_url('/mod/assign/view.php', array('id' => $cm->id, 'action'=>'grading'));
|
||||
$node = $navref->add(get_string('viewgrading', 'assign'), $link, navigation_node::TYPE_SETTING);
|
||||
|
||||
$link = new moodle_url('/mod/assign/view.php', array('id' => $cm->id, 'action'=>'downloadall'));
|
||||
$node = $navref->add(get_string('downloadall', 'assign'), $link, navigation_node::TYPE_SETTING);
|
||||
$node->set_force_into_more_menu(true);
|
||||
}
|
||||
|
||||
if (has_capability('mod/assign:revealidentities', $context)) {
|
||||
|
||||
+45
-3
@@ -4569,7 +4569,9 @@ class assign {
|
||||
$gradingoptionsdata->workflowfilter = $workflowfilter;
|
||||
$gradingoptionsform->set_data($gradingoptionsdata);
|
||||
|
||||
$actionformtext = $this->get_renderer()->render($gradingactions);
|
||||
$buttons = new \mod_assign\output\grading_actionmenu($this->get_course_module()->id);
|
||||
$actionformtext = $this->get_renderer()->render($buttons);
|
||||
$actionformtext .= $this->get_renderer()->render($gradingactions);
|
||||
|
||||
$currenturl = new moodle_url('/mod/assign/view.php', ['id' => $this->get_course_module()->id, 'action' => 'grading']);
|
||||
|
||||
@@ -5802,6 +5804,9 @@ class assign {
|
||||
}
|
||||
|
||||
if ($this->can_view_grades()) {
|
||||
$actionbuttons = new \mod_assign\output\actionmenu($this->get_course_module()->id);
|
||||
$o .= $this->get_renderer()->submission_actionmenu($actionbuttons);
|
||||
|
||||
// Group selector will only be displayed if necessary.
|
||||
$currenturl = new moodle_url('/mod/assign/view.php', array('id' => $this->get_course_module()->id));
|
||||
$o .= groups_print_activity_menu($this->get_course_module(), $currenturl->out(), true);
|
||||
@@ -5809,10 +5814,9 @@ class assign {
|
||||
$summary = $this->get_assign_grading_summary_renderable();
|
||||
$o .= $this->get_renderer()->render($summary);
|
||||
}
|
||||
$grade = $this->get_user_grade($USER->id, false);
|
||||
$submission = $this->get_user_submission($USER->id, false);
|
||||
|
||||
if ($this->can_view_submission($USER->id)) {
|
||||
$o .= $this->view_submission_action_bar($instance, $USER);
|
||||
$o .= $this->view_student_summary($USER, true);
|
||||
}
|
||||
|
||||
@@ -5823,6 +5827,44 @@ class assign {
|
||||
return $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* The action bar displayed in the submissions page.
|
||||
*
|
||||
* @param stdClass $instance The settings for the current instance of this assignment
|
||||
* @param stdClass $user The user to print the action bar for
|
||||
* @return string
|
||||
*/
|
||||
public function view_submission_action_bar(stdClass $instance, stdClass $user): string {
|
||||
$submission = $this->get_user_submission($user->id, false);
|
||||
// Figure out if we are team or solitary submission.
|
||||
$teamsubmission = null;
|
||||
if ($instance->teamsubmission) {
|
||||
$teamsubmission = $this->get_group_submission($user->id, 0, false);
|
||||
}
|
||||
|
||||
$showsubmit = ($this->submissions_open($user->id)
|
||||
&& $this->show_submit_button($submission, $teamsubmission, $user->id));
|
||||
$showedit = ($this->is_any_submission_plugin_enabled()) && $this->can_edit_submission($user->id);
|
||||
|
||||
// The method get_group_submission() says that it returns a stdClass, but it can return false >_>.
|
||||
if ($teamsubmission === false) {
|
||||
$teamsubmission = new stdClass();
|
||||
}
|
||||
// Same goes for get_user_submission().
|
||||
if ($submission === false) {
|
||||
$submission = new stdClass();
|
||||
}
|
||||
$actionbuttons = new \mod_assign\output\user_submission_actionmenu(
|
||||
$this->get_course_module()->id,
|
||||
$showsubmit,
|
||||
$showedit,
|
||||
$submission,
|
||||
$teamsubmission
|
||||
);
|
||||
|
||||
return $this->get_renderer()->render($actionbuttons);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the final raw grade(s) in the grading table for the gradebook.
|
||||
*
|
||||
|
||||
@@ -66,6 +66,7 @@ $groupmode = ($mode == "group");
|
||||
$url = new moodle_url('/mod/assign/overrides.php', array('cmid' => $cm->id, 'mode' => $mode));
|
||||
|
||||
$PAGE->set_url($url);
|
||||
navigation_node::override_active_url(new moodle_url('/mod/assign/overrides.php', ['cmid' => $cmid]));
|
||||
|
||||
if ($action == 'movegroupoverride') {
|
||||
$id = required_param('id', PARAM_INT);
|
||||
@@ -82,7 +83,12 @@ $PAGE->set_pagelayout('admin');
|
||||
$PAGE->set_title(get_string('overrides', 'assign'));
|
||||
$PAGE->set_heading($course->fullname);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(format_string($assign->name, true, array('context' => $context)));
|
||||
if (!$PAGE->has_secondary_navigation()) {
|
||||
echo $OUTPUT->heading(format_string($assign->name, true, array('context' => $context)));
|
||||
}
|
||||
$overridemenu = new \mod_assign\output\override_actionmenu($url, $cm);
|
||||
$renderer = $PAGE->get_renderer('mod_assign');
|
||||
echo $renderer->render($overridemenu);
|
||||
|
||||
// Delete orphaned group overrides.
|
||||
$sql = 'SELECT o.id
|
||||
@@ -296,9 +302,6 @@ if ($groupmode) {
|
||||
echo $OUTPUT->notification(get_string('groupsnone', 'assign'), 'error');
|
||||
$options['disabled'] = true;
|
||||
}
|
||||
echo $OUTPUT->single_button($overrideediturl->out(true,
|
||||
array('action' => 'addgroup', 'cmid' => $cm->id)),
|
||||
get_string('addnewgroupoverride', 'assign'), 'post', $options);
|
||||
} else {
|
||||
$users = array();
|
||||
// See if there are any users in the assign.
|
||||
@@ -329,9 +332,6 @@ if ($groupmode) {
|
||||
echo $OUTPUT->notification($nousermessage, 'error');
|
||||
$options['disabled'] = true;
|
||||
}
|
||||
echo $OUTPUT->single_button($overrideediturl->out(true,
|
||||
array('action' => 'adduser', 'cmid' => $cm->id)),
|
||||
get_string('addnewuseroverride', 'assign'), 'get', $options);
|
||||
}
|
||||
echo html_writer::end_tag('div');
|
||||
echo html_writer::end_tag('div');
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
{{!
|
||||
This file is part of Moodle - http://moodle.org/
|
||||
|
||||
Moodle is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Moodle is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
@template mod_assign/grading_actionmenu
|
||||
|
||||
Actions panel for the assignment grading UI.
|
||||
|
||||
Classes required for JS:
|
||||
* none
|
||||
|
||||
Context variables required for this template:
|
||||
* see mod/lesson/classes/output/grading_actionmenu.php
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"back": "https://moodle.org",
|
||||
"downloadall": "https://moodle.org"
|
||||
}
|
||||
|
||||
}}
|
||||
<div class="container-fluid mb-2">
|
||||
<div class="row justify-content-between">
|
||||
<div class="float-left">
|
||||
<a class="btn btn-secondary" href="{{back}}">{{#str}}back, mod_assign{{/str}}</a>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<a class="btn btn-secondary" href="{{downloadall}}">{{#str}}downloadall, mod_assign{{/str}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,94 @@
|
||||
{{!
|
||||
This file is part of Moodle - http://moodle.org/
|
||||
|
||||
Moodle is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Moodle is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
@template mod_assign/override_actionmenu
|
||||
|
||||
Override select menu for users and groups.
|
||||
|
||||
Classes required for JS:
|
||||
* none
|
||||
|
||||
Context variables required for this template:
|
||||
* see mod/lesson/classes/output/override_actionmenu.php
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"urlselect": {
|
||||
"id": "url_select_test",
|
||||
"action": "https://example.com/post",
|
||||
"formid": "url_select_form",
|
||||
"sesskey": "sesskey",
|
||||
"label": "core/url_select",
|
||||
"helpicon": {
|
||||
"title": "Help with something",
|
||||
"text": "Help with something",
|
||||
"url": "http://example.org/help",
|
||||
"linktext": "",
|
||||
"icon": {
|
||||
"extraclasses": "iconhelp",
|
||||
"attributes": [
|
||||
{"name": "src", "value": "../../../pix/help.svg"},
|
||||
{"name": "alt", "value": "Help icon"}
|
||||
]
|
||||
}
|
||||
},
|
||||
"showbutton": "Go",
|
||||
"options": [{
|
||||
"name": "Group 1", "isgroup": true, "options":
|
||||
[
|
||||
{"name": "Item 1", "isgroup": false, "value": "1"},
|
||||
{"name": "Item 2", "isgroup": false, "value": "2"}
|
||||
]},
|
||||
{"name": "Group 2", "isgroup": true, "options":
|
||||
[
|
||||
{"name": "Item 3", "isgroup": false, "value": "3"},
|
||||
{"name": "Item 4", "isgroup": false, "value": "4"}
|
||||
]}],
|
||||
"disabled": false,
|
||||
"title": "Some cool title"
|
||||
},
|
||||
"addoverride": {
|
||||
"method" : "get",
|
||||
"url" : "#",
|
||||
"formid": "1",
|
||||
"primary" : true,
|
||||
"tooltip" : "This is a tooltip",
|
||||
"label" : "This is a the button text",
|
||||
"attributes": [
|
||||
{
|
||||
"name": "data-attribute",
|
||||
"value": "yeah"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
<div class="container-fluid mb-2">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
{{#urlselect}}
|
||||
{{>core/url_select}}
|
||||
{{/urlselect}}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
{{#addoverride}}
|
||||
{{>core/single_button}}
|
||||
{{/addoverride}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,44 @@
|
||||
{{!
|
||||
This file is part of Moodle - http://moodle.org/
|
||||
|
||||
Moodle is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Moodle is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
@template mod_assign/submission_actionmenu
|
||||
|
||||
Actions for grading submissions in the assignment.
|
||||
|
||||
Classes required for JS:
|
||||
* none
|
||||
|
||||
Context variables required for this template:
|
||||
* see mod/assign/classes/output/actionmenu.php
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"submissionlink": "https://moodle.org",
|
||||
"gradelink": "https://moodle.org"
|
||||
}
|
||||
|
||||
}}
|
||||
<div class="container-fluid mb-1">
|
||||
<div class="submissionlinks row">
|
||||
<div class="col-xs-6 mr-3">
|
||||
<a class="btn btn-secondary mr-1" href="{{submissionlink}}">{{#str}}viewgrading, mod_assign{{/str}}</a>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<a class="btn btn-primary" href="{{gradelink}}">{{#str}}gradeverb, core{{/str}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,185 @@
|
||||
{{!
|
||||
This file is part of Moodle - http://moodle.org/
|
||||
|
||||
Moodle is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Moodle is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
@template mod_assign/user_submission_actionmenu
|
||||
|
||||
Actions for editing and submitting assignments.
|
||||
|
||||
Classes required for JS:
|
||||
* none
|
||||
|
||||
Context variables required for this template:
|
||||
* see mod/assign/classes/output/user_submission_actionmenu.php
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"submit": {
|
||||
"button": {
|
||||
"method" : "get",
|
||||
"url" : "#",
|
||||
"formid": "submit_button_1",
|
||||
"primary" : true,
|
||||
"tooltip" : "Submit tooltip",
|
||||
"label" : "Submit",
|
||||
"attributes": [
|
||||
{
|
||||
"name": "data-attribute",
|
||||
"value": "yeah"
|
||||
}
|
||||
]
|
||||
},
|
||||
"help": {
|
||||
"title": "Help with something",
|
||||
"url": "http://example.org/help",
|
||||
"linktext": "",
|
||||
"icon":{
|
||||
"attributes": [
|
||||
{"name": "class", "value": "iconhelp"},
|
||||
{"name": "src", "value": "../../../pix/help.svg"},
|
||||
{"name": "alt", "value": "Help icon"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"previoussubmission": {
|
||||
"button": {
|
||||
"method" : "get",
|
||||
"url" : "#",
|
||||
"formid": "previous_button_2",
|
||||
"primary" : true,
|
||||
"tooltip" : "Submit tooltip",
|
||||
"label" : "Previous submission",
|
||||
"attributes": [
|
||||
{
|
||||
"name": "data-attribute",
|
||||
"value": "yeah"
|
||||
}
|
||||
]
|
||||
},
|
||||
"help": {
|
||||
"title": "Help with something",
|
||||
"url": "http://example.org/help",
|
||||
"linktext": "",
|
||||
"icon":{
|
||||
"attributes": [
|
||||
{"name": "class", "value": "iconhelp"},
|
||||
{"name": "src", "value": "../../../pix/help.svg"},
|
||||
{"name": "alt", "value": "Help icon"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"edit": {
|
||||
"button": {
|
||||
"method" : "get",
|
||||
"url" : "#",
|
||||
"formid": "edit_button_3",
|
||||
"primary" : true,
|
||||
"tooltip" : "Submit tooltip",
|
||||
"label" : "Edit",
|
||||
"attributes": [
|
||||
{
|
||||
"name": "data-attribute",
|
||||
"value": "yeah"
|
||||
}
|
||||
]
|
||||
},
|
||||
"help": {
|
||||
"title": "Help with something",
|
||||
"url": "http://example.org/help",
|
||||
"linktext": "",
|
||||
"icon":{
|
||||
"attributes": [
|
||||
{"name": "class", "value": "iconhelp"},
|
||||
{"name": "src", "value": "../../../pix/help.svg"},
|
||||
{"name": "alt", "value": "Help icon"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"remove": {
|
||||
"button": {
|
||||
"method" : "get",
|
||||
"url" : "#",
|
||||
"formid": "remove_button_4",
|
||||
"primary" : true,
|
||||
"tooltip" : "Submit tooltip",
|
||||
"label" : "Remove",
|
||||
"attributes": [
|
||||
{
|
||||
"name": "data-attribute",
|
||||
"value": "yeah"
|
||||
}
|
||||
]
|
||||
},
|
||||
"help": {
|
||||
"title": "Help with something",
|
||||
"url": "http://example.org/help",
|
||||
"linktext": "",
|
||||
"icon":{
|
||||
"attributes": [
|
||||
{"name": "class", "value": "iconhelp"},
|
||||
{"name": "src", "value": "../../../pix/help.svg"},
|
||||
{"name": "alt", "value": "Help icon"}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
<div class="container-fluid mb-1">
|
||||
<div class="row">
|
||||
{{#submit}}
|
||||
<div class="col-xs-6 mr-3">
|
||||
{{#button}}
|
||||
{{>core/single_button}}
|
||||
{{/button}}
|
||||
{{#help}}
|
||||
{{>core/help_icon}}
|
||||
{{/help}}
|
||||
</div>
|
||||
{{/submit}}
|
||||
{{#previoussubmission}}
|
||||
<div class="col-xs-6 mr-3">
|
||||
{{#button}}
|
||||
{{>core/single_button}}
|
||||
{{/button}}
|
||||
{{#help}}
|
||||
{{>core/help_icon}}
|
||||
{{/help}}
|
||||
</div>
|
||||
{{/previoussubmission}}
|
||||
{{#edit}}
|
||||
<div class="col-xs-6 mr-3">
|
||||
{{#button}}
|
||||
{{>core/single_button}}
|
||||
{{/button}}
|
||||
{{#help}}
|
||||
{{>core/help_icon}}
|
||||
{{/help}}
|
||||
</div>
|
||||
{{/edit}}
|
||||
{{#remove}}
|
||||
<div class="col-xs-6">
|
||||
{{#button}}
|
||||
{{>core/single_button}}
|
||||
{{/button}}
|
||||
</div>
|
||||
{{/remove}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,7 +32,7 @@ Feature: In an assignment, students start a new attempt based on their previous
|
||||
| Test assignment name | student1 | I'm the student first submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the following fields to these values:
|
||||
| Allow another attempt | 1 |
|
||||
@@ -47,7 +47,7 @@ Feature: In an assignment, students start a new attempt based on their previous
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I should see "I'm the student first submission"
|
||||
|
||||
@@ -98,7 +98,7 @@ Feature: In an assignment, students start a new attempt based on their previous
|
||||
| Test assignment name | student1 | I'm the student first submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
Then "Student 1" row "Status" column of "generaltable" table should contain "Submitted for grading"
|
||||
And "Student 2" row "Status" column of "generaltable" table should contain "Submitted for grading"
|
||||
And "Student 3" row "Status" column of "generaltable" table should contain "No submission"
|
||||
@@ -124,7 +124,7 @@ Feature: In an assignment, students start a new attempt based on their previous
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And "Student 1" row "Status" column of "generaltable" table should contain "Reopened"
|
||||
And "Student 2" row "Status" column of "generaltable" table should contain "Reopened"
|
||||
And "Student 3" row "Status" column of "generaltable" table should contain "Submitted for grading"
|
||||
|
||||
@@ -112,7 +112,7 @@ Feature: View activity completion in the assignment activity
|
||||
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
|
||||
And I log out
|
||||
And I am on the "Music history" "assign activity" page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Vinnie Student1" "table_row"
|
||||
And I set the field "Grade out of 100" to "33"
|
||||
And I set the field "Notify students" to "0"
|
||||
|
||||
@@ -44,7 +44,7 @@ Feature: Assign reset
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Submitted for grading"
|
||||
And I am on "Course 1" course homepage
|
||||
When I navigate to "Reset" in current page administration
|
||||
@@ -53,13 +53,13 @@ Feature: Assign reset
|
||||
And I press "Reset course"
|
||||
And I press "Continue"
|
||||
And I am on the "Test assignment name" Activity page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should not see "Submitted for grading"
|
||||
|
||||
@javascript
|
||||
Scenario: Use course reset to remove user overrides.
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "User overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I press "Add user override"
|
||||
And I set the following fields to these values:
|
||||
| Override user | Student1 |
|
||||
@@ -79,12 +79,13 @@ Feature: Assign reset
|
||||
And I press "Continue"
|
||||
And I am on "Course 1" course homepage
|
||||
And I click on "Test assignment name" "link" in the "region-main" "region"
|
||||
And I navigate to "User overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
Then I should not see "Sam1 Student1"
|
||||
|
||||
Scenario: Use course reset to remove group overrides.
|
||||
When I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "Group overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
And I press "Add group override"
|
||||
And I set the following fields to these values:
|
||||
| Override group | Group 1 |
|
||||
@@ -103,7 +104,8 @@ Feature: Assign reset
|
||||
And I press "Reset course"
|
||||
And I press "Continue"
|
||||
And I am on the "Test assignment name" Activity page
|
||||
And I navigate to "Group overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
Then I should not see "Group 1"
|
||||
|
||||
Scenario: Use course reset to reset blind marking assignment.
|
||||
@@ -113,7 +115,7 @@ Feature: Assign reset
|
||||
| blindmarking | 1 |
|
||||
And I press "Save"
|
||||
When I am on the "Test assignment name" Activity page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I select "Reveal student identities" from the "Grading action" singleselect
|
||||
And I press "Continue"
|
||||
And I should see "Sam1 Student1"
|
||||
@@ -124,5 +126,5 @@ Feature: Assign reset
|
||||
And I press "Reset course"
|
||||
And I press "Continue"
|
||||
And I am on the "Test assignment name" Activity page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should not see "Sam1 Student1"
|
||||
|
||||
@@ -35,7 +35,8 @@ Feature: Assign group override
|
||||
|
||||
Scenario: Add, modify then delete a group override
|
||||
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "Group overrides" in current page administration
|
||||
When I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
And I press "Add group override"
|
||||
And I set the following fields to these values:
|
||||
| Override group | Group 1 |
|
||||
@@ -53,7 +54,8 @@ Feature: Assign group override
|
||||
|
||||
Scenario: Duplicate a user override
|
||||
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "Group overrides" in current page administration
|
||||
When I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
And I press "Add group override"
|
||||
And I set the following fields to these values:
|
||||
| Override group | Group 1 |
|
||||
@@ -76,7 +78,8 @@ Feature: Assign group override
|
||||
| Due date | ##1 Jan 2000 08:00## |
|
||||
| Cut-off date | disabled |
|
||||
And I press "Save and display"
|
||||
And I navigate to "Group overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
And I press "Add group override"
|
||||
And I set the following fields to these values:
|
||||
| Override group | Group 1 |
|
||||
@@ -98,7 +101,8 @@ Feature: Assign group override
|
||||
| Allow submissions from | disabled |
|
||||
| Cut-off date | ##1 Jan 2000 08:00## |
|
||||
And I press "Save and display"
|
||||
And I navigate to "Group overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
And I press "Add group override"
|
||||
And I set the following fields to these values:
|
||||
| Override group | Group 1 |
|
||||
@@ -110,7 +114,7 @@ Feature: Assign group override
|
||||
Then I should not see "You have not made a submission yet."
|
||||
And I log out
|
||||
And I am on the "Test assignment name" Activity page logged in as student1
|
||||
And I should see "You have not made a submission yet."
|
||||
And I should see "No submissions have been made yet"
|
||||
|
||||
Scenario: Allow a group to have a different start date
|
||||
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
@@ -120,7 +124,8 @@ Feature: Assign group override
|
||||
| Allow submissions from | ##1 January 2030 08:00## |
|
||||
| Cut-off date | disabled |
|
||||
And I press "Save and display"
|
||||
And I navigate to "Group overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
And I press "Add group override"
|
||||
And I set the following fields to these values:
|
||||
| Override group | Group 1 |
|
||||
@@ -143,8 +148,10 @@ Feature: Assign group override
|
||||
| Due date | disabled |
|
||||
| Allow submissions from | ##1 January 2040 08:00## |
|
||||
| Cut-off date | disabled |
|
||||
| Group mode | Visible groups |
|
||||
And I press "Save and display"
|
||||
And I navigate to "Group overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
And I press "Add group override"
|
||||
And I set the following fields to these values:
|
||||
| Override group | Group 1 |
|
||||
@@ -152,7 +159,7 @@ Feature: Assign group override
|
||||
And I press "Save"
|
||||
And I should see "Tuesday, 1 January 2030, 8:00"
|
||||
And I am on the "Test assignment name" Activity page
|
||||
And I navigate to "User overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I press "Add user override"
|
||||
And I set the following fields to these values:
|
||||
| Override user | Student1 |
|
||||
@@ -177,7 +184,8 @@ Feature: Assign group override
|
||||
| activity | name | intro | course | groupmode |
|
||||
| assign | Assignment 2 | Assignment 2 description | C1 | 1 |
|
||||
And I am on the "Assignment 2" Activity page logged in as teacher1
|
||||
When I navigate to "Group overrides" in current page administration
|
||||
When I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
Then I should see "No groups you can access."
|
||||
And the "Add group override" "button" should be disabled
|
||||
|
||||
@@ -193,7 +201,8 @@ Feature: Assign group override
|
||||
| user | group |
|
||||
| teacher1 | G1 |
|
||||
And I am on the "Assignment 2" Activity page logged in as teacher1
|
||||
When I navigate to "Group overrides" in current page administration
|
||||
When I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
And I press "Add group override"
|
||||
Then the "Override group" select box should contain "Group 1"
|
||||
And the "Override group" select box should not contain "Group 2"
|
||||
@@ -210,7 +219,8 @@ Feature: Assign group override
|
||||
| user | group |
|
||||
| teacher1 | G1 |
|
||||
And I am on the "Assignment 2" Activity page logged in as admin
|
||||
And I navigate to "Group overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
And I press "Add group override"
|
||||
And I set the following fields to these values:
|
||||
| Override group | Group 1 |
|
||||
@@ -223,6 +233,7 @@ Feature: Assign group override
|
||||
And I log out
|
||||
|
||||
When I am on the "Assignment 2" Activity page logged in as teacher1
|
||||
And I navigate to "Group overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I select "Group overrides" from the "jump" singleselect
|
||||
Then I should see "Group 1" in the ".generaltable" "css_element"
|
||||
And I should not see "Group 2" in the ".generaltable" "css_element"
|
||||
|
||||
@@ -25,7 +25,7 @@ Feature: Assign user override
|
||||
@javascript
|
||||
Scenario: Add, modify then delete a user override
|
||||
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "User overrides" in current page administration
|
||||
When I navigate to "Overrides" in current page administration
|
||||
And I press "Add user override"
|
||||
And I set the following fields to these values:
|
||||
| Override user | Student1 |
|
||||
@@ -44,7 +44,7 @@ Feature: Assign user override
|
||||
@javascript
|
||||
Scenario: Duplicate a user override
|
||||
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "User overrides" in current page administration
|
||||
When I navigate to "Overrides" in current page administration
|
||||
And I press "Add user override"
|
||||
And I set the following fields to these values:
|
||||
| Override user | Student1 |
|
||||
@@ -68,7 +68,7 @@ Feature: Assign user override
|
||||
| Due date | ##1 Jan 2000 08:00## |
|
||||
| Cut-off date | disabled |
|
||||
And I press "Save and display"
|
||||
And I navigate to "User overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I press "Add user override"
|
||||
And I set the following fields to these values:
|
||||
| Override user | Student1 |
|
||||
@@ -91,7 +91,7 @@ Feature: Assign user override
|
||||
| Allow submissions from | disabled |
|
||||
| Cut-off date | ##1 Jan 2000 08:00## |
|
||||
And I press "Save and display"
|
||||
And I navigate to "User overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I press "Add user override"
|
||||
And I set the following fields to these values:
|
||||
| Override user | Student1 |
|
||||
@@ -100,10 +100,10 @@ Feature: Assign user override
|
||||
And I should see "Tuesday, 1 January 2030, 8:00"
|
||||
And I log out
|
||||
And I am on the "Test assignment name" Activity page logged in as student2
|
||||
Then I should not see "You have not made a submission yet."
|
||||
Then I should not see "Add submission"
|
||||
And I log out
|
||||
And I am on the "Test assignment name" Activity page logged in as student1
|
||||
And I should see "You have not made a submission yet."
|
||||
And I should see "Add submission"
|
||||
|
||||
@javascript
|
||||
Scenario: Allow a user to have a different start date
|
||||
@@ -114,7 +114,7 @@ Feature: Assign user override
|
||||
| Allow submissions from | ##1 January 2030 08:00## |
|
||||
| Cut-off date | disabled |
|
||||
And I press "Save and display"
|
||||
And I navigate to "User overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I press "Add user override"
|
||||
And I set the following fields to these values:
|
||||
| Override user | Student1 |
|
||||
@@ -140,7 +140,7 @@ Feature: Assign user override
|
||||
| activity | name | intro | course | groupmode |
|
||||
| assign | Assignment 2 | Assignment 2 description | C1 | 1 |
|
||||
And I am on the "Assignment 2" Activity page logged in as teacher1
|
||||
When I navigate to "User overrides" in current page administration
|
||||
When I navigate to "Overrides" in current page administration
|
||||
Then I should see "No groups you can access."
|
||||
And the "Add user override" "button" should be disabled
|
||||
|
||||
@@ -162,7 +162,7 @@ Feature: Assign user override
|
||||
| student1 | G1 |
|
||||
| student2 | G2 |
|
||||
And I am on the "Assignment 2" Activity page logged in as teacher1
|
||||
When I navigate to "User overrides" in current page administration
|
||||
When I navigate to "Overrides" in current page administration
|
||||
And I press "Add user override"
|
||||
Then the "Override user" select box should contain "Sam1 Student1, student1@example.com"
|
||||
And the "Override user" select box should not contain "Sam2 Student2, student2@example.com"
|
||||
@@ -186,7 +186,7 @@ Feature: Assign user override
|
||||
| student1 | G1 |
|
||||
| student2 | G2 |
|
||||
And I am on the "Assignment 2" Activity page logged in as admin
|
||||
And I navigate to "User overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I press "Add user override"
|
||||
And I set the following fields to these values:
|
||||
| Override user | Student1 |
|
||||
@@ -199,7 +199,7 @@ Feature: Assign user override
|
||||
And I log out
|
||||
|
||||
And I am on the "Assignment 2" Activity page logged in as teacher1
|
||||
When I navigate to "User overrides" in current page administration
|
||||
When I navigate to "Overrides" in current page administration
|
||||
Then I should see "Student1" in the ".generaltable" "css_element"
|
||||
But I should not see "Student2" in the ".generaltable" "css_element"
|
||||
|
||||
@@ -210,7 +210,7 @@ Feature: Assign user override
|
||||
And I expand all fieldsets
|
||||
And I set the field "Availability" to "Hide from students"
|
||||
And I click on "Save and display" "button"
|
||||
When I navigate to "User overrides" in current page administration
|
||||
When I navigate to "Overrides" in current page administration
|
||||
And I press "Add user override"
|
||||
And I set the following fields to these values:
|
||||
| Override user | Student1 |
|
||||
|
||||
@@ -51,7 +51,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
|
||||
And I log out
|
||||
# Mark the submissions.
|
||||
And I am on the "Test assignment name" "assign activity" page logged in as "teacher1"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should see "Not marked" in the "I'm student1's submission" "table_row"
|
||||
And I click on "Grade" "link" in the "I'm student1's submission" "table_row"
|
||||
And I set the field "Grade out of 100" to "50"
|
||||
@@ -60,7 +60,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
|
||||
And I set the field "Notify students" to "0"
|
||||
And I press "Save changes"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should see "Not marked" in the "I'm student2's submission" "table_row"
|
||||
And I click on "Grade" "link" in the "I'm student2's submission" "table_row"
|
||||
And I set the field "Grade out of 100" to "50"
|
||||
@@ -69,7 +69,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
|
||||
And I set the field "Notify students" to "0"
|
||||
And I press "Save changes"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should see "In review" in the "I'm student1's submission" "table_row"
|
||||
And I should see "In review" in the "I'm student2's submission" "table_row"
|
||||
|
||||
@@ -84,7 +84,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
|
||||
And I set the field "Notify students" to "No"
|
||||
And I press "Save changes"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should see "Released" in the "I'm student1's submission" "table_row"
|
||||
And I should see "Released" in the "I'm student2's submission" "table_row"
|
||||
And I log out
|
||||
@@ -101,7 +101,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
|
||||
And I should not see "Great job!"
|
||||
And I log out
|
||||
And I am on the "Test assignment name" "assign activity" page logged in as "teacher1"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I set the field "Grading action" to "Reveal student identities"
|
||||
And I press "Continue"
|
||||
Then I should see "Released" in the "Student 1" "table_row"
|
||||
@@ -132,7 +132,7 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
|
||||
And I set the field "Notify students" to "No"
|
||||
And I press "Save changes"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should see "Released" in the "Student 1" "table_row"
|
||||
And I should see "Released" in the "Student 2" "table_row"
|
||||
And I log out
|
||||
|
||||
@@ -42,7 +42,7 @@ Feature: Bulk remove submissions
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "I'm the student1 submission"
|
||||
And I should see "I'm the student2 submission"
|
||||
And I set the field "selectall" to "1"
|
||||
@@ -75,7 +75,7 @@ Feature: Bulk remove submissions
|
||||
| Test assignment name | student2 | I'm the student2 submission |
|
||||
|
||||
When I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "I'm the student1 submission"
|
||||
And I should see "I'm the student2 submission"
|
||||
And I set the field "selectall" to "1"
|
||||
@@ -104,7 +104,7 @@ Feature: Bulk remove submissions
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "I'm the student1 submission"
|
||||
And I should see "I'm the student2 submission"
|
||||
And I set the field "selectall" to "1"
|
||||
@@ -142,7 +142,7 @@ Feature: Bulk remove submissions
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "I'm the student1 submission"
|
||||
And I should see "I'm the student2 submission"
|
||||
And I set the field "selectall" to "1"
|
||||
|
||||
@@ -32,7 +32,7 @@ Feature: In an assignment, teachers can edit a students submission inline
|
||||
| Test assignment name | student1 | I'm the student first submission |
|
||||
|
||||
When I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the following fields to these values:
|
||||
| Grade out of 100 | 50 |
|
||||
@@ -41,7 +41,7 @@ Feature: In an assignment, teachers can edit a students submission inline
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should see "50.00" in the "Student 1" "table_row"
|
||||
And I should see "Submitted for grading" in the "Student 1" "table_row"
|
||||
And I should see "Graded" in the "Student 1" "table_row"
|
||||
|
||||
@@ -28,7 +28,7 @@ Feature: Check that the assignment grade can not be input in a wrong format.
|
||||
| markingworkflow | 1 |
|
||||
| submissiondrafts | 0 |
|
||||
When I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "Grade out of 100" to "50,,6"
|
||||
And I press "Save changes"
|
||||
@@ -58,7 +58,7 @@ Feature: Check that the assignment grade can not be input in a wrong format.
|
||||
| markingworkflow | 1 |
|
||||
| submissiondrafts | 0 |
|
||||
When I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "Grade out of 100" to "50..6"
|
||||
And I press "Save changes"
|
||||
|
||||
@@ -28,14 +28,14 @@ Feature: Check that the assignment grade can be updated correctly
|
||||
| markingworkflow | 1 |
|
||||
| submissiondrafts | 0 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
Then I navigate to "View all submissions" in current page administration
|
||||
Then I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "Grade out of 100" to "50"
|
||||
And I set the field "Notify students" to "0"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And "Student 1" row "Grade" column of "generaltable" table should contain "50.00"
|
||||
|
||||
@javascript
|
||||
@@ -64,12 +64,12 @@ Feature: Check that the assignment grade can be updated correctly
|
||||
| teamsubmission | 1 |
|
||||
| groupmode | 0 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "Grade out of 100" to "50"
|
||||
And I set the field "Notify students" to "0"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then "Student 1" row "Grade" column of "generaltable" table should contain "50.00"
|
||||
|
||||
@@ -32,7 +32,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su
|
||||
| assign | user | onlinetext |
|
||||
| Test assignment name | student2 | I'm the student first submission |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 2" "table_row"
|
||||
And I set the following fields to these values:
|
||||
| Grade | 49 |
|
||||
@@ -47,7 +47,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 2" "table_row"
|
||||
And I click on "View a different attempt" "link"
|
||||
And I click on "Attempt 1" "radio" in the "View a different attempt" "dialogue"
|
||||
|
||||
@@ -26,7 +26,7 @@ Feature: In an assignment, the administrator can edit students' submissions
|
||||
| Test assignment name | student1 | I'm the student1 submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as admin
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I open the action menu in "Student 1" "table_row"
|
||||
And I choose "Edit submission" in the open action menu
|
||||
And I set the following fields to these values:
|
||||
|
||||
@@ -32,7 +32,7 @@ Feature: In an assignment, teachers can filter displayed submissions by assigned
|
||||
| markingworkflow | 1 |
|
||||
| markingallocation | 1 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "allocatedmarker" to "Marker 1"
|
||||
And I set the field "Notify students" to "0"
|
||||
@@ -40,7 +40,7 @@ Feature: In an assignment, teachers can filter displayed submissions by assigned
|
||||
And I click on "Edit settings" "link"
|
||||
|
||||
When I am on the "Test assignment name" Activity page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I set the field "markerfilter" to "Marker 1"
|
||||
Then I should see "Student 1"
|
||||
And I should not see "Student 2"
|
||||
|
||||
@@ -42,7 +42,7 @@ Feature: In an assignment, teachers can filter displayed submissions and see dra
|
||||
@javascript
|
||||
Scenario: View assignments with draft status on the view all submissions page
|
||||
Given I am on the "Test assignment" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
When I set the field "Filter" to "Draft"
|
||||
Then I should see "Student 2"
|
||||
And I should not see "Student 1"
|
||||
@@ -51,7 +51,7 @@ Feature: In an assignment, teachers can filter displayed submissions and see dra
|
||||
@javascript
|
||||
Scenario: View assignments with draft status in the grader
|
||||
Given I am on the "Test assignment" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
When I click on "[data-region=user-filters]" "css_element"
|
||||
And I set the field "filter" to "Draft"
|
||||
|
||||
@@ -35,7 +35,7 @@ Feature: In an assignment, teachers can change filters in the grading app
|
||||
@javascript
|
||||
Scenario: Set filters in the grading table and see them in the grading app
|
||||
Given I am on the "Test assignment name &" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I should not see "Course 1 &"
|
||||
And the "title" attribute of "a[title='Course: Course 1 &']" "css_element" should not contain "&"
|
||||
@@ -46,7 +46,7 @@ Feature: In an assignment, teachers can change filters in the grading app
|
||||
And I press "Save changes"
|
||||
|
||||
And I am on the "Test assignment name &" Activity page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I set the field "filter" to "Not submitted"
|
||||
And I set the field "markerfilter" to "Marker 1"
|
||||
And I set the field "workflowfilter" to "In marking"
|
||||
@@ -58,7 +58,7 @@ Feature: In an assignment, teachers can change filters in the grading app
|
||||
@javascript
|
||||
Scenario: Set filters in the grading app and see them in the grading table
|
||||
Given I am on the "Test assignment name &" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "allocatedmarker" to "Marker 1"
|
||||
And I set the field "workflowstate" to "In marking"
|
||||
@@ -66,7 +66,7 @@ Feature: In an assignment, teachers can change filters in the grading app
|
||||
And I press "Save changes"
|
||||
|
||||
And I am on the "Test assignment name &" Activity page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I click on "[data-region=user-filters]" "css_element"
|
||||
And I set the field "filter" to "Not submitted"
|
||||
|
||||
@@ -36,7 +36,7 @@ Feature: View the grading status of an assignment
|
||||
| Test assignment name | student1 | I'm the student first submission |
|
||||
# Mark the submission.
|
||||
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Not marked" in the "Student 1" "table_row"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I should see "1 of 2"
|
||||
@@ -49,7 +49,7 @@ Feature: View the grading status of an assignment
|
||||
And I set the field "Notify students" to "0"
|
||||
And I press "Save changes"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "In review" in the "Student 1" "table_row"
|
||||
And I log out
|
||||
# View the grading status as a student.
|
||||
@@ -59,7 +59,7 @@ Feature: View the grading status of an assignment
|
||||
And I log out
|
||||
# Mark the submission again but set the marking workflow to 'Released'.
|
||||
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "In review" in the "Student 1" "table_row"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I should see "1 of 1"
|
||||
@@ -67,7 +67,7 @@ Feature: View the grading status of an assignment
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Released" in the "Student 1" "table_row"
|
||||
And I log out
|
||||
# View the grading status as a student.
|
||||
@@ -77,7 +77,7 @@ Feature: View the grading status of an assignment
|
||||
And I log out
|
||||
# Now, change the status from 'Released' to 'In marking' (this will remove the grade from the gradebook).
|
||||
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Released" in the "Student 1" "table_row"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I should see "1 of 1"
|
||||
@@ -85,7 +85,7 @@ Feature: View the grading status of an assignment
|
||||
And I set the field "Notify students" to "0"
|
||||
And I press "Save changes"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "In marking" in the "Student 1" "table_row"
|
||||
# The grade should also remain displayed as it's stored in the assign DB tables, but the final grade should be empty.
|
||||
And "Student 1" row "Grade" column of "generaltable" table should contain "50.00"
|
||||
@@ -112,7 +112,7 @@ Feature: View the grading status of an assignment
|
||||
| Test assignment name | student1 | I'm the student first submission |
|
||||
# Mark the submission.
|
||||
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should not see "Graded" in the "Student 1" "table_row"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I should see "1 of 2"
|
||||
@@ -124,7 +124,7 @@ Feature: View the grading status of an assignment
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Graded" in the "Student 1" "table_row"
|
||||
And I log out
|
||||
# View the grading status as a student.
|
||||
@@ -141,7 +141,7 @@ Feature: View the grading status of an assignment
|
||||
And I log out
|
||||
# Teacher marks the submission again after noticing the 'Graded - follow-up submission received'.
|
||||
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Graded - follow-up submission received" in the "Student 1" "table_row"
|
||||
And I wait "10" seconds
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
@@ -151,7 +151,7 @@ Feature: View the grading status of an assignment
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Graded" in the "Student 1" "table_row"
|
||||
And I log out
|
||||
# View the grading status as a student again.
|
||||
|
||||
@@ -33,7 +33,7 @@ Feature: Grant an extension to an offline student
|
||||
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | duedate |
|
||||
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | 1388534400 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
And I open the action menu in "Student 1" "table_row"
|
||||
And I follow "Grant extension"
|
||||
And I should see "Student 1 (student1@example.com)"
|
||||
@@ -51,7 +51,7 @@ Feature: Grant an extension to an offline student
|
||||
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | duedate |
|
||||
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | 1388534400 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
And I set the field "selectall" to "1"
|
||||
And I set the field "operation" to "Grant extension"
|
||||
And I click on "Go" "button" confirming the dialogue
|
||||
@@ -80,7 +80,7 @@ Feature: Grant an extension to an offline student
|
||||
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | allowsubmissionsfromdate | duedate |
|
||||
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | 1388534400 | 1388620800 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
And I open the action menu in "Student 1" "table_row"
|
||||
And I follow "Grant extension"
|
||||
And I should see "Student 1 (student1@example.com)"
|
||||
@@ -100,7 +100,7 @@ Feature: Grant an extension to an offline student
|
||||
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | allowsubmissionsfromdate | duedate |
|
||||
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | 1388534400 | 1388620800 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
And I set the field "selectall" to "1"
|
||||
And I set the field "operation" to "Grant extension"
|
||||
And I click on "Go" "button" confirming the dialogue
|
||||
|
||||
@@ -34,7 +34,7 @@ Feature: Group assignment submissions
|
||||
| submissiondrafts | 0 |
|
||||
| teamsubmission | 1 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
Then "//tr[contains(., 'Student 0')][contains(., 'Default group')]" "xpath_element" should exist
|
||||
And "//tr[contains(., 'Student 1')][contains(., 'Default group')]" "xpath_element" should exist
|
||||
And "//tr[contains(., 'Student 2')][contains(., 'Default group')]" "xpath_element" should exist
|
||||
@@ -52,7 +52,7 @@ Feature: Group assignment submissions
|
||||
| student0 | G1 |
|
||||
| student1 | G1 |
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I set the field "Separate groups" to "Group 1"
|
||||
And "//tr[contains(., 'Student 0')][contains(., 'Group 1')]" "xpath_element" should exist
|
||||
And "//tr[contains(., 'Student 1')][contains(., 'Group 1')]" "xpath_element" should exist
|
||||
@@ -104,7 +104,7 @@ Feature: Group assignment submissions
|
||||
| Test assignment name | student1 | I'm the student's first submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
Then "Student 1" row "Status" column of "generaltable" table should contain "Submitted for grading"
|
||||
And "Student 2" row "Status" column of "generaltable" table should contain "Submitted for grading"
|
||||
And "Student 3" row "Status" column of "generaltable" table should not contain "Submitted for grading"
|
||||
@@ -115,7 +115,7 @@ Feature: Group assignment submissions
|
||||
| Test assignment name | student3 | I'm the student's first submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And "Student 1" row "Status" column of "generaltable" table should contain "Submitted for grading"
|
||||
And "Student 2" row "Status" column of "generaltable" table should contain "Submitted for grading"
|
||||
And "Student 3" row "Status" column of "generaltable" table should contain "Submitted for grading"
|
||||
@@ -164,7 +164,7 @@ Feature: Group assignment submissions
|
||||
| Test assignment name | student1 | I'm the student's first submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the following fields to these values:
|
||||
| Grade out of 100 | 50.0 |
|
||||
@@ -175,7 +175,7 @@ Feature: Group assignment submissions
|
||||
And I press "Save changes"
|
||||
When I am on "Course 1" course homepage
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then "Student 1" row "Status" column of "generaltable" table should contain "Reopened"
|
||||
And "Student 2" row "Status" column of "generaltable" table should contain "Reopened"
|
||||
|
||||
@@ -312,6 +312,6 @@ Feature: Group assignment submissions
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
Then "Student 1" row "Status" column of "generaltable" table should contain "Submitted for grading"
|
||||
And "Student 2" row "Status" column of "generaltable" table should contain "Submitted for grading"
|
||||
|
||||
@@ -36,14 +36,14 @@ Feature: Hide grader identities identity from students
|
||||
|
||||
# Grade the submission and leave feedback
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should not see "Graded" in the "Student 1" "table_row"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "Grade out of 100" to "50"
|
||||
And I set the field "Feedback comments" to "Catch for us the foxes."
|
||||
And I press "Save changes"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Graded" in the "Student 1" "table_row"
|
||||
And I log out
|
||||
|
||||
|
||||
@@ -57,14 +57,14 @@ Feature: Outcome grading
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
When I am on the "Test assignment name" "assign activity" page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 0" "table_row"
|
||||
And I set the following fields to these values:
|
||||
| Outcome Test: | Excellent |
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
When I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should see "Outcome Test: Excellent" in the "Student 0" "table_row"
|
||||
And I should not see "Outcome Test: Excellent" in the "Student 1" "table_row"
|
||||
|
||||
@@ -100,14 +100,14 @@ Feature: Outcome grading
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
When I am on the "Test assignment name" "assign activity" page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 0" "table_row"
|
||||
And I set the following fields to these values:
|
||||
| Outcome Test: | Excellent |
|
||||
| Apply grades and feedback to entire group | Yes |
|
||||
And I press "Save changes"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should see "Outcome Test: Excellent" in the "Student 0" "table_row"
|
||||
And I should see "Outcome Test: Excellent" in the "Student 1" "table_row"
|
||||
And I should not see "Outcome Test: Excellent" in the "Student 2" "table_row"
|
||||
@@ -117,7 +117,7 @@ Feature: Outcome grading
|
||||
| Apply grades and feedback to entire group | No |
|
||||
And I press "Save changes"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Outcome Test: Excellent" in the "Student 0" "table_row"
|
||||
And I should see "Outcome Test: Disappointing" in the "Student 1" "table_row"
|
||||
And I should not see "Outcome Test: Disappointing" in the "Student 0" "table_row"
|
||||
|
||||
@@ -28,7 +28,7 @@ Feature: In an assignment, page titles are informative
|
||||
Scenario: I view an assignment as a teacher and take an action
|
||||
When I am on the "History of ants" Activity page logged in as teacher1
|
||||
Then "title[text() = 'C1: History of ants']" "xpath_element" should exist in the "head" "css_element"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And "title[text() = 'C1: History of ants - Grading']" "xpath_element" should exist in the "head" "css_element"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And "title[text() = 'C1: History of ants - Grading']" "xpath_element" should exist in the "head" "css_element"
|
||||
|
||||
@@ -41,7 +41,7 @@ Feature: Prevent or allow assignment submission changes
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
And I open the action menu in "Student 1" "table_row"
|
||||
And I follow "Prevent submission changes"
|
||||
Then I should see "Submission changes not allowed"
|
||||
@@ -53,7 +53,7 @@ Feature: Prevent or allow assignment submission changes
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I open the action menu in "Student 1" "table_row"
|
||||
And I follow "Allow submission changes"
|
||||
And I should not see "Submission changes not allowed"
|
||||
@@ -78,7 +78,7 @@ Feature: Prevent or allow assignment submission changes
|
||||
| Test assignment name | student2 | I'm the student2 submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
And I set the field "selectall" to "1"
|
||||
And I click on "Go" "button" confirming the dialogue
|
||||
Then I should see "Submission changes not allowed" in the "Student 1" "table_row"
|
||||
@@ -90,7 +90,7 @@ Feature: Prevent or allow assignment submission changes
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I set the field "selectall" to "1"
|
||||
And I set the field "id_operation" to "Unlock submissions"
|
||||
And I click on "Go" "button" confirming the dialogue
|
||||
|
||||
@@ -29,7 +29,7 @@ Feature: In an assignment, teachers grade multiple students on one page
|
||||
| Test assignment name | student1 | I'm the student1 submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
When I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
@@ -93,7 +93,7 @@ Feature: In an assignment, teachers grade multiple students on one page
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the following fields to these values:
|
||||
| Grade out of 100 | 50.0 |
|
||||
@@ -102,7 +102,7 @@ Feature: In an assignment, teachers grade multiple students on one page
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I click on "Quick grading" "checkbox"
|
||||
And I set the field "User grade" to "60.0"
|
||||
And I press "Save all quick grading changes"
|
||||
@@ -124,7 +124,7 @@ Feature: In an assignment, teachers grade multiple students on one page
|
||||
And I should not see "1337"
|
||||
And I log out
|
||||
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Hide User picture" "link"
|
||||
And I click on "Hide Full name" "link"
|
||||
And I click on "Hide Email address" "link"
|
||||
|
||||
@@ -80,7 +80,7 @@ I should be able to create an assignment with a due date relative to the course
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And the activity date in "Test assignment name" should contain "after course start"
|
||||
And I should see "Calculated for each student" in the "Time remaining" "table_row"
|
||||
When I navigate to "View all submissions" in current page administration
|
||||
When I follow "View all submissions"
|
||||
Then I should see "No submission" in the "Student 1" "table_row"
|
||||
And I should see "Assignment is overdue by:" in the "Student 1" "table_row"
|
||||
And I should see "No submission" in the "Student 2" "table_row"
|
||||
|
||||
@@ -46,7 +46,7 @@ Feature: Remove a submission
|
||||
| Test assignment name | student1 | I'm the student submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I open the action menu in "Student 1" "table_row"
|
||||
When I follow "Remove submission"
|
||||
And I click on "Continue" "button"
|
||||
@@ -74,7 +74,7 @@ Feature: Remove a submission
|
||||
| Test assignment name | student1 | I'm the student submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I open the action menu in "Student 1" "table_row"
|
||||
When I follow "Remove submission"
|
||||
And I click on "Continue" "button"
|
||||
@@ -106,7 +106,7 @@ Feature: Remove a submission
|
||||
And I log out
|
||||
|
||||
When I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should not see "I'm the student submission"
|
||||
And "Student 1" row "Status" column of "generaltable" table should contain "No submission"
|
||||
And I log out
|
||||
|
||||
@@ -33,7 +33,7 @@ Feature: Submissions are unlocked when a new attempt is given
|
||||
| Test assignment name | student1 | I'm the student1 submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I open the action menu in "Student 1" "table_row"
|
||||
And I follow "Prevent submission changes"
|
||||
And I should see "Submission changes not allowed"
|
||||
@@ -59,7 +59,7 @@ Feature: Submissions are unlocked when a new attempt is given
|
||||
| Test assignment name | student1 | I'm the student1 submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
When I open the action menu in "Student 1" "table_row"
|
||||
And I follow "Prevent submission changes"
|
||||
Then I should see "Submission changes not allowed"
|
||||
|
||||
@@ -28,13 +28,13 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
|
||||
| submissiondrafts | 0 |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "Grade out of 100" to "40"
|
||||
And I press "Save changes"
|
||||
And I follow "Edit settings"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And "Student 1" row "Grade" column of "generaltable" table should contain "40.00"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
|
||||
@@ -44,7 +44,7 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
|
||||
And I set the field "Rescale existing grades" to "No"
|
||||
And I set the field "Maximum grade" to "80"
|
||||
When I press "Save and display"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then "Student 1" row "Grade" column of "generaltable" table should contain "40.00"
|
||||
|
||||
Scenario: Update an assignment without touching the max grades
|
||||
@@ -60,7 +60,7 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
|
||||
And I set the field "Rescale existing grades" to "Yes"
|
||||
And I set the field "Maximum grade" to "80"
|
||||
When I press "Save and display"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then "Student 1" row "Grade" column of "generaltable" table should contain "40.00"
|
||||
|
||||
Scenario: Update the max grade for an assignment rescaling existing grades
|
||||
@@ -69,11 +69,11 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
|
||||
And I set the field "Rescale existing grades" to "Yes"
|
||||
And I set the field "Maximum grade" to "50"
|
||||
When I press "Save and display"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then "Student 1" row "Grade" column of "generaltable" table should contain "20.00"
|
||||
|
||||
Scenario: Rescaling should not produce negative grades
|
||||
Given I navigate to "View all submissions" in current page administration
|
||||
Given I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 2" "table_row"
|
||||
And I wait until the page is ready
|
||||
And I follow "Assignment: Test assignment name"
|
||||
@@ -82,6 +82,6 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
|
||||
And I set the field "Rescale existing grades" to "Yes"
|
||||
And I set the field "Maximum grade" to "50"
|
||||
When I press "Save and display"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
# Make sure the student did not receive a negative grade.
|
||||
Then "Student 2" row "Grade" column of "generaltable" table should not contain "-0.50"
|
||||
|
||||
@@ -85,7 +85,7 @@ Feature: Set availability dates for an assignment
|
||||
|
||||
And I am on the "Assignment name" Activity page logged in as teacher1
|
||||
And I should see "1" in the "Submitted" "table_row"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Submitted for grading" in the "Student 1" "table_row"
|
||||
|
||||
@_file_upload
|
||||
@@ -116,7 +116,7 @@ Feature: Set availability dates for an assignment
|
||||
|
||||
And I am on the "Assignment name" Activity page logged in as teacher1
|
||||
And I should see "1" in the "Submitted" "table_row"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Submitted for grading" in the "Student 1" "table_row"
|
||||
And I should see "2 days 5 hours late" in the "Student 1" "table_row"
|
||||
|
||||
@@ -139,6 +139,6 @@ Feature: Set availability dates for an assignment
|
||||
|
||||
And I am on the "Assignment name" Activity page logged in as teacher1
|
||||
And I should see "0" in the "Submitted" "table_row"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "No submission" in the "Student 1" "table_row"
|
||||
And I should see "Assignment is overdue by: 2 days 5 hours" in the "Student 1" "table_row"
|
||||
|
||||
@@ -34,7 +34,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
|
||||
|
||||
# Mark the submission.
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Not marked" in the "I'm the student's first submission" "table_row"
|
||||
And I click on "Grade" "link" in the "I'm the student's first submission" "table_row"
|
||||
And I set the field "Grade out of 100" to "50"
|
||||
@@ -44,7 +44,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "In review" in the "I'm the student's first submission" "table_row"
|
||||
|
||||
@javascript
|
||||
@@ -55,14 +55,14 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Ready for release" in the "I'm the student's first submission" "table_row"
|
||||
And I click on "Grade" "link" in the "I'm the student's first submission" "table_row"
|
||||
And I set the field "Marking workflow state" to "Released"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Released" in the "I'm the student's first submission" "table_row"
|
||||
And I set the field "Grading action" to "Reveal student identities"
|
||||
And I press "Continue"
|
||||
@@ -81,7 +81,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Ready for release" in the "I'm the student's first submission" "table_row"
|
||||
And I set the field "Grading action" to "Reveal student identities"
|
||||
And I press "Continue"
|
||||
@@ -90,7 +90,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Released" in the "Student 1" "table_row"
|
||||
And I log out
|
||||
|
||||
@@ -102,7 +102,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
|
||||
@javascript
|
||||
Scenario: Submissions table visible with overrides and blind marking
|
||||
When I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "User overrides" in current page administration
|
||||
And I navigate to "Overrides" in current page administration
|
||||
And I press "Add user override"
|
||||
And I set the following fields to these values:
|
||||
| Override user | Student |
|
||||
@@ -110,5 +110,5 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
|
||||
And I press "Save"
|
||||
And I should see "Tuesday, 1 January 2030, 8:00"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "In review" in the "I'm the student's first submission" "table_row"
|
||||
|
||||
@@ -57,7 +57,7 @@ Feature: In an assignment, students can comment in their submissions
|
||||
And I log out
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I click on ".comment-link" "css_element"
|
||||
When I set the field "content" to "Teacher feedback first comment"
|
||||
@@ -75,7 +75,7 @@ Feature: In an assignment, students can comment in their submissions
|
||||
| Test assignment name | student1 | I'm the student submission |
|
||||
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I click on ".comment-link" "css_element"
|
||||
When I set the field "content" to "Teacher feedback first comment"
|
||||
@@ -92,7 +92,7 @@ Feature: In an assignment, students can comment in their submissions
|
||||
| activity | course | name | assignsubmission_onlinetext_enabled | assignmentsubmission_file_enabled | assignfeedback_comments_enabled |
|
||||
| assign | C1 | Test assignment name | 0 | 0 | 1 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
When I set the following fields to these values:
|
||||
| Grade out of 100 | 50 |
|
||||
@@ -100,7 +100,7 @@ Feature: In an assignment, students can comment in their submissions
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
Then I should see "50.00" in the "Student 1" "table_row"
|
||||
And I should see "I'm the teacher feedback" in the "Student 1" "table_row"
|
||||
|
||||
@@ -109,7 +109,7 @@ Feature: In an assignment, students can comment in their submissions
|
||||
| activity | course | name | assignsubmission_onlinetext_enabled | assignmentsubmission_file_enabled | assignfeedback_comments_enabled |
|
||||
| assign | C1 | Test assignment name | 0 | 0 | 1 |
|
||||
And I am on the "Test assignment name" Activity page logged in as teacher1
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the following fields to these values:
|
||||
| Grade out of 100 | 0 |
|
||||
|
||||
@@ -81,7 +81,7 @@ Feature: Submit assignment without group
|
||||
And I am on the "c1assign1" "assign activity" page logged in as teacher1
|
||||
And I should see "1" in the "Groups" "table_row"
|
||||
And I should not see "The setting 'Require group to make submission\' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Default group" in the "Student 1" "table_row"
|
||||
And I should see "Default group" in the "Student 2" "table_row"
|
||||
And I should see "Submitted for grading" in the "Student 1" "table_row"
|
||||
@@ -89,7 +89,7 @@ Feature: Submit assignment without group
|
||||
And I am on the "c1assign2" "assign activity" page
|
||||
And I should see "0" in the "Groups" "table_row"
|
||||
And I should see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Not a member of any group, so unable to make submissions." in the "Student 1" "table_row"
|
||||
And I should see "Not a member of any group, so unable to make submissions." in the "Student 2" "table_row"
|
||||
And I should not see "Submitted for grading" in the "Student 1" "table_row"
|
||||
@@ -97,7 +97,7 @@ Feature: Submit assignment without group
|
||||
And I am on the "c2assign1" "assign activity" page
|
||||
And I should see "1" in the "Groups" "table_row"
|
||||
And I should not see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Group 1" in the "Student 1" "table_row"
|
||||
And I should see "Group 1" in the "Student 2" "table_row"
|
||||
And I should see "Submitted for grading" in the "Student 1" "table_row"
|
||||
@@ -112,7 +112,7 @@ Feature: Submit assignment without group
|
||||
And I log out
|
||||
And I am on the "c3assign1" "assign activity" page logged in as teacher1
|
||||
And I should see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
And I follow "View all submissions"
|
||||
And I should see "Member of more than one group, so unable to make submissions." in the "Student 3" "table_row"
|
||||
|
||||
Scenario: All users are in groups, so no warning messages needed.
|
||||
|
||||
@@ -859,7 +859,7 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
|
||||
// Test you can see the submit button for an online text assignment with a submission.
|
||||
$this->setUser($student);
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertStringContainsString(get_string('submitassignment', 'assign'),
|
||||
$output, 'Can submit non empty onlinetext assignment');
|
||||
}
|
||||
@@ -1990,7 +1990,7 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
|
||||
// Check we can see the submit button.
|
||||
$this->setUser($student);
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertStringContainsString(get_string('submitassignment', 'assign'), $output);
|
||||
|
||||
$submission = $assign->get_group_submission($student->id, 0, true);
|
||||
@@ -1998,18 +1998,18 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
$assign->testable_update_submission($submission, $student->id, true, true);
|
||||
|
||||
// Check that the student does not see "Submit" button.
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertStringNotContainsString(get_string('submitassignment', 'assign'), $output);
|
||||
|
||||
// Change to another user in the same group.
|
||||
$this->setUser($otherstudent);
|
||||
$output = $assign->view_student_summary($otherstudent, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $otherstudent);
|
||||
$this->assertStringContainsString(get_string('submitassignment', 'assign'), $output);
|
||||
|
||||
$submission = $assign->get_group_submission($otherstudent->id, 0, true);
|
||||
$submission->status = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
|
||||
$assign->testable_update_submission($submission, $otherstudent->id, true, true);
|
||||
$output = $assign->view_student_summary($otherstudent, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $otherstudent);
|
||||
$this->assertStringNotContainsString(get_string('submitassignment', 'assign'), $output);
|
||||
}
|
||||
|
||||
@@ -2044,8 +2044,9 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
$this->add_submission($student, $assign);
|
||||
|
||||
// Check we can see the submit button.
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertStringContainsString(get_string('submitassignment', 'assign'), $output);
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$this->assertStringContainsString(get_string('timeremaining', 'assign'), $output);
|
||||
$difftime = time() - $time;
|
||||
$this->assertStringContainsString(get_string('overdue', 'assign', format_time((2 * DAYSECS) + $difftime)), $output);
|
||||
@@ -2055,15 +2056,16 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
$assign->testable_update_submission($submission, $student->id, true, true);
|
||||
|
||||
// Check that the student does not see "Submit" button.
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertStringNotContainsString(get_string('submitassignment', 'assign'), $output);
|
||||
|
||||
// Change to another user in the same group.
|
||||
$this->setUser($otherstudent);
|
||||
$output = $assign->view_student_summary($otherstudent, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $otherstudent);
|
||||
$this->assertStringNotContainsString(get_string('submitassignment', 'assign'), $output);
|
||||
|
||||
// Check that time remaining is not overdue.
|
||||
$output = $assign->view_student_summary($otherstudent, true);
|
||||
$this->assertStringContainsString(get_string('timeremaining', 'assign'), $output);
|
||||
$difftime = time() - $time;
|
||||
$this->assertStringContainsString(get_string('submittedlate', 'assign', format_time((2 * DAYSECS) + $difftime)), $output);
|
||||
@@ -2071,7 +2073,7 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
$submission = $assign->get_group_submission($otherstudent->id, 0, true);
|
||||
$submission->status = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
|
||||
$assign->testable_update_submission($submission, $otherstudent->id, true, true);
|
||||
$output = $assign->view_student_summary($otherstudent, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $otherstudent);
|
||||
$this->assertStringNotContainsString(get_string('submitassignment', 'assign'), $output);
|
||||
}
|
||||
|
||||
@@ -2507,7 +2509,7 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
|
||||
// Student should be able to see an add submission button.
|
||||
$this->setUser($student);
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertNotEquals(false, strpos($output, get_string('addsubmission', 'assign')));
|
||||
|
||||
// Add a submission.
|
||||
@@ -2538,14 +2540,16 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
// Need a better check.
|
||||
$this->assertNotEquals(false, strpos($output, 'Submission text'), 'Contains: Submission text');
|
||||
|
||||
// Check that the student now has a button for Add a new attempt".
|
||||
$this->assertNotEquals(false, strpos($output, get_string('addnewattempt', 'assign')));
|
||||
// Check that the student now does not have a button for Submit.
|
||||
$this->assertEquals(false, strpos($output, get_string('submitassignment', 'assign')));
|
||||
|
||||
// Check that the student now has a submission history.
|
||||
$this->assertNotEquals(false, strpos($output, get_string('attempthistory', 'assign')));
|
||||
|
||||
// Check that the student now does not have a button for Submit.
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertEquals(false, strpos($output, get_string('submitassignment', 'assign')));
|
||||
|
||||
// Check that the student now has a button for Add a new attempt".
|
||||
$this->assertNotEquals(false, strpos($output, get_string('addnewattempt', 'assign')));
|
||||
|
||||
$this->setUser($teacher);
|
||||
// Check that the grading table loads correctly and contains this user.
|
||||
// This is also testing that we do not get duplicate rows in the grading table.
|
||||
@@ -2608,7 +2612,7 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
|
||||
// Student should be able to see an add submission button.
|
||||
$this->setUser($student);
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertNotEquals(false, strpos($output, get_string('addsubmission', 'assign')));
|
||||
|
||||
// Add a submission.
|
||||
@@ -2627,16 +2631,16 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$this->assertNotEquals(false, strpos($output, '50.0'));
|
||||
|
||||
// Check that the student now has a button for Add a new attempt.
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$this->assertNotEquals(false, strpos($output, get_string('addnewattempt', 'assign')));
|
||||
|
||||
// Check that the student now does not have a button for Submit.
|
||||
$this->assertEquals(false, strpos($output, get_string('submitassignment', 'assign')));
|
||||
|
||||
// Check that the student now has a submission history.
|
||||
$this->assertNotEquals(false, strpos($output, get_string('attempthistory', 'assign')));
|
||||
|
||||
// Check that the student now does not have a button for Submit.
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertEquals(false, strpos($output, get_string('submitassignment', 'assign')));
|
||||
|
||||
// Check that the student now has a button for Add a new attempt.
|
||||
$this->assertNotEquals(false, strpos($output, get_string('addnewattempt', 'assign')));
|
||||
|
||||
// Add a second submission.
|
||||
$this->add_submission($student, $assign);
|
||||
$this->submit_for_grading($student, $assign);
|
||||
@@ -2654,7 +2658,7 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
|
||||
// Check that the student now has a button for Add a new attempt.
|
||||
$this->setUser($student);
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertMatchesRegularExpression('/' . get_string('addnewattempt', 'assign') . '/', $output);
|
||||
$this->assertNotEquals(false, strpos($output, get_string('addnewattempt', 'assign')));
|
||||
}
|
||||
@@ -2682,7 +2686,7 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
|
||||
// Student should be able to see an add submission button.
|
||||
$this->setUser($student);
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertNotEquals(false, strpos($output, get_string('addsubmission', 'assign')));
|
||||
|
||||
// Add a submission as a student.
|
||||
@@ -2725,7 +2729,7 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
|
||||
// Student should be able to see an add submission button.
|
||||
$this->setUser($student);
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertNotEquals(false, strpos($output, get_string('addsubmission', 'assign')));
|
||||
|
||||
// Add a submission.
|
||||
@@ -3012,7 +3016,7 @@ class mod_assign_locallib_testcase extends advanced_testcase {
|
||||
|
||||
// Student should be able to see an add submission button.
|
||||
$this->setUser($student);
|
||||
$output = $assign->view_student_summary($student, true);
|
||||
$output = $assign->view_submission_action_bar($assign->get_instance(), $student);
|
||||
$this->assertNotEquals(false, strpos($output, get_string('addsubmission', 'assign')));
|
||||
|
||||
// Add a submission but don't submit now.
|
||||
|
||||
Reference in New Issue
Block a user