MDL-77346 mod_workshop: Added missing class properties

In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
This commit is contained in:
Meirza 2023-03-27 21:55:21 +07:00
parent 09fd61415e
commit 98c55a725e
10 changed files with 148 additions and 3 deletions

View file

@ -731,6 +731,8 @@ class workshop_random_allocator_setting {
public $assesswosubmission; public $assesswosubmission;
/** @var bool add self-assessments */ /** @var bool add self-assessments */
public $addselfassessment; public $addselfassessment;
/** @var bool scheduled allocation status */
public $enablescheduled;
/** /**
* Use the factory method {@link self::instance_from_object()} * Use the factory method {@link self::instance_from_object()}

View file

@ -35,9 +35,6 @@ require_once($CFG->libdir . '/gradelib.php');
*/ */
class workshop_best_evaluation extends workshop_evaluation { class workshop_best_evaluation extends workshop_evaluation {
/** @var workshop the parent workshop instance */
protected $workshop;
/** @var the recently used settings in this workshop */ /** @var the recently used settings in this workshop */
protected $settings; protected $settings;

View file

@ -31,6 +31,9 @@ require_once($CFG->dirroot . '/lib/formslib.php');
*/ */
abstract class workshop_evaluation { abstract class workshop_evaluation {
/** @var workshop the parent workshop instance */
protected $workshop;
/** /**
* Calculates grades for assessment and updates 'gradinggrade' fields in 'workshop_assessments' table * Calculates grades for assessment and updates 'gradinggrade' fields in 'workshop_assessments' table
* *

View file

@ -39,6 +39,36 @@ use core_privacy\tests\provider_testcase;
*/ */
class provider_test extends provider_testcase { class provider_test extends provider_testcase {
/** @var \testing_data_generator data generator. */
protected $generator;
/** @var \mod_workshop_generator workshop generator. */
protected $workshopgenerator;
/** @var \stdClass course data. */
protected $course1;
/** @var \stdClass student data. */
protected $student1;
/** @var \stdClass student data. */
protected $student2;
/** @var \stdClass first workshop in course1 */
protected $workshop11;
/** @var int ID of the submission in workshop11 by student1 */
protected $submission111;
/** @var int ID of the assessment of submission111 by student2 */
protected $assessment1112;
/** @var bool|int true or new id */
protected $dim1;
/** @var bool|int true or new id */
protected $dim2;
/** /**
* Test {@link workshopform_accumulative\privacy\provider::export_assessment_form()} implementation. * Test {@link workshopform_accumulative\privacy\provider::export_assessment_form()} implementation.
*/ */

View file

@ -37,6 +37,18 @@ require_once($CFG->libdir . '/formslib.php'); // parent class definition
*/ */
class workshop_assessment_form extends moodleform { class workshop_assessment_form extends moodleform {
/** @var string Mode to open the form in: preview/assessment. */
public $mode;
/** @var workshop_strategy workshop strategy */
public $strategy;
/** @var workshop workshop. */
public $workshop;
/** @var array options. */
public $options;
/** /**
* Add the fields that are common for all grading strategies. * Add the fields that are common for all grading strategies.
* *

View file

@ -39,6 +39,36 @@ use core_privacy\tests\provider_testcase;
*/ */
class provider_test extends provider_testcase { class provider_test extends provider_testcase {
/** @var \testing_data_generator data generator. */
protected $generator;
/** @var \mod_workshop_generator workshop generator. */
protected $workshopgenerator;
/** @var \stdClass course data. */
protected $course1;
/** @var \stdClass student data. */
protected $student1;
/** @var \stdClass student data. */
protected $student2;
/** @var \stdClass first workshop in course1 */
protected $workshop11;
/** @var int ID of the submission in workshop11 by student1 */
protected $submission111;
/** @var int ID of the assessment of submission111 by student2 */
protected $assessment1112;
/** @var bool|int true or new id */
protected $dim1;
/** @var bool|int true or new id */
protected $dim2;
/** /**
* Test {@link workshopform_comments\privacy\provider::export_assessment_form()} implementation. * Test {@link workshopform_comments\privacy\provider::export_assessment_form()} implementation.
*/ */

View file

@ -40,6 +40,9 @@ class workshop_edit_strategy_form extends moodleform {
/** strategy logic instance that this class is editor of */ /** strategy logic instance that this class is editor of */
protected $strategy; protected $strategy;
/** @var workshop workshop. */
protected $workshop;
/** /**
* Add the fields that are common for all grading strategies. * Add the fields that are common for all grading strategies.
* *

View file

@ -39,6 +39,36 @@ use core_privacy\tests\provider_testcase;
*/ */
class provider_test extends provider_testcase { class provider_test extends provider_testcase {
/** @var \testing_data_generator data generator. */
protected $generator;
/** @var \mod_workshop_generator workshop generator. */
protected $workshopgenerator;
/** @var \stdClass course data. */
protected $course1;
/** @var \stdClass student data. */
protected $student1;
/** @var \stdClass student data. */
protected $student2;
/** @var \stdClass first workshop in course1 */
protected $workshop11;
/** @var int ID of the submission in workshop11 by student1 */
protected $submission111;
/** @var int ID of the assessment of submission111 by student2 */
protected $assessment1112;
/** @var bool|int true or new id */
protected $dim1;
/** @var bool|int true or new id */
protected $dim2;
/** /**
* Test {@link workshopform_numerrors\privacy\provider::export_assessment_form()} implementation. * Test {@link workshopform_numerrors\privacy\provider::export_assessment_form()} implementation.
*/ */

View file

@ -39,6 +39,36 @@ use core_privacy\tests\provider_testcase;
*/ */
class provider_test extends provider_testcase { class provider_test extends provider_testcase {
/** @var \testing_data_generator data generator. */
protected $generator;
/** @var \mod_workshop_generator workshop generator. */
protected $workshopgenerator;
/** @var \stdClass course data. */
protected $course1;
/** @var \stdClass student data. */
protected $student1;
/** @var \stdClass student data. */
protected $student2;
/** @var \stdClass first workshop in course1 */
protected $workshop11;
/** @var int ID of the submission in workshop11 by student1 */
protected $submission111;
/** @var int ID of the assessment of submission111 by student2 */
protected $assessment1112;
/** @var bool|int true or new id */
protected $dim1;
/** @var bool|int true or new id */
protected $dim2;
/** /**
* Test {@link workshopform_rubric\privacy\provider::export_assessment_form()} implementation. * Test {@link workshopform_rubric\privacy\provider::export_assessment_form()} implementation.
*/ */

View file

@ -65,6 +65,14 @@ class external_test extends externallib_advanced_testcase {
private $studentrole; private $studentrole;
/** @var stdClass teacher role object */ /** @var stdClass teacher role object */
private $teacherrole; private $teacherrole;
/** @var \stdClass student object. */
private $anotherstudentg1;
/** @var \stdClass student object. */
private $anotherstudentg2;
/** @var \stdClass group object. */
private $group1;
/** @var \stdClass group object. */
private $group2;
/** /**
* Set up for every test * Set up for every test