WebFund 2013F: Assignment 4: 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.'''


In this assignment you will be extending <tt>adventure-ajax-demo</tt> covered in [[WebFund 2013F: Tutorial 9|Tutorial 9]] with a simple editor interface and a persistent MongoDB datastore.  The assignment is worth 50 points with 20 bonus points and is due on December 9th.  Your modifications should be as follows:
In this assignment you will be extending <tt>adventure-ajax-demo</tt> covered in [[WebFund 2013F: Tutorial 9|Tutorial 9]] with a simple editor interface and a persistent MongoDB datastore.  The assignment is worth 50 points with 20 bonus points and is due on December 9th.  You should upload a complete node application (including modules) as a zip file.  Your modifications should be as follows:


# [5] Store the rooms data in a MongoDB collection entitled "2406rooms" and have the game use this collection rather than the in-memory rooms object.
# [5] Store the rooms data in a MongoDB collection entitled "2406rooms" and have the game use this collection rather than the in-memory rooms object.

Revision as of 20:45, 22 November 2013

This assignment is not yet finalized.

In this assignment you will be extending adventure-ajax-demo covered in Tutorial 9 with a simple editor interface and a persistent MongoDB datastore. The assignment is worth 50 points with 20 bonus points and is due on December 9th. You should upload a complete node application (including modules) as a zip file. Your modifications should be as follows:

  1. [5] Store the rooms data in a MongoDB collection entitled "2406rooms" and have the game use this collection rather than the in-memory rooms object.
  2. [4] Make the starting room configurable by adding a special room structure called "start" that has only one property, "roomName", that is the name of the room to start in. Make sure the rest of the game does not accidentally use the start room as a room.
  3. [5] Have the string "<?player>" be automatically replaced in a room's description by the player's name.
  4. [1] At the bottom of the player name screen add a heading "Administration" that has three bulleted links under it: Editor, Export Rooms, Import Rooms.
  5. [10] Have the Import Rooms link lead to "/import", a new screen that asks "Upload what rooms file?" and has a file input field. This field should be part of a form that allows the selected file to be uploaded to the server when the button "Upload" (a form submit button) is pressed. The server, upon receiving the file, should check to make sure the uploaded file is valid JSON with all the necessary fields (including the special "start" room). Then, if it is valid file, it should overwrite the current 2406rooms MongoDB table, replacing it with the contents of the uploaded file. The server should return a page stating whether the import was successful or not and should give a link to go back to /.
  6. [5] Have the Export Rooms link return a JSON object (in a text file) containing all of the rooms in the 2406rooms MongoDB collection. This file should be suitable for importing back into the game. Note the file may be displayed in the browser or you can force the browser to prompt to save it.
  7. [20] Have the Editor link lead to /editor the URL of your editor (just as /game is the URL for the game). In one or more screens implement a simple room editor of your own design. At a bare minimum your interface should allow for the following:
    • [4] Edit each room link name, title, and description.
    • [2] Add rooms
    • [4] Add and remove exits, giving feedback whether specified rooms exist. Either give clear warnings regarding invalid rooms or automatically create rooms as needed.
    • [4] Delete rooms, either giving clear warnings about exits that now refer to non-existent rooms or automatically deleting such exits.
    • [1] Have a quit button to return to /.
    • [5] Do all of the above with style.
  8. [BONUS 20] Add locks and keys to the game and editor, meaning that a player should be able to pick up a key in one room and use it to open a locked room (go through an exit that they couldn't before) in another room.