add tests batch 20

This commit is contained in:
root
2026-06-09 01:03:53 -04:00
parent 95efb9652e
commit 6be4875c5e
1502 changed files with 13797 additions and 11313 deletions
+17 -25
View File
@@ -2,6 +2,8 @@
namespace App\Models;
use App\Models\BaseModel;
class Participation extends BaseModel
{
protected $table = 'participation';
@@ -31,19 +33,19 @@ class Participation extends BaseModel
];
protected $casts = [
'student_id' => 'integer',
'school_id' => 'integer',
'student_id' => 'integer',
'school_id' => 'integer',
'class_section_id' => 'integer',
'updated_by' => 'integer',
'updated_by' => 'integer',
// score is numeric; change to 'integer' if it is whole number
'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 */
@@ -78,25 +80,15 @@ class Participation extends BaseModel
}
$row = $q->first();
if (! $row) {
return null;
}
if (!$row) return null;
$score = $row->score;
if ($score === null) {
return null;
}
if (is_string($score) && trim($score) === '') {
return null;
}
if ($score === '') {
return null;
}
if (! is_numeric($score)) {
return null;
}
if ($score === null) return null;
if (is_string($score) && trim($score) === '') return null;
if ($score === '') return null;
if (!is_numeric($score)) return null;
return (float) $score;
}
}
}