Java Code Examples for ims.core.vo.AssessmentQuestionGroupVo.getActiveStatus()

The following are Jave code examples for showing how to use getActiveStatus() of the ims.core.vo.AssessmentQuestionGroupVo class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Fix for WDEV-1014
 * This method checks to see if the active assessment
 * being saved contains only active questions and groups.
 * @return false if one of the questions or groups in the assessment is not active
 * or true if the assessment is not active or all the questions and groups are active.
 * AU - Extra functionality (check the Assessment Question to be Active as well)
 */
private String IsValidActiveAssessment(UserAssessmentVo assessment)
{
	String error="This active assessment contains questions and/or groups that are not active";
	String inactiveQuestions="The group contains inactive questions";
	String activeQuestions="The group contains only active questions";
	String returningText=null;
	if(assessment == null)
		throw new CodingRuntimeException("Invalid assessment to validate");		
	if(assessment.getActiveStatus() == null || !assessment.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
		return activeQuestions;		
	if(assessment.getQuestionGroups() == null)
		return activeQuestions;
	
	for(int x = 0; x < assessment.getQuestionGroups().size(); x++)
	{
		AssessmentQuestionGroupVo questionGroup = assessment.getQuestionGroups().get(x);			
		if(questionGroup != null)
		{				
			if(questionGroup.getActiveStatus() != null && !questionGroup.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
				// we found a group that is not active
				return error;
			
			if(questionGroup.getQuestions() != null)
			{
				for(int y = 0; y < questionGroup.getQuestions().size(); y++)
				{
					AssessmentQuestionVo question = questionGroup.getQuestions().get(y);
					if(question != null && question.getQuestionIsNotNull() && question.getActiveStatusIsNotNull())
					{
						QuestionInformationVo realQuestion = question.getQuestion();
						if(realQuestion.getStatus() != null && !(realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE)||realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE)))
						{
							// we found a question that is not active.
							
							return error;
						}
						else if(realQuestion.getStatus()!=null && realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE))
							returningText=inactiveQuestions;
						
					}
				}
			}
		}
	}
	if (returningText==null)
		return activeQuestions;
	return returningText;
}
 
Example 2
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Fix for WDEV-1014
 * This method checks to see if the active assessment
 * being saved contains only active questions and groups.
 * @return false if one of the questions or groups in the assessment is not active
 * or true if the assessment is not active or all the questions and groups are active.
 * AU - Extra functionality (check the Assessment Question to be Active as well)
 */
private String IsValidActiveAssessment(UserAssessmentVo assessment)
{
	String error="This active assessment contains questions and/or groups that are not active";
	String inactiveQuestions="The group contains inactive questions";
	String activeQuestions="The group contains only active questions";
	String returningText=null;
	if(assessment == null)
		throw new CodingRuntimeException("Invalid assessment to validate");		
	if(assessment.getActiveStatus() == null || !assessment.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
		return activeQuestions;		
	if(assessment.getQuestionGroups() == null)
		return activeQuestions;
	
	for(int x = 0; x < assessment.getQuestionGroups().size(); x++)
	{
		AssessmentQuestionGroupVo questionGroup = assessment.getQuestionGroups().get(x);			
		if(questionGroup != null)
		{				
			if(questionGroup.getActiveStatus() != null && !questionGroup.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
				// we found a group that is not active
				return error;
			
			if(questionGroup.getQuestions() != null)
			{
				for(int y = 0; y < questionGroup.getQuestions().size(); y++)
				{
					AssessmentQuestionVo question = questionGroup.getQuestions().get(y);
					if(question != null && question.getQuestionIsNotNull() && question.getActiveStatusIsNotNull())
					{
						QuestionInformationVo realQuestion = question.getQuestion();
						if(realQuestion.getStatus() != null && !(realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE)||realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE)))
						{
							// we found a question that is not active.
							
							return error;
						}
						else if(realQuestion.getStatus()!=null && realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE))
							returningText=inactiveQuestions;
						
					}
				}
			}
		}
	}
	if (returningText==null)
		return activeQuestions;
	return returningText;
}
 
