Merge branch 'MDL-80748-main' of https://github.com/rezaies/moodle

This commit is contained in:
Jun Pataleta
2024-07-03 17:13:21 +08:00
29 changed files with 205 additions and 110 deletions
@@ -0,0 +1,11 @@
issueNumber: MDL-80748
notes:
core_table:
- message: >+
A new `$reponsive` property (defaulting to `true`) has been added to the
`core_table\flexible_table` class.
This property allows you to control whether the table is rendered as a
responsive table.
type: improved
@@ -89,7 +89,9 @@ Feature: availability_grade
# Give the assignment 40%.
And I follow "View all submissions"
# Pick the grade link in the row that has [email protected] in it.
And I change window size to "large"
And I click on "Grade" "link" in the "s@example.com" "table_row"
And I change window size to "medium"
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
And I click on "Edit settings" "link"
@@ -45,7 +45,9 @@ Feature: Restrict activity availability through grade conditions
And I am on the "Grade assignment" "assign activity" page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Student First" "table_row"
And I change window size to "medium"
And I set the following fields to these values:
| Grade | 21 |
And I press "Save changes"
@@ -68,7 +68,9 @@ Feature: Restrict sections availability through completion or grade conditions
And I log out
And I am on the "Grade assignment" "assign activity" page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Student First" "table_row"
And I change window size to "medium"
And I set the following fields to these values:
| Grade | 21 |
And I press "Save changes"
@@ -50,7 +50,9 @@ Feature: Rubrics can be created and edited
Then I should see "Ready for use"
# Grading two students.
And I navigate to "Assignment" in current page administration
And I change window size to "large"
And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
And I change window size to "medium"
And I grade by filling the rubric with:
| Criterion 1 | 50 | Very good |
And I press "Save changes"
@@ -66,7 +68,9 @@ Feature: Rubrics can be created and edited
And I should see "65" in the "Student 1" "table_row"
# Updating the user grade.
And I am on the "Test assignment 1 name" "assign activity" page
And I change window size to "large"
And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
And I change window size to "medium"
And I grade by filling the rubric with:
| Criterion 1 | 20 | Bad, I changed my mind |
| Criterion 2 | 10 | Mmmm, you can do it better |
@@ -118,7 +122,9 @@ Feature: Rubrics can be created and edited
And I log out
# Regrade student.
And I am on the "Test assignment 1 name" "assign activity" page logged in as teacher1
And I change window size to "large"
And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
And I change window size to "medium"
And I should see "The rubric definition was changed after this student had been graded. The student can not see this rubric until you check the rubric and update the grade."
And I save the advanced grading form
And I log out
+96 -109
View File
@@ -41,53 +41,89 @@ require_once("{$CFG->libdir}/tablelib.php");
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class flexible_table {
public $uniqueid = null;
public $attributes = [];
public $headers = [];
public $attributes = [];
public $baseurl = null;
/**
* @var string A column which should be considered as a header column.
*/
protected $headercolumn = null;
/** @var string The caption of table */
public $caption;
/**
* @var string For create header with help icon.
*/
private $helpforheaders = [];
public $columns = [];
public $column_style = [];
public $column_class = [];
/** @var array The caption attributes of table */
public $captionattributes;
public $column_class = [];
public $column_nosort = ['userpic'];
public $column_style = [];
public $column_suppress = [];
public $column_nosort = ['userpic'];
private $column_textsort = [];
public $columns = [];
public $currentrow = 0;
public $currpage = 0;
/**
* @var array The sticky attribute of each table column.
* Which download plugin to use. Default '' means none - print html table with paging.
* Property set by is_downloading which typically passes in cleaned data from $
* @var string
*/
protected $columnsticky = [];
public $download = '';
/**
* Whether data is downloadable from table. Determines whether to display download buttons. Set by method downloadable().
* @var bool
*/
public $downloadable = false;
/** @var dataformat_export_format */
public $exportclass = null;
public $headers = [];
public $is_collapsible = false;
public $is_sortable = false;
public $maxsortkeys = 2;
public $pagesize = 30;
public $request = [];
/** @var bool Stores if setup has already been called on this flixible table. */
public $setup = false;
public $baseurl = null;
public $request = [];
public $setup = false;
/** @var string[] Columns that are expected to contain a users fullname. */
protected $userfullnamecolumns = ['fullname'];
/** @var int[] Array of positions in which to display download controls. */
public $showdownloadbuttonsat = [TABLE_P_TOP];
/** @var array[] Attributes for each column */
private $columnsattributes = [];
public $sort_default_column = null;
public $sort_default_order = SORT_ASC;
/** @var bool Has start output been called yet? */
public $started_output = false;
public $totalrows = 0;
public $uniqueid = null;
public $use_initials = false;
public $use_pages = false;
/** @var string Key of field returned by db query that is the id field of the user table or equivalent. */
public $useridfield = 'id';
/** @var bool Whether to make the table to be scrolled horizontally with ease. Make table responsive across all viewports. */
public bool $responsive = true;
/** @var array The sticky attribute of each table column. */
protected $columnsticky = [];
/** @var string $filename */
protected $filename;
/**
* @var bool Whether or not to store table properties in the user_preferences table.
* The currently applied filerset. This is required for dynamic tables, but can be used by other tables too if desired.
* @var filterset
*/
private $persistent = false;
public $is_collapsible = false;
public $is_sortable = false;
protected $filterset = null;
/**
* @var array The fields to sort.
*/
protected $sortdata;
/** @var string A column which should be considered as a header column. */
protected $headercolumn = null;
/** @var string For create header with help icon. */
private $helpforheaders = [];
/** @var array List of hidden columns. */
protected $hiddencolumns;
/** @var string The manually set first name initial preference */
protected $ifirst;
@@ -95,84 +131,31 @@ class flexible_table {
/** @var string The manually set last name initial preference */
protected $ilast;
public $use_pages = false;
public $use_initials = false;
public $maxsortkeys = 2;
public $pagesize = 30;
public $currpage = 0;
public $totalrows = 0;
public $currentrow = 0;
public $sort_default_column = null;
public $sort_default_order = SORT_ASC;
/** @var int The defeult per page size for the table. */
private $defaultperpage = 30;
/**
* @var array Array of positions in which to display download controls.
*/
public $showdownloadbuttonsat = [TABLE_P_TOP];
/**
* @var string Key of field returned by db query that is the id field of the
* user table or equivalent.
*/
public $useridfield = 'id';
/**
* @var string which download plugin to use. Default '' means none - print
* html table with paging. Property set by is_downloading which typically
* passes in cleaned data from $
*/
public $download = '';
/**
* @var bool whether data is downloadable from table. Determines whether
* to display download buttons. Set by method downloadable().
*/
public $downloadable = false;
/**
* @var bool Has start output been called yet?
*/
public $started_output = false;
/** @var dataformat_export_format */
public $exportclass = null;
/**
* @var array For storing user-customised table properties in the user_preferences db table.
*/
private $prefs = [];
/** @var string $sheettitle */
protected $sheettitle;
/** @var string $filename */
protected $filename;
/** @var array $hiddencolumns List of hidden columns. */
protected $hiddencolumns;
/** @var bool $resetting Whether the table preferences is resetting. */
/** @var bool Whether the table preferences is resetting. */
protected $resetting;
/**
* @var string $caption The caption of table
*/
public $caption;
/** @var string */
protected $sheettitle;
/**
* @var array $captionattributes The caption attributes of table
*/
public $captionattributes;
/** @var array The fields to sort. */
protected $sortdata;
/**
* @var filterset The currently applied filerset
* This is required for dynamic tables, but can be used by other tables too if desired.
*/
protected $filterset = null;
/** @var string[] Columns that are expected to contain a users fullname. */
protected $userfullnamecolumns = ['fullname'];
private $column_textsort = [];
/** @var array[] Attributes for each column */
private $columnsattributes = [];
/** @var int The default per page size for the table. */
private $defaultperpage = 30;
/** @var bool Whether to store table properties in the user_preferences table. */
private $persistent = false;
/** @var array For storing user-customised table properties in the user_preferences db table. */
private $prefs = [];
/**
* Constructor
@@ -1222,7 +1205,9 @@ class flexible_table {
echo html_writer::end_tag('tbody');
echo html_writer::end_tag('table');
echo html_writer::end_tag('div');
if ($this->responsive) {
echo html_writer::end_tag('div');
}
$this->wrap_html_finish();
// Paging bar.
@@ -1880,7 +1865,9 @@ class flexible_table {
$this->wrap_html_start();
// Start of main data table.
echo html_writer::start_tag('div', ['class' => 'no-overflow']);
if ($this->responsive) {
echo html_writer::start_tag('div', ['class' => 'no-overflow']);
}
echo html_writer::start_tag('table', $this->attributes) . $this->render_caption();
}
@@ -36,7 +36,9 @@ Feature: In an assignment, teacher can annotate PDF files during grading
When I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I change window size to "medium"
Then I should see "Page 1 of 1"
And I wait for the complete PDF to load
And I click on ".linebutton" "css_element"
@@ -54,7 +56,9 @@ Feature: In an assignment, teacher can annotate PDF files during grading
Then I should see "Page 1 of 1"
And I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I change window size to "medium"
Then I should see "Page 1 of 3"
And I wait for the complete PDF to load
And I click on ".linebutton" "css_element"
@@ -108,7 +112,9 @@ Feature: In an assignment, teacher can annotate PDF files during grading
When I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I change window size to "medium"
Then I should see "Page 1 of 3"
And I click on ".navigate-next-button" "css_element"
And I should see "Page 2 of 3"
@@ -33,7 +33,9 @@ Feature: Ensure that a comment remains visible if its popup menu is open
And I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I change window size to "medium"
And I wait for the complete PDF to load
Scenario: Add an empty comment and open its menu
@@ -37,7 +37,9 @@ Feature: In an assignment, teacher can view the feedback for a previous attempt.
When I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I change window size to "medium"
Then I should see "Page 1 of 3"
And I click on ".navigate-next-button" "css_element"
And I should see "Page 2 of 3"
+2
View File
@@ -4602,6 +4602,7 @@ class assign {
// Load and print the table of submissions.
if ($showquickgrading && $quickgrading) {
$gradingtable = new assign_grading_table($this, $perpage, $filter, 0, true);
$gradingtable->responsive = false;
$table = $this->get_renderer()->render($gradingtable);
$page = optional_param('page', null, PARAM_INT);
$quickformparams = array('cm'=>$this->get_course_module()->id,
@@ -4613,6 +4614,7 @@ class assign {
$o .= $this->get_renderer()->render(new assign_form('quickgradingform', $quickgradingform));
} else {
$gradingtable = new assign_grading_table($this, $perpage, $filter, 0, false);
$gradingtable->responsive = false;
$o .= $this->get_renderer()->render($gradingtable);
}
+9
View File
@@ -139,6 +139,15 @@
display: block;
}
.path-mod-assign .gradingtable table {
border-collapse: separate;
border-spacing: 0;
}
.path-mod-assign .gradingtable thead th {
background-color: white;
}
.path-mod-assign .gradingtable tr.selectedrow td {
background-color: #fec;
}
@@ -34,7 +34,9 @@ Feature: In an assignment, students start a new attempt based on their previous
And I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
And I set the following fields to these values:
| Allow another attempt | 1 |
And I press "Save changes"
@@ -49,7 +51,9 @@ Feature: In an assignment, students start a new attempt based on their previous
And I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
And I should see "I'm the student first submission"
@javascript @_alert
@@ -107,7 +107,9 @@ Feature: Assignments settings can be changed
When I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 3" "table_row"
And I change window size to "medium"
And I set the field "Grade out of 100" to "40"
And I set the field "Notify student" to "0"
And I press "Save changes"
@@ -118,7 +120,9 @@ Feature: Assignments settings can be changed
And I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I open the action menu in "Student 3" "table_row"
And I change window size to "medium"
And I follow "Allow another attempt"
And I am on the "Test assignment name" Activity page logged in as student3
@@ -48,7 +48,9 @@ Feature: In an assignment, teachers can use table preferences.
And I am on the "Test assignment" Activity page
And I follow "View all submissions"
And I click on "T" "link" in the ".lastinitial" "css_element"
And I change window size to "large"
And I click on "Grade" "link" in the "Student Two" "table_row"
And I change window size to "medium"
And I should see "This is a submission for Student Two"
And I should see "1 of 1"
And I follow "Reset table preferences"
@@ -49,7 +49,9 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
And I am on the "Test assignment name" "assign activity" page
And I follow "View all submissions"
Then I should see "Not marked" in the "I'm student2's submission" "table_row"
And I change window size to "large"
And I click on "Grade" "link" in the "I'm student2's submission" "table_row"
And I change window size to "medium"
And I set the field "Grade out of 100" to "50"
And I set the field "Marking workflow state" to "In review"
And I set the field "Feedback comments" to "Great job!"
@@ -33,7 +33,9 @@ Feature: In an assignment, teachers can edit a students submission inline
When I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
And I set the following fields to these values:
| Grade out of 100 | 50 |
| Feedback comments | I'm the teacher feedback |
@@ -63,7 +63,9 @@ Feature: Check that the assignment grade can be updated correctly
| groupmode | 0 |
And I am on the "Test assignment name" Activity page logged in as teacher1
When I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
And I set the field "Grade out of 100" to "50"
And I set the field "Notify student" to "0"
And I press "Save changes"
@@ -36,7 +36,9 @@ Feature: In an assignment, teachers can edit feedback for a students previous su
| 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 follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 2" "table_row"
And I change window size to "medium"
And I set the following fields to these values:
| Grade | 49 |
| Feedback comments | I'm the teacher first feedback |
@@ -51,7 +53,9 @@ Feature: In an assignment, teachers can edit feedback for a students previous su
And I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 2" "table_row"
And I change window size to "medium"
And I click on "View a different attempt" "link"
And I click on "Attempt 1" "radio" in the "View a different attempt" "dialogue"
And I click on "View" "button" in the "View a different attempt" "dialogue"
@@ -27,7 +27,9 @@ Feature: In an assignment, the administrator can edit students' submissions
And I am on the "Test assignment name" Activity page logged in as admin
And I follow "View all submissions"
And I change window size to "large"
And I open the action menu in "Student 1" "table_row"
And I change window size to "medium"
And I choose "Edit submission" in the open action menu
And I set the following fields to these values:
| Online text | Have you seen the movie Chef? |
@@ -50,7 +50,9 @@ Feature: In an assignment, teachers can change filters in the grading app
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"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
Then the field "filter" matches value "Not submitted"
And the field "markerfilter" matches value "Marker 1"
And the field "workflowfilter" matches value "In marking"
@@ -61,7 +61,9 @@ Feature: View the grading status of an assignment
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I follow "View all submissions"
And I should see "In review" in the "Student 1" "table_row"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
And I should see "1 of 1"
And I set the field "Marking workflow state" to "Released"
And I press "Save changes"
@@ -77,7 +79,9 @@ Feature: View the grading status of an assignment
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I follow "View all submissions"
And I should see "Released" in the "Student 1" "table_row"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
And I should see "1 of 1"
And I set the field "Marking workflow state" to "In marking"
And I set the field "Notify student" to "0"
@@ -88,7 +92,9 @@ Feature: View the grading status of an assignment
# 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"
And "Student 1" row "Final grade" column of "generaltable" table should contain "-"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
And I click on "Change filters" "link"
And I set the field "Workflow filter" to "In review"
And I should see "0 of 0"
@@ -142,7 +148,9 @@ Feature: View the grading status of an assignment
And I follow "View all submissions"
And I should see "Graded - resubmitted" in the "Student 1" "table_row"
And I wait "10" seconds
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
And I should see "1 of 1"
And I set the field "Grade out of 100" to "99.99"
And I set the field "Feedback comments" to "Even better job! Really."
@@ -38,7 +38,9 @@ Feature: Hide grader identities identity from students
And I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I should not see "Graded" in the "Student 1" "table_row"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
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"
+3 -1
View File
@@ -30,7 +30,9 @@ Feature: In an assignment, teachers grade multiple students on one page
And I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
When I click on "Grade" "link" in the "Student 1" "table_row"
When I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
And I press "Save changes"
And I am on the "Test assignment name" "assign activity" page
Then I should see "1" in the "Needs grading" "table_row"
@@ -35,7 +35,9 @@ Feature: Submissions are unlocked when a new attempt is given
And I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
And I open the action menu in "Student 1" "table_row"
And I change window size to "medium"
And I follow "Prevent submission changes"
And I should see "Submission changes not allowed"
And I click on "Quick grading" "checkbox"
@@ -62,10 +64,14 @@ Feature: Submissions are unlocked when a new attempt is given
And I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "View all submissions"
And I change window size to "large"
When I open the action menu in "Student 1" "table_row"
And I change window size to "medium"
And I follow "Prevent submission changes"
Then I should see "Submission changes not allowed"
And I change window size to "large"
And I open the action menu in "Student 1" "table_row"
And I change window size to "medium"
And I follow "Allow another attempt"
And I should see "Reopened"
And I should not see "Submission changes not allowed"
@@ -72,7 +72,9 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
Scenario: Rescaling should not produce negative grades
Given I follow "View all submissions"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 2" "table_row"
And I change window size to "medium"
And I wait until the page is ready
And I am on the "Test assignment name" "assign activity" page
And I navigate to "Settings" in current page administration
@@ -74,7 +74,9 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
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"
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I change window size to "medium"
And I set the field "Marking workflow state" to "Released"
And I press "Save changes"
And I follow "View all submissions"
+6
View File
@@ -1497,6 +1497,12 @@ $popout-header-height: 4rem;
background-color: $card-bg;
}
.path-mod-assign .gradingtable thead tr {
position: sticky;
top: $navbar-height;
z-index: 1;
}
/**
* Mod LTI.
*/
+6
View File
@@ -34764,6 +34764,12 @@ img.userpicture {
background-color: #fff;
}
.path-mod-assign .gradingtable thead tr {
position: sticky;
top: 60px;
z-index: 1;
}
/**
* Mod LTI.
*/
+6
View File
@@ -34764,6 +34764,12 @@ img.userpicture {
background-color: #fff;
}
.path-mod-assign .gradingtable thead tr {
position: sticky;
top: 50px;
z-index: 1;
}
/**
* Mod LTI.
*/