Java Code Examples for ims.core.vo.AnswerOptionVo

The following are top voted examples for showing how to use ims.core.vo.AnswerOptionVo. 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
private String getChildTooltip(AnswerOptionVo voAnswerOption)
{
	if (voAnswerOption != null)
	{
		StringBuffer sb = new StringBuffer();
		if (voAnswerOption.getOptionDescriptionIsNotNull())
		{
			sb.append("*Description: *");
			sb.append(voAnswerOption.getOptionDescription());
			sb.append(CR);
		}
		if (isScoringAssessmentQuestion() && voAnswerOption.getScoreIsNotNull())
		{
			sb.append("*Score: *");
			sb.append(voAnswerOption.getScore());
			sb.append(CR);
		}
		return new Textile().process(sb.toString());
	}

	return "";
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	AnswerOptionVoCollection result = new AnswerOptionVoCollection();

	for (int x = 0; x < cell.getItems().size(); x++)
	{
		if (cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo) cell.getItems().get(x).getIdentifier());
		}
	}

	return result;
}
 
Example 3
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	AnswerOptionVoCollection result = new AnswerOptionVoCollection();
	
	for(int x = 0; x < cell.getItems().size(); x++)
	{
		if(cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo)cell.getItems().get(x).getIdentifier());
		}
	}
	
	return result;
}
 
Example 4
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isYellowOrRedColourCellsSelected(DynamicGridRow row)
{
	DynamicGridCell answerCell = getDppAnswerCell(row);
	if (answerCell != null)
	{
		AnswerDetailsVo answerDetail = getCellAnswer(answerCell);
		if (answerDetail != null && answerDetail.getMultiSelectAnswers() != null)
		{
			for (int i = 0; i < answerDetail.getMultiSelectAnswers().size(); i++)
			{
				AnswerOptionVo voAnswerOption = answerDetail.getMultiSelectAnswers().get(i);
				//WDEV-3916
				Float score = voAnswerOption.getScore();
				if (score != null && (score.intValue() == getYellowScore() || score.intValue() == getRedScore()))
					return true;
			}
		}
	}

	return false;
}
 
Example 5
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	AnswerOptionVoCollection result = new AnswerOptionVoCollection();
	
	for(int x = 0; x < cell.getItems().size(); x++)
	{
		if(cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo)cell.getItems().get(x).getIdentifier());
		}
	}
	
	return result;
}
 
Example 6
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private String getChildTooltip(AnswerOptionVo voAnswerOption)
{
	if (voAnswerOption != null)
	{
		StringBuffer sb = new StringBuffer();
		if (voAnswerOption.getOptionDescriptionIsNotNull())
		{
			sb.append("*Description: *");
			sb.append(voAnswerOption.getOptionDescription());
			sb.append(CR);
		}
		if (isScoringAssessmentQuestion() && voAnswerOption.getScoreIsNotNull())
		{
			sb.append("*Score: *");
			sb.append(voAnswerOption.getScore());
			sb.append(CR);
		}
		return new Textile().process(sb.toString());
	}

	return "";
}
 
Example 7
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	AnswerOptionVoCollection result = new AnswerOptionVoCollection();

	for (int x = 0; x < cell.getItems().size(); x++)
	{
		if (cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo) cell.getItems().get(x).getIdentifier());
		}
	}

	return result;
}
 
Example 8
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	AnswerOptionVoCollection result = new AnswerOptionVoCollection();
	
	for(int x = 0; x < cell.getItems().size(); x++)
	{
		if(cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo)cell.getItems().get(x).getIdentifier());
		}
	}
	
	return result;
}
 
Example 9
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isYellowOrRedColourCellsSelected(DynamicGridRow row)
{
	DynamicGridCell answerCell = getDppAnswerCell(row);
	if (answerCell != null)
	{
		AnswerDetailsVo answerDetail = getCellAnswer(answerCell);
		if (answerDetail != null && answerDetail.getMultiSelectAnswers() != null)
		{
			for (int i = 0; i < answerDetail.getMultiSelectAnswers().size(); i++)
			{
				AnswerOptionVo voAnswerOption = answerDetail.getMultiSelectAnswers().get(i);
				//WDEV-3916
				Float score = voAnswerOption.getScore();
				if (score != null && (score.intValue() == getYellowScore() || score.intValue() == getRedScore()))
					return true;
			}
		}
	}

	return false;
}
 
