PA 16.1: Refactor crud.js
- Due Nov 4, 2020 by 11:59pm
- Points 1
- Submitting a website url
- Available after Oct 21, 2020 at 12am
Copy the ca13-solutions code from the course Dropbox folder Links to an external site. (or a newer version of that code) to a new folder in your Git repository: pas/pa16.1.
The file js/crud.js has a lot of redundant code. Refactor it so that there's only one function that makes a call to $.ajax(), and all the functions that currently make $.ajax() calls now call that function instead. You should aim to make other functions as short as possible (potentially 1 line of code!).
Here's the rubric:
[ ] a new function exists in js/crud.js and is the only one that makes a call to $.ajax()
[ ] all other functions in js/crud.js that used to make $.ajax() calls now call the new function
[ ] there is very little redundant code (if any) in js/crud.js
[ ] the code is well commented and styled
[ ] there is a header at the top of the file that includes the name of the author(s) and a brief description of the file
[ ] the PA folder includes a README.md file with the required information in it
Submitting PAs
Be sure to create a README.md with the following information:
- who you worked with (say "I worked alone" if you didn't have a partner)
- how long you spent on the assignment
- the PA option (and, if applicable, the earlier PA option it builds off of)
- a copy of the PA option's rubric, filled out (only submit if you can honestly check off each of the criteria)
- what the most challenging aspects were
- any lingering questions you have about the assignment
Commit and push your git repository to GitHub, then paste a link to your PA directory.