vatz88/FFCSonTheGo

Support different timetables for different campuses

vatz88 opened this issue · 7 comments

Is your feature request related to a problem? Please describe.

Currently we only have one timetable for both Vellore and Chennai campuses. This works well if timetable followed by both campuses are same. But in case the timetable is different for both the campuses we don't have a way to support both of them.

Describe the solution you'd like

Add support for different timetables for different campuses. This will require good efforts in terms of refactoring existing code.
Must ideal refactoring is moving to react or preact but it's lot of efforts. It'll also require re-writing all of jquery code.
Easiest approach I can think of is to write a helper function which takes a schema of timetable and renders it accordingly. We can call this function with correct schema when changing the campus and re-render the timetable.

Describe alternatives you've considered

In past, similar problem was solved by deploying different code on a different route. I don't think it's a good approach.

Additional context

#168

Just thought I should add this here, this is what my Winter Semester 2020-21 timetable looks like (Chennai campus, BCE).

image

It was different for Fall Semester 2020-21, the timings were different and he had a few more slots. They updated VTOP so that you can only view timetables for the semesters you have registered for, so I'm not sure if it's the same for other branches or what the next semester's timetable will look like.

Can someone add what it looks like for the Vellore campus? If VIT is going to be making changes like this often, I feel it'll be better to resolve this in a way where changing slots and timings in future doesn't take a lot of effort.

Can someone add what it looks like for the Vellore campus?

The current timetable we are using in this site is what Vellore is using currently (best to my knowledge). @sanket9918 can confirm and help you with any more information you'd want.

I feel it'll be better to resolve this in a way where changing slots and timings in future doesn't take a lot of effort

Yes, that the idea here. Support multiple timetable and make it easier to update timetables. One of the approaches I can think of for achieving this is to have a define a timetable schema (probably json). And we should write a generic function which takes this schema and renders the timetable accordingly. I feel this is easier to do with our current codebase. Open to other solutions.

One of the approaches I can think of for achieving this is to have a define a timetable schema (probably json).

Yeah, I was thinking the same. I think someone is already working on a patch? If not I'll see what I can do next week as this would cause conflicts with the redesign (#172).

If there are different layouts for other branches we'll be able to support them too by giving an option to select a layout. The schema's can be defined in files like layout_vellore_bce.json, layout_chennai_bce.json, etc.

You can pick it up next week. Sync with @hariketsheth once if he has made any progress on it

This is what the Winter Semester 2020-21 timetable looks like (Vellore campus, BCE). Can @sanket9918 confirm?

unknown (2) (1)

Here's the JSON file (Chennai) I thought can be used for this issue. I am NOT currently working on this (maybe sometime in the future, if I do I'll mention it here), so this is available for anyone who'd like to take it up. You'll have to also check for time clashing using JavaScript and add classes like no-pre-theory or no-post-lab accordingly.

