WebFund 2015W: Assignment 8: Difference between revisions

From Soma-notes
No edit summary
No edit summary
Line 1: Line 1:
'''This assignment is not yet finalized.'''
'''This assignment is not yet finalized.'''


 
This assignment has 10 points.  For five of the following eight error messages/conditions, please explain what small code change to [http://homeostasis.scs.carleton.ca/~soma/webfund-2015w/code/ajax-notes.zip ajax-notes] (from [[Assignment 7]]) would produce the error (1 point) and briefly explain why this code change produces this error (1 point).  You may answer one additional question for extra credit, allowing you to get a maximum score of 12 (out of 10) on this assignment.




Line 45: Line 45:


On the /notes page, when logged in as Alice, you only see "Alice account", "Welcome Alice", and the logout button (which works fine).  In the JavaScript console in the browser you see no new error messages.  In the network view you see four 200-code GET requests for <tt>notes</tt>, <tt>style.css</tt>, <tt>jquery-1.1.12.js</tt> and <tt>notes.js</tt>.
On the /notes page, when logged in as Alice, you only see "Alice account", "Welcome Alice", and the logout button (which works fine).  In the JavaScript console in the browser you see no new error messages.  In the network view you see four 200-code GET requests for <tt>notes</tt>, <tt>style.css</tt>, <tt>jquery-1.1.12.js</tt> and <tt>notes.js</tt>.
===Error 8===
The "Refresh Notes" button doesn't seem to do anything.  The rest of the application seems to work fine.

Revision as of 18:23, 15 March 2015

This assignment is not yet finalized.

This assignment has 10 points. For five of the following eight error messages/conditions, please explain what small code change to ajax-notes (from Assignment 7) would produce the error (1 point) and briefly explain why this code change produces this error (1 point). You may answer one additional question for extra credit, allowing you to get a maximum score of 12 (out of 10) on this assignment.


Error 1

The following message was printed at the terminal prompt after running bin/www:

/home/soma/Documents/Class/WebFund/2015W/ajax-notes-broken/node_modules/mongodb/lib/mongodb/mongo_client.js:409
          throw err
                ^
Error: failed to connect to [localhost:27017]
    at null.<anonymous> (/home/soma/Documents/Class/WebFund/2015W/ajax-notes-broken/node_modules/mongodb/lib/mongodb/connection/server.js:555:74)
    at emit (events.js:106:17)
    at null.<anonymous> (/home/soma/Documents/Class/WebFund/2015W/ajax-notes-broken/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:156:15)
    at emit (events.js:98:17)
    at Socket.<anonymous> (/home/soma/Documents/Class/WebFund/2015W/ajax-notes-broken/node_modules/mongodb/lib/mongodb/connection/connection.js:534:10)
    at Socket.emit (events.js:95:17)
    at net.js:440:14
    at process._tickCallback (node.js:419:13)

Error 2

You are logged in and you try to go to http://localhost:3000/ (the top-level page). Rather than redirecting to /notes the load just hangs.

Error 3

The notes listing screen only says "Loading Notes...". When you look at the network tab in the browser developer tools you notice a GET for /getNotes has returned a 500 status code.

Error 4

In the notes listing you see only one note listed with the title "Not Logged In" and contents of "Nobody seems to be logged in!". The top of the page says the current username and the logout button still works normally.

Error 5

Clicking the "New Note" button seems to do nothing. However, a POST request to /newNote has a response code of 200 and, when refreshed, there is a new, "Untitled" note added to the list.

Error 6

On the /notes page, when logged in as Alice, you only see "Alice account", "Welcome Alice", and the logout button (which works fine). In the JavaScript console in the browser you see a message "ReferenceError: $ is not defined".

Error 7

On the /notes page, when logged in as Alice, you only see "Alice account", "Welcome Alice", and the logout button (which works fine). In the JavaScript console in the browser you see no new error messages. In the network view you see four 200-code GET requests for notes, style.css, jquery-1.1.12.js and notes.js.

Error 8

The "Refresh Notes" button doesn't seem to do anything. The rest of the application seems to work fine.