Browse Source

Minor - format code

Julio 6 years ago
parent
commit
e7bfe8fd93
1 changed files with 35 additions and 35 deletions
  1. 35 35
      plugin/questionoptionsevaluation/QuestionOptionsEvaluationPlugin.php

+ 35 - 35
plugin/questionoptionsevaluation/QuestionOptionsEvaluationPlugin.php

@@ -26,7 +26,7 @@ class QuestionOptionsEvaluationPlugin extends Plugin
             $author,
             [
                 self::SETTING_ENABLE => 'boolean',
-                self::SETTING_MAX_SCORE => 'text'
+                self::SETTING_MAX_SCORE => 'text',
             ]
         );
     }
@@ -86,40 +86,6 @@ class QuestionOptionsEvaluationPlugin extends Plugin
         return $this;
     }
 
-    /**
-     * Creates an extrafield.
-     */
-    private function createExtraField()
-    {
-        $extraField = new ExtraField('quiz');
-
-        if (false === $extraField->get_handler_field_info_by_field_variable(self::EXTRAFIELD_FORMULA)) {
-            $extraField
-                ->save(
-                    [
-                        'variable' => self::EXTRAFIELD_FORMULA,
-                        'field_type' => ExtraField::FIELD_TYPE_TEXT,
-                        'display_text' => $this->get_lang('EvaluationFormula'),
-                        'visible_to_self' => false,
-                        'changeable' => false,
-                    ]
-                );
-        }
-    }
-
-    /**
-     * Removes the extrafield .
-     */
-    private function removeExtraField()
-    {
-        $extraField = new ExtraField('quiz');
-        $value = $extraField->get_handler_field_info_by_field_variable(self::EXTRAFIELD_FORMULA);
-
-        if (false !== $value) {
-            $extraField->delete($value['id']);
-        }
-    }
-
     /**
      * @param Exercise $exercise
      */
@@ -269,4 +235,38 @@ class QuestionOptionsEvaluationPlugin extends Plugin
 
         return ($result / count($qTracks)) * 10;
     }
+
+    /**
+     * Creates an extrafield.
+     */
+    private function createExtraField()
+    {
+        $extraField = new ExtraField('quiz');
+
+        if (false === $extraField->get_handler_field_info_by_field_variable(self::EXTRAFIELD_FORMULA)) {
+            $extraField
+                ->save(
+                    [
+                        'variable' => self::EXTRAFIELD_FORMULA,
+                        'field_type' => ExtraField::FIELD_TYPE_TEXT,
+                        'display_text' => $this->get_lang('EvaluationFormula'),
+                        'visible_to_self' => false,
+                        'changeable' => false,
+                    ]
+                );
+        }
+    }
+
+    /**
+     * Removes the extrafield .
+     */
+    private function removeExtraField()
+    {
+        $extraField = new ExtraField('quiz');
+        $value = $extraField->get_handler_field_info_by_field_variable(self::EXTRAFIELD_FORMULA);
+
+        if (false !== $value) {
+            $extraField->delete($value['id']);
+        }
+    }
 }