ucsb-cs156-s24 / proj-courses-s24-4pm-2

https://ucsb-cs156-s24.github.io/proj-courses-s24-4pm-2/
0 stars 0 forks source link

kriteen - feature on the course history page (okay to type cs156 for course number) #30

Closed kriteenshrestha closed 1 month ago

kriteenshrestha commented 1 month ago

In this PR, I edited the CourseOverTimeSearch form so that, on the Course History Search Page, if a user is used to typing CS156 as a course number, it will still accept that input and interpret the input's course number as 156. In other words, on the course history page, if a user searches for "CS156", you get equivalent results if you typed '156'. I added a check so that we remove all non-digits from courseNumber, and suffix parsing stays the same. I have also added tests to CourseOverTimeSearchFormTest.js to make sure this works.

I have also added more checks so if letters that don't match the subject area (i.e. CMPSC) are before the digits, it will not go into the search, and also if there are no digits that will also not go into the search; so inputs like the following will not lead to any search results:

"LKFJLKSDJLSF156"

image

"CMPSC"

image

Because many users may be used to other names for "CMPSC" (like CS and COMS), I also allowed those subject areas to be inputted in the courseNumber field. That is, if the following were inputted in courseNumber, it would still be allowed (case insensitive):

"cmPSC156"

image

"CS156"

image

"COMS156"

image

"cs130a"

image

(etc, with also case insensitive cases)

Here, you can see in the image below that when I type "130A" or "CMPSC130A", I get the same search results.

image image

dokku deployment: https://proj-kriteenshrestha-dev.dokku-02.cs.ucsb.edu/courseovertime/search

Closes #12 .

pconrad commented 1 month ago

i feel like LMAO 16 should not pull up cs 16.

That's a legitimate concern. On the other hand, what would you do instead? Which of these would you accept/reject and on what basis:

I sort of feel like the current solution of ignoring all letters before the first digit is ... maybe the least bad approach.

pconrad commented 1 month ago

I added FIXME-Team Cr needed because the current team CR is not an approving one.

kriteenshrestha commented 1 month ago

i feel like LMAO 16 should not pull up cs 16.

That's a legitimate concern. On the other hand, what would you do instead? Which of these would you accept/reject and on what basis:

  • CMPSC 16
  • CMPSC16
  • CS16
  • COMS 16 Note that this, weirdly, is the abbreviation used by the UCSB Library and the Office of Research for Computer Science, even though no one else uses it.

I sort of feel like the current solution of ignoring all letters before the first digit is ... maybe the least bad approach.

I am currently working on this! I am making it so that it accepts the first 3, I will add the second one, and update this PR soon!