Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 62... Línea 62...
62
    public static function get_field_sql(string $field, int $columntype): string {
62
    public static function get_field_sql(string $field, int $columntype): string {
63
        return "AVG(1.0 * {$field}) * 100.0";
63
        return "AVG(1.0 * {$field}) * 100.0";
64
    }
64
    }
Línea 65... Línea 65...
65
 
65
 
-
 
66
    /**
-
 
67
     * Returns aggregated column type
-
 
68
     *
-
 
69
     * @param int $columntype
-
 
70
     * @return int
-
 
71
     */
-
 
72
    public static function get_column_type(int $columntype): int {
-
 
73
        return column::TYPE_FLOAT;
-
 
74
    }
-
 
75
 
66
    /**
76
    /**
67
     * Return formatted value for column when applying aggregation
77
     * Return formatted value for column when applying aggregation
68
     *
78
     *
69
     * @param mixed $value
79
     * @param mixed $value
70
     * @param array $values
80
     * @param array $values
71
     * @param array $callbacks
81
     * @param array $callbacks
72
     * @param int $columntype
82
     * @param int $columntype
73
     * @return string
83
     * @return string
74
     */
84
     */
75
    public static function format_value($value, array $values, array $callbacks, int $columntype): string {
85
    public function format_value($value, array $values, array $callbacks, int $columntype): string {
76
        if (reset($values) === null) {
86
        if (reset($values) === null) {
77
            return '';
87
            return '';
78
        }
88
        }
79
        return format::percent((float) reset($values));
89
        return format::percent((float) reset($values));