-
Notifications
You must be signed in to change notification settings - Fork 70
feat: Add basic exam widgets #4428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| $failed = PracticalResult::where('result', PracticalResult::FAILED)->count(); | ||
| $incomplete = PracticalResult::where('result', PracticalResult::INCOMPLETE)->count(); | ||
|
|
||
| $examStats = PracticalResult::select('exam', 'result', DB::raw('count(*) as total')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what @AxonC thinks, but I feel like this query will eat us in prod. Thinking about some pagination such as quarterly/yearly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It did cross my mind....
What if we tried to combine it?
Id be interested to know how the CTS shows these stats.
|
|
||
| $cards = [ | ||
| Stat::make('Total Taken', $overall->total), | ||
| Stat::make('Pass Rate', ($overall->total ? round($overall->passed / $overall->total * 100) : 100).'%') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was aware but decided it didn't really make a difference. Happy to correct to 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah it's fine, you can leave it. The DB should rarely be empty in prod
|
I assume you did this to show current year only. |

Summary of changes
Adds very basic widgets showing exam details for both practical and theory exams.
Screenshots (if necessary)