Java Code Examples for ims.core.vo.AnswerOptionVoCollection

The following are top voted examples for showing how to use ims.core.vo.AnswerOptionVoCollection. 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 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 2
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 3
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 4
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 5
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 6
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 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: 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 9
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 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-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 12
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 13
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 14
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 15
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	if (cell.getItems() != null)
	{
		for (int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;

			if (items != null)
			{
				for (int y = 0; y < items.size(); y++)
				{
					if (cell.getItems().get(x).getIdentifier() != null && cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
		
		if(displayAnsweredOnly)	//WDEV-12349
		{
			for (int a = cell.getItems().size() -1; a >=0; a--)
			{
				if(cell.getItems().get(a) != null && !cell.getItems().get(a).isChecked())
					cell.getItems().remove(cell.getItems().get(a));
			}
		}
	}
}
 
Example 16
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 17
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 18
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 19
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	if (cell.getItems() != null)
	{
		for (int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;

			if (items != null)
			{
				for (int y = 0; y < items.size(); y++)
				{
					if (cell.getItems().get(x).getIdentifier() != null && cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
		
		if(displayAnsweredOnly)	//WDEV-12349
		{
			for (int a = cell.getItems().size() -1; a >=0; a--)
			{
				if(cell.getItems().get(a) != null && !cell.getItems().get(a).isChecked())
					cell.getItems().remove(cell.getItems().get(a));
			}
		}
	}
}
 
Example 20
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 21
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	if (cell.getItems() != null)
	{
		for (int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;

			if (items != null)
			{
				for (int y = 0; y < items.size(); y++)
				{
					if (cell.getItems().get(x).getIdentifier() != null && cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}

			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 23
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 24
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	if (cell.getItems() != null)
	{
		for (int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;

			if (items != null)
			{
				for (int y = 0; y < items.size(); y++)
				{
					if (cell.getItems().get(x).getIdentifier() != null && cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
		
		if(displayAnsweredOnly)	//WDEV-12349
		{
			for (int a = cell.getItems().size() -1; a >=0; a--)
			{
				if(cell.getItems().get(a) != null && !cell.getItems().get(a).isChecked())
					cell.getItems().remove(cell.getItems().get(a));
			}
		}
	}
}
 
Example 25
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 26
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 27
Project: openmaxims-linux   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 28
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	if (cell.getItems() != null)
	{
		for (int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;

			if (items != null)
			{
				for (int y = 0; y < items.size(); y++)
				{
					if (cell.getItems().get(x).getIdentifier() != null && cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
		
		if(displayAnsweredOnly)	//WDEV-12349
		{
			for (int a = cell.getItems().size() -1; a >=0; a--)
			{
				if(cell.getItems().get(a) != null && !cell.getItems().get(a).isChecked())
					cell.getItems().remove(cell.getItems().get(a));
			}
		}
	}
}
 
Example 29
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 30
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   View source code 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 31
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
private void cloneQuestion(QuestionInformationShortVo voQInfoShort) 
{
	clearQuestionControls();
	initialiseNewQuestion();
	enableTabNewQuestion(true);
	enableTabListQuestion(false);
	showClassificationTree(true);	
	form.getGlobalContext().Core.setQuestionType(QuestionType.PRIMARY);
	form.lyrTabs().tabNewQuestion().setCaption(ADD_QUESTION);
			
	QuestionInformationVo voQInfo = null;
	if (voQInfoShort != null && voQInfoShort.getID_QuestionInformationIsNotNull())
	{
		voQInfo = domain.getQuestion(voQInfoShort.getID_QuestionInformation());
		voQInfo.clearIDAndVersion();
		//WDEV-17026 
		if (voQInfo.getTaxonomyMap() == null)
		{	
		voQInfo.setTaxonomyMap(new TaxonomyMapCollection());
		}
		voQInfo.setKeywords(new KeywordVoCollection());
		if (voQInfo.getKeywords() == null)
		{	
		voQInfo.setTaxonomyMap(new TaxonomyMapCollection());
		}
		if(voQInfo.getAnswerTypes() != null)
		{
			QuestionAnswerTypeVoCollection answers = new QuestionAnswerTypeVoCollection();
			for(int x = 0; x < voQInfo.getAnswerTypes().size(); x++)
			{
				QuestionAnswerTypeVo answer = voQInfo.getAnswerTypes().get(x);
				answer.clearIDAndVersion();
				
				if(answer.getOptions() != null)
				{
					AnswerOptionVoCollection options = new AnswerOptionVoCollection();
					for(int y = 0; y < answer.getOptions().size(); y++)
					{
						AnswerOptionVo option = answer.getOptions().get(y);
						if(option != null)
						{
							option.clearIDAndVersion();
							options.add(option);
						}
					}						
					answer.setOptions(options);
				}
				
				answers.add(answer);					
			}
			voQInfo.setAnswerTypes(answers);
		}
			
		voQInfo.setID_QuestionInformation(-1);
		voQInfo.setStatus(PreActiveActiveInactiveStatus.PREACTIVE);
		form.getLocalContext().setVoQuestionInformation(voQInfo);
		populateControlsFromData(voQInfo);
		this.form.lyrTabs().tabNewQuestion().cmbStatus().setValue(PreActiveActiveInactiveStatus.PREACTIVE);
	}
	
	enableContextMenu();
}
 
Example 32
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void cloneQuestion(QuestionInformationShortVo voQInfoShort) 
{
	clearQuestionControls();
	initialiseNewQuestion();
	enableTabNewQuestion(true);
	enableTabListQuestion(false);
	showClassificationTree(true);	
	form.getGlobalContext().Core.setQuestionType(QuestionType.PRIMARY);
	form.lyrTabs().tabNewQuestion().setCaption(ADD_QUESTION);
			
	QuestionInformationVo voQInfo = null;
	if (voQInfoShort != null && voQInfoShort.getID_QuestionInformationIsNotNull())
	{
		voQInfo = domain.getQuestion(voQInfoShort.getID_QuestionInformation());
		voQInfo.clearIDAndVersion();
		//WDEV-17026 
		if (voQInfo.getTaxonomyMap() == null)
		{	
		voQInfo.setTaxonomyMap(new TaxonomyMapCollection());
		}
		voQInfo.setKeywords(new KeywordVoCollection());
		if (voQInfo.getKeywords() == null)
		{	
		voQInfo.setTaxonomyMap(new TaxonomyMapCollection());
		}
		if(voQInfo.getAnswerTypes() != null)
		{
			QuestionAnswerTypeVoCollection answers = new QuestionAnswerTypeVoCollection();
			for(int x = 0; x < voQInfo.getAnswerTypes().size(); x++)
			{
				QuestionAnswerTypeVo answer = voQInfo.getAnswerTypes().get(x);
				answer.clearIDAndVersion();
				
				if(answer.getOptions() != null)
				{
					AnswerOptionVoCollection options = new AnswerOptionVoCollection();
					for(int y = 0; y < answer.getOptions().size(); y++)
					{
						AnswerOptionVo option = answer.getOptions().get(y);
						if(option != null)
						{
							option.clearIDAndVersion();
							options.add(option);
						}
					}						
					answer.setOptions(options);
				}
				
				answers.add(answer);					
			}
			voQInfo.setAnswerTypes(answers);
		}
			
		voQInfo.setID_QuestionInformation(-1);
		voQInfo.setStatus(PreActiveActiveInactiveStatus.PREACTIVE);
		form.getLocalContext().setVoQuestionInformation(voQInfo);
		populateControlsFromData(voQInfo);
		this.form.lyrTabs().tabNewQuestion().cmbStatus().setValue(PreActiveActiveInactiveStatus.PREACTIVE);
	}
	
	enableContextMenu();
}
 
Example 33
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void cloneQuestion(QuestionInformationShortVo voQInfoShort) 
{
	clearQuestionControls();
	initialiseNewQuestion();
	enableTabNewQuestion(true);
	enableTabListQuestion(false);
	showClassificationTree(true);	
	form.getGlobalContext().Core.setQuestionType(QuestionType.PRIMARY);
	form.lyrTabs().tabNewQuestion().setCaption(ADD_QUESTION);
			
	QuestionInformationVo voQInfo = null;
	if (voQInfoShort != null && voQInfoShort.getID_QuestionInformationIsNotNull())
	{
		voQInfo = domain.getQuestion(voQInfoShort.getID_QuestionInformation());
		voQInfo.clearIDAndVersion();
		//WDEV-17026 
		if (voQInfo.getTaxonomyMap() == null)
		{	
		voQInfo.setTaxonomyMap(new TaxonomyMapCollection());
		}
		voQInfo.setKeywords(new KeywordVoCollection());
		if (voQInfo.getKeywords() == null)
		{	
		voQInfo.setTaxonomyMap(new TaxonomyMapCollection());
		}
		if(voQInfo.getAnswerTypes() != null)
		{
			QuestionAnswerTypeVoCollection answers = new QuestionAnswerTypeVoCollection();
			for(int x = 0; x < voQInfo.getAnswerTypes().size(); x++)
			{
				QuestionAnswerTypeVo answer = voQInfo.getAnswerTypes().get(x);
				answer.clearIDAndVersion();
				
				if(answer.getOptions() != null)
				{
					AnswerOptionVoCollection options = new AnswerOptionVoCollection();
					for(int y = 0; y < answer.getOptions().size(); y++)
					{
						AnswerOptionVo option = answer.getOptions().get(y);
						if(option != null)
						{
							option.clearIDAndVersion();
							options.add(option);
						}
					}						
					answer.setOptions(options);
				}
				
				answers.add(answer);					
			}
			voQInfo.setAnswerTypes(answers);
		}
			
		voQInfo.setID_QuestionInformation(-1);
		voQInfo.setStatus(PreActiveActiveInactiveStatus.PREACTIVE);
		form.getLocalContext().setVoQuestionInformation(voQInfo);
		populateControlsFromData(voQInfo);
		this.form.lyrTabs().tabNewQuestion().cmbStatus().setValue(PreActiveActiveInactiveStatus.PREACTIVE);
	}
	
	enableContextMenu();
}
 
Example 34
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
private void cloneQuestion(QuestionInformationShortVo voQInfoShort) 
{
	clearQuestionControls();
	initialiseNewQuestion();
	enableTabNewQuestion(true);
	enableTabListQuestion(false);
	showClassificationTree(true);	
	form.getGlobalContext().Core.setQuestionType(QuestionType.PRIMARY);
	form.lyrTabs().tabNewQuestion().setCaption(ADD_QUESTION);
			
	QuestionInformationVo voQInfo = null;
	if (voQInfoShort != null && voQInfoShort.getID_QuestionInformationIsNotNull())
	{
		voQInfo = domain.getQuestion(voQInfoShort.getID_QuestionInformation());
		voQInfo.clearIDAndVersion();
		//WDEV-17026 
		if (voQInfo.getTaxonomyMap() == null)
		{	
		voQInfo.setTaxonomyMap(new TaxonomyMapCollection());
		}
		voQInfo.setKeywords(new KeywordVoCollection());
		if (voQInfo.getKeywords() == null)
		{	
		voQInfo.setTaxonomyMap(new TaxonomyMapCollection());
		}
		if(voQInfo.getAnswerTypes() != null)
		{
			QuestionAnswerTypeVoCollection answers = new QuestionAnswerTypeVoCollection();
			for(int x = 0; x < voQInfo.getAnswerTypes().size(); x++)
			{
				QuestionAnswerTypeVo answer = voQInfo.getAnswerTypes().get(x);
				answer.clearIDAndVersion();
				
				if(answer.getOptions() != null)
				{
					AnswerOptionVoCollection options = new AnswerOptionVoCollection();
					for(int y = 0; y < answer.getOptions().size(); y++)
					{
						AnswerOptionVo option = answer.getOptions().get(y);
						if(option != null)
						{
							option.clearIDAndVersion();
							options.add(option);
						}
					}						
					answer.setOptions(options);
				}
				
				answers.add(answer);					
			}
			voQInfo.setAnswerTypes(answers);
		}
			
		voQInfo.setID_QuestionInformation(-1);
		voQInfo.setStatus(PreActiveActiveInactiveStatus.PREACTIVE);
		form.getLocalContext().setVoQuestionInformation(voQInfo);
		populateControlsFromData(voQInfo);
		this.form.lyrTabs().tabNewQuestion().cmbStatus().setValue(PreActiveActiveInactiveStatus.PREACTIVE);
	}
	
	enableContextMenu();
}