{
    "theory": [
        {
            "start": "08:00",
            "end": "08:50",
            "days": {
                "mon": "A1",
                "tue": "B1",
                "wed": "C1",
                "thu": "D1",
                "fri": "E1"
            }
        },
        {
            "start": "08:55",
            "end": "09:45",
            "days": {
                "mon": "F1",
                "tue": "G1",
                "wed": "A1",
                "thu": "B1",
                "fri": "C1"
            }
        },
        {
            "start": "09:50",
            "end": "10:40",
            "days": {
                "mon": "D1",
                "tue": "E1",
                "wed": "F1",
                "thu": "G1",
                "fri": "TA1"
            }
        },
        {
            "start": "10:45",
            "end": "11:35",
            "days": {
                "mon": "TB1",
                "tue": "TC1",
                "wed": "TD1",
                "thu": "TE1",
                "fri": "TF1"
            }
        },
        {
            "start": "11:40",
            "end": "12:30",
            "days": {
                "mon": "TG1",
                "tue": "TAA1",
                "wed": "TBB1",
                "thu": "TCC1",
                "fri": "TDD1"
            }
        },
        {
            "lunch": true
        },
        {
            "start": "14:00",
            "end": "14:50",
            "days": {
                "mon": "A2",
                "tue": "B2",
                "wed": "C2",
                "thu": "D2",
                "fri": "E2"
            }
        },
        {
            "start": "14:55",
            "end": "15:45",
            "days": {
                "mon": "F2",
                "tue": "G2",
                "wed": "A2",
                "thu": "B2",
                "fri": "C2"
            }
        },
        {
            "start": "15:50",
            "end": "16:40",
            "days": {
                "mon": "D2",
                "tue": "E2",
                "wed": "F2",
                "thu": "G2",
                "fri": "TA2"
            }
        },
        {
            "start": "16:45",
            "end": "17:35",
            "days": {
                "mon": "TB2",
                "tue": "TC2",
                "wed": "TD2",
                "thu": "TE2",
                "fri": "TF2"
            }
        },
        {
            "start": "15:40",
            "end": "18:30",
            "days": {
                "mon": "TG2",
                "tue": "TAA2",
                "wed": "TBB2",
                "thu": "TCC2",
                "fri": "TDD2"
            }
        },
        {
            "start": "18:35",
            "end": "19:25",
            "days": {
            	"tue": "S1",
            	"thu": "S2"
            }
        }
    ],
    "lab": [
        {
            "start": "08:00",
            "end": "08:50",
            "days": {
                "mon": "L1",
                "tue": "L7",
                "wed": "L13",
                "thu": "L19",
                "fri": "L25"
            }
        },
        {
            "start": "08:50",
            "end": "09:40",
            "days": {
                "mon": "L2",
                "tue": "L8",
                "wed": "L14",
                "thu": "L20",
                "fri": "L26"
            }
        },
        {
            "start": "09:50",
            "end": "10:40",
            "days": {
                "mon": "L3",
                "tue": "L9",
                "wed": "L15",
                "thu": "L21",
                "fri": "L27"
            }
        },
        {
            "start": "10:40",
            "end": "11:30",
            "days": {
                "mon": "L4",
                "tue": "L10",
                "wed": "L16",
                "thu": "L22",
                "fri": "L28"
            }
        },
        {
            "start": "11:40",
            "end": "12:30",
            "days": {
                "mon": "L5",
                "tue": "L11",
                "wed": "L17",
                "thu": "L23",
                "fri": "L29"
            }
        },
        {
            "start": "12:30",
            "end": "13:20",
            "days": {
                "mon": "L6",
                "tue": "L12",
                "wed": "L18",
                "thu": "L24",
                "fri": "L30"
            }
        },
        {
            "lunch": true
        },
        {
            "start": "14:00",
            "end": "14:50",
            "days": {
                "mon": "L31",
                "tue": "L37",
                "wed": "L43",
                "thu": "L49",
                "fri": "L55"
            }
        },
        {
            "start": "14:50",
            "end": "15:40",
            "days": {
                "mon": "L32",
                "tue": "L38",
                "wed": "L44",
                "thu": "L50",
                "fri": "L56"
            }
        },
        {
            "start": "15:50",
            "end": "16:40",
            "days": {
                "mon": "L33",
                "tue": "L39",
                "wed": "L45",
                "thu": "L51",
                "fri": "L57"
            }
        },
        {
            "start": "16:40",
            "end": "17:30",
            "days": {
                "mon": "L34",
                "tue": "L40",
                "wed": "L46",
                "thu": "L52",
                "fri": "L58"
            }
        },
        {
            "start": "17:40",
            "end": "18:30",
            "days": {
                "mon": "L35",
                "tue": "L41",
                "wed": "L47",
                "thu": "L53",
                "fri": "L59"
            }
        },
        {
            "start": "18:30",
            "end": "19:20",
            "days": {
                "mon": "L36",
                "tue": "L42",
                "wed": "L48",
                "thu": "L54",
                "fri": "L60"
            }
        }
    ]
}

I've made some progress on this one, timetable schemas can easily be changed in the JSON file in future if any changes are required. The only thing left is to figure out how to check for slot clashes, will probably have to make use of JavaScript's Date() class. I think this should be ready by next week.

FFCS.On.The.Go.-.VIT.University.-.31.December.2021.mp4