src/org/ohmage/domain/campaign/prompt/CustomChoicePrompt.java
@Override
	public JSONObject toJson() throws JSONException {
		JSONObject result = super.toJson();
		
		JSONObject choiceGlossary = 
				result.getJSONObject(JSON_KEY_CHOICE_GLOSSARY);
		for(Integer key : customChoices.keySet()) {
			choiceGlossary.put(key.toString(), customChoices.get(key).toJson());
		}
		result.put(JSON_KEY_CHOICE_GLOSSARY, choiceGlossary);
		
		JSONArray labels = new JSONArray();
		for(LabelValuePair lvp : getChoices().values()) {
			labels.put(lvp.getLabel());
		}
		result.put(JSON_KEY_FIXED_CHOICES, labels);
		
		return result;
	}
/**
	 * Creates a JSONObject that represents this custom choice prompt.
	 * 
	 * @return A JSONObject that represents this custom choice prompt.
	 * 
	 * @throws JSONException There was a problem creating the JSONObject.
	 */
Creates a JSONObject that represents this custom choice prompt.

@return A JSONObject that represents this custom choice prompt.

@throws JSONException There was a problem creating the JSONObject.
Creates a JSONObject that represents this custom choice prompt . @return A JSONObject that represents this custom choice prompt . @throws JSONException There was a problem creating the JSONObject .
@Override
	public JSONObject toJson() throws JSONException {
		JSONObject result = super.toJson();
		JSONObject choiceGlossary = 
				result.getJSONObject(JSON_KEY_CHOICE_GLOSSARY);
		for(Integer key : customChoices.keySet()) {
			choiceGlossary.put(key.toString(), customChoices.get(key).toJson());
		}
		result.put(JSON_KEY_CHOICE_GLOSSARY, choiceGlossary);
		JSONArray labels = new JSONArray();
		for(LabelValuePair lvp : getChoices().values()) {
			labels.put(lvp.getLabel());
		}
		result.put(JSON_KEY_FIXED_CHOICES, labels);
		return result;
	}
@ Override public JSONObject toJson ( ) throws JSONException { JSONObject result = super . toJson ( ) ; JSONObject choiceGlossary = result . getJSONObject ( JSON_KEY_CHOICE_GLOSSARY ) ; for ( Integer key : customChoices . keySet ( ) ) { choiceGlossary . put ( key . toString ( ) , customChoices . get ( key ) . toJson ( ) ) ; } result . put ( JSON_KEY_CHOICE_GLOSSARY , choiceGlossary ) ; JSONArray labels = new JSONArray ( ) ; for ( LabelValuePair lvp : getChoices ( ) . values ( ) ) { labels . put ( lvp . getLabel ( ) ) ; } result . put ( JSON_KEY_FIXED_CHOICES , labels ) ; return result ; }
Creates a JSONObject that represents this custom choice prompt.
Creates a JSONObject that represents this custom choice prompt .