feat: add analysis tools and dashboard views for intern data tracking and reporting
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
$app = require_once __DIR__ . '/../bootstrap/app.php';
|
||||
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
|
||||
|
||||
$interns = \App\Models\CareerApplication::where('type', 'internship')->with(['journalEntries' => function($q) {
|
||||
$q->orderBy('day_number', 'asc');
|
||||
}])->get();
|
||||
|
||||
$results = [];
|
||||
foreach ($interns as $i) {
|
||||
$filledEntries = $i->journalEntries->filter(fn($e) => !empty(trim($e->content)));
|
||||
$hasTrans = !empty($i->transcript_markdown) && !str_contains($i->transcript_markdown, 'Laravel framework, RESTful API');
|
||||
|
||||
$results[] = [
|
||||
'id' => $i->id,
|
||||
'name' => $i->name,
|
||||
'email' => $i->email,
|
||||
'status' => $i->status,
|
||||
'start_date' => $i->internship_start_date,
|
||||
'end_date' => $i->internship_end_date,
|
||||
'total_days' => $i->internship_total_days,
|
||||
'filled_days' => $filledEntries->count(),
|
||||
'total_entries' => $i->journalEntries->count(),
|
||||
'github_repo' => $i->github_repo,
|
||||
'github_username' => $i->github_username,
|
||||
'certificate_code' => $i->certificate_code,
|
||||
'has_custom_transcript' => $hasTrans,
|
||||
'transcript_length' => strlen($i->transcript_markdown ?? ''),
|
||||
'notebook_supervisor_signed' => $i->notebook_supervisor_signed,
|
||||
'notebook_unit_signed' => $i->notebook_unit_signed,
|
||||
'notebook_approved' => $i->notebook_approved,
|
||||
];
|
||||
}
|
||||
|
||||
file_put_contents(__DIR__ . '/all_interns_summary.json', json_encode($results, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
||||
echo "Saved " . count($results) . " interns to scratch/all_interns_summary.json\n";
|
||||
Reference in New Issue
Block a user