src/org/ohmage/domain/campaign/Campaign.java
public boolean promptContainsSingleChoiceValues(
			final String promptId) 
			throws DomainException {
		
		if(promptId == null) {
			throw new DomainException("The prompt ID is null.");
		}
		
		Survey survey = getSurveyForPromptId(promptId);
		if(survey == null) {
			throw new DomainException("Unknown prompt ID: " + promptId);
		}
		
		SurveyItem abstractPrompt = survey.getSurveyItem(promptId);
		if(abstractPrompt == null) {
			// This is impossible given that we just got the survey ID from 
			// this prompt ID.
			throw new DomainException("The prompt ID has changed.");
		}
		
		if(abstractPrompt instanceof Prompt) {
			Prompt prompt = (Prompt) abstractPrompt;
			
			if(prompt instanceof SingleChoicePrompt) {
				SingleChoicePrompt singleChoicePrompt = (SingleChoicePrompt) prompt;
				
				return singleChoicePrompt.getChoices().values().size() != 0;
			}
		}
		
		return false;
	}
/**
	 * Returns whether or not the prompt contains single choice values.
	 * 
	 * @param promptId The prompt's configuration-unique identifier.
	 * 
	 * @return Whether or not the prompt contains single choice values.
	 * 
	 * @throws DomainException Thrown if the prompt ID is null or if the prompt
	 * 						   ID is not known.
	 */
Returns whether or not the prompt contains single choice values.

@param promptId The prompt's configuration-unique identifier.

@return Whether or not the prompt contains single choice values.

@throws DomainException Thrown if the prompt ID is null or if the prompt
ID is not known.
Returns whether or not the prompt contains single choice values . @param promptId The prompt ' s configuration - unique identifier . @return Whether or not the prompt contains single choice values . @throws DomainException Thrown if the prompt ID is null or if the prompt ID is not known .
public boolean promptContainsSingleChoiceValues(
			final String promptId) 
			throws DomainException {
		if(promptId == null) {
			throw new DomainException("The prompt ID is null.");
		}
		Survey survey = getSurveyForPromptId(promptId);
		if(survey == null) {
			throw new DomainException("Unknown prompt ID: " + promptId);
		}
		SurveyItem abstractPrompt = survey.getSurveyItem(promptId);
		if(abstractPrompt == null) {
			throw new DomainException("The prompt ID has changed.");
		}
		if(abstractPrompt instanceof Prompt) {
			Prompt prompt = (Prompt) abstractPrompt;
			if(prompt instanceof SingleChoicePrompt) {
				SingleChoicePrompt singleChoicePrompt = (SingleChoicePrompt) prompt;
				return singleChoicePrompt.getChoices().values().size() != 0;
			}
		}
		return false;
	}
public boolean promptContainsSingleChoiceValues ( final String promptId ) throws DomainException { if ( promptId == null ) { throw new DomainException ( "The prompt ID is null." ) ; } Survey survey = getSurveyForPromptId ( promptId ) ; if ( survey == null ) { throw new DomainException ( "Unknown prompt ID: " + promptId ) ; } SurveyItem abstractPrompt = survey . getSurveyItem ( promptId ) ; if ( abstractPrompt == null ) { throw new DomainException ( "The prompt ID has changed." ) ; } if ( abstractPrompt instanceof Prompt ) { Prompt prompt = ( Prompt ) abstractPrompt ; if ( prompt instanceof SingleChoicePrompt ) { SingleChoicePrompt singleChoicePrompt = ( SingleChoicePrompt ) prompt ; return singleChoicePrompt . getChoices ( ) . values ( ) . size ( ) != 0 ; } } return false ; }
Returns whether or not the prompt contains single choice values.
Returns whether or not the prompt contains single choice values .
// This is impossible given that we just got the survey ID from  // this prompt ID.