Dependencies:
- In one terminal, type
mongod
to start the database - In another terminal, go to your cloned directory of this repo and type
python server.py
to start the server - In browser, go to http://localhost:8080
- By default this code will run on mturk sandbox - mturk without payments
- To switch from sandbox to real, edit
mturk/mturk.properties
array of maps (dictionaries). each map has the following format:
{
"title": string,
"description": string,
"problem_id": string,
"time_created": string,
"stage": string,
"schema_count": int,
"inspiration_count": int,
"idea_count": int,
"suggestion_count": int
//// if stage=unpublished ////
"edit_page_link": string,
//// if stage=schema ////
"schemas_page_link": string,
"view_page_link": string
//// if stage=inspiration ////
"inspirations_page_link": string,
//// if stage=idea ////
"ideas_page_link": string,
//// if stage=suggestion ////
"suggestions_page_link": string
}
"problem_id": string,
"schema_assignments_num": int,
"title": string,
"description": string
}
schemas = array of the format:
{
"status" : int,
"text" : string,
"time_created" : string,
"schema_id" : string,
"worker_id" : string,
"problem_id" : string
}
also problem_id, problem_stage, schemas_page_link, inspirations_page_link,ideas_page_link
inspirations = array of the format:
{
"status" : int,
"source_link" : string,
"inspiration_id" : string,
"schema_id" : string,
"schema_text": string,
"time_created" : string,
"summary" : string,
"image_link" : string,
"reason" : string,
"worker_id" : string,
"problem_id" : string,
}
also problem_id, problem_stage, schemas_page_link, inspirations_page_link,ideas_page_link
ideas = array of the format:
{
"is_launched" : boolean,
"feedbacks_num" : int,
"text" : string,
"inspiration_id" : string,
"idea_id" : string,
"time_created" : string,
"slug" : string,
"schema_id" : string,
"worker_id" : string,
"problem_id" : string,
"suggestions_page_link": string
}
also problem_id, problem_stage, schemas_page_link, inspirations_page_link,ideas_page_link
feedbacks =
{
"feedback_id":string,
"feedback_text" : string,
"suggestions" : [{ //array of suggestions
"time_created" : string,
"suggestion_id" : string,
"worker_id" : string,
"text": string
}]
}
also idea_id, idea_text, problem_id
array of ideas:
{
"idea_id" : string
"text" : string
"feedbacks": [{ //array of feedbacks:
"feedback_id":string,
"feedback_text" : string,
"suggestions" : [{ //array of suggestions
"time_created" : string,
"suggestion_id" : string,
"worker_id" : string,
"text": string
}]
}]
}
also problem_id
input
{
"title": string,
"description": string,
"schema_assignments_num": int,
"lazy": boolean,
"problem_id": string or null
}
output
{
"success": boolean,
"url": string, //only if success=true
}
input
{
"title": string,
"description": string,
"schema_assignments_num": int,
"lazy": boolean
}
output
{
"success": boolean,
"url": string, //only if success=true
}
input
{
"problem_id": string
}
output
{
"success": boolean,
"new_id": string //only if success=true
}
input
{
"name": username or email string,
"password": string
}
output
{
"success": boolean,
"url": string
}
input
{
"username": string,
"email": string,
"password": string
}
output
{
"success": boolean,
"url": string, //only if success
"issue": string
}
output
"ideas" : array of maps:
{
"problem_id": string,
"schema_count": int,
"inspiration_count": int,
"idea_count": int,
"suggestion_count": int
}
input
{
"problem_id": string
}
input
{
"problem_id": string,
"schema_assignments_num": int,
"title": string,
"description": string
}
input
{
"problem_id": string,
"count_goal": int
}
output
{
"success": boolean,
"url": string, //only if success=true
}
input
{
"problem_id": string,
"count_goal": int
}
output
{
"success": boolean,
"url": string, //only if success=true
}
{
"to_reject": boolean,
"type": "schema" or "inspiration" or "idea"
"id": string
}
{
"idea_id": string,
"feedbacks": array of strings,
"count_goal": int
}
output
{
"success": boolean,
"suggestion_page_link": string
}
input
{
"problem_id": string
}
output
"ideas" = array of maps. each map has the following format:
{
"idea_id": string,
"suggestion_count": int
}
input
{
"problem_id": string
}
output
{
"count": int
}
input
{
"problem_id": string,
"count": int
}
output
{
"success": boolean
}
input
{
"feedback_id": string,
"count": int
}
output
{
"success": boolean
}
input
{
"idea_id": string
}
output
"feedbacks": array of maps:
{
"feedback_id": string,
"text": string,
}