decided to add season support

This commit is contained in:
Sriram Hariharan
2023-03-04 23:00:01 -06:00
parent bc464cd264
commit d9739cdb56
3 changed files with 99 additions and 1 deletions

View File

@@ -27,6 +27,16 @@ export enum Status {
CANCELLED = 'CANCELLED', CANCELLED = 'CANCELLED',
} }
/**
* Represents a semester, with the year and the season for when a course is offered
*/
export type Semester = {
/** The year that the semester is in */
year: number;
/** The season that the semester is in (Fall, Spring, Summer) */
season: string;
};
/** /**
* The internal representation of a course for the extension * The internal representation of a course for the extension
*/ */
@@ -59,6 +69,8 @@ export class Course {
flags: string[]; flags: string[];
/** How is the class being taught (online, hybrid, in person, etc) */ /** How is the class being taught (online, hybrid, in person, etc) */
instructionMode: InstructionMode; instructionMode: InstructionMode;
/** Which semester is the course from */
semester: Semester;
constructor(course: Course | Serialized<Course>) { constructor(course: Course | Serialized<Course>) {
Object.assign(this, course); Object.assign(this, course);

View File

@@ -60,8 +60,18 @@ export class CourseScraper {
fullName = fullName.replace(/\s\s+/g, ' ').trim(); fullName = fullName.replace(/\s\s+/g, ' ').trim();
const [courseName, department, number] = this.separateCourseName(fullName); const [courseName, department, number] = this.separateCourseName(fullName);
const [status, isReserved] = this.getStatus(row); const [status, isReserved] = this.getStatus(row);
// TODO: get semester from somewhere
const year = new Date().getFullYear();
const month = new Date().getMonth();
let season = 'Fall';
if (month >= 0 && month < 5) {
season = 'Spring';
} else if (month >= 5 && month < 8) {
season = 'Summer';
}
const newCourse = new Course({ const newCourse = new Course({
fullName, fullName,
courseName, courseName,
@@ -77,6 +87,11 @@ export class CourseScraper {
instructionMode: this.getInstructionMode(row), instructionMode: this.getInstructionMode(row),
instructors: this.getInstructors(row), instructors: this.getInstructors(row),
description: this.getDescription(document), description: this.getDescription(document),
// TODO: get semester from somewhere
semester: {
year,
season,
},
}); });
courses.push({ courses.push({
rowElement: row, rowElement: row,

71
todo.md Normal file
View File

@@ -0,0 +1,71 @@
# To Do
Last Updated: 03/4/2023
## Features:
- [ ] scraping course information
- [ ] auto loading next pages
- [ ] injecting plus header and buttons
- [ ] showing course popup
- [ ] RMP, eCis, Textbook, and Syllabus buttons
- [ ] displaying professor information on popup
- [ ] saving courses
- [ ] Multiple schedule support
- [ ] Browser Action Popup
- [ ] browser action badge
- [ ] links to RIS, Registrar, Degree Audit in browser action
- [ ] copy unique id quickly from browser action
- [ ] Clickable links to buildings
- [ ] Count how many hours and # of classes in schedule
- [ ] Conflict highlighting
- [ ] Tooltip that says which classes conflict, maybe suggest a different section or time that doesn't conflict
- [ ] import / export schedules from JSON file
- [ ] Search for classes from within extension
- [ ] Grade distribution
- [ ] Course description
- [ ] Highlight and use rich text to make course description more readable
- [ ] auto load
- [ ] calendar
- [ ] calendar file export
- [ ] save as png
- [ ] calendar click to open course popup
- [ ] calendar switch schedule
- [ ] User Options
- [ ] UTPlanner support? (not as much of a priority anymore)
- [ ] Waitlist support
- [ ] import classes from waitlist page
- [ ] waitlist pooling
- [ ] store in db
- [ ] see who else is looking at certain classes (waitlist, or has it in their schedule)
- [ ] CHECK ALL THE TODOs in CODE BEFORE LAUNCHING
## LEGACY FROM UTRP-V1
- [ ] unneeded Logout message on individual course pages
- [ ] RMP not working on individual course pages
- [ ] Textbook button (amber)
- [ ] Calendar popup
- [ ] online classes no times in popup link
- [ ] load all courses on first pages
- [ ] Location in popup e tra info
- [ ] E port calendar format
- [ ] import courses from class schedule screen
- [ ] all semester's grade distribution
- [ ] import into and e port from UT registration plus
- [ ] Showing the icon on the flags pages
- [ ] Easter egg, no course messages
- [ ] clean upcalendar e port and add more options to screen
- [ ] search by unique number
- [ ] the update/install bug
- [ ] Redesign footer menu
- [ ] work on UT Planner & Coursicle
- [ ] work on multiple schedules
- [ ] polish
- [ ] more 'at a glance info'
- [ ] Rearrange Courses
- [ ] Firefo Support
- [ ] RMP (cumulative score for class based off CIS, RMP, grade dist., etc.)
- [ ] Conflict indicator ( Possible different section? )
- [ ] Compare classes mode
- [ ] Screenshotting calendar on zoomed browser cuts off image.