Skip to content

Commit

Permalink
Merge pull request #89 from Chamorgio/ten_twelve_gio
Browse files Browse the repository at this point in the history
SAMI scoring guide implemented and click scoring
  • Loading branch information
echap1 authored Oct 13, 2023
2 parents ac408da + 3dd4960 commit a4cf886
Show file tree
Hide file tree
Showing 12 changed files with 378 additions and 229 deletions.
334 changes: 170 additions & 164 deletions .dart_tool/package_config.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions android/local.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flutter.sdk=/Users/rylie/Documents/Flutter/flutter
sdk.dir=/Users/rylie/Library/Android/sdk
flutter.sdk=C:\\Users\\C25Giovanni.Quintani\\OneDrive - afacademy.af.edu\\Desktop\\Flutter\\flutter
sdk.dir=C:\\Users\\C25Giovanni.Quintani\\AppData\\Local\\Android\\sdk
flutter.buildMode=release
flutter.versionName=1.9.0
flutter.versionCode=12
2 changes: 0 additions & 2 deletions lib/Model/Store/Actions/PassAction.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:async_redux/async_redux.dart';
import 'package:falcon_net/Model/Database/CadetPass.dart';
import 'package:falcon_net/Model/Database/Role.dart';
import 'package:falcon_net/Model/Store/Endpoints.dart';
import 'package:falcon_net/Model/Store/GlobalState.dart';
import 'package:falcon_net/Services/NotificationService.dart';
Expand All @@ -9,7 +8,6 @@ import 'package:falcon_net/Utility/ListExtensions.dart';

import '../../../Utility/ErrorFormatting.dart';
import '../../Database/AccountabilityEvent.dart';
import '../../Database/UserEventStatus.dart';

class PassAction extends ReduxAction<GlobalState> {
final CadetPass? pass;
Expand Down
2 changes: 0 additions & 2 deletions lib/Structure/Pages/Dashboard/DIWidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import 'package:falcon_net/Structure/Components/ConfirmationDialog.dart';
import 'package:falcon_net/Structure/Components/PageWidget.dart';
import 'package:falcon_net/Structure/Components/ViewModel.dart';
import 'package:falcon_net/Utility/ListExtensions.dart';
import 'package:falcon_net/Utility/TemporalFormatting.dart';
import 'package:flutter/material.dart';

import '../../../Model/Database/AccountabilityEvent.dart';
import '../../../Model/Database/Role.dart';
import '../../../Utility/FNConstants.dart';

///Page widget for displaying DI information with signing ui
class DIWidget extends StatelessWidget {
Expand Down
8 changes: 4 additions & 4 deletions lib/Structure/Pages/Profile/CadetInfo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class CadetInfoState extends State<CadetInfo> {
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).errorColor,
color: Theme.of(context).colorScheme.error,
),
),
border: const OutlineInputBorder(),
Expand Down Expand Up @@ -188,16 +188,16 @@ class InputBlockState extends State<InputBlock> {
onChanged: (change) => setState(() => value = change),
style: Theme.of(context).textTheme.bodyMedium,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 23.5, horizontal: 10),
contentPadding: const EdgeInsets.symmetric(vertical: 23.5, horizontal: 10),
labelText: widget.label,
hintText: widget.hint,
errorText: widget.validator?.call(value),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).errorColor,
color: Theme.of(context).colorScheme.error,
),
),
border: OutlineInputBorder(),
border: const OutlineInputBorder(),
filled: !selected || widget.disabled,
fillColor: widget.disabled
? Theme.of(context).disabledColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ class SEAnalytics extends StatelessWidget {
onTap: (name, grades) {
showDialog(context: context, builder: (context) => SEInfoDialog(
title: name,
onSelection: (entry) {

},
pairs: grades.map((key, value) => MapEntry(key.name, value.score.toString()))
));
})
Expand Down
26 changes: 23 additions & 3 deletions lib/Structure/Pages/TaskManagement/Tasks/StanEval/SEEvent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:falcon_net/Structure/Pages/TaskManagement/Tasks/StanEval/SEScori
import 'package:falcon_net/Structure/Pages/TaskManagement/Tasks/StanEval/SESelectionDialog.dart';
import 'package:falcon_net/Utility/ErrorFormatting.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

