mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-75362 gradereport_singleview: CiBot complaints
This commit is contained in:
parent
84d8c98d04
commit
7973d6b11c
@ -44,13 +44,22 @@ defined('MOODLE_INTERNAL') || die;
|
||||
*/
|
||||
class grade extends tablelike implements selectable_items, filterable_items {
|
||||
|
||||
/** @var int $totalitemcount Used for paging */
|
||||
/**
|
||||
* Used for paging
|
||||
* @var int $totalitemcount
|
||||
*/
|
||||
private int $totalitemcount = 0;
|
||||
|
||||
/** @var bool $requiresextra True if this is a manual grade item */
|
||||
/**
|
||||
* True if this is a manual grade item
|
||||
* @var bool $requiresextra
|
||||
*/
|
||||
private bool $requiresextra = false;
|
||||
|
||||
/** @var bool $requirepaging True if there are more users than our limit. */
|
||||
/**
|
||||
* True if there are more users than our limit.
|
||||
* @var bool $requirepaging
|
||||
*/
|
||||
private bool $requirespaging = true;
|
||||
|
||||
/**
|
||||
|
@ -43,28 +43,52 @@ defined('MOODLE_INTERNAL') || die;
|
||||
*/
|
||||
abstract class screen {
|
||||
|
||||
/** @var int $courseid The id of the course */
|
||||
/**
|
||||
* The id of the course
|
||||
* @var int $courseid
|
||||
*/
|
||||
protected int $courseid;
|
||||
|
||||
/** @var int|null $itemid Either a user id or a grade_item id */
|
||||
/**
|
||||
* Either a user id or a grade_item id
|
||||
* @var int|null $itemid
|
||||
*/
|
||||
protected ?int $itemid;
|
||||
|
||||
/** @var int $groupid The currently set groupid (if set) */
|
||||
/**
|
||||
* The currently set groupid (if set)
|
||||
* @var int $groupid
|
||||
*/
|
||||
protected $groupid;
|
||||
|
||||
/** @var context_course $context The course context */
|
||||
/**
|
||||
* The course context
|
||||
* @var context_course $context
|
||||
*/
|
||||
protected context_course $context;
|
||||
|
||||
/** @var int $page The page number */
|
||||
/**
|
||||
* The page number
|
||||
* @var int $page
|
||||
*/
|
||||
protected int $page;
|
||||
|
||||
/** @var int $perpage Results per page */
|
||||
/**
|
||||
* Results per page
|
||||
* @var int $perpage
|
||||
*/
|
||||
protected int $perpage;
|
||||
|
||||
/** @var array $items List of items on the page, they could be users or grade_items */
|
||||
/**
|
||||
* List of items on the page, they could be users or grade_items
|
||||
* @var array $items
|
||||
*/
|
||||
protected array $items;
|
||||
|
||||
/** @var array $validperpage List of allowed values for 'perpage' setting */
|
||||
/**
|
||||
* List of allowed values for 'perpage' setting
|
||||
* @var array $validperpage
|
||||
*/
|
||||
protected static array $validperpage = [20, 50, 100, 200, 400, 1000, 5000];
|
||||
|
||||
/**
|
||||
@ -222,21 +246,21 @@ abstract class screen {
|
||||
*
|
||||
* @param boolean $selfitemisempty True if no item has been selected yet.
|
||||
*/
|
||||
public abstract function init(bool $selfitemisempty = false);
|
||||
abstract public function init(bool $selfitemisempty = false);
|
||||
|
||||
/**
|
||||
* Get the type of items in the list.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public abstract function item_type(): string;
|
||||
abstract public function item_type(): string;
|
||||
|
||||
/**
|
||||
* Get the entire screen as a string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public abstract function html(): string;
|
||||
abstract public function html(): string;
|
||||
|
||||
/**
|
||||
* Does this screen support paging?
|
||||
|
@ -105,7 +105,7 @@ class select extends screen {
|
||||
$url = new moodle_url('/grade/report/singleview/index.php', $params);
|
||||
|
||||
$select = new \single_select($url, 'itemid', $options, '', ['' => $screen->select_label()]);
|
||||
$select->set_label($screen->select_label(), ['class'=>'accesshide']);
|
||||
$select->set_label($screen->select_label(), ['class' => 'accesshide']);
|
||||
$html .= $OUTPUT->render($select);
|
||||
}
|
||||
$html = $OUTPUT->container($html, 'selectitems');
|
||||
|
@ -41,29 +41,38 @@ defined('MOODLE_INTERNAL') || die;
|
||||
*/
|
||||
abstract class tablelike extends screen {
|
||||
|
||||
/** @var array $headers A list of table headers */
|
||||
/**
|
||||
* A list of table headers
|
||||
* @var array $headers
|
||||
*/
|
||||
protected array $headers = [];
|
||||
|
||||
/** @var array $initerrors A list of errors that mean we should not show the table */
|
||||
/**
|
||||
* A list of errors that mean we should not show the table
|
||||
* @var array $initerrors
|
||||
*/
|
||||
protected array $initerrors = [];
|
||||
|
||||
/** @var array $definition Describes the columns in the table */
|
||||
/**
|
||||
* Describes the columns in the table
|
||||
* @var array $definition
|
||||
*/
|
||||
protected array $definition = [];
|
||||
|
||||
/**
|
||||
* Format a row of the table
|
||||
*
|
||||
* @param mixed $item
|
||||
* @var mixed $item
|
||||
* @return array
|
||||
*/
|
||||
public abstract function format_line($item): array;
|
||||
abstract public function format_line($item): array;
|
||||
|
||||
/**
|
||||
* Get the summary for this table.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public abstract function summary(): string;
|
||||
abstract public function summary(): string;
|
||||
|
||||
/**
|
||||
* Get the table headers
|
||||
|
@ -152,7 +152,7 @@ class user extends tablelike implements selectable_items {
|
||||
* @param grade_item $item
|
||||
* @return array
|
||||
*/
|
||||
public function format_line($item): array{
|
||||
public function format_line($item): array {
|
||||
global $OUTPUT;
|
||||
|
||||
$grade = $this->fetch_grade_or_default($item, $this->item->id);
|
||||
|
@ -35,13 +35,22 @@ defined('MOODLE_INTERNAL') || die;
|
||||
*/
|
||||
class dropdown_attribute extends element {
|
||||
|
||||
/** @var string $selected Who is selected ? */
|
||||
/**
|
||||
* Who is selected?
|
||||
* @var string $selected
|
||||
*/
|
||||
private string $selected;
|
||||
|
||||
/** @var array $options List of options ? */
|
||||
/**
|
||||
* List of options
|
||||
* @var array $options
|
||||
*/
|
||||
private array $options;
|
||||
|
||||
/** @var bool $isdisabled Is this input disabled. */
|
||||
/**
|
||||
* Is this input disabled.
|
||||
* @var bool $isdisabled
|
||||
*/
|
||||
private bool $isdisabled;
|
||||
|
||||
/**
|
||||
|
@ -35,13 +35,22 @@ defined('MOODLE_INTERNAL') || die;
|
||||
*/
|
||||
abstract class element {
|
||||
|
||||
/** @var string $name The first bit of the name for this input. */
|
||||
/**
|
||||
* The first bit of the name for this input.
|
||||
* @var string $name
|
||||
*/
|
||||
public string $name;
|
||||
|
||||
/** @var string $value The value for this input. */
|
||||
/**
|
||||
* The value for this input.
|
||||
* @var string $value
|
||||
*/
|
||||
public string $value;
|
||||
|
||||
/** @var string $label The form label for this input. */
|
||||
/**
|
||||
* The form label for this input.
|
||||
* @var string $label
|
||||
*/
|
||||
public string $label;
|
||||
|
||||
/**
|
||||
|
@ -37,10 +37,16 @@ use grade_grade;
|
||||
*/
|
||||
class exclude extends grade_attribute_format implements be_checked, be_disabled {
|
||||
|
||||
/** @var string $name The name of the input */
|
||||
/**
|
||||
* The name of the input
|
||||
* @var string $name
|
||||
*/
|
||||
public string $name = 'exclude';
|
||||
|
||||
/** @var bool $disabled Is the checkbox disabled? */
|
||||
/**
|
||||
* Is the checkbox disabled?
|
||||
* @var bool $disabled
|
||||
*/
|
||||
public $disabled = false;
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,10 @@ defined('MOODLE_INTERNAL') || die;
|
||||
*/
|
||||
class feedback extends grade_attribute_format implements unique_value, be_disabled {
|
||||
|
||||
/** @var string $name Name of this input */
|
||||
/**
|
||||
* Name of this input
|
||||
* @var string $name
|
||||
*/
|
||||
public string $name = 'feedback';
|
||||
|
||||
/**
|
||||
|
@ -36,7 +36,10 @@ use stdClass;
|
||||
*/
|
||||
class finalgrade extends grade_attribute_format implements unique_value, be_disabled {
|
||||
|
||||
/** @var string $name Name of this input */
|
||||
/**
|
||||
* Name of this input
|
||||
* @var string $name
|
||||
*/
|
||||
public string $name = 'finalgrade';
|
||||
|
||||
/**
|
||||
|
@ -37,13 +37,22 @@ defined('MOODLE_INTERNAL') || die;
|
||||
*/
|
||||
abstract class grade_attribute_format extends attribute_format implements unique_name {
|
||||
|
||||
/** @var string $name The first part of the name attribute of the form input */
|
||||
/**
|
||||
* The first part of the name attribute of the form input
|
||||
* @var string $name
|
||||
*/
|
||||
public string $name;
|
||||
|
||||
/** @var null|string $label The label of the input */
|
||||
/**
|
||||
* The label of the input
|
||||
* @var null|string $label
|
||||
*/
|
||||
public ?string $label;
|
||||
|
||||
/** @var grade_grade $grade The grade_grade of the input */
|
||||
/**
|
||||
* The grade_grade of the input
|
||||
* @var grade_grade $grade
|
||||
*/
|
||||
public grade_grade $grade;
|
||||
|
||||
/**
|
||||
@ -70,5 +79,5 @@ abstract class grade_attribute_format extends attribute_format implements unique
|
||||
* @param string $value The value from the form.
|
||||
* @return string Any error message
|
||||
*/
|
||||
public abstract function set(string $value);
|
||||
abstract public function set(string $value);
|
||||
}
|
||||
|
@ -35,7 +35,10 @@ defined('MOODLE_INTERNAL') || die;
|
||||
*/
|
||||
class override extends grade_attribute_format implements be_checked, be_disabled {
|
||||
|
||||
/** @var string $name The name for this input */
|
||||
/**
|
||||
* The name for this input
|
||||
* @var string $name
|
||||
*/
|
||||
public string $name = 'override';
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,10 @@ defined('MOODLE_INTERNAL') || die;
|
||||
*/
|
||||
class text_attribute extends element {
|
||||
|
||||
/** @var bool $isdisabled Is this input disabled? */
|
||||
/**
|
||||
* Is this input disabled?
|
||||
* @var bool $isdisabled
|
||||
*/
|
||||
private bool $isdisabled;
|
||||
|
||||
/**
|
||||
|
@ -74,7 +74,14 @@ class singleview extends grade_report {
|
||||
* @param int $itemid The id of the user or grade item
|
||||
* @param string|null $unused Used to be group id but that was removed and this is now unused.
|
||||
*/
|
||||
public function __construct(int $courseid, object $gpr, context_course $context, string $itemtype, int $itemid, ?string $unused = null) {
|
||||
public function __construct(
|
||||
int $courseid,
|
||||
object $gpr,
|
||||
context_course $context,
|
||||
string $itemtype,
|
||||
int $itemid,
|
||||
?string $unused = null
|
||||
) {
|
||||
parent::__construct($courseid, $gpr, $context);
|
||||
|
||||
$base = '/grade/report/singleview/index.php';
|
||||
|
Loading…
x
Reference in New Issue
Block a user