Fix Pint formatting

This commit is contained in:
root
2026-06-09 01:25:14 -04:00
parent 6be4875c5e
commit 20a0b6c4e5
1485 changed files with 11318 additions and 10273 deletions
+23 -16
View File
@@ -2,7 +2,6 @@
namespace App\Models;
use App\Models\BaseModel;
use Illuminate\Support\Facades\DB;
class Homework extends BaseModel
@@ -35,20 +34,20 @@ class Homework extends BaseModel
];
protected $casts = [
'student_id' => 'integer',
'school_id' => 'integer',
'student_id' => 'integer',
'school_id' => 'integer',
'class_section_id' => 'integer',
'updated_by' => 'integer',
'homework_index' => 'integer',
'updated_by' => 'integer',
'homework_index' => 'integer',
// keep numeric; change to 'integer' if your scores are whole numbers
'score' => 'decimal:2',
'max_points' => 'decimal:2',
'locked_by' => 'integer',
'locked_at' => 'datetime',
'score' => 'decimal:2',
'max_points' => 'decimal:2',
'locked_by' => 'integer',
'locked_at' => 'datetime',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/* Optional relationships */
@@ -93,10 +92,18 @@ class Homework extends BaseModel
foreach ($rows as $r) {
$score = $r->score ?? null;
if ($score === null) continue;
if (is_string($score) && trim($score) === '') continue;
if ($score === '') continue;
if (!is_numeric($score)) continue;
if ($score === null) {
continue;
}
if (is_string($score) && trim($score) === '') {
continue;
}
if ($score === '') {
continue;
}
if (! is_numeric($score)) {
continue;
}
$total += (float) $score;
$count++;
@@ -108,4 +115,4 @@ class Homework extends BaseModel
return round($total / $count, 2);
}
}
}