Browse Source

Minor - flint fixes

jmontoyaa 6 years ago
parent
commit
44b423b546

+ 1 - 1
main/course_home/course_home.php

@@ -248,7 +248,7 @@ if ($forumAutoLaunch == 1) {
 }
 
 if (api_get_configuration_value('allow_exercise_auto_launch')) {
-    $exerciseAutoLaunch = (int)api_get_course_setting('enable_exercise_auto_launch');
+    $exerciseAutoLaunch = (int) api_get_course_setting('enable_exercise_auto_launch');
     if ($exerciseAutoLaunch == 2) {
         if (api_is_platform_admin() || api_is_allowed_to_edit()) {
             if (empty($autoLaunchWarning)) {

+ 0 - 2
main/course_info/infocours.php

@@ -283,7 +283,6 @@ $group = [
 ];
 $form->addGroup($group, '', [get_lang('ShowSystemFolders')]);
 
-
 $group = [];
 $group[] = $form->createElement(
     'radio',
@@ -295,7 +294,6 @@ $group[] = $form->createElement(
 $group[] = $form->createElement('radio', 'enable_document_auto_launch', null, get_lang('Deactivate'), 0);
 $form->addGroup($group, '', [get_lang('DocumentAutoLaunch')]);
 
-
 $form->addButtonSave(get_lang('SaveSettings'), 'submit_save');
 $form->addHtml('
         </div>

+ 30 - 30
main/exercise/exercise.class.php

@@ -7920,6 +7920,36 @@ class Exercise
         }
     }
 
+    /**
+     * @return int
+     */
+    public function getAutoLaunch()
+    {
+        return $this->autolaunch;
+    }
+
+    /**
+     * Clean auto launch settings for all exercise in course/course-session.
+     */
+    public function enableAutoLaunch()
+    {
+        $table = Database::get_course_table(TABLE_QUIZ_TEST);
+        $sql = "UPDATE $table SET autolaunch = 1
+                WHERE iid = ".$this->iId;
+        Database::query($sql);
+    }
+
+    /**
+     * Clean auto launch settings for all exercise in course/course-session.
+     */
+    public function cleanCourseLaunchSettings()
+    {
+        $table = Database::get_course_table(TABLE_QUIZ_TEST);
+        $sql = "UPDATE $table SET autolaunch = 0  
+                WHERE c_id = ".$this->course_id." AND session_id = ".$this->sessionId;
+        Database::query($sql);
+    }
+
     /**
      * Gets the question list ordered by the question_order setting (drag and drop).
      *
@@ -8294,34 +8324,4 @@ class Exercise
     {
         return strip_tags(api_html_entity_decode($this->title));
     }
-
-    /**
-     * @return int
-     */
-    public function getAutoLaunch()
-    {
-        return $this->autolaunch;
-    }
-
-    /**
-     * Clean auto launch settings for all exercise in course/course-session
-     */
-    public function enableAutoLaunch()
-    {
-        $table = Database::get_course_table(TABLE_QUIZ_TEST);
-        $sql = "UPDATE $table SET autolaunch = 1
-                WHERE iid = ".$this->iId;
-        Database::query($sql);
-    }
-
-    /**
-     * Clean auto launch settings for all exercise in course/course-session
-     */
-    public function cleanCourseLaunchSettings()
-    {
-        $table = Database::get_course_table(TABLE_QUIZ_TEST);
-        $sql = "UPDATE $table SET autolaunch = 0  
-                WHERE c_id = ".$this->course_id." AND session_id = ".$this->sessionId;
-        Database::query($sql);
-    }
 }

+ 1 - 0
main/inc/lib/formvalidator/FormValidator.class.php

@@ -1688,6 +1688,7 @@ EOT;
         return $this->addElement('UserAvatar', $name, $label, ['image_size' => $imageSize, 'sub_title' => $subtitle]);
     }
 
+
     /**
      * @param string $url           page that will handle the upload
      * @param string $inputName