Example 3
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Fix for WDEV-1014
 * This method checks to see if the active assessment
 * being saved contains only active questions and groups.
 * @return false if one of the questions or groups in the assessment is not active
 * or true if the assessment is not active or all the questions and groups are active.
 * AU - Extra functionality (check the Assessment Question to be Active as well)
 */
private String IsValidActiveAssessment(UserAssessmentVo assessment)
{
	String error="This active assessment contains questions and/or groups that are not active";
	String inactiveQuestions="The group contains inactive questions";
	String activeQuestions="The group contains only active questions";
	String returningText=null;
	if(assessment == null)
		throw new CodingRuntimeException("Invalid assessment to validate");		
	if(assessment.getActiveStatus() == null || !assessment.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
		return activeQuestions;		
	if(assessment.getQuestionGroups() == null)
		return activeQuestions;
	
	for(int x = 0; x < assessment.getQuestionGroups().size(); x++)
	{
		AssessmentQuestionGroupVo questionGroup = assessment.getQuestionGroups().get(x);			
		if(questionGroup != null)
		{				
			if(questionGroup.getActiveStatus() != null && !questionGroup.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
				// we found a group that is not active
				return error;
			
			if(questionGroup.getQuestions() != null)
			{
				for(int y = 0; y < questionGroup.getQuestions().size(); y++)
				{
					AssessmentQuestionVo question = questionGroup.getQuestions().get(y);
					if(question != null && question.getQuestionIsNotNull() && question.getActiveStatusIsNotNull())
					{
						QuestionInformationVo realQuestion = question.getQuestion();
						if(realQuestion.getStatus() != null && !(realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE)||realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE)))
						{
							// we found a question that is not active.
							
							return error;
						}
						else if(realQuestion.getStatus()!=null && realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE))
							returningText=inactiveQuestions;
						
					}
				}
			}
		}
	}
	if (returningText==null)
		return activeQuestions;
	return returningText;
}
 
Example 4
Project: openmaxims-linux   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Fix for WDEV-1014
 * This method checks to see if the active assessment
 * being saved contains only active questions and groups.
 * @return false if one of the questions or groups in the assessment is not active
 * or true if the assessment is not active or all the questions and groups are active.
 * AU - Extra functionality (check the Assessment Question to be Active as well)
 */
private String IsValidActiveAssessment(UserAssessmentVo assessment)
{
	String error="This active assessment contains questions and/or groups that are not active";
	String inactiveQuestions="The group contains inactive questions";
	String activeQuestions="The group contains only active questions";
	String returningText=null;
	if(assessment == null)
		throw new CodingRuntimeException("Invalid assessment to validate");		
	if(assessment.getActiveStatus() == null || !assessment.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
		return activeQuestions;		
	if(assessment.getQuestionGroups() == null)
		return activeQuestions;
	
	for(int x = 0; x < assessment.getQuestionGroups().size(); x++)
	{
		AssessmentQuestionGroupVo questionGroup = assessment.getQuestionGroups().get(x);			
		if(questionGroup != null)
		{				
			if(questionGroup.getActiveStatus() != null && !questionGroup.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
				// we found a group that is not active
				return error;
			
			if(questionGroup.getQuestions() != null)
			{
				for(int y = 0; y < questionGroup.getQuestions().size(); y++)
				{
					AssessmentQuestionVo question = questionGroup.getQuestions().get(y);
					if(question != null && question.getQuestionIsNotNull() && question.getActiveStatusIsNotNull())
					{
						QuestionInformationVo realQuestion = question.getQuestion();
						if(realQuestion.getStatus() != null && !(realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE)||realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE)))
						{
							// we found a question that is not active.
							
							return error;
						}
						else if(realQuestion.getStatus()!=null && realQuestion.getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE))
							returningText=inactiveQuestions;
						
					}
				}
			}
		}
	}
	if (returningText==null)
		return activeQuestions;
	return returningText;
}