import '../../../../../Model/Database/UnitGrades.dart';
import '../../../../../Model/Database/UserGrades.dart';
Expand All @@ -35,7 +36,7 @@ class SEEvent extends StatefulWidget {
}

class SEEventState extends State<SEEvent> {
TextEditingController score = TextEditingController();
TextEditingController score = TextEditingController(text: "100");
TextEditingController description = TextEditingController();
List<StanEvalUser> gradees = [];
String? scoreError;
Expand Down Expand Up @@ -259,10 +260,29 @@ class SEEventState extends State<SEEvent> {
showDialog(
context: context,
builder: (context) => SEInfoDialog(
// Determine which scoring guide map to use
// IF, ELSE: (IF, ELSE)
title: widget.type == GradeType.pai
? "PAI Scoring Guide"
: "Room Scoring Guide",
pairs: (widget.type == GradeType.pai ? paiDeductions : roomDeductions)
: (widget.type == GradeType.sami
? "SAMI Scoring Guide"
: "AMI Scoring Guide" ),
onSelection: (entry) {
setState(() {
// Update current score
score.text = ((int.tryParse(score.text) ?? 100) + (int.tryParse(entry.value) ?? 0)).toString();
// Updates the description
description.text += "${entry.key} (${entry.value}), ";
});

// Close deduction selection
Navigator.of(context).pop();
},
pairs: (widget.type == GradeType.pai
? paiDeductions
: (widget.type == GradeType.sami
? samiDeductions
: roomDeductions))
.map((key, value) => MapEntry(key, value.toString())),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import '../../../../Components/InfoBar.dart';
class SEInfoDialog extends StatefulWidget {
final Map<String, String> pairs;
final String title;
final void Function(MapEntry<String, String>)? onSelection;

const SEInfoDialog({super.key, required this.title, required this.pairs});
const SEInfoDialog({super.key, required this.title, required this.pairs, this.onSelection});

@override
State<SEInfoDialog> createState() => SEInfoDialogState();
Expand Down Expand Up @@ -57,7 +58,10 @@ class SEInfoDialogState extends State<SEInfoDialog> {
}
else {
var grade = ordered[index - 3];
return InfoBar(
return GestureDetector(
// When tapped, handle selection
onTap: () => widget.onSelection?.call(grade),
child: InfoBar(
children: [
Expanded(
flex: 5,
Expand All @@ -77,6 +81,7 @@ class SEInfoDialogState extends State<SEInfoDialog> {
)
)
],
),
);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//AMI Grading Rubric
Map<String, int> roomDeductions = {
"Hat Shelf": -2,
"Hangers/Hooks": -2,
Expand All @@ -15,6 +16,7 @@ Map<String, int> roomDeductions = {
"Alcove/Exterior": -3,
"Walls/Carpet": -2,
"Trash Can": -3,
"Recycling Bin": -2, // May or may not have been added by G-0
"Lights": -2,
"Windows/Runner": -2,
"Door Closed": -10,
Expand All @@ -23,7 +25,7 @@ Map<String, int> roomDeductions = {
"Unauthorized Room Arrangement": -20,
"Security Violation": -25
};

//PAI Grading Rubric
Map<String, int> paiDeductions = {
"Appropriate Uniform": -100,
"Proxy Card": -10,
Expand All @@ -44,3 +46,107 @@ Map<String, int> paiDeductions = {
"Socks": -2,
"Shoes": -2,
};

//SAMI Grading Card Rubric
Map<String, int> samiDeductions = {
//Outside Room
"Alcove/Doorway Cleanliness/Lightbulb in Place" : -2,
"Door Display (Open/Closed)" : -50,
"Name Plate Display" : -2,
//Overall Room:
"Not SAMI Order": -100,
"Bearing not IAW SAMI Procedure" : -20,
"Wall Cleanliness": -2,
"Floors": -4,
"Lights On": -2,
"Ceiling Cleanliness" : -2,
//Valet
"Items on Countertop": -4,
"Rifle Rack": -4,
"Trash Can": -4,
"Sink": -4,
"Mirror/Mirror Cabinets": -4,
"Mirror Forms (Missing Items, Discrepencies, Form 226)": -4,
"Sink Cabinets Cleanliness": -2,
"Laundry" :-2,
"Towels and Washcloths": -2,
"Lightswitch": -2,
"Thermostat":-2,
//Overhead Storage
"Overhead Storage":-2,
//Closet-HatShelf
"Order of Display (Closet)": -4,
"Cleanliness (Closet)": -4,
"Flight Cap": -2,
"OCP Cap/Beret": -2,
"Parade Cap": -2,
"Service Cap & Eagle": -2,
//Closet-Uniforms
"Order of Display (Uniforms)": -4,
"Cleanliness (Uniforms)": -4,
"Bathrobe": -2,
"Athletic Jacket": -2,
"Light Blues Shirt (trousers over crossbar)": -2,
"Service Dress (trousers over crossbar)": -2,
"Optional Service Uniform Clothing Items": -2,
"Mess Dress": -2,
"Mess Dress Shirt": -2,
"Flight Duty Uniform with Jacket": -2,
"OCP APECS Jacket with Rank": -2,
"Coyote Brown Fleece (Nametape, USAF, Rank)": -2,
"OCP Blouse (trousers over crossbar)": -2,
"Parka (scarf over crossbar; watch cap in outside pocket)": -2,
"Raincoat": -2,
"Overcoat": -2,
"USAFA Running Top (bottoms over corssbar)": -2,
"Cadet Informal Uniform": -2,
"Empty Hangers (not required but must be right location)": -2,
"Civilian Clothes": -2,
//Closet-Shoe Rack
"Order of Display (Shoe Rack)": -4,
"Cleanliness (Shoe Rack)": -4,
"Low Quarters": -2,
"OCP Boots":-2,
"Pumps": -2,
"Cadet Informal Uniform Shoes": -2,
"Civilian Shoes": -2,
"Heels Aligned": -2,
"Laces Tucked": -2,
//Bed
"Cleanliness/Display (Bed)": -4,
"E-Fold": -4,
"Hospital Corners": -4,
"18 in. to Collar": -4,
"6 in. Collar": -4,
"Pillow Display": -4,
//Bed-Drawers
"Cleanliness (Drawers)": -4,
"Drawers Open at 8 in. Top, 12 in. Bottom": -2,
//Bed-Military Drawer
"V-Neck (male only)": -2,
"PC Shirts": -2,
"Ranks": -2,
"Belts": -2,
"Athletic Shorts & Swimsuit": -2,
"Intramural Jersey": -2,
"Black Gloves w/ White Gloves on Top": -2,
"Coyote Brown Undershirt": -2,
"Ties, Tie Tab": -2,
"Additional Authorized Items": -2,
//Desk and BookCase
"Cleanliness (Desk/Bookcase)": -4,
"'V' Display": -2,
"No Extraneous Papers": -2,
"Desk Chair Pushed In": -2,
"Wires Neatly Bundled": -2,
"Bulletin Board has 4 Corners Tacked on Items": -2,
"Memorabilia": -2,
"Underneath Desk is Cleared": -2,
"Items on Top of Desk Bookshelf": -2,
//Windows
"Free of Objects": -2,
"Curtain Display": -2,
"Window Runner": -2,
"Window Closed": -2,
"Screen in Place": -2
};
Loading

0 comments on commit a4cf886

Please sign in to comment.