Assignment 6

Modifying Django Walkthrough


Due Date: Wednesday, April 27th, 11:59:59 PM

Value: 150 points

Github Invite: Click Here

Collaboration: For Assignment 6, collaboration is not allowed; you must work individually. You may still come to office hours for help, but you may not work with any other CMSC 210 students. You may post questions on Discord, but you may not post code.

Objectives:

Instructions

Your starting point for this assignment is the django tutorial you went through for assignment 5. In this assignment, we are going to update our web app so that users can add and remove questions and choices themselves (rather than going through the admin interface).

When you check this assignment out on GitHub, you will find a fully-functioning web app that includes all the work done as part of the tutorial. This completed tutorial will form the starting point for this assignment. There will be four tasks to complete.

Change the web app such that:

  1. On the page where poll questions are listed (polls.views.IndexView) each question should have a "remove" button after it. Clicking that button will remove the question from the database and refresh the page (refreshing the page can be accomplished with a view that returns a RedirectResponse)
  2. Also on the page where poll questions are, there should be an empty text form field with a button at the end of the list of questions. Clicking the button will submit the form, adding a new poll question with the text from the text field to the database.
  3. On the page where poll responses are listed (polls.views.DetailView) there should be an empty text form field with a button to add a new choice to the poll. When clicked, this should refresh the page, showing the poll with the new chocie added.
  4. On the pgae where the results/votes are listed (polls.views.ResultsView) each response should have a "remove" button after it. Clicking that button will remove the response from the database and refresh the page (refreshing the page can be accomplished with a view that returns a RedirectResponse)

As always, feel free to ask questions in Discord if you get stuck or stumped. Here's a mock-up of how the pages cuold look after your changes:

Mockup with task #1 and #2 done:

Mockup with task #3 done:

Mockup with task #4 done:

Grading Rubric

Following the style guide 10 points
Task #1: Add a question 35 points
Task #2: Remove question 35 points
Task #3: Add choice 35 points
Task #4: Remove choice 35 points
Total: 150 points