Assignment 8 - Twosquare part 1

Due Monday, April 7, 11:59pm

Part 1 of this assignment requires you to complete requirements 1 and 2 highlighted in red below. By the deadline on Monday April 7 make sure to have a complete app page for this part of the assignment. You will be awarded up to 20 points for part 1, and up to 30 additional points for part 2 of this assignment.

For this assignment, you will create a yelp/foursquare-like app that allows a user to review a location and check in at places previously reviewed. The app will use the Web Component to send a place, review, and rating to a server. The app will use the LocationSensor Component to detect the user's location. The app will use the TinyDB Component to save previous places so that the user may check in at a previously visited place. This app will be similar to Energy Watch.

You will see all of your reviews here: http://twosquare.meteor.com/viewmarkers/<username> Replace <username> with the username you use for the app, and you may use multiple user names for testing.

You will see a map with clickable markers specifying the locations you have reviewed here: http://twosquare.meteor.com/map/<username> (replace <username> with the username you use for the app).

You will see a full list of all places and the number of check ins here: http://twosquare.meteor.com/checkins (note, no username is required because all places visited by all users will be reported)

Examples: http://twosquare.meteor.com/viewmarkers/sami | http://twosquare.meteor.com/map/sami

Requirements:

  1. (5 points) Profile Page - Your app will have a second screen that allows a user to enter his/her profile information. In this case, the only profile information will be the user name. When the screen closes, it will return a result to the main screen and the main screen will use the OtherScreenClosed block to save the result in a global variable. See the example here: http://cs107.cs.usfca.edu/tutorials/multiple-screens-returning-results
  2. (15 points) Reviews - Allow the user to enter a place (e.g., Starbucks), a review (e.g. great coffee), and a rating (number from 1-5). When a "Review" button is clicked, use the Web component to send the following parameters to the server in a request to the URL http://twosquare.meteor.com/review?. Note that in the BuildRequestData block you must use the following parameter names (in bold) exactly as they are written.
    1. user = text entered on the profile page
    2. lat = Latitude retrieved from the LocationSensor
    3. lng = Longitude retrieved from the LocationSensor
    4. review = text retrieved from a Text Box on the main screen
    5. rating = number retrieved from a Text Box on the main screen
    6. place = text retrieved from a Text Box on the main screen
    7. (10 points) Place List - Whenever the user enters a new review, save the place in a TinyDB database.
    8. (10 points) Check in - Allow the user to check in to a place previously visited. Use a ListPicker where the options are all of the elements stored in the TinyDB database. When the user selects an element (the AfterPicking block) use the Web Component to send the following parameters in a request to the URL http://twosquare.meteor.com/checkin?.
      1. user = text entered on the profile page
      2. place = selection from the ListPicker.
    9. (5 points) Error Checking - Make sure all information is entered before you send a request to the server. If the user has failed to enter review, rating, place, or username then display an error message.
    10. (5 points) Design - Use images to make your app look nicer than mine (shown below). Consider using a slider or buttons/images to allow the user to select a rating rather than entering a number in a text box.

An example interface: