Skip to content

Commit

Permalink
Crossword: declare missing fields for PHP 8.2 #743313
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed May 21, 2024
1 parent a9d922a commit bdfbb47
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 13 additions & 0 deletions question.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ class qtype_crossword_question extends question_graded_automatically {
/** @var float The penalty mark for each incorrect accents. */
public $accentpenalty;

/** @var string Feedback for any correct response. */
public $correctfeedback;
/** @var int format of $correctfeedback. */
public $correctfeedbackformat;
/** @var string Feedback for any partially correct response. */
public $partiallycorrectfeedback;
/** @var int format of $partiallycorrectfeedback. */
public $partiallycorrectfeedbackformat;
/** @var string Feedback for any incorrect response. */
public $incorrectfeedback;
/** @var int format of $incorrectfeedback. */
public $incorrectfeedbackformat;

/**
* Answer field name.
*
Expand Down
4 changes: 1 addition & 3 deletions tests/backup_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ public function test_cw_backup_data(string $filename, string $coursefullname, st
$filename, $coursefullname, $courseshortname);
// Assume there is only one crossword question in the DB after restore.
$questionid = $DB->get_field('question', 'id', ['qtype' => 'crossword'], MUST_EXIST);
$q = \question_bank::load_question($questionid);
$qtype = new qtype_crossword();
$qtype->get_question_options($q);
$q = \question_bank::load_question_data($questionid);
// Verify question exist after restore and question word options is correct.
$this->assertEquals($questionname, $q->name);
$count = 0;
Expand Down

0 comments on commit bdfbb47

Please sign in to comment.