metakgp / gyft

Get Your Freaking Timetable
https://gyft.metakgp.org
MIT License
56 stars 60 forks source link

[BUG]: Fails to parse time table for first year #143

Closed productsystem closed 1 month ago

productsystem commented 2 months ago

Time table Document

1st year, Phy sem

    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Time Table View</title>
        <link rel="StyleSheet" href="../css/style1.css">
    </head>
    <body>
        <form name="frm" action="secwiseview.jsp?action=first" method="post">
              <center><font color="#000099"><b>Your TimeTable for AUTUMN 2024-2025</b></font></center>
                        <table><tr><td><table border="1" cellpadding="0" cellspacing="0" >
                                        <tr><td class=tableheader nowrap style='padding-top:5px;padding-bottom:5px;padding-left:7px;padding-right:7px'>Day Name</td>
                                            <TD class=tableheader nowrap style='padding-top:5px;padding-bottom:5px;padding-left:7px;padding-right:7px'>8:0:AM-8:55:AM</TD>
<TD class=tableheader nowrap style='padding-top:5px;padding-bottom:5px;padding-left:7px;padding-right:7px'>9:0:AM-9:55:AM</TD>
<TD class=tableheader nowrap style='padding-top:5px;padding-bottom:5px;padding-left:7px;padding-right:7px'>10:0:AM-10:55:AM</TD>
<TD class=tableheader nowrap style='padding-top:5px;padding-bottom:5px;padding-left:7px;padding-right:7px'>11:0:AM-11:55:AM</TD>
<TD class=tableheader nowrap style='padding-top:5px;padding-bottom:5px;padding-left:7px;padding-right:7px'>12:0:PM-12:55:PM</TD>
<TD class=tableheader nowrap style='padding-top:5px;padding-bottom:5px;padding-left:7px;padding-right:7px'>2:0:PM-2:55:PM</TD>
<TD class=tableheader nowrap style='padding-top:5px;padding-bottom:5px;padding-left:7px;padding-right:7px'>3:0:PM-3:55:PM</TD>
<TD class=tableheader nowrap style='padding-top:5px;padding-bottom:5px;padding-left:7px;padding-right:7px'>4:0:PM-4:55:PM</TD>
<TD class=tableheader nowrap style='padding-top:5px;padding-bottom:5px;padding-left:7px;padding-right:7px'>5:0:PM-5:55:PM</TD>
</TR>
<TR>
<TD class='tableheader' valign='top' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1 >Mon</TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>MA11003<BR>NR111</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>MA11003<BR>NR111</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>EE11003<BR>NR212</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>CS10003<BR>NR111</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>&nbsp;</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=3><b>ME29201<BR>IN DEPT.</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>&nbsp;</b></TD>
</TR>
<TR>
<TD class='tableheader' valign='top' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1 >Tue</TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1><b>CS10003<BR>NR111</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1><b>CS10003<BR>NR111</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1><b>&nbsp;</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1><b>&nbsp;</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1><b>MA11003<BR>NR111</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=3><b>PH19003<BR>JC Bose Lab.Complex</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1><b>&nbsp;</b></TD>
</TR>
<TR>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=3><b>ME29201<BR>IN DEPT.</b></TD>
</TR>
<TR>
<TD class='tableheader' valign='top' style='padding-top:5px;padding-bottom:5px' rowspan=3 colspan=1 >Wed</TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=3 colspan=1><b>EE11003<BR>NR212</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=3 colspan=1><b>EE11003<BR>NR212</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=3 colspan=3><b>ME29201<BR>IN DEPT.</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=3><b>ME29201<BR>IN DEPT.</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=3 colspan=1><b>&nbsp;</b></TD>
</TR>
<TR>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=3><b>CS19003<BR>CIC LAB.</b></TD>
</TR>
<TR>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=3><b>CS19003<BR>CIC. LAB.</b></TD>
</TR>
<TR>
<TD class='tableheader' valign='top' style='padding-top:5px;padding-bottom:5px' rowspan=3 colspan=1 >Thur</TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=3 colspan=1><b>&nbsp;</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=3 colspan=1><b>&nbsp;</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=3 colspan=3><b>ME29201<BR>IN DEPT.</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=3><b>ME29201<BR>IN DEPT.</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=3 colspan=1><b>EE11003<BR>NR212</b></TD>
</TR>
<TR>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>&nbsp;</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>PH11003<BR>NR211</b></TD>
</TR>
<TR>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>&nbsp;</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>&nbsp;</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>PH11003<BR>NR211</b></TD>
</TR>
<TR>
<TD class='tableheader' valign='top' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1 >Fri</TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1><b>&nbsp;</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1><b>&nbsp;</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=3><b>ME29201<BR>IN DEPT.</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=1><b>PH11003<BR>NR211</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1><b>PH11003<BR>NR211</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1><b>&nbsp;</b></TD>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=2 colspan=1><b>MA11003<BR>NR111</b></TD>
</TR>
<TR>
<TD  align='center' style='padding-top:5px;padding-bottom:5px' rowspan=1 colspan=3><b>ME29201<BR>IN DEPT.</b></TD>
</TR>

                                    </table></td></tr></table><input type=hidden name=semester id=semester value="AUTUMN">
                        <input type=hidden name=session id=session value="2024-2025">

                    </form></td></tr></table></body>
</html>

Probable cause

Multiple classes in one slot (actual timetable shared on teams).

Observed Behaviour

No classes are added but insti holidays are.

dipamsen commented 1 month ago

Looking into this, when I print(table), this is what I get (completely empty table)

Long html dump ```html
Day Name 8:0:AM-8:55:AM 9:0:AM-9:55:AM 10:0:AM-10:55:AM 11:0:AM-11:55:AM 12:0:PM-12:55:PM 2:0:PM-2:55:PM 3:0:PM-3:55:PM 4:0:PM-4:55:PM 5:0:PM-5:55:PM
Mon
Tue
Wed
Thur
Fri
```
dipamsen commented 1 month ago

Upon further investigation, I saw that on my ERP the timetable is being fetched from POST /student_timetable.jsp rather than POST /view_stud_time_table.jsp (which is what's in the code). I changed the URL in the code accordingly, and now it works as intended.

I am not sure however if this url works for all years students.

Bikram-ghuku commented 1 month ago

From what it looks like, erp fetches it timetable data from a different endpoint for first year students

Bikram-ghuku commented 1 month ago

I suspect it may be because of the new curriculum for admission batch 2024 onwards

nah thats how erp is

proffapt commented 1 month ago

The reason is: