-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
We will develop an Android app written in Kotlin on Android Studio. We will be using Android Views XML files to create our app’s layouts and the android.graphics library for custom graphics like charts and graphs. We will use Gradle as our package manager. Google Firebase Realtime Database will act as our database and Google Firebase Authentication will authenticate our users.
For testing during development, we will be using the built-in Android emulator in Android Studio.
For distributing to testers during development, we will upload a signed APK to GitHub as part of a GitHub release on our repository. This allows testers to either directly download the APK on an Android device for native testing or to download the APK onto a computer and drag-and-drop the APK file into an Android Studio emulator for emulated testing.
Note that these roles are subject to shift as the project develops and we learn more about the work involved with each part of the application.
- Harvey: Will work on the application's user interface, with a focus on creating the Android Views XML files and developing the code to handle user inputs from buttons, text fields, etc.
- Dylan: Will work on the application's backend database, with a focus on creating the Firebase Realtime Database and developing code for reading/writing to/from the database.
- Chance: Will work on the application's backend authentication, with a focus on setting up Firebase Authentication and developing the code for user logins/signups.
- Hyatt: Will work on the application's key classes, with a focus on developing the classes our app will use to represent its various entities such users, classes, students, etc.
- William: Will work on joining the application's UI and key classes, with a focus on bridging the functionality of classes with the UI so that the app can properly display and update information about its entities.
The user will not be able to login to multiple devices at once or select the same shared class as another user at the same time. When the user opens the app, user data will be loaded from the database as it is encountered (e.g. opening the class list screen will initiate an asynchronous request for all of that user’s classes). Once the data has been loaded, it will be turned into in-memory model classes. Because the user can only be logged in on one device, subsequent read operations can occur in memory from the model classes. Write operations on these model classes will initiate the change on the database and then—if successful—on the model class.
First bullet points denote defined classes. The sub-bullet points denote class attributes or methods (differentiated by parenthesis), with the text before a colon representing the attribute or method name and the text after representing the data type of attribute or data type returned by method if one is returned (“getters” and “setters” are omitted). The sub-sub-bullet points are descriptions of either the class, attribute, or method, depending on what it is under (unambiguous well-named items do not have descriptions). [] denotes lists.
- User
- classes: [Class]
- unpreparedOption: bool
- Attribute which enables the “unprepared” option when spotting students
- skippedStudentNotRespottedOnThatDay: bool
- Attribute for user’s preference on skipped students not to be called on again for the day.
- raiseAbsentSpotProb: bool
- Attribute for user’s preference on increasing the probability of student to be called on next time if they are absent.
- raiseSkipSpotProb: bool
- Attribute for user’s preference on increasing the probability of student to be called on next time if they are skipped.
- selectionAnimation: bool
- Attribute which toggles on/off an animation for spotting students
- Class
- layout: ILayout
- Attribute which determines the layout of the class. Null for roster only classes.
- ratingSystem: RatingSystem
- Attribute that is an enumeration representing which type of rating scale for this class, defaulted to 1-5.
- name: String
- students: [Student]
- callStudent(user: User): student
- Method that chooses a student randomly, according to the constraints of the user.
- numSpots(): int
- Return the total number of spotingss for this class
- avgRating(): Rating
- Return the average rating of spotings in this class
- sumRatings(): double
- Return the total of all ratings for all spottings that have occurred in this class.
- countAbsent(): int
- Return the total number of absences in this class
- countUnprepared(): int
- Return the number of times a student was tagged unprepared when spotted in this class
- addStudent(student):
- removeStudent(student):
- layout: ILayout
- Student
- firstName: String
- lastName: String
- year: String
- class: Class
- class to which this student belongs
- spottings: [Spotting]
- List of times this student was spotted on
- seat: String
- The seat position of the student in the class which will show on screen when they’re spotted. For unstructured classes, this is an optional custom field. For grid/bowl, this will correspond to the student’s row/column.
- numSpots(): int
- Return the number of times this student was spotted
- avgRating(): Rating
- Return the average rating of this student when spotted
- sumRatings(): double
- Returns the sum of student’s rating
- countAbsent(): int
- Return the number of times this student was tagged absent when spotted
- countUnprepared(): int
- Return the number of times this student was tagged unprepared when spotted
- lastAbsence(): Date
- Return the date of the most recent time this student was tagged absent
- lastUnprepared(): Date
- Return the date of the most recent time this student was tagged unprepared
- addSpotting(spotting):
- removeSpotting(spotting):
- LayoutType - An enumeration of what types the class layout will be.
- RatingSystem - An enumeration of what type of rating scale is used for a class.
- NumberingSystem - An enumeration of the numbering system used for a layout (e.g. numbers in reading order, columns are alphabetical, rows are numbers, ect.)
- ILayout
- This interface defines the methods that all class seating layouts will provide.
- getLayoutType(): LayoutType
- Returns the type of layout this layout is.
- getNumberingSystem(): NumberingSystem
- Returns the numbering system this layout uses.
- getLayoutType(): LayoutType
- BowlLayout : ILayout
- rows: int
- How many seats in a column of the bowl
- columns: [int]
- How many seats in each row of the bowl
- numberingSystem: NumberingSystem
- the seat numbering system used with this layout
- rows: int
- GridLayout: ILayout
- rows: int
- How many seats in a column of the grid
- columns: int
- How many seats in a row of the grid
- numberingSystem: NumberingSystem
- the seat numbering system used with this layout
- rows: int
- Seat
- A private class for CustomLayouts that contains information on a seat in the class layout
- x: double
- x position of the seat as a fraction of the whole layout
- y: double
- y position of the seat as a fraction of the whole layout
- rotation: double
- orientation of the seat in degrees relative to the x-axis (whose positive direction is 0 degrees)
- x: double
- CustomLayout: ILayout
- numberingSystem: NumberingSystem
- the seat numbering system used with this layout
- seats: [Seat]
- A list of all seats in the custom layout
- numberingSystem: NumberingSystem
- Spotting
- rating: float
- The rating received for this spot
- absent: bool
- Flag for whether the student was absent
- unprepared: bool
- Flag for whether the student was unprepared
- skipped: bool
- Flag for whether this spot was skipped
- datetime: Datetime
- Datetime of this spot
- rating: float
The user will have their own profile, and all the information of their instance of the class is stored in a database, along with all the information about their specific classes.
Firebase Realtime Databases store everything in one JSON tree. The following tree represents the schema of that tree, but avoids exact JSON syntax for conciseness. The text before a colon represents a key. After a colon, a simple datatype may be specified for the type of the value that key stores, or "List" may be specified, in which case a collection of properties using UUIDs as keys follows (for example, the value of “users” will be a collection of key-value pairs with users’ UUID as the key, and users’ attributes as the value). [Type] represents an array of that simple type. Non-JSON-supported types, such as UUIDs, Dates, and DateTimes are strings. Descriptions for some attributes are provided. If not provided, the description can be safely inferred by the attribute’s name.
Root of Firebase Realtime Database tree:
- users: List
- <UUID>:
- classes: [UUID] (array of class UUIDs to which this user has access)
- classInvitations: [UUID] (array of class UUIDs that other users have created and invited this user to)
- blockedUsers: [UUID] (array of user UUIDs that cannot invite this user to classes)
- unpreparedOption: bool (flag for the setting controlling if the user can mark students as unprepared)
- selectionAnimation: bool (flag for the setting controlling if an animation plays while a student is being selected)
- selectionAlgorithmIParam: int (explained in requirement 5.1)
- skippedStudentNotRespottedOnThatDay: bool (flag for the setting controlling if skipped students can be selected again on the same day)
- raiseAbsentSpotProb: bool (flag for the setting controlling if students marked absent shall have a higher chance of being selected in subsequent classes)
- raiseSkipSpotProb: bool (flag for the setting controlling if students skipped shall have a higher chance of being selected in subsequent classes)
- <UUID>:
- classes: List
- <UUID>:
- owner: UUID (UUID of user that originally created this class)
- students: [UUID] (array of UUIDs representing the students in this class)
- layout: UUID (UUID of layout describing this class. Types of layouts are given below)
- name: string (name of class)
- acceptedUsers: [UUID] (array of user UUIDs that can view and edit this class)
- invitedUsers: [UUID] (array of user UUIDs that have been invited to this class but have not yet accepted or declined)
- <UUID>:
- students: List
- <UUID>:
- class: UUID (UUID of the class to which this student belongs)
- user: UUID (UUID of the user which created this student)
- firstname: string
- lastname: string
- nonAbsentSpottings: int (number of times this user has been selected where they are not marked absent)
- lastNonAbsentSpotting: Date
- absences: int
- unprepareds: int
- lastAbsence: Date
- lastUnprepared: Date
- totalOfRatings: double (sum of all ratings)
- numberOfRatings: int
- seat: string
- profilePicture: Cloud Storage for Firebase URI string
- year: string (graduating year to which the student belongs)
- <UUID>:
- spottings: List
- <UUID>:
- student: UUID
- user: UUID (UUID of user which created this spotting)
- unprepared: bool
- rating: double
- skipped: bool
- absent: bool
- datetime: DateTime
- <UUID>:
- gridLayouts: List
- <UUID>:
- rows: int
- columns: int
- seatNumberingSystem: string
- <UUID>:
- bowlLayouts: List
- <UUID>:
- rows: int
- columnsPerRow: [int]
- seatNumberingSystem: string
- <UUID>:
- customLayouts: List
- <UUID>:
- seatNumberingSystem: string (of the form “, ”. Example: “letter, number”)
- seats: list of objects with:
- x: double
- y: double
- rotation: double
- <UUID>:
Firebase realtime database is a noSQL database that stores data in one JSON tree. It does not have queries or joins in a traditional sense. Instead subtrees from the JSON can be read or written. Most “queries” will thus happen in memory after data has been read from the database. Some of these common queries (and the pseudocode that performs them) are:
- Get all classes for a user
- db.child("users").child(userId).child(“classes”).get()
- For each classId in the result:
- db.child.class(“classes”).child(classId).get()
- Collect all classes
- Get all students for a class
- db.child("classes").child(classId).child(“students”).get()
- For each studentId in the result:
- db.child.class(“students”).child(studentId).get()
- Collect all students
- Get all spottings for a student:
- db.child("students").child(studentId).child(“spottings”).get()
- For each spottingId in the result:
- db.child.class(“spottings”).child(spottingId).get()
- Collect all spottings
- Get all spottings on a day for a class
- Get all students in the class (see above)
- Get all spottings for each student in the class (see previous)
- Iterate through results to find spottings with correct date
- tvLogInPrompt (TextView): A TextView prompting the user to log in.
- etUsername (EditText): An EditText for the user to enter their username.
- etPassword (EditText): An EditText for the user to enter their password.
- chkRememberMe (CheckBox): A CheckBox for the user to select in order to avoid logging in every time they use the app.
- btnForgotPass (Button): A Button which brings the user to the “Password Recovery” screen in case they have forgotten their password.
- btnLogIn (Button): A Button which submits the user’s username and password when pressed and brings them to the “Home” screen if their username and password correspond to an existing account.
- btnSignUp (Button): A button which brings the user to the “Sign Up” screen if they need to create an account.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “Login” screen.
- tvSignUpPrompt (TextView): A TextView prompting the user to enter their information in order to create a new account.
- etEmail (EditText): An EditText for the user to enter their email.
- etUsername (EditText): An EditText for the user to enter their username.
- etPassword (EditText): An EditText for the user to enter their password.
- etPasswordRepeat (EditText): An EditText for the user to enter their password again in order to confirm their password choice.
- btnSubmit (Button): A Button which submits the user’s info to create a new account and brings them to the “Home” screen.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “Login” screen.
- tvRecoveryPrompt (TextView): A TextView prompting the user to enter the email connected to their account.
- **etEmail (EditText)*: An EditText for the user to enter their email.
- btnSendEmail (Button): A Button for the user to submit their email address so that they can receive an email to reset their password and recover their account (or an email notifying them that there is no account corresponding to the given email).
- imgBtnHamburgerMenu (ImageButton): An ImageButton to open up a NavigationDrawer from the left side which contains a list of the user’s classes.
- imgBtnSettings (ImageButton): An ImageButton which brings the user to SettingsActivity when pressed.
- tvClassTitle (TextView): A TextView displaying the name of the currently open class.
- btnStudent1, btnStudent2, … (Buttons): A grid of Buttons representing seats based on the classroom layout. If the seat the button represents is occupied, the initials of the student occupying it will be presented. If a button representing an occupied seat is pressed, the app will switch to StudentInformationActivity for the student sitting in the selected seat.
- btnSpot (Button): A Button which selects a random student from the class roster and displays their name and information along with the performance rating interface in a popup screen.
- imgBtnRoster (ImageButton): an ImageButton in the bottom left which opens up ClassRosterActivity when pressed, allowing the user to view information about the students in their class.
- imgBtnStats (ImageButton): An ImageButton to the right of imgBtnRoster which opens up StatisticsActivity when pressed, allowing the user to view the class’s statistics.
- imgBtnEditClass (ImageButton): An ImageButton in the bottom right which opens up EditClassActivity when pressed, allowing the user to edit the class title, roster, and seat layout.