Example 10
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	AnswerOptionVoCollection result = new AnswerOptionVoCollection();
	
	for(int x = 0; x < cell.getItems().size(); x++)
	{
		if(cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo)cell.getItems().get(x).getIdentifier());
		}
	}
	
	return result;
}
 
Example 11
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	AnswerOptionVoCollection result = new AnswerOptionVoCollection();

	for (int x = 0; x < cell.getItems().size(); x++)
	{
		if (cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo) cell.getItems().get(x).getIdentifier());
		}
	}

	return result;
}
 
Example 12
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private String getChildTooltip(AnswerOptionVo voAnswerOption)
{
	if (voAnswerOption != null)
	{
		StringBuffer sb = new StringBuffer();
		if (voAnswerOption.getOptionDescriptionIsNotNull())
		{
			sb.append("*Description: *");
			sb.append(voAnswerOption.getOptionDescription());
			sb.append(CR);
		}
		if (isScoringAssessmentQuestion() && voAnswerOption.getScoreIsNotNull())
		{
			sb.append("*Score: *");
			sb.append(voAnswerOption.getScore());
			sb.append(CR);
		}
		return new Textile().process(sb.toString());
	}

	return "";
}
 
Example 13
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	AnswerOptionVoCollection result = new AnswerOptionVoCollection();

	for (int x = 0; x < cell.getItems().size(); x++)
	{
		if (cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo) cell.getItems().get(x).getIdentifier());
		}
	}

	return result;
}
 
Example 14
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	AnswerOptionVoCollection result = new AnswerOptionVoCollection();
	
	for(int x = 0; x < cell.getItems().size(); x++)
	{
		if(cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo)cell.getItems().get(x).getIdentifier());
		}
	}
	
	return result;
}
 
Example 15
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isYellowOrRedColourCellsSelected(DynamicGridRow row)
{
	DynamicGridCell answerCell = getDppAnswerCell(row);
	if (answerCell != null)
	{
		AnswerDetailsVo answerDetail = getCellAnswer(answerCell);
		if (answerDetail != null && answerDetail.getMultiSelectAnswers() != null)
		{
			for (int i = 0; i < answerDetail.getMultiSelectAnswers().size(); i++)
			{
				AnswerOptionVo voAnswerOption = answerDetail.getMultiSelectAnswers().get(i);
				//WDEV-3916
				Float score = voAnswerOption.getScore();
				if (score != null && (score.intValue() == getYellowScore() || score.intValue() == getRedScore()))
					return true;
			}
		}
	}

	return false;
}
 
Example 16
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	AnswerOptionVoCollection result = new AnswerOptionVoCollection();
	
	for(int x = 0; x < cell.getItems().size(); x++)
	{
		if(cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo)cell.getItems().get(x).getIdentifier());
		}
	}
	
	return result;
}
 
Example 17
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private String getChildTooltip(AnswerOptionVo voAnswerOption)
{
	if (voAnswerOption != null)
	{
		StringBuffer sb = new StringBuffer();
		if (voAnswerOption.getOptionDescriptionIsNotNull())
		{
			sb.append("*Description: *");
			sb.append(voAnswerOption.getOptionDescription());
			sb.append(CR);
		}
		if (isScoringAssessmentQuestion() && voAnswerOption.getScoreIsNotNull())
		{
			sb.append("*Score: *");
			sb.append(voAnswerOption.getScore());
			sb.append(CR);
		}
		return new Textile().process(sb.toString());
	}

	return "";
}
 
Example 18
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	AnswerOptionVoCollection result = new AnswerOptionVoCollection();

	for (int x = 0; x < cell.getItems().size(); x++)
	{
		if (cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo) cell.getItems().get(x).getIdentifier());
		}
	}

	return result;
}
 
Example 19
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	AnswerOptionVoCollection result = new AnswerOptionVoCollection();
	
	for(int x = 0; x < cell.getItems().size(); x++)
	{
		if(cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo)cell.getItems().get(x).getIdentifier());
		}
	}
	
	return result;
}
 
Example 20
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isYellowOrRedColourCellsSelected(DynamicGridRow row)
{
	DynamicGridCell answerCell = getDppAnswerCell(row);
	if (answerCell != null)
	{
		AnswerDetailsVo answerDetail = getCellAnswer(answerCell);
		if (answerDetail != null && answerDetail.getMultiSelectAnswers() != null)
		{
			for (int i = 0; i < answerDetail.getMultiSelectAnswers().size(); i++)
			{
				AnswerOptionVo voAnswerOption = answerDetail.getMultiSelectAnswers().get(i);
				//WDEV-3916
				Float score = voAnswerOption.getScore();
				if (score != null && (score.intValue() == getYellowScore() || score.intValue() == getRedScore()))
					return true;
			}
		}
	}

	return false;
}
 
Example 21
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private AnswerOptionVoCollection getCellMultiAnswer(DynamicGridCell cell)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	AnswerOptionVoCollection result = new AnswerOptionVoCollection();
	
	for(int x = 0; x < cell.getItems().size(); x++)
	{
		if(cell.getItems().get(x).isChecked())
		{
			result.add((AnswerOptionVo)cell.getItems().get(x).getIdentifier());
		}
	}
	
	return result;
}
 
Example 22
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void populateDataFromAnswerOptions(QuestionAnswerTypeVo voQAnswerType)
{
	AnswerOptionVoCollection voColl = new AnswerOptionVoCollection();
	for (int i = 0; i < form.grdAnswerOption().getRows().size(); i++)
	{
		grdAnswerOptionRow row = form.grdAnswerOption().getRows().get(i);
		AnswerOptionVo voAnswerOption = row.getValue() != null ? row.getValue() : new AnswerOptionVo();
		voAnswerOption.setOptionText(row.getcolOptionText());
		voAnswerOption.setOptionDescription(row.getcolOptionDesc());
		voAnswerOption.setScore(row.getcolScore());
		Object objCol = row.getcolColour();
		if (objCol instanceof Color)
			voAnswerOption.setColour((Color) objCol);
		else
			voAnswerOption.setColour(null);
		
		NonUniqueTaxonomyMapVoCollection voTaxonomyColl = new NonUniqueTaxonomyMapVoCollection();
		NonUniqueTaxonomyMapVo voTaxonomyMap = new NonUniqueTaxonomyMapVo();
		if (row.getcolExtCodeType()==null&&(row.getcolCode()==null||row.getcolCode().equals("")))
			voAnswerOption.setTaxonomyMappings(null);
		else
		{
			voTaxonomyMap.setTaxonomyName(row.getcolExtCodeType());
			voTaxonomyMap.setTaxonomyCode(row.getcolCode());
			voTaxonomyColl.add(voTaxonomyMap);
			voAnswerOption.setTaxonomyMappings(voTaxonomyColl);
		}
					
		voColl.add(voAnswerOption);
	}
	voQAnswerType.setOptions(voColl);
}
 
Example 23
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void setRowData(AnswerOptionVo voAnswerOption, GenForm.grdAnswerOptionRow newRow)
{
	if (voAnswerOption != null)
	{
		newRow.setcolOptionText(voAnswerOption.getOptionText());
		newRow.setcolOptionDesc(voAnswerOption.getOptionDescription());
		newRow.setcolScore(voAnswerOption.getScore());
		newRow.setcolColour(voAnswerOption.getColour());
		if (voAnswerOption.getTaxonomyMappingsIsNotNull() && voAnswerOption.getTaxonomyMappings().size() > 0)
		{
			setColTaxonomy(newRow, voAnswerOption.getTaxonomyMappings().get(0));
		}
		newRow.setValue(voAnswerOption);
	}
}
 
Example 24
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
/**
 * @param newRow
 * @param voAnswerOption
 */
private void setColTaxonomy(GenForm.grdAnswerOptionRow newRow, NonUniqueTaxonomyMapVo voTaxonomyMap)
{
	if (newRow != null && voTaxonomyMap != null)
	{
		newRow.setcolExtCodeType(voTaxonomyMap.getTaxonomyName());
		newRow.setcolCode(voTaxonomyMap.getTaxonomyCode());
		AnswerOptionVo voAnswerOption = newRow.getValue() != null ? newRow.getValue() : new AnswerOptionVo();
		NonUniqueTaxonomyMapVoCollection voTaxonomyColl = new NonUniqueTaxonomyMapVoCollection();
		voTaxonomyColl.add(voTaxonomyMap);
		voAnswerOption.setTaxonomyMappings(voTaxonomyColl);
		newRow.setValue(voAnswerOption);
	}
}
 
Example 25
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void addNewAnswerOption()
{
	GenForm.grdAnswerOptionRow row = form.grdAnswerOption().getRows().newRow(true);
	row.setReadOnly(false);
	row.setcolScoreReadOnly(!isScoringAssessmentQuestion());
	row.setcolColourReadOnly(!isColorColumnVisible());
	row.setValue(new AnswerOptionVo());
}
 
Example 26
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private Integer getRowIndex(grdAnswerOptionRow row)
{
	for (int i = 0; i < form.grdAnswerOption().getRows().size(); i++)
	{
		AnswerOptionVo voAnswerOption = form.grdAnswerOption().getRows().get(i).getValue();
		if (voAnswerOption != null && voAnswerOption.equals(row.getValue()))
			return new Integer(i);
	}
	return null;
}
 
Example 27
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private boolean isNotAnswered(AnswerOptionVo answerItem, AnswerDetailsVo instAnswer)
{
	if (answerItem == null || instAnswer == null)
		return false;

	return instAnswer.getMultiSelectAnswers().indexOf(answerItem) < 0;
}
 
Example 28
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 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 29
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private boolean isNotAnswered(AnswerOptionVo answerItem, AnswerDetailsVo instAnswer)
{
	if(answerItem == null || instAnswer == null)
		return false;

	return instAnswer.getMultiSelectAnswers().indexOf(answerItem) < 0;
}
 
Example 30
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View source code 5 votes vote down vote up
private void setAnswerCellOptions(QuestionAnswerTypeVo answer, DynamicGridCell cell) 
	{
		cell.getItems().clear();
		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(maxVisibleItems == 0?1:maxVisibleItems);
	}
 
Example 31
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void populateDataFromAnswerOptions(QuestionAnswerTypeVo voQAnswerType)
{
	AnswerOptionVoCollection voColl = new AnswerOptionVoCollection();
	for (int i = 0; i < form.grdAnswerOption().getRows().size(); i++)
	{
		grdAnswerOptionRow row = form.grdAnswerOption().getRows().get(i);
		AnswerOptionVo voAnswerOption = row.getValue() != null ? row.getValue() : new AnswerOptionVo();
		voAnswerOption.setOptionText(row.getcolOptionText());
		voAnswerOption.setOptionDescription(row.getcolOptionDesc());
		voAnswerOption.setScore(row.getcolScore());
		Object objCol = row.getcolColour();
		if (objCol instanceof Color)
			voAnswerOption.setColour((Color) objCol);
		else
			voAnswerOption.setColour(null);
		
		NonUniqueTaxonomyMapVoCollection voTaxonomyColl = new NonUniqueTaxonomyMapVoCollection();
		NonUniqueTaxonomyMapVo voTaxonomyMap = new NonUniqueTaxonomyMapVo();
		if (row.getcolExtCodeType()==null&&(row.getcolCode()==null||row.getcolCode().equals("")))
			voAnswerOption.setTaxonomyMappings(null);
		else
		{
			voTaxonomyMap.setTaxonomyName(row.getcolExtCodeType());
			voTaxonomyMap.setTaxonomyCode(row.getcolCode());
			voTaxonomyColl.add(voTaxonomyMap);
			voAnswerOption.setTaxonomyMappings(voTaxonomyColl);
		}
					
		voColl.add(voAnswerOption);
	}
	voQAnswerType.setOptions(voColl);
}
 
Example 32
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void setRowData(AnswerOptionVo voAnswerOption, GenForm.grdAnswerOptionRow newRow)
{
	if (voAnswerOption != null)
	{
		newRow.setcolOptionText(voAnswerOption.getOptionText());
		newRow.setcolOptionDesc(voAnswerOption.getOptionDescription());
		newRow.setcolScore(voAnswerOption.getScore());
		newRow.setcolColour(voAnswerOption.getColour());
		if (voAnswerOption.getTaxonomyMappingsIsNotNull() && voAnswerOption.getTaxonomyMappings().size() > 0)
		{
			setColTaxonomy(newRow, voAnswerOption.getTaxonomyMappings().get(0));
		}
		newRow.setValue(voAnswerOption);
	}
}
 
Example 33
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
/**
 * @param newRow
 * @param voAnswerOption
 */
private void setColTaxonomy(GenForm.grdAnswerOptionRow newRow, NonUniqueTaxonomyMapVo voTaxonomyMap)
{
	if (newRow != null && voTaxonomyMap != null)
	{
		newRow.setcolExtCodeType(voTaxonomyMap.getTaxonomyName());
		newRow.setcolCode(voTaxonomyMap.getTaxonomyCode());
		AnswerOptionVo voAnswerOption = newRow.getValue() != null ? newRow.getValue() : new AnswerOptionVo();
		NonUniqueTaxonomyMapVoCollection voTaxonomyColl = new NonUniqueTaxonomyMapVoCollection();
		voTaxonomyColl.add(voTaxonomyMap);
		voAnswerOption.setTaxonomyMappings(voTaxonomyColl);
		newRow.setValue(voAnswerOption);
	}
}
 
Example 34
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void addNewAnswerOption()
{
	GenForm.grdAnswerOptionRow row = form.grdAnswerOption().getRows().newRow(true);
	row.setReadOnly(false);
	row.setcolScoreReadOnly(!isScoringAssessmentQuestion());
	row.setcolColourReadOnly(!isColorColumnVisible());
	row.setValue(new AnswerOptionVo());
}
 
Example 35
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private Integer getRowIndex(grdAnswerOptionRow row)
{
	for (int i = 0; i < form.grdAnswerOption().getRows().size(); i++)
	{
		AnswerOptionVo voAnswerOption = form.grdAnswerOption().getRows().get(i).getValue();
		if (voAnswerOption != null && voAnswerOption.equals(row.getValue()))
			return new Integer(i);
	}
	return null;
}
 
Example 36
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private boolean isNotAnswered(AnswerOptionVo answerItem, AnswerDetailsVo instAnswer)
{
	if (answerItem == null || instAnswer == null)
		return false;

	return instAnswer.getMultiSelectAnswers().indexOf(answerItem) < 0;
}
 
Example 37
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 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 38
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private boolean isNotAnswered(AnswerOptionVo answerItem, AnswerDetailsVo instAnswer)
{
	if(answerItem == null || instAnswer == null)
		return false;

	return instAnswer.getMultiSelectAnswers().indexOf(answerItem) < 0;
}
 
Example 39
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   View source code 5 votes vote down vote up
private void setAnswerCellOptions(QuestionAnswerTypeVo answer, DynamicGridCell cell) 
	{
		cell.getItems().clear();
		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(maxVisibleItems == 0?1:maxVisibleItems);
	}
 
Example 40
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void setAnswerCellOptions(QuestionAnswerTypeVo answer, DynamicGridCell cell)
{
	cell.getItems().clear();
	int maxVisibleItems = 0;

	if (answer.getOptionsIsNotNull())
	{
		for (int x = 0; x < answer.getOptions().size(); x++)
		{
			AnswerOptionVo answerItem = answer.getOptions().get(x);

			if (answerItem != null)
			{
				DynamicGridCellItem item = cell.getItems().newItem(answerItem);
				item.setIdentifier(answerItem);
				maxVisibleItems++;

				if (answerItem.getColourIsNotNull() && ims.core.vo.lookups.QuestionAnswerType.MULTISELECT.equals(answer.getAnswerType()))
				{
					item.setMarkerColor(answerItem.getColour());
				}
			}
		}
	}

	cell.setMaxVisibleItemsForMultiSelect(maxVisibleItems == 0 ? 1 : maxVisibleItems);
}