Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 212... Línea 212...
212
        $this->define_columns(array_keys($cols));
212
        $this->define_columns(array_keys($cols));
213
        $this->define_headers(array_values($cols));
213
        $this->define_headers(array_values($cols));
214
    }
214
    }
Línea 215... Línea 215...
215
 
215
 
-
 
216
    /**
-
 
217
     * Display name of country
-
 
218
     *
-
 
219
     * @param \stdClass $history
-
 
220
     * @return string
-
 
221
     */
-
 
222
    public function col_country(\stdClass $history): string {
-
 
223
        $countries = get_string_manager()->get_list_of_countries();
-
 
224
        return $countries[$history->country] ?? $history->country;
-
 
225
    }
-
 
226
 
216
    /**
227
    /**
217
     * Method to display the final grade.
228
     * Method to display the final grade.
218
     *
229
     *
219
     * @param \stdClass $history an entry of history record.
230
     * @param \stdClass $history an entry of history record.
220
     *
231
     *
Línea 466... Línea 477...
466
            // more than one histories happened at the same second.
477
            // more than one histories happened at the same second.
467
            $prevgrade = "SELECT MAX(finalgrade)
478
            $prevgrade = "SELECT MAX(finalgrade)
468
                            FROM {grade_grades_history} h
479
                            FROM {grade_grades_history} h
469
                           WHERE h.itemid = ggh.itemid
480
                           WHERE h.itemid = ggh.itemid
470
                             AND h.userid = ggh.userid
481
                             AND h.userid = ggh.userid
-
 
482
                             AND (
471
                             AND h.timemodified < ggh.timemodified
483
                                    h.timemodified < ggh.timemodified
-
 
484
                                    OR (h.timemodified = ggh.timemodified AND h.source != ggh.source AND h.id < ggh.id)
-
 
485
                                 )
472
                             AND NOT EXISTS (
486
                             AND NOT EXISTS (
473
                              SELECT 1
487
                              SELECT 1
474
                                FROM {grade_grades_history} h2
488
                                FROM {grade_grades_history} h2
475
                               WHERE h2.itemid = ggh.itemid
489
                               WHERE h2.itemid = ggh.itemid
476
                                 AND h2.userid = ggh.userid
490
                                 AND h2.userid = ggh.userid