- nvClassList (NavigationView): A NavigationView containing the Buttons used to swap between classes. This will slide in/out from the left when the hamburger button is pressed.
- imgBtnHamburgerMenu (ImageButton): An ImageButton to close the NavigationDrawer from the left side which contains a list of the user’s classes.
- btnClass1, btnClass2, … (Buttons): A series of Buttons used to switch to other classes that the user has created. When a user creates a new class, a new Button is added to this list containing the name of the created class.
- btnAddClass (Button): A Button which brings the user to the “Create Class” screen when pressed so that the user can create new classes.

- tvStudentName (TextView): A TextView containing the student’s name that was selected from the class roster.
- tvNumPriorCalls (TextView): A TextView containing the number of times the selected student has been called that day.
- tvAvgRating (TextView): A TextView containing the overall average rating of that student’s performance.
- tvRatingPrompt (TextView): A TextView containing the text “Performance Rating”, prompting the user to rate the student’s performance from 1 to 5 stars.
- imgBtnStar1, imgBtnStar2, … (ImageButtons): A series of five ImageButtons allowing the user to rank the performance of the student.
- btnAbsent (Button): A button allowing the user to indicate the selected student is absent from class.
- btnUnprepared (Button): A button allowing the user to indicate the selected student was unprepared for the question. This simply provides an extra flag for class statistics.
- imgBtnDone (ImageButton): An ImageButton in the bottom left allowing the user to submit their rating of the student and return to the “Home” screen.
- imgBtnNext (ImageButton): An ImageButton in the bottom right allowing the user to submit their rating of the student and randomly select another student.
- btnSkip (Button): A Button allowing the user to skip the selected student and not save any rating data for the selected student.
- Note: This entire layout will be placed in a Dialog object to achieve the popup effect.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “Home” screen.
- tvSettings (TextView): A TextView containing “Settings”.
- tvUnpreparedOpt (TextView): A TextView labeling the Switch which turns on and off the option for a user to mark a student as “unprepared”.
- swtUnpreparedOpt (Switch): A Switch allowing the user to turn on and off the option for a user to mark a student as “unprepared”.
- imgBtnUnpreparedOptInfo (ImageButton): An ImageButton to the left of tvUnpreparedOpt which will provide more information about the specific setting when pressed by the user.
- tvAnimationOpt (TextView): A TextView labeling the Switch which turns on and off the option for a user to mark a student as “unprepared”.
- swtAnimationOpt (Switch): A Switch allowing the user to turn on and off the animation that plays when btnSpot is pressed.
- imgBtnAnimationOptInfo (ImageButton): An ImageButton to the left of tvAnimationOpt which will provide more information about the specific setting when pressed by the user.
- tvRatingOpt (TextView): A TextView labeling the Spinner which allows the user to select which rating system they want to use (5 stars, 1-10, letter grading system, etc.)
- spnRatingOpt (Spinner): A Switch allowing the user to turn on and off the option for a user to mark a student as “unprepared”.
- imgBtnRatingOptInfo (ImageButton): An ImageButton to the left of tvRatingOpt which will provide more information about the specific setting when pressed by the user.
- btnLogOut (Button): A Button allowing the user to log out of their account and return to the “Login” screen.
- Note: There will be other settings added to this screen as we develop the app. Each will have the same setup: a TextView labeling the setting, the proper widget for choosing the setting, and a Button to provide more information about the setting.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “Home” screen.
- tvStatistics (TextView): A TextView containing “Class Statistics”
- tvUpdate (TextView): A TextView containing a generated update about the class based on its current performance trends.
- tvClassData (TextView): A TextView containing various statistics about the class such as total students, average rating, best performing student, worst performing student, etc.
- Note: There will be multiple graphs on this screen. For example, there may be a pie chart representing the distribution of performance ratings, and there may be a line chart representing the progression of ratings over time. These graphs will be drawn in Canvases using the android.graphics library.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “Home” screen.
- etClassName (EditText): An Edit Text for Users to input the name of the class they would like to create.
- tvSelectSeatingType (Text View): A Text View prompting the user to select the seating arrangement type they would like to choose.
- imgBtnSelectSeatingType (ImageButton): An image button to the left of the ‘tvSelectSeatingType’ that will provide more information on the types of seating.
- btnGridStructure (Button): A button where if the user selects it, the class structure they will be making is of the Grid class structure.
- btnNoStructure (Button): A button where if the user selects it, the class structure they will be making is of the No Structure class structure.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “ClassSeatingType” screen.
- tvCreateRoster (TextView): A text view prompting the user to create their roster.
- etSearchStudent (EditText): An edit text that allows the user to search for students in their imported roster, then attach them to a seat in the classroom.
- btnSeatOne, btnSeatTwo … (Buttons): Seats the user can tap and select a student to assign to that seat.
- tvRows (TextView): A textView that tells the user to input the number of rows for their grid layout.
- tvCols (TextView): A textView that tells the user to input the number of columns for their grid layout.
- etRowAmount (EditText): An editText that allows the user to input the amount of rows within their classroom layout.
- etColAmount (EditText): An editText that allows the user to input the amount of columns within their classroom layout.
- btnImportRoster (Button): A button that allows the user to input a roster of their students, whether it be .csv, Google sheet, or Excel.
- btnCancelClassCreation (Button): button that allows the user to cancel their creation of their class and return them back to the “Home” screen.
- btnCreateClass (Button): button that allows the user to create their class with their assigned seats and imported students.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “ClassSeatingType” screen.
- tvCreateRosterNoStructure (TextView): a textView that prompts the user to create a roster for their no structure classroom.
- etSearchStudentNoStructure (EditText): An edit text that allows the user to search for students in their imported roster, to check that their roster was imported correctly.
- btnStudentListOne, btnStudentListTwo … (Buttons): A list of students part of the no structure classroom that the user can select and edit and add as they see fit.
- btnImportRosterNoStructure (Button): A button that allows the user to input a roster of their students, whether it be .csv, Google sheet, or Excel.
- btnCancelClassCreationNoStructure (Button): button that allows the user to cancel their creation of their class and return them back to the “Home” screen.
- btnCreateClassNoStructure (Button): button that allows the user to create their class with their assigned seats and imported students.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “Home” screen.
- etClassName (EditText): An editText that allows the user to edit the name of the classroom.
- etStudentSearch (EditText): An editText that allows the user to search for where a specific student is within a classroom.
- btnStudentSeatOne, btnStudentSeatTwo, … (Buttons): seats within a classroom, and if the user taps on the seat they can see which student is sitting there and the student information as well.
- btnAddStudent (Button): A button that allows the user to add a student name to their roster of students to then assign them a seat.
- btnDeleteClass (Button): A button that allows the user to delete their class, then the application will open up the next available classroom.
- btnUpdateClass (Button): A button that allows the user to update their class after making changes in the edit screen.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “Edit Class” screen.
- gvStudentList (GalleryView): A GalleryView of all the possible students that can be assigned to a selected seat.
- imgBtnStudentInfo (ImageButton): An image button of an arrow where if the user selects the arrow they can see more information on the student in that list.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “Home” screen.
- tvStudentsPrompt (TextView): A textView telling the user that this is the student list view of the roster of students.
- etStudentSearch (EditText): An editText that allows the user to filter and search for a specific student in that classroom.
- gvStudentList (GalleryView): A gallery view of all the students within a classroom.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “StudentList” screen.
- imgBtnEdit (ImageButton): An Image Button that allows the user to edit the information for the student.
- tvStudentName (TextView): a textView that displays the student’s name for the student information.
- tvStudentInformation (TextView): a textView that displays all the class performance statistics associated with that student.
- imgBtnBack (ImageButton): An ImageButton in the upper left to bring the user back to the “StudentList” screen.
- tvStudentName (TextView): a textView that displays the student’s name for the student information.
- etStudentName (EditText): an editText that allows the user to edit the student name of the student.
- etStudentSeat (EditText): an editText that allows the user to edit the student seating of the student.
- etStudentYear (EditText): an editText that allows the user to edit the year of the student.
- etStudentAmountCalled (EditText): an editText that allows the user to edit the number of times called for the student.
- etAverageScore (EditText): an editText that allows the user to edit the average score for the student.
- tvStudentName (TextView): a textView that prompts the user what to input for the student information, in this case the Student Name
- tvStudentSeat (TextView): a textView that prompts the user what to input for the student information, in this case the Student Seat
- tvStudentYear (TextView): a textView that prompts the user what to input for the student information, in this case the Student Year
- tvStudentAmountCalled (TextView): a textView that prompts the user what to input for the student information, in this case the Amount of Times called.
- tvAverageScore (TextView): a textView that prompts the user what to input for the student information, in this case the Average Score.
- btnDeleteStudent (Button): A button to delete the student from the classroom roster.
- btnUpdateStudent (Button): A button to update the student’s information in the classroom roster to whatever was inputted.