Browse Source

Minor - format code.

Julio Montoya 10 years ago
parent
commit
48688c97ee

+ 6 - 1
main/gradebook/gradebook_display_certificate.php

@@ -107,7 +107,12 @@ if (!empty($cats)) {
 
     $total_resource_weight = 0;
     if (!empty($datagen)) {
-        $data_array = $datagen->get_data(GradebookDataGenerator :: GDG_SORT_NAME,0,null,true);
+        $data_array = $datagen->get_data(
+            GradebookDataGenerator :: GDG_SORT_NAME,
+            0,
+            null,
+            true
+        );
 
         if (!empty($data_array)) {
             $newarray = array();

+ 10 - 5
main/gradebook/lib/be/category.class.php

@@ -697,14 +697,17 @@ class Category implements GradebookItem
 
     /**
      * Checks if the certificate is available for the given user in this category
-     * @param    integer    User ID
-     * @return    boolean    True if conditions match, false if fails
+     * @param   integer    $user_id User ID
+     * @return  boolean    True if conditions match, false if fails
      */
     public function is_certificate_available($user_id)
     {
         $score = $this->calc_score($user_id, $this->course_code);
+
         if (isset($score)) {
-            $certification_score = ($score[0]/$score[1])*100; //get a percentage score to compare to minimum certificate score
+            // Get a percentage score to compare to minimum certificate score
+            $certification_score = $score[0] / $score[1] * 100;
+
             if ($certification_score >= $this->certificate_min_score) {
                 return true;
             }
@@ -1592,8 +1595,8 @@ class Category implements GradebookItem
         );
         /** @var Category $category */
         $category = $cats_course[0];
-        $alleval_course  = $category->get_evaluations($user_id, true);
-        $alllink_course  = $category->get_links($user_id, true);
+        $alleval_course = $category->get_evaluations($user_id, true);
+        $alllink_course = $category->get_links($user_id, true);
         $evals_links = array_merge($alleval_course, $alllink_course);
 
         //@todo move these in a function
@@ -1643,6 +1646,7 @@ class Category implements GradebookItem
             $item_total_value >= $certificate_min_score
         ) {
             $my_certificate = get_certificate_by_user_id($cats_course[0]->get_id(), $user_id);
+
             if (empty($my_certificate)) {
                 register_user_info_about_certificate(
                     $category_id,
@@ -1656,6 +1660,7 @@ class Category implements GradebookItem
             if (!empty($my_certificate)) {
                 $certificate_obj = new Certificate($my_certificate['id']);
                 $fileWasGenerated = $certificate_obj->html_file_is_generated();
+
                 if (!empty($fileWasGenerated)) {
                     $url = api_get_path(WEB_PATH) . 'certificates/index.php?id=' . $my_certificate['id'];
                     $certificates = Display::url(

+ 4 - 1
main/gradebook/lib/flatview_data_generator.class.php

@@ -200,6 +200,7 @@ class FlatViewDataGenerator
         }
 
         $headers[] = api_strtoupper(get_lang('GradebookQualificationTotal'));
+
         return $headers;
     }
 
@@ -358,7 +359,9 @@ class FlatViewDataGenerator
             }
 
             // Last name
-            if (isset($this->params['join_firstname_lastname']) && $this->params['join_firstname_lastname']) {
+            if (isset($this->params['join_firstname_lastname']) &&
+                $this->params['join_firstname_lastname']
+            ) {
                 if ($export_to_pdf) {
                     $row['name'] = api_get_person_name($user[3], $user[2]);
                 } else {