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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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;		
}