Java Code Examples for ims.core.vo.lookups.QuestionAnswerType

The following are top voted examples for showing how to use ims.core.vo.lookups.QuestionAnswerType. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
	if (formName.equals(form.getForms().Core.QuestionAnswerType) && result.equals(DialogResult.OK))
	{
		QuestionAnswerTypeVo voAnswType = form.getGlobalContext().Core.getQuestionAnswerType();
		if (voAnswType != null)
		{
			DynamicGridRow row = null;
			if(voAnswType.getID_QuestionAnswerTypeIsNotNull())
				row = getDynamicRowByValue(voAnswType);
			else if (form.getLocalContext().getIsNewAnwerTypeIsNotNull())
				if (form.getLocalContext().getIsNewAnwerType())
					row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().newRow();
				else 
					row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getSelectedRow();
					
			createDynamicGridRow(voAnswType, row);				
			setDefaultDynamicGridCheckBox(voAnswType, true);
			enableContextMenu();
		}
	}		
	else if( formName.equals(form.getForms().Core.YesNoDialog) && result.equals(DialogResult.YES))
	{
		save(false);
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cmbAnswerTypeValueChanged()
{
	setControlsStatus();
	enableLkpControls();
	enableSeparatorText();
	enableChkMultiselect();
	enableMultiselect();
	enableChkCustomWidth();
	enableCustomWidth();
	hideColourColumn();
	
	form.chkIsMandatory().setEnabled(!(form.cmbAnswerType().getValue() instanceof QuestionAnswerType && form.cmbAnswerType().getValue().equals(QuestionAnswerType.SEPARATOR)));
	//WDEV-13768
	form.txtValidationMsg().setEnabled(!QuestionAnswerType.SEPARATOR.equals(form.cmbAnswerType().getValue()) && form.chkIsMandatory().getValue());
	
	if(form.cmbAnswerType().getValue() instanceof QuestionAnswerType && form.cmbAnswerType().getValue().equals(QuestionAnswerType.SEPARATOR))
	{
		form.chkIsMandatory().setValue(false);
		form.txtValidationMsg().setValue(null);
		
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void hideColourColumn()
{
	QuestionType qType = form.getGlobalContext().Core.getQuestionType();
	if (qType != null)
	{
		QuestionAnswerType type = form.cmbAnswerType().getValue();

		if (type != null && isSingleOrMultiSelect(type))
		{
			form.grdAnswerOption().setcolColourCaption("Colour");
			setReadonlyColColour(false);
		}
		else
		{
			form.grdAnswerOption().setcolColourCaption(" ");
			setReadonlyColColour(true);
		}
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(AnswerDetailsVo answerDetail)
{
	if (answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;

	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();

	return false;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		return;
	}
	
	//WDEV-17363
	if (Boolean.TRUE.equals(form.dyngrdAnswers().isReadOnly()))
		return;
	
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicCellType getCellAnswerType(ims.core.vo.lookups.QuestionAnswerType answerType)
{
	if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DynamicCellType.DATE;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DynamicCellType.DECIMAL;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DynamicCellType.INT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
		return DynamicCellType.MULTISELECT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DynamicCellType.PARTIALDATE;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
		return DynamicCellType.ENUMERATION;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DynamicCellType.DYNAMICLABEL;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		return DynamicCellType.WRAPTEXT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DynamicCellType.TIME;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DynamicCellType.ANSWER;

	return DynamicCellType.EMPTY;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, Question_AnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		return;
	}
	
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(Answer_DetailsVo answerDetail)
{
	if (answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;

	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();

	return false;
}
 
Example 9
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(AnswerDetailsVo answerDetail)
{
	if(answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;
	
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0; 
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();
	
	return false;
}
 
Example 10
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
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 11
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private DynamicCellType getCellAnswerType(ims.core.vo.lookups.QuestionAnswerType answerType)
{
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DynamicCellType.DATE;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DynamicCellType.DECIMAL;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DynamicCellType.INT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
		return DynamicCellType.MULTISELECT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DynamicCellType.PARTIALDATE;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
		return DynamicCellType.ENUMERATION;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DynamicCellType.DYNAMICLABEL;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		return DynamicCellType.WRAPTEXT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DynamicCellType.TIME;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DynamicCellType.ANSWER;
	
	return DynamicCellType.EMPTY;		
}
 
Example 12
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(Answer_DetailsVo answerDetail)
{
	if(answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;
	
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0; 
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();
	
	return false;
}
 
Example 13
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private DynamicCellType getCellAnswerType(ims.core.vo.lookups.QuestionAnswerType answerType)
{
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DynamicCellType.DATE;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DynamicCellType.DECIMAL;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DynamicCellType.INT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
		return DynamicCellType.MULTISELECT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DynamicCellType.PARTIALDATE;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
		return DynamicCellType.ENUMERATION;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DynamicCellType.DYNAMICLABEL;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		return DynamicCellType.WRAPTEXT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DynamicCellType.TIME;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DynamicCellType.ANSWER;
	
	return DynamicCellType.EMPTY;		
}
 
Example 14
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private void setAnswerCellValue(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer) 
{
	if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes);
		cell.getItems().newItem(this.optionNo);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))				
	{
		setAnswerCellOptions(configAnswer, cell);
		if(configAnswer.getMaxMultiselectAllowedIsNotNull())
		{
			cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
		}								
	}
}
 
Example 15
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(AnswerDetailsVo answerDetail)
{
	if(answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;
	
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0; 
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();
	
	return false;
}
 
Example 16
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		return;
	}
	
	//WDEV-17363
	if (Boolean.TRUE.equals(form.dyngrdAnswers().isReadOnly()))
		return;
	
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void hideColourColumn()
{
	QuestionType qType = form.getGlobalContext().Core.getQuestionType();
	if (qType != null)
	{
		QuestionAnswerType type = form.cmbAnswerType().getValue();

		if (type != null && isSingleOrMultiSelect(type))
		{
			form.grdAnswerOption().setcolColourCaption("Colour");
			setReadonlyColColour(false);
		}
		else
		{
			form.grdAnswerOption().setcolColourCaption(" ");
			setReadonlyColColour(true);
		}
	}
}
 
Example 18
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(Answer_DetailsVo answerDetail)
{
	if (answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;

	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();

	return false;
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		return;
	}
	
	//WDEV-17363
	if (Boolean.TRUE.equals(form.dyngrdAnswers().isReadOnly()))
		return;
	
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, Question_AnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		return;
	}
	
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(Answer_DetailsVo answerDetail)
{
	if (answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;

	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();

	return false;
}
 
Example 22
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(AnswerDetailsVo answerDetail)
{
	if(answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;
	
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0; 
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();
	
	return false;
}
 
Example 23
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private DynamicCellType getCellAnswerType(ims.core.vo.lookups.QuestionAnswerType answerType)
{
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DynamicCellType.DATE;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DynamicCellType.DECIMAL;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DynamicCellType.INT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
		return DynamicCellType.MULTISELECT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DynamicCellType.PARTIALDATE;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
		return DynamicCellType.ENUMERATION;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DynamicCellType.DYNAMICLABEL;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		return DynamicCellType.WRAPTEXT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DynamicCellType.TIME;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DynamicCellType.ANSWER;
	
	return DynamicCellType.EMPTY;		
}
 
Example 24
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(Answer_DetailsVo answerDetail)
{
	if(answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;
	
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0; 
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();
	
	return false;
}
 
Example 25
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(AnswerDetailsVo answerDetail)
{
	if(answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;
	
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0; 
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();
	
	return false;
}
 
Example 26
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private DynamicCellType getCellAnswerType(ims.core.vo.lookups.QuestionAnswerType answerType)
{
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DynamicCellType.DATE;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DynamicCellType.DECIMAL;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DynamicCellType.INT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
		return DynamicCellType.MULTISELECT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DynamicCellType.PARTIALDATE;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
		return DynamicCellType.ENUMERATION;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DynamicCellType.DYNAMICLABEL;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		return DynamicCellType.WRAPTEXT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DynamicCellType.TIME;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DynamicCellType.ANSWER;
	
	return DynamicCellType.EMPTY;		
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicCellType getCellAnswerType(ims.core.vo.lookups.QuestionAnswerType answerType)
{
	if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DynamicCellType.DATE;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DynamicCellType.DECIMAL;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DynamicCellType.INT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
		return DynamicCellType.MULTISELECT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DynamicCellType.PARTIALDATE;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
		return DynamicCellType.ENUMERATION;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DynamicCellType.DYNAMICLABEL;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		return DynamicCellType.WRAPTEXT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DynamicCellType.TIME;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DynamicCellType.ANSWER;

	return DynamicCellType.EMPTY;
}
 
Example 28
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(AnswerDetailsVo answerDetail)
{
	if (answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;

	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();

	return false;
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cmbAnswerTypeValueChanged()
{
	setControlsStatus();
	enableLkpControls();
	enableSeparatorText();
	enableChkMultiselect();
	enableMultiselect();
	enableChkCustomWidth();
	enableCustomWidth();
	hideColourColumn();
	
	form.chkIsMandatory().setEnabled(!(form.cmbAnswerType().getValue() instanceof QuestionAnswerType && form.cmbAnswerType().getValue().equals(QuestionAnswerType.SEPARATOR)));
	//WDEV-13768
	form.txtValidationMsg().setEnabled(!QuestionAnswerType.SEPARATOR.equals(form.cmbAnswerType().getValue()) && form.chkIsMandatory().getValue());
	
	if(form.cmbAnswerType().getValue() instanceof QuestionAnswerType && form.cmbAnswerType().getValue().equals(QuestionAnswerType.SEPARATOR))
	{
		form.chkIsMandatory().setValue(false);
		form.txtValidationMsg().setValue(null);
		
	}
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
	if (formName.equals(form.getForms().Core.QuestionAnswerType) && result.equals(DialogResult.OK))
	{
		QuestionAnswerTypeVo voAnswType = form.getGlobalContext().Core.getQuestionAnswerType();
		if (voAnswType != null)
		{
			DynamicGridRow row = null;
			if(voAnswType.getID_QuestionAnswerTypeIsNotNull())
				row = getDynamicRowByValue(voAnswType);
			else if (form.getLocalContext().getIsNewAnwerTypeIsNotNull())
				if (form.getLocalContext().getIsNewAnwerType())
					row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().newRow();
				else 
					row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getSelectedRow();
					
			createDynamicGridRow(voAnswType, row);				
			setDefaultDynamicGridCheckBox(voAnswType, true);
			enableContextMenu();
		}
	}		
	else if( formName.equals(form.getForms().Core.YesNoDialog) && result.equals(DialogResult.YES))
	{
		save(false);
	}
}
 
Example 31
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicCellType getCellAnswerType(ims.core.vo.lookups.QuestionAnswerType answerType)
{
	if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DynamicCellType.DATE;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DynamicCellType.DECIMAL;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DynamicCellType.INT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
		return DynamicCellType.MULTISELECT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DynamicCellType.PARTIALDATE;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
		return DynamicCellType.ENUMERATION;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DynamicCellType.DYNAMICLABEL;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		return DynamicCellType.WRAPTEXT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DynamicCellType.TIME;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DynamicCellType.ANSWER;

	return DynamicCellType.EMPTY;
}
 
Example 32
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void hideColourColumn()
{
	QuestionType qType = form.getGlobalContext().Core.getQuestionType();
	if (qType != null)
	{
		QuestionAnswerType type = form.cmbAnswerType().getValue();

		if (type != null && isSingleOrMultiSelect(type))
		{
			form.grdAnswerOption().setcolColourCaption("Colour");
			setReadonlyColColour(false);
		}
		else
		{
			form.grdAnswerOption().setcolColourCaption(" ");
			setReadonlyColColour(true);
		}
	}
}
 
Example 33
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, Question_AnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		return;
	}
	
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");
}
 
Example 34
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(AnswerDetailsVo answerDetail)
{
	if (answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;

	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();

	return false;
}
 
Example 35
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(Answer_DetailsVo answerDetail)
{
	if(answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;
	
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0; 
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();
	
	return false;
}
 
Example 36
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
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 37
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		return;
	}
	
	//WDEV-17363
	if (Boolean.TRUE.equals(form.dyngrdAnswers().isReadOnly()))
		return;
	
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");
}
 
Example 38
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicCellType getCellAnswerType(ims.core.vo.lookups.QuestionAnswerType answerType)
{
	if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DynamicCellType.DATE;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DynamicCellType.DECIMAL;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DynamicCellType.INT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
		return DynamicCellType.MULTISELECT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DynamicCellType.PARTIALDATE;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
		return DynamicCellType.ENUMERATION;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DynamicCellType.DYNAMICLABEL;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		return DynamicCellType.WRAPTEXT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DynamicCellType.TIME;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DynamicCellType.ANSWER;

	return DynamicCellType.EMPTY;
}
 
Example 39
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
	if (formName.equals(form.getForms().Core.QuestionAnswerType) && result.equals(DialogResult.OK))
	{
		QuestionAnswerTypeVo voAnswType = form.getGlobalContext().Core.getQuestionAnswerType();
		if (voAnswType != null)
		{
			DynamicGridRow row = null;
			if(voAnswType.getID_QuestionAnswerTypeIsNotNull())
				row = getDynamicRowByValue(voAnswType);
			else if (form.getLocalContext().getIsNewAnwerTypeIsNotNull())
				if (form.getLocalContext().getIsNewAnwerType())
					row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().newRow();
				else 
					row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getSelectedRow();
					
			createDynamicGridRow(voAnswType, row);				
			setDefaultDynamicGridCheckBox(voAnswType, true);
			enableContextMenu();
		}
	}		
	else if( formName.equals(form.getForms().Core.YesNoDialog) && result.equals(DialogResult.YES))
	{
		save(false);
	}
}
 
Example 40
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private DynamicCellType getCellAnswerType(ims.core.vo.lookups.QuestionAnswerType answerType)
{
	if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DynamicCellType.DATE;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DynamicCellType.DECIMAL;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DynamicCellType.INT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
		return DynamicCellType.MULTISELECT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DynamicCellType.PARTIALDATE;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
		return DynamicCellType.ENUMERATION;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DynamicCellType.DYNAMICLABEL;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		return DynamicCellType.WRAPTEXT;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DynamicCellType.TIME;
	else if(answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DynamicCellType.ANSWER;
	
	return DynamicCellType.EMPTY;		
}
 
Example 41
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, Question_AnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		return;
	}
	
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");
}
 
Example 42
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(Answer_DetailsVo answerDetail)
{
	if (answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;

	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if (answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();

	return false;
}
 
Example 43
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private boolean isAnswered(Answer_DetailsVo answerDetail)
{
	if(answerDetail == null || answerDetail.getAnswerType() == null || answerDetail.getAnswerType().getAnswerType() == null)
		return false;
	
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DATE))
		return answerDetail.getDateAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.DECIMAL))
		return answerDetail.getDecimalAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.INTEGER))
		return answerDetail.getIntegerAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.MULTISELECT))
		return answerDetail.getMultiSelectAnswersIsNotNull() && answerDetail.getMultiSelectAnswers().size() > 0; 
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PARTIALDATE))
		return answerDetail.getPartialDateIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.PICKLIST))
		return answerDetail.getPicklistIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TEXT))
		return answerDetail.getStringAnswerIsNotNull() && answerDetail.getStringAnswer().trim().length() > 0;
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.TIME))
		return answerDetail.getTimeAnswerIsNotNull();
	if(answerDetail.getAnswerType().getAnswerType().equals(QuestionAnswerType.YESNO))
		return answerDetail.getBoolValueAnswerIsNotNull();
	
	return false;
}
 
Example 44
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
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 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateAnswerType()
{
	Object objQAT = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getValue();
	form.getGlobalContext().Core.setQuestionAnswerType(objQAT instanceof QuestionAnswerTypeVo ? (QuestionAnswerTypeVo) objQAT : null);
	form.getLocalContext().setIsNewAnwerType(new Boolean(false));
	engine.open(form.getForms().Core.QuestionAnswerType);
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addAnswerType()
{
	QuestionAnswerTypeVo voQAnswer = new QuestionAnswerTypeVo();
	voQAnswer.setActiveStatus(new Boolean(true));
	form.getGlobalContext().Core.setQuestionAnswerType(voQAnswer);
	form.getLocalContext().setIsNewAnwerType(new Boolean(true));
	engine.open(form.getForms().Core.QuestionAnswerType);
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean hasSeparator(QuestionAnswerTypeVoCollection voColl)
{
	for (int i = 0; i < voColl.size(); i++)
	{
		if(voColl.get(i).getAnswerTypeIsNotNull() && voColl.get(i).getAnswerType().equals(QuestionAnswerType.SEPARATOR))
			return true;
	}
	return false;
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean hasOtherThanSeparatorType(QuestionAnswerTypeVoCollection voColl)
{
	for (int i = 0; i < voColl.size(); i++)
	{
		if(voColl.get(i).getAnswerTypeIsNotNull() && !voColl.get(i).getAnswerType().equals(QuestionAnswerType.SEPARATOR) && voColl.get(i).getActiveStatusIsNotNull() && voColl.get(i).getActiveStatus())
			return true;
	}
	return false;
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void enableLkpControls()
{
	QuestionAnswerType type = form.cmbAnswerType().getValue();
	if (type != null && (type.equals(QuestionAnswerType.PICKLIST) == true || type.equals(QuestionAnswerType.MULTISELECT)))
	{
		/*
		 * form.qmbLookupType().setEnabled(true);
		 * form.qmbLookupType().setFocus();
		 */
	}
	else
	{
		form.grdAnswerOption().getRows().clear();
	}
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void enableSeparatorText()
{
	QuestionAnswerType type = form.cmbAnswerType().getValue();
	if (type != null && type.equals(QuestionAnswerType.SEPARATOR))
	{
		form.txtSeparator().setEnabled(form.getMode().equals(FormMode.EDIT));
		form.txtSeparator().setFocus();
	}
	else
	{
		if (form.getMode().equals(FormMode.EDIT))
			form.txtSeparator().setEnabled(false);
		form.txtSeparator().setValue("");
	}
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void enableChkCustomWidth()
{
	QuestionAnswerType type = form.cmbAnswerType().getValue();
	if (form.getMode().equals(FormMode.EDIT))
	{
		boolean chkCustomWidthEnable = type != null && (type.equals(QuestionAnswerType.PICKLIST) || type.equals(QuestionAnswerType.MULTISELECT) || type.equals(QuestionAnswerType.TEXT));
		form.chkCustomWidth().setEnabled(chkCustomWidthEnable);
		if (chkCustomWidthEnable == false)
			form.chkCustomWidth().setValue(false);
	}
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void enableChkMultiselect()
{
	QuestionAnswerType type = form.cmbAnswerType().getValue();
	if (form.getMode().equals(FormMode.EDIT))
	{
		boolean chkMultiselectEnable = type != null && type.equals(QuestionAnswerType.MULTISELECT);
		form.chkMaxMultiselect().setEnabled(chkMultiselectEnable);
		if (chkMultiselectEnable == false)
			form.chkMaxMultiselect().setValue(false);
	}
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isColorColumnVisible()
{
	QuestionAnswerType type = form.cmbAnswerType().getValue();
	if (type != null && (type.equals(QuestionAnswerType.MULTISELECT) || type.equals(QuestionAnswerType.PICKLIST)))
		return true;

	return false;
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setAnswerCellValue(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes, this.optionYes.getIItemImage());
		cell.getItems().newItem(this.optionNo, this.optionNo.getIItemImage());
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		setAnswerCellOptions(configAnswer, cell, instAnswer);

		if (instAnswer != null)
		{
			if (instAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(instAnswer.getMaxMultiselectAllowed());
			}
		}
		else
		{
			if (configAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
			}
		}
	}
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setAnswerCellValue(DynamicGridCell cell, Question_AnswerTypeVo configAnswer, Answer_DetailsVo instAnswer)
{
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes, this.optionYes.getIItemImage());
		cell.getItems().newItem(this.optionNo, this.optionNo.getIItemImage());
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		setAnswerCellOptions(configAnswer, cell, instAnswer);

		if (instAnswer != null)
		{
			if (instAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(instAnswer.getMaxMultiselectAllowed());
			}
		}
		else
		{
			if (configAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
			}
		}
	}
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setAnswerCellOptions(Question_AnswerTypeVo answer, DynamicGridCell cell, Answer_DetailsVo instAnswer)
{
	cell.getItems().clear();
	// WDEV-3617
	cell.setAutoWrapForMultiSelect(true);

	int maxVisibleItems = 0;
	if (answer.getOptionsIsNotNull())
	{
		for (int x = 0; x < answer.getOptions().size(); x++)
		{
			Answer_OptionVo answerItem = answer.getOptions().get(x);
			if (answerItem != null)
			{
				if (displayAnsweredOnly && isNotAnswered(answerItem, instAnswer))
					continue;
				DynamicGridCellItem item = cell.getItems().newItem(answerItem);
				item.setIdentifier(answerItem);
				
				// WDEV-3708
				item.setTooltip(answerItem.getOptionDescription() != null ? answerItem.getOptionDescription() : "");
				maxVisibleItems++;
				if (answerItem.getColourIsNotNull() && answer.getAnswerTypeIsNotNull() && answer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
				{
					item.setMarkerColor(answerItem.getColour());
				}
			}
		}
	}

	cell.setMaxVisibleItemsForMultiSelect(0);
}
 
Example 57
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void setAnswerCellValue(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer) 
{
	if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes, this.optionYes.getIItemImage());
		cell.getItems().newItem(this.optionNo, this.optionNo.getIItemImage());
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))				
	{
		setAnswerCellOptions(configAnswer, cell, instAnswer);
		
		if(instAnswer != null)
		{
			if(instAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(instAnswer.getMaxMultiselectAllowed());						
			}
		}
		else
		{
			if(configAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
			}
		}							
	}
}
 
Example 58
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void setAnswerCellOptions(QuestionAnswerTypeVo answer, DynamicGridCell cell, AnswerDetailsVo instAnswer) 
{
	cell.getItems().clear();
 	// WDEV-3617
	cell.setAutoWrapForMultiSelect(true);
	int maxVisibleItems = 0;
	if(answer.getOptionsIsNotNull())
	{
		for(int x = 0; x < answer.getOptions().size(); x++)
		{
			AnswerOptionVo answerItem = answer.getOptions().get(x);									
			if(answerItem != null)
			{
				//WDEV-1631 - When Viewing an Instantiated Assessment i simply want to see all the question and answered given, in edit mode i want to see all the questions and answer options. 
				if(displayAnsweredOnly && isNotAnswered(answerItem, instAnswer))
					continue;
				DynamicGridCellItem item = cell.getItems().newItem(answerItem);				
				item.setIdentifier(answerItem);
				maxVisibleItems++;
				if(answerItem.getColourIsNotNull() 
						&& answer.getAnswerTypeIsNotNull() 
						&& answer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
				{
					item.setMarkerColor(answerItem.getColour());					
				}
			}
		}			
	}		
	
	cell.setMaxVisibleItemsForMultiSelect(0);
	
	// This line is no longer needed, the answer is going to be wrapped.
	// MM - WDEV-3617
	//cell.setMaxVisibleItemsForMultiSelect(maxVisibleItems == 0 ? 1 : maxVisibleItems + 1);
}
 
Example 59
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer)
{
	if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");		
}
 
Example 60
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, Question_AnswerTypeVo configAnswer)
{
	if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");		
}