Prechádzať zdrojové kódy

Fix declaration of inheritable function #2946

Angel Fernando Quiroz Campos 5 rokov pred
rodič
commit
f6b16777ca

+ 1 - 1
main/exercise/Annotation.php

@@ -127,7 +127,7 @@ class Annotation extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = [])
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $score['revised'] = $this->isQuestionWaitingReview($score);
 

+ 1 - 1
main/exercise/Draggable.php

@@ -210,7 +210,7 @@ class Draggable extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="'.$this->question_table_class.'"><tr>';

+ 1 - 1
main/exercise/MatchingDraggable.php

@@ -260,7 +260,7 @@ class MatchingDraggable extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="matching '.$this->question_table_class.'"><tr>';

+ 2 - 8
main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php

@@ -301,15 +301,9 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question
     }
 
     /**
-     * Show result table headers.
-     *
-     * @param Exercise $exercise
-     * @param int      $counter
-     * @param float    $score
-     *
-     * @return string|null
+     * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="'

+ 2 - 6
main/exercise/UniqueAnswerImage.php

@@ -371,13 +371,9 @@ class UniqueAnswerImage extends UniqueAnswer
     }
 
     /**
-     * @param Exercise $exercise
-     * @param null     $counter
-     * @param null     $score
-     *
-     * @return string
+     * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         if ($exercise->showExpectedChoice()) {
             $header = '<table class="'.$this->question_table_class.'">

+ 1 - 1
main/exercise/calculated_answer.class.php

@@ -245,7 +245,7 @@ class CalculatedAnswer extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="'.$this->question_table_class.'"><tr>';

+ 1 - 1
main/exercise/fill_blanks.class.php

@@ -484,7 +484,7 @@ class FillBlanks extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="'.$this->question_table_class.'">

+ 1 - 1
main/exercise/freeanswer.class.php

@@ -55,7 +55,7 @@ class FreeAnswer extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = [])
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $score['revised'] = $this->isQuestionWaitingReview($score);
         $header = parent::return_header($exercise, $counter, $score);

+ 1 - 5
main/exercise/global_multiple_answer.class.php

@@ -261,11 +261,7 @@ class GlobalMultipleAnswer extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header(
-        $exercise,
-        $counter = null,
-        $score = null
-    ) {
+    public function return_header(Exercise $exercise, $counter = null, $score = []) {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="'.$this->question_table_class.'"><tr>';
 

+ 1 - 1
main/exercise/matching.class.php

@@ -280,7 +280,7 @@ class Matching extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="'.$this->question_table_class.'">';

+ 1 - 1
main/exercise/multiple_answer.class.php

@@ -229,7 +229,7 @@ class MultipleAnswer extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="'.$this->question_table_class.'"><tr>';

+ 1 - 1
main/exercise/multiple_answer_combination.class.php

@@ -227,7 +227,7 @@ class MultipleAnswerCombination extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="'.$this->question_table_class.'"><tr>';

+ 1 - 1
main/exercise/multiple_answer_true_false.class.php

@@ -308,7 +308,7 @@ class MultipleAnswerTrueFalse extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="'.$this->question_table_class.'"><tr>';

+ 1 - 1
main/exercise/oral_expression.class.php

@@ -67,7 +67,7 @@ class OralExpression extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $score['revised'] = $this->isQuestionWaitingReview($score);
         $header = parent::return_header($exercise, $counter, $score);

+ 1 - 5
main/exercise/unique_answer.class.php

@@ -408,11 +408,7 @@ class UniqueAnswer extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header(
-        $exercise,
-        $counter = null,
-        $score = null
-    ) {
+    public function return_header(Exercise $exercise, $counter = null, $score = []) {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="'.$this->question_table_class.'"><tr>';
 

+ 1 - 1
main/exercise/unique_answer_no_option.class.php

@@ -399,7 +399,7 @@ class UniqueAnswerNoOption extends Question
     /**
      * {@inheritdoc}
      */
-    public function return_header($exercise, $counter = null, $score = null)
+    public function return_header(Exercise $exercise, $counter = null, $score = [])
     {
         $header = parent::return_header($exercise, $counter, $score);
         $header .= '<table class="'.$this->question_table_class.'"><tr>';