Week 7 - Some housekeeping

I started the week where I left off last week- at the admin functions. Although I had provided a lot of things to be done, one last thing was clearing of inactive tokens.

As the admin can set the period of time for which tokens are valid, there is a possibility of the database tables getting filled with expired tokens. There is a cron job available in ATutor, which I will explore later. For now, I have given an option to the admin to clear the inactive tokens.

I mentioned two weeks ago about introducing a DEBUG mode which prints the SQL query being executed. This week, I added few more adjustments to it, including displaying the token related queries.

Last week, I implemented a logging level in which all requests except GET requests were logged. This week, I changed the implementation of logging errors in case of GET requests in case this logging level was active.

Using the already matured api_backbone, I started implementing a few more of the API calls. I had started with the GET calls for members (instructors and students both), so I went ahead and implemented the POST, PUT and DELETE ones. There were many calls that I had to implement (for both students and instructors), a list of which can be found in the commit history. That concluded all member related calls. From the original list, I am now left with calls for questions and tests only.

Lastly, to reuse the SQL queries, I have been using functions like get_courses_main() and get_members_main(). To see how the code looks like if we do not reuse the SQL queries and write new ones for evert call, my mentor suggested I do that in a separate branch. You can find the alternate branch here. I will wait for his feedback before I decide to go ahead with one of the branches.

P.S. This week, I crossed 50 commits on my branch(es). That's about 1.3 commit a day - not a bad pace.