Java Code Examples for ims.core.vo.QuestionAnswerTypeVo.getSeparatorText()

The following are Jave code examples for showing how to use getSeparatorText() of the ims.core.vo.QuestionAnswerTypeVo 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: UserAssessmentInstHelper.java   View Source Code Vote up 6 votes
private static String getPreviousSeparatorIfExists(AssessmentQuestionVo assessmentQuestion, QuestionAnswerTypeVo ansType)
{
	if(assessmentQuestion == null || ansType == null)
		return null;
	
	if(assessmentQuestion.getQuestion() == null || assessmentQuestion.getQuestion().getAnswerTypes() == null)
		return null;
	
	for (int i = 0; i < assessmentQuestion.getQuestion().getAnswerTypes().size(); i++)
	{
		QuestionAnswerTypeVo voQuestionAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i);
		if(voQuestionAnswerType != null && voQuestionAnswerType.equals(ansType))
		{
			if(i > 0)
			{
				QuestionAnswerTypeVo voPrevAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i-1);
				if(voPrevAnswerType != null && voPrevAnswerType.getAnswerTypeIsNotNull() && voPrevAnswerType.getAnswerType().equals(QuestionAnswerType.SEPARATOR))
					return voPrevAnswerType.getSeparatorText();
			}
		}
	}
	return null;
}
 
Example 2
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View Source Code Vote up 6 votes
private static String getPreviousSeparatorIfExists(AssessmentQuestionVo assessmentQuestion, QuestionAnswerTypeVo ansType)
{
	if(assessmentQuestion == null || ansType == null)
		return null;
	
	if(assessmentQuestion.getQuestion() == null || assessmentQuestion.getQuestion().getAnswerTypes() == null)
		return null;
	
	for (int i = 0; i < assessmentQuestion.getQuestion().getAnswerTypes().size(); i++)
	{
		QuestionAnswerTypeVo voQuestionAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i);
		if(voQuestionAnswerType != null && voQuestionAnswerType.equals(ansType))
		{
			if(i > 0)
			{
				QuestionAnswerTypeVo voPrevAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i-1);
				if(voPrevAnswerType != null && voPrevAnswerType.getAnswerTypeIsNotNull() && voPrevAnswerType.getAnswerType().equals(QuestionAnswerType.SEPARATOR))
					return voPrevAnswerType.getSeparatorText();
			}
		}
	}
	return null;
}
 
Example 3
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View Source Code Vote up 6 votes
private static String getPreviousSeparatorIfExists(AssessmentQuestionVo assessmentQuestion, QuestionAnswerTypeVo ansType)
{
	if(assessmentQuestion == null || ansType == null)
		return null;
	
	if(assessmentQuestion.getQuestion() == null || assessmentQuestion.getQuestion().getAnswerTypes() == null)
		return null;
	
	for (int i = 0; i < assessmentQuestion.getQuestion().getAnswerTypes().size(); i++)
	{
		QuestionAnswerTypeVo voQuestionAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i);
		if(voQuestionAnswerType != null && voQuestionAnswerType.equals(ansType))
		{
			if(i > 0)
			{
				QuestionAnswerTypeVo voPrevAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i-1);
				if(voPrevAnswerType != null && voPrevAnswerType.getAnswerTypeIsNotNull() && voPrevAnswerType.getAnswerType().equals(QuestionAnswerType.SEPARATOR))
					return voPrevAnswerType.getSeparatorText();
			}
		}
	}
	return null;
}
 
Example 4
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View Source Code Vote up 6 votes
private static String getPreviousSeparatorIfExists(AssessmentQuestionVo assessmentQuestion, QuestionAnswerTypeVo ansType)
{
	if(assessmentQuestion == null || ansType == null)
		return null;
	
	if(assessmentQuestion.getQuestion() == null || assessmentQuestion.getQuestion().getAnswerTypes() == null)
		return null;
	
	for (int i = 0; i < assessmentQuestion.getQuestion().getAnswerTypes().size(); i++)
	{
		QuestionAnswerTypeVo voQuestionAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i);
		if(voQuestionAnswerType != null && voQuestionAnswerType.equals(ansType))
		{
			if(i > 0)
			{
				QuestionAnswerTypeVo voPrevAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i-1);
				if(voPrevAnswerType != null && voPrevAnswerType.getAnswerTypeIsNotNull() && voPrevAnswerType.getAnswerType().equals(QuestionAnswerType.SEPARATOR))
					return voPrevAnswerType.getSeparatorText();
			}
		}
	}
	return null;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private String getQuestionTooltip(AssessmentQuestionVo assessmentQuestionVo)
{
	if(assessmentQuestionVo == null)
		return "";
	
	StringBuffer sb = new StringBuffer();
	
	if(assessmentQuestionVo.getQuestionIsNotNull())
	{
		sb.append("<b>Short text: &nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
		sb.append(CR);
		sb.append("<b>Text: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		sb.append(CR);
	}
	
	if(assessmentQuestionVo.getQuestionIsNotNull() && assessmentQuestionVo.getQuestion().getAnswerTypesIsNotNull())
	{
		sb.append("<b>Status: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestion().getStatusIsNotNull() ? assessmentQuestionVo.getQuestion().getStatus().toString() : "");
		sb.append(CR);
		
		sb.append("<b>Answer Types: &nbsp;&nbsp;</b>");
		for (int i = 0; i < assessmentQuestionVo.getQuestion().getAnswerTypes().size(); i++)
		{
			QuestionAnswerTypeVo answerType = assessmentQuestionVo.getQuestion().getAnswerTypes().get(i);
			if(answerType.getActiveStatusIsNotNull() && answerType.getActiveStatus().booleanValue())
			{
				sb.append(CR);
				sb.append("&nbsp;&nbsp;&nbsp;");
				sb.append(i+1);
				sb.append(")");
				sb.append("&nbsp;&nbsp;");
				sb.append(answerType.getAnswerType().getText());
				String separator = answerType.getAnswerTypeIsNotNull() && answerType.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR)?" - " + answerType.getSeparatorText():"";
				sb.append(separator);
				if(answerType.getOptionsIsNotNull())
				{
					for (int j = 0; j < answerType.getOptions().size(); j++)
					{
						AnswerOptionVo option = answerType.getOptions().get(j);
						sb.append(CR);
						sb.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;->&nbsp;");
						sb.append(option.getOptionText());
						
						if(option.getScoreIsNotNull())
						{
							sb.append("&nbsp;&nbsp; (Score: ");
							sb.append(option.getScore().toString());
							sb.append(")");
						}
					}
				}
				sb.append("</li>");
			}
		}
	}
	return sb.toString();
}
 
Example 6
Project: AvoinApotti   File: StructuredAssessmentsHelper.java   View Source Code Vote up 4 votes
private String getQuestionTooltip(AssessmentQuestionVo assessmentQuestionVo)
{
	if(assessmentQuestionVo == null)
		return "";
	
	StringBuffer sb = new StringBuffer();
	
	if(assessmentQuestionVo.getQuestionIsNotNull())
	{
		sb.append("<b>Short text: &nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
		sb.append(CR);
		sb.append("<b>Text: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		sb.append(CR);
	}
	
	if(assessmentQuestionVo.getQuestionIsNotNull() && assessmentQuestionVo.getQuestion().getAnswerTypesIsNotNull())
	{
		sb.append("<b>Status: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestion().getStatusIsNotNull() ? assessmentQuestionVo.getQuestion().getStatus().toString() : "");
		sb.append(CR);
		
		sb.append("<b>Answer Types: &nbsp;&nbsp;</b>");
		for (int i = 0; i < assessmentQuestionVo.getQuestion().getAnswerTypes().size(); i++)
		{
			QuestionAnswerTypeVo answerType = assessmentQuestionVo.getQuestion().getAnswerTypes().get(i);
			if(answerType.getActiveStatusIsNotNull() && answerType.getActiveStatus().booleanValue())
			{
				sb.append(CR);
				sb.append("&nbsp;&nbsp;&nbsp;");
				sb.append(i+1);
				sb.append(")");
				sb.append("&nbsp;&nbsp;");
				sb.append(answerType.getAnswerType().getText());
				String separator = answerType.getAnswerTypeIsNotNull() && answerType.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR)?" - " + answerType.getSeparatorText():"";
				sb.append(separator);
				if(answerType.getOptionsIsNotNull())
				{
					for (int j = 0; j < answerType.getOptions().size(); j++)
					{
						AnswerOptionVo option = answerType.getOptions().get(j);
						sb.append(CR);
						sb.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;->&nbsp;");
						sb.append(option.getOptionText());
						
						if(option.getScoreIsNotNull())
						{
							sb.append("&nbsp;&nbsp; (Score: ");
							sb.append(option.getScore().toString());
							sb.append(")");
						}
					}
				}
				sb.append("</li>");
			}
		}
	}
	return sb.toString();
}
 
Example 7
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private String getQuestionTooltip(AssessmentQuestionVo assessmentQuestionVo)
{
	if(assessmentQuestionVo == null)
		return "";
	
	StringBuffer sb = new StringBuffer();
	
	if(assessmentQuestionVo.getQuestionIsNotNull())
	{
		sb.append("<b>Short text: &nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
		sb.append(CR);
		sb.append("<b>Text: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		sb.append(CR);
	}
	
	if(assessmentQuestionVo.getQuestionIsNotNull() && assessmentQuestionVo.getQuestion().getAnswerTypesIsNotNull())
	{
		sb.append("<b>Status: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestion().getStatusIsNotNull() ? assessmentQuestionVo.getQuestion().getStatus().toString() : "");
		sb.append(CR);
		
		sb.append("<b>Answer Types: &nbsp;&nbsp;</b>");
		for (int i = 0; i < assessmentQuestionVo.getQuestion().getAnswerTypes().size(); i++)
		{
			QuestionAnswerTypeVo answerType = assessmentQuestionVo.getQuestion().getAnswerTypes().get(i);
			if(answerType.getActiveStatusIsNotNull() && answerType.getActiveStatus().booleanValue())
			{
				sb.append(CR);
				sb.append("&nbsp;&nbsp;&nbsp;");
				sb.append(i+1);
				sb.append(")");
				sb.append("&nbsp;&nbsp;");
				sb.append(answerType.getAnswerType().getText());
				String separator = answerType.getAnswerTypeIsNotNull() && answerType.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR)?" - " + answerType.getSeparatorText():"";
				sb.append(separator);
				if(answerType.getOptionsIsNotNull())
				{
					for (int j = 0; j < answerType.getOptions().size(); j++)
					{
						AnswerOptionVo option = answerType.getOptions().get(j);
						sb.append(CR);
						sb.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;->&nbsp;");
						sb.append(option.getOptionText());
						
						if(option.getScoreIsNotNull())
						{
							sb.append("&nbsp;&nbsp; (Score: ");
							sb.append(option.getScore().toString());
							sb.append(")");
						}
					}
				}
				sb.append("</li>");
			}
		}
	}
	return sb.toString();
}
 
Example 8
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   View Source Code Vote up 4 votes
private String getQuestionTooltip(AssessmentQuestionVo assessmentQuestionVo)
{
	if(assessmentQuestionVo == null)
		return "";
	
	StringBuffer sb = new StringBuffer();
	
	if(assessmentQuestionVo.getQuestionIsNotNull())
	{
		sb.append("<b>Short text: &nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
		sb.append(CR);
		sb.append("<b>Text: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		sb.append(CR);
	}
	
	if(assessmentQuestionVo.getQuestionIsNotNull() && assessmentQuestionVo.getQuestion().getAnswerTypesIsNotNull())
	{
		sb.append("<b>Status: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestion().getStatusIsNotNull() ? assessmentQuestionVo.getQuestion().getStatus().toString() : "");
		sb.append(CR);
		
		sb.append("<b>Answer Types: &nbsp;&nbsp;</b>");
		for (int i = 0; i < assessmentQuestionVo.getQuestion().getAnswerTypes().size(); i++)
		{
			QuestionAnswerTypeVo answerType = assessmentQuestionVo.getQuestion().getAnswerTypes().get(i);
			if(answerType.getActiveStatusIsNotNull() && answerType.getActiveStatus().booleanValue())
			{
				sb.append(CR);
				sb.append("&nbsp;&nbsp;&nbsp;");
				sb.append(i+1);
				sb.append(")");
				sb.append("&nbsp;&nbsp;");
				sb.append(answerType.getAnswerType().getText());
				String separator = answerType.getAnswerTypeIsNotNull() && answerType.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR)?" - " + answerType.getSeparatorText():"";
				sb.append(separator);
				if(answerType.getOptionsIsNotNull())
				{
					for (int j = 0; j < answerType.getOptions().size(); j++)
					{
						AnswerOptionVo option = answerType.getOptions().get(j);
						sb.append(CR);
						sb.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;->&nbsp;");
						sb.append(option.getOptionText());
						
						if(option.getScoreIsNotNull())
						{
							sb.append("&nbsp;&nbsp; (Score: ");
							sb.append(option.getScore().toString());
							sb.append(")");
						}
					}
				}
				sb.append("</li>");
			}
		}
	}
	return sb.toString();
}
 
Example 9
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private String getQuestionTooltip(AssessmentQuestionVo assessmentQuestionVo)
{
	if(assessmentQuestionVo == null)
		return "";
	
	StringBuffer sb = new StringBuffer();
	
	if(assessmentQuestionVo.getQuestionIsNotNull())
	{
		sb.append("<b>Short text: &nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
		sb.append(CR);
		sb.append("<b>Text: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		sb.append(CR);
	}
	
	if(assessmentQuestionVo.getQuestionIsNotNull() && assessmentQuestionVo.getQuestion().getAnswerTypesIsNotNull())
	{
		sb.append("<b>Status: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestion().getStatusIsNotNull() ? assessmentQuestionVo.getQuestion().getStatus().toString() : "");
		sb.append(CR);
		
		sb.append("<b>Answer Types: &nbsp;&nbsp;</b>");
		for (int i = 0; i < assessmentQuestionVo.getQuestion().getAnswerTypes().size(); i++)
		{
			QuestionAnswerTypeVo answerType = assessmentQuestionVo.getQuestion().getAnswerTypes().get(i);
			if(answerType.getActiveStatusIsNotNull() && answerType.getActiveStatus().booleanValue())
			{
				sb.append(CR);
				sb.append("&nbsp;&nbsp;&nbsp;");
				sb.append(i+1);
				sb.append(")");
				sb.append("&nbsp;&nbsp;");
				sb.append(answerType.getAnswerType().getText());
				String separator = answerType.getAnswerTypeIsNotNull() && answerType.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR)?" - " + answerType.getSeparatorText():"";
				sb.append(separator);
				if(answerType.getOptionsIsNotNull())
				{
					for (int j = 0; j < answerType.getOptions().size(); j++)
					{
						AnswerOptionVo option = answerType.getOptions().get(j);
						sb.append(CR);
						sb.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;->&nbsp;");
						sb.append(option.getOptionText());
						
						if(option.getScoreIsNotNull())
						{
							sb.append("&nbsp;&nbsp; (Score: ");
							sb.append(option.getScore().toString());
							sb.append(")");
						}
					}
				}
				sb.append("</li>");
			}
		}
	}
	return sb.toString();
}
 
Example 10
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   View Source Code Vote up 4 votes
private String getQuestionTooltip(AssessmentQuestionVo assessmentQuestionVo)
{
	if(assessmentQuestionVo == null)
		return "";
	
	StringBuffer sb = new StringBuffer();
	
	if(assessmentQuestionVo.getQuestionIsNotNull())
	{
		sb.append("<b>Short text: &nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
		sb.append(CR);
		sb.append("<b>Text: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		sb.append(CR);
	}
	
	if(assessmentQuestionVo.getQuestionIsNotNull() && assessmentQuestionVo.getQuestion().getAnswerTypesIsNotNull())
	{
		sb.append("<b>Status: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestion().getStatusIsNotNull() ? assessmentQuestionVo.getQuestion().getStatus().toString() : "");
		sb.append(CR);
		
		sb.append("<b>Answer Types: &nbsp;&nbsp;</b>");
		for (int i = 0; i < assessmentQuestionVo.getQuestion().getAnswerTypes().size(); i++)
		{
			QuestionAnswerTypeVo answerType = assessmentQuestionVo.getQuestion().getAnswerTypes().get(i);
			if(answerType.getActiveStatusIsNotNull() && answerType.getActiveStatus().booleanValue())
			{
				sb.append(CR);
				sb.append("&nbsp;&nbsp;&nbsp;");
				sb.append(i+1);
				sb.append(")");
				sb.append("&nbsp;&nbsp;");
				sb.append(answerType.getAnswerType().getText());
				String separator = answerType.getAnswerTypeIsNotNull() && answerType.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR)?" - " + answerType.getSeparatorText():"";
				sb.append(separator);
				if(answerType.getOptionsIsNotNull())
				{
					for (int j = 0; j < answerType.getOptions().size(); j++)
					{
						AnswerOptionVo option = answerType.getOptions().get(j);
						sb.append(CR);
						sb.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;->&nbsp;");
						sb.append(option.getOptionText());
						
						if(option.getScoreIsNotNull())
						{
							sb.append("&nbsp;&nbsp; (Score: ");
							sb.append(option.getScore().toString());
							sb.append(")");
						}
					}
				}
				sb.append("</li>");
			}
		}
	}
	return sb.toString();
}
 
Example 11
Project: openmaxims-linux   File: Logic.java   View Source Code Vote up 4 votes
private String getQuestionTooltip(AssessmentQuestionVo assessmentQuestionVo)
{
	if(assessmentQuestionVo == null)
		return "";
	
	StringBuffer sb = new StringBuffer();
	
	if(assessmentQuestionVo.getQuestionIsNotNull())
	{
		sb.append("<b>Short text: &nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
		sb.append(CR);
		sb.append("<b>Text: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		sb.append(CR);
	}
	
	if(assessmentQuestionVo.getQuestionIsNotNull() && assessmentQuestionVo.getQuestion().getAnswerTypesIsNotNull())
	{
		sb.append("<b>Status: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestion().getStatusIsNotNull() ? assessmentQuestionVo.getQuestion().getStatus().toString() : "");
		sb.append(CR);
		
		sb.append("<b>Answer Types: &nbsp;&nbsp;</b>");
		for (int i = 0; i < assessmentQuestionVo.getQuestion().getAnswerTypes().size(); i++)
		{
			QuestionAnswerTypeVo answerType = assessmentQuestionVo.getQuestion().getAnswerTypes().get(i);
			if(answerType.getActiveStatusIsNotNull() && answerType.getActiveStatus().booleanValue())
			{
				sb.append(CR);
				sb.append("&nbsp;&nbsp;&nbsp;");
				sb.append(i+1);
				sb.append(")");
				sb.append("&nbsp;&nbsp;");
				sb.append(answerType.getAnswerType().getText());
				String separator = answerType.getAnswerTypeIsNotNull() && answerType.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR)?" - " + answerType.getSeparatorText():"";
				sb.append(separator);
				if(answerType.getOptionsIsNotNull())
				{
					for (int j = 0; j < answerType.getOptions().size(); j++)
					{
						AnswerOptionVo option = answerType.getOptions().get(j);
						sb.append(CR);
						sb.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;->&nbsp;");
						sb.append(option.getOptionText());
						
						if(option.getScoreIsNotNull())
						{
							sb.append("&nbsp;&nbsp; (Score: ");
							sb.append(option.getScore().toString());
							sb.append(")");
						}
					}
				}
				sb.append("</li>");
			}
		}
	}
	return sb.toString();
}
 
Example 12
Project: openmaxims-linux   File: StructuredAssessmentsHelper.java   View Source Code Vote up 4 votes
private String getQuestionTooltip(AssessmentQuestionVo assessmentQuestionVo)
{
	if(assessmentQuestionVo == null)
		return "";
	
	StringBuffer sb = new StringBuffer();
	
	if(assessmentQuestionVo.getQuestionIsNotNull())
	{
		sb.append("<b>Short text: &nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
		sb.append(CR);
		sb.append("<b>Text: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		sb.append(CR);
	}
	
	if(assessmentQuestionVo.getQuestionIsNotNull() && assessmentQuestionVo.getQuestion().getAnswerTypesIsNotNull())
	{
		sb.append("<b>Status: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>");
		sb.append(assessmentQuestionVo.getQuestion().getStatusIsNotNull() ? assessmentQuestionVo.getQuestion().getStatus().toString() : "");
		sb.append(CR);
		
		sb.append("<b>Answer Types: &nbsp;&nbsp;</b>");
		for (int i = 0; i < assessmentQuestionVo.getQuestion().getAnswerTypes().size(); i++)
		{
			QuestionAnswerTypeVo answerType = assessmentQuestionVo.getQuestion().getAnswerTypes().get(i);
			if(answerType.getActiveStatusIsNotNull() && answerType.getActiveStatus().booleanValue())
			{
				sb.append(CR);
				sb.append("&nbsp;&nbsp;&nbsp;");
				sb.append(i+1);
				sb.append(")");
				sb.append("&nbsp;&nbsp;");
				sb.append(answerType.getAnswerType().getText());
				String separator = answerType.getAnswerTypeIsNotNull() && answerType.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR)?" - " + answerType.getSeparatorText():"";
				sb.append(separator);
				if(answerType.getOptionsIsNotNull())
				{
					for (int j = 0; j < answerType.getOptions().size(); j++)
					{
						AnswerOptionVo option = answerType.getOptions().get(j);
						sb.append(CR);
						sb.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;->&nbsp;");
						sb.append(option.getOptionText());
						
						if(option.getScoreIsNotNull())
						{
							sb.append("&nbsp;&nbsp; (Score: ");
							sb.append(option.getScore().toString());
							sb.append(")");
						}
					}
				}
				sb.append("</li>");
			}
		}
	}
	return sb.toString();
}