Skip to content

Conversation

@TheoKnoll
Copy link
Collaborator

In this PR, the get-course-info endpoint was created for the backend.

This endpoint returns 2 things (all packaged into one return)
1: All the information associated with a course_id and the semester
2: All of the course reviews associated with the course_id (across many semesters)


        params: query = {
                             "course_id": "the course_id",
                             "semester = "semester_in_words"
                        }

       Semester is of format Spring/Summer/Fall Year

       Example from COS 126, Fall 2021:
            query = { "course_id": "002051", "semester": "Fall 2021" }

Use command flask run to start the server.
I would suggest using Postman to make these queries, as that can make the testing process go straightforward.
This is a sample string if you'd rather test in your browser:
http://localhost:5000/api/get-course-info?course_id=002051&semester=Fall 2021

Copy link
Collaborator

@bnehoran bnehoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I made some comments on specific parts of the code below.
In addition, would it be possible to also return the names of the professors who taught each previous iteration of the course, so that it can be displayed as it currently is in PrincetonCourses?
Screenshot_20220319-173704_Kiwi Browser

Comment on lines +65 to +66
"course_id": "the course_id",
"semester = "semester_in_words"
Copy link
Collaborator

@bnehoran bnehoran Mar 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting of one of these two lines is off. I know this is just documentation so it doesn't affect the functionality, but best to clean it before merging in.

Example from COS 126, Fall 2021:
query = { "course_id": "002051", "semester": "Fall 2021" }
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also specify what the format of the returned value is? I can find it by running it, but it's good to document the format.
Am I understanding correctly that the result is a list where the first element (position 0) is the information on the course, and the other elements of the list are evaluations? If so, is there possibly a neater way to format it? Perhaps as a dictionary with one key for info and the other key for evals? What do you think?

# Running the Program -- Backend.
To run the program, ensure that your .env files are set up. See back_end README.md for instructions.

Then, use ```flask run``` to run the program. It will run on localhost:5000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for documenting this! We should probably expand this readme even further at some point with more specific instructions, as well as an overview of the project (in a future pull request, of course, not here!).

@TheoKnoll TheoKnoll self-assigned this Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants