Java Code Examples for ims.assessment.vo.AssessmentRoleVo

The following are top voted examples for showing how to use ims.assessment.vo.AssessmentRoleVo. 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
public int compare(Object ob1, Object ob2) 
{
	String name1 = null;
	String name2 = null;
	if(ob1 instanceof AssessmentRoleVo )
	{
		AssessmentRoleVo ps1 = (AssessmentRoleVo)ob1;
		name1 = ps1.getAppRoleIsNotNull() ? ps1.getAppRole().getName() : null;
	}
	if(ob2 instanceof AssessmentRoleVo)
	{
		AssessmentRoleVo ps2 = (AssessmentRoleVo)ob2;
		name2 = ps2.getAppRoleIsNotNull() ? ps2.getAppRole().getName():null;
	}
	if(name1 != null )
		return  name1.toUpperCase().compareTo(name2.toUpperCase())*direction;
	if(name2 != null)
		return (-1)*direction;
	
	return 0;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateRolesDetails(UserAssessmentVo assessment)
{
	form.lyrTabs().tabRoles().grdRoles().getRows().clear();
	form.lyrTabs().tabRoles().dyngrdQuestions().getRows().clear();
	if (assessment == null)
		return;

	if (assessment.getIsMultiRoleIsNotNull() && assessment.getIsMultiRole().booleanValue())
	{
		for (int i = 0; i < assessment.getAssessmentRoles().size(); i++)
		{
			AssessmentRoleVo assessmentRoleVo = assessment.getAssessmentRoles().get(i);
			AppRoleShortVo voRole = assessmentRoleVo.getAppRole();
			if (voRole != null)
			{
				grdRolesRow row = form.lyrTabs().tabRoles().grdRoles().getRows().newRow();
				row.setcolAnswerAll(assessmentRoleVo.getAnswerAllIsNotNull() && assessmentRoleVo.getAnswerAll().booleanValue() ? true : false);
				row.setcolRole(voRole.getName());
				row.setcolImage(form.getImages().OCRR.Role);
				row.setValue(assessmentRoleVo);
			}
		}
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkUserRole(UserAssessmentVo data)
{
	boolean userCanAnswerToAllQuestion = true;
	
	if(data.getAssessmentRolesIsNotNull())
	{
		for(AssessmentRoleVo role : data.getAssessmentRoles())
		{
			if(role == null)
				continue;
			
			if(role.getAppRoleIsNotNull() && role.getAppRole().getID_AppRole().equals(engine.getLoggedInRole().getId()))
			{
				userCanAnswerToAllQuestion = role.getAnswerAllIsNotNull() && role.getAnswerAll();
			}
		}			
	}
	
	return userCanAnswerToAllQuestion;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkUserRole(User_AssessmentVo data)
{
	boolean userCanAnswerToAllQuestion = true;
	
	if(data.getAssessmentRolesIsNotNull())
	{
		for(AssessmentRoleVo role : data.getAssessmentRoles())
		{
			if(role == null)
				continue;
			
			if(role.getAppRoleIsNotNull() && role.getAppRole().getID_AppRole().equals(engine.getLoggedInRole().getId()))
			{
				userCanAnswerToAllQuestion = role.getAnswerAllIsNotNull() && role.getAnswerAll();
			}
		}			
	}
	
	return userCanAnswerToAllQuestion;
}
 
Example 5
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
public int compare(Object ob1, Object ob2) 
{
	String name1 = null;
	String name2 = null;
	if(ob1 instanceof AssessmentRoleVo )
	{
		AssessmentRoleVo ps1 = (AssessmentRoleVo)ob1;
		name1 = ps1.getAppRoleIsNotNull() ? ps1.getAppRole().getName() : null;
	}
	if(ob2 instanceof AssessmentRoleVo)
	{
		AssessmentRoleVo ps2 = (AssessmentRoleVo)ob2;
		name2 = ps2.getAppRoleIsNotNull() ? ps2.getAppRole().getName():null;
	}
	if(name1 != null )
		return  name1.toUpperCase().compareTo(name2.toUpperCase())*direction;
	if(name2 != null)
		return (-1)*direction;
	
	return 0;
}
 
Example 6
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateRolesDetails(UserAssessmentVo assessment)
{
	form.lyrTabs().tabRoles().grdRoles().getRows().clear();
	form.lyrTabs().tabRoles().dyngrdQuestions().getRows().clear();
	if (assessment == null)
		return;

	if (assessment.getIsMultiRoleIsNotNull() && assessment.getIsMultiRole().booleanValue())
	{
		for (int i = 0; i < assessment.getAssessmentRoles().size(); i++)
		{
			AssessmentRoleVo assessmentRoleVo = assessment.getAssessmentRoles().get(i);
			AppRoleShortVo voRole = assessmentRoleVo.getAppRole();
			if (voRole != null)
			{
				grdRolesRow row = form.lyrTabs().tabRoles().grdRoles().getRows().newRow();
				row.setcolAnswerAll(assessmentRoleVo.getAnswerAllIsNotNull() && assessmentRoleVo.getAnswerAll().booleanValue() ? true : false);
				row.setcolRole(voRole.getName());
				row.setcolImage(form.getImages().OCRR.Role);
				row.setValue(assessmentRoleVo);
			}
		}
	}
}
 
Example 7
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkUserRole(UserAssessmentVo data)
{
	boolean userCanAnswerToAllQuestion = true;
	
	if(data.getAssessmentRolesIsNotNull())
	{
		for(AssessmentRoleVo role : data.getAssessmentRoles())
		{
			if(role == null)
				continue;
			
			if(role.getAppRoleIsNotNull() && role.getAppRole().getID_AppRole().equals(engine.getLoggedInRole().getId()))
			{
				userCanAnswerToAllQuestion = role.getAnswerAllIsNotNull() && role.getAnswerAll();
			}
		}			
	}
	
	return userCanAnswerToAllQuestion;
}
 
Example 8
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkUserRole(User_AssessmentVo data)
{
	boolean userCanAnswerToAllQuestion = true;
	
	if(data.getAssessmentRolesIsNotNull())
	{
		for(AssessmentRoleVo role : data.getAssessmentRoles())
		{
			if(role == null)
				continue;
			
			if(role.getAppRoleIsNotNull() && role.getAppRole().getID_AppRole().equals(engine.getLoggedInRole().getId()))
			{
				userCanAnswerToAllQuestion = role.getAnswerAllIsNotNull() && role.getAnswerAll();
			}
		}			
	}
	
	return userCanAnswerToAllQuestion;
}
 
Example 9
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
public int compare(Object ob1, Object ob2) 
{
	String name1 = null;
	String name2 = null;
	if(ob1 instanceof AssessmentRoleVo )
	{
		AssessmentRoleVo ps1 = (AssessmentRoleVo)ob1;
		name1 = ps1.getAppRoleIsNotNull() ? ps1.getAppRole().getName() : null;
	}
	if(ob2 instanceof AssessmentRoleVo)
	{
		AssessmentRoleVo ps2 = (AssessmentRoleVo)ob2;
		name2 = ps2.getAppRoleIsNotNull() ? ps2.getAppRole().getName():null;
	}
	if(name1 != null )
		return  name1.toUpperCase().compareTo(name2.toUpperCase())*direction;
	if(name2 != null)
		return (-1)*direction;
	
	return 0;
}
 
Example 10
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateRolesDetails(UserAssessmentVo assessment)
{
	form.lyrTabs().tabRoles().grdRoles().getRows().clear();
	form.lyrTabs().tabRoles().dyngrdQuestions().getRows().clear();
	if (assessment == null)
		return;

	if (assessment.getIsMultiRoleIsNotNull() && assessment.getIsMultiRole().booleanValue())
	{
		for (int i = 0; i < assessment.getAssessmentRoles().size(); i++)
		{
			AssessmentRoleVo assessmentRoleVo = assessment.getAssessmentRoles().get(i);
			AppRoleShortVo voRole = assessmentRoleVo.getAppRole();
			if (voRole != null)
			{
				grdRolesRow row = form.lyrTabs().tabRoles().grdRoles().getRows().newRow();
				row.setcolAnswerAll(assessmentRoleVo.getAnswerAllIsNotNull() && assessmentRoleVo.getAnswerAll().booleanValue() ? true : false);
				row.setcolRole(voRole.getName());
				row.setcolImage(form.getImages().OCRR.Role);
				row.setValue(assessmentRoleVo);
			}
		}
	}
}
 
Example 11
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkUserRole(UserAssessmentVo data)
{
	boolean userCanAnswerToAllQuestion = true;
	
	if(data.getAssessmentRolesIsNotNull())
	{
		for(AssessmentRoleVo role : data.getAssessmentRoles())
		{
			if(role == null)
				continue;
			
			if(role.getAppRoleIsNotNull() && role.getAppRole().getID_AppRole().equals(engine.getLoggedInRole().getId()))
			{
				userCanAnswerToAllQuestion = role.getAnswerAllIsNotNull() && role.getAnswerAll();
			}
		}			
	}
	
	return userCanAnswerToAllQuestion;
}
 
Example 12
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkUserRole(User_AssessmentVo data)
{
	boolean userCanAnswerToAllQuestion = true;
	
	if(data.getAssessmentRolesIsNotNull())
	{
		for(AssessmentRoleVo role : data.getAssessmentRoles())
		{
			if(role == null)
				continue;
			
			if(role.getAppRoleIsNotNull() && role.getAppRole().getID_AppRole().equals(engine.getLoggedInRole().getId()))
			{
				userCanAnswerToAllQuestion = role.getAnswerAllIsNotNull() && role.getAnswerAll();
			}
		}			
	}
	
	return userCanAnswerToAllQuestion;
}
 
Example 13
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
public int compare(Object ob1, Object ob2) 
{
	String name1 = null;
	String name2 = null;
	if(ob1 instanceof AssessmentRoleVo )
	{
		AssessmentRoleVo ps1 = (AssessmentRoleVo)ob1;
		name1 = ps1.getAppRoleIsNotNull() ? ps1.getAppRole().getName() : null;
	}
	if(ob2 instanceof AssessmentRoleVo)
	{
		AssessmentRoleVo ps2 = (AssessmentRoleVo)ob2;
		name2 = ps2.getAppRoleIsNotNull() ? ps2.getAppRole().getName():null;
	}
	if(name1 != null )
		return  name1.toUpperCase().compareTo(name2.toUpperCase())*direction;
	if(name2 != null)
		return (-1)*direction;
	
	return 0;
}
 
Example 14
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void populateRolesDetails(UserAssessmentVo assessment)
{
	form.lyrTabs().tabRoles().grdRoles().getRows().clear();
	form.lyrTabs().tabRoles().dyngrdQuestions().getRows().clear();
	if (assessment == null)
		return;

	if (assessment.getIsMultiRoleIsNotNull() && assessment.getIsMultiRole().booleanValue())
	{
		for (int i = 0; i < assessment.getAssessmentRoles().size(); i++)
		{
			AssessmentRoleVo assessmentRoleVo = assessment.getAssessmentRoles().get(i);
			AppRoleShortVo voRole = assessmentRoleVo.getAppRole();
			if (voRole != null)
			{
				grdRolesRow row = form.lyrTabs().tabRoles().grdRoles().getRows().newRow();
				row.setcolAnswerAll(assessmentRoleVo.getAnswerAllIsNotNull() && assessmentRoleVo.getAnswerAll().booleanValue() ? true : false);
				row.setcolRole(voRole.getName());
				row.setcolImage(form.getImages().OCRR.Role);
				row.setValue(assessmentRoleVo);
			}
		}
	}
}
 
Example 15
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkUserRole(UserAssessmentVo data)
{
	boolean userCanAnswerToAllQuestion = true;
	
	if(data.getAssessmentRolesIsNotNull())
	{
		for(AssessmentRoleVo role : data.getAssessmentRoles())
		{
			if(role == null)
				continue;
			
			if(role.getAppRoleIsNotNull() && role.getAppRole().getID_AppRole().equals(engine.getLoggedInRole().getId()))
			{
				userCanAnswerToAllQuestion = role.getAnswerAllIsNotNull() && role.getAnswerAll();
			}
		}			
	}
	
	return userCanAnswerToAllQuestion;
}
 
Example 16
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkUserRole(User_AssessmentVo data)
{
	boolean userCanAnswerToAllQuestion = true;
	
	if(data.getAssessmentRolesIsNotNull())
	{
		for(AssessmentRoleVo role : data.getAssessmentRoles())
		{
			if(role == null)
				continue;
			
			if(role.getAppRoleIsNotNull() && role.getAppRole().getID_AppRole().equals(engine.getLoggedInRole().getId()))
			{
				userCanAnswerToAllQuestion = role.getAnswerAllIsNotNull() && role.getAnswerAll();
			}
		}			
	}
	
	return userCanAnswerToAllQuestion;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private Boolean isQuestionRoleReadOnly(AssessmentQuestionVo voAssessmentQuestion)
{
	Integer roleId = getLoggedInRole();

	UserAssessmentVo voUserAssessment = getCurrentUserAssessment();

	// Check if there is at least one role in the User Assessment
	// If the Role has Answer All = true return false;
	if (roleId != null && voUserAssessment != null)
	{
		for (int i = 0; voUserAssessment != null && i < voUserAssessment.getAssessmentRoles().size(); i++)
		{
			AssessmentRoleVo role = voUserAssessment.getAssessmentRoles().get(i);
			if (userHasRoleAssociated(role.getAppRole(), roleId))
			{
				if (role.getAnswerAllIsNotNull() && role.getAnswerAll().booleanValue())
				{
					return Boolean.FALSE;
				}
			}
		}
	}

	// Find if the AssessmentQuestion has the Role associated with
	for (int j = 0; j < voAssessmentQuestion.getAssessmentAnswerRole().size(); j++)
	{
		if (userHasRoleAssociated(voAssessmentQuestion.getAssessmentAnswerRole().get(j).getAppRole(), roleId))
			return Boolean.FALSE;
	}

	return Boolean.TRUE;
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void populateRolesCombo(UserAssessmentVo voUserAssessment)
{
	form.cmbRoles().clear();
	if(voUserAssessment != null && voUserAssessment.getAssessmentRolesIsNotNull())
	{
		voUserAssessment.getAssessmentRoles().sort(new RoleComparator(SortOrder.ASCENDING));  //wdev-16161
		for (int i = 0; i < voUserAssessment.getAssessmentRoles().size(); i++)
		{
			AssessmentRoleVo voAssessmentRole = voUserAssessment.getAssessmentRoles().get(i);
			form.cmbRoles().newRow(voAssessmentRole, voAssessmentRole.getAppRoleIsNotNull()?voAssessmentRole.getAppRole().getName():"");
		}
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onCmbRolesValueChanged() throws PresentationLogicException
{
	AssessmentRoleVo voAssessmentRole = form.cmbRoles().getValue();
	UserAssessmentVo voUserAssesment = form.getLocalContext().getUserAssessmentVo();
	if(voAssessmentRole != null && (voAssessmentRole.getAnswerAll() == null || !voAssessmentRole.getAnswerAll().booleanValue()))
	{
		populateGrid(getFilteredOnRoleUserAssessment(voUserAssesment, voAssessmentRole));
	}
	else
	{
		populateGrid(voUserAssesment);
	}
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private UserAssessmentVo getFilteredOnRoleUserAssessment(UserAssessmentVo voUserAssesmentOriginal, AssessmentRoleVo voAssessmentRole)
{
	if(voUserAssesmentOriginal == null)
		return voUserAssesmentOriginal;
	
	UserAssessmentVo voUserAssesment = (UserAssessmentVo) voUserAssesmentOriginal.clone();
	if (voUserAssesment != null && voAssessmentRole != null && voUserAssesment.getAssessmentRoles().size() > 0)
	{
		for (int i = 0; voUserAssesment.getQuestionGroupsIsNotNull() && i < voUserAssesment.getQuestionGroups().size(); i++)
		{
			boolean deleted = true;
			while (deleted)
			{
				deleted = false;
				AssessmentQuestionGroupVo voAssessQuestion = voUserAssesment.getQuestionGroups().get(i);
				for (int j = 0; j < voAssessQuestion.getQuestions().size(); j++)
				{
					AssessmentQuestionVo assessmentQuestionVo = voAssessQuestion.getQuestions().get(j);
					boolean found = isRoleAdded(voAssessmentRole, assessmentQuestionVo);

					if (found == false)
					{
						voAssessQuestion.getQuestions().remove(j);
						deleted = true;
						break;
					}
				}
			}
		}
	}

	return voUserAssesment;
}
 
Example 21
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private boolean isRoleAdded(AssessmentRoleVo voAssessmentRole, AssessmentQuestionVo assessmentQuestionVo)
{
	if(voAssessmentRole == null || assessmentQuestionVo == null)
		return false;

	for (int k = 0; k < assessmentQuestionVo.getAssessmentAnswerRole().size(); k++)
	{
		AppRoleShortVo appRoleVo = assessmentQuestionVo.getAssessmentAnswerRole().get(k).getAppRole();
		if(appRoleVo != null && appRoleVo.equals(voAssessmentRole.getAppRole()))
		{
			return true;
		}
	}
	return false;
}
 
Example 22
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private boolean isVoAdded(AppRoleShortVo voAppRole)
{
	for (int j = 0; j < form.lyrTabs().tabRoles().grdRoles().getRows().size(); j++)
	{
		AssessmentRoleVo voAssessment = form.lyrTabs().tabRoles().grdRoles().getRows().get(j).getValue();
		if(voAssessment != null && voAssessment.getAppRoleIsNotNull())
		{
			if(voAssessment.getAppRole().equals(voAppRole))
				return true;
		}
	}
	
	return false;
}
 
Example 23
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private AssessmentRoleVoCollection getRoles()
{
	AssessmentRoleVoCollection voCollection = new AssessmentRoleVoCollection();
	for (int i = 0; i < form.lyrTabs().tabRoles().grdRoles().getRows().size(); i++)
	{
		grdRolesRow rolesRow = form.lyrTabs().tabRoles().grdRoles().getRows().get(i);
		AssessmentRoleVo voAssessRole = rolesRow.getValue();
		voAssessRole.setAnswerAll(new Boolean(rolesRow.getcolAnswerAll()));
		voCollection.add(voAssessRole);
	}

	return voCollection;
}
 
Example 24
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
@SuppressWarnings("unchecked")
private AssessmentQuestionRoleVoCollection getQuestionRole(AssessmentQuestionVo voAssessmentQuestion)
{
	HashMap map = form.getLocalContext().getAssessmentRoles();
	if (map == null)
		return null;

	AssessmentQuestionRoleVoCollection voColl = new AssessmentQuestionRoleVoCollection();

	AssessmentRoleVoCollection roleVoColl = getRoles();
	for (int i = 0; i < roleVoColl.size(); i++)
	{
		AssessmentRoleVo voAssessRole = roleVoColl.get(i);
		if (voAssessRole.getAnswerAllIsNotNull() && voAssessRole.getAnswerAll().booleanValue() == false)
		{
			AssessmentQuestionVoCollection voAssQColl = (AssessmentQuestionVoCollection) map.get(voAssessRole.getAppRole().getID_AppRole());
			if (voAssQColl != null)
			{
				if (voAssQColl.indexOf(voAssessmentQuestion) >= 0)
				{
					AssessmentQuestionRoleVo voAssessQuestionRole = new AssessmentQuestionRoleVo();
					voAssessQuestionRole.setAppRole(voAssessRole.getAppRole());
					voColl.add(voAssessQuestionRole);
				}
			}
		}
	}

	return voColl;
}
 
Example 25
Project: AvoinApotti   File: StructuredAssessmentsHelper.java   View source code 5 votes vote down vote up
private AssessmentQuestionRoleVoCollection getQuestionRole(AssessmentQuestionVo voAssessmentQuestion, HashMap assessmentRoleMap)
{
	if (assessmentRoleMap == null)
		return null;

	AssessmentQuestionRoleVoCollection voColl = new AssessmentQuestionRoleVoCollection();

	for (int i = 0; roleVoColl != null && i < roleVoColl.size(); i++)
	{
		AssessmentRoleVo voAssessRole = roleVoColl.get(i);
		if (voAssessRole.getAnswerAllIsNotNull() && voAssessRole.getAnswerAll().booleanValue() == false)
		{
			AssessmentQuestionVoCollection voAssQColl = (AssessmentQuestionVoCollection) assessmentRoleMap.get(voAssessRole.getAppRole().getID_AppRole());
			if (voAssQColl != null)
			{
				if (voAssQColl.indexOf(voAssessmentQuestion) >= 0)
				{
					AssessmentQuestionRoleVo voAssessQuestionRole = new AssessmentQuestionRoleVo();
					voAssessQuestionRole.setAppRole(voAssessRole.getAppRole());
					voColl.add(voAssessQuestionRole);
				}
			}
		}
	}

	return voColl;
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private Boolean isQuestionRoleReadOnly(AssessmentQuestionVo voAssessmentQuestion)
{
	Integer roleId = getLoggedInRole();

	UserAssessmentVo voUserAssessment = getCurrentUserAssessment();

	// Check if there is at least one role in the User Assessment
	// If the Role has Answer All = true return false;
	if (roleId != null && voUserAssessment != null)
	{
		for (int i = 0; voUserAssessment != null && i < voUserAssessment.getAssessmentRoles().size(); i++)
		{
			AssessmentRoleVo role = voUserAssessment.getAssessmentRoles().get(i);
			if (userHasRoleAssociated(role.getAppRole(), roleId))
			{
				if (role.getAnswerAllIsNotNull() && role.getAnswerAll().booleanValue())
				{
					return Boolean.FALSE;
				}
			}
		}
	}

	// Find if the AssessmentQuestion has the Role associated with
	for (int j = 0; j < voAssessmentQuestion.getAssessmentAnswerRole().size(); j++)
	{
		if (userHasRoleAssociated(voAssessmentQuestion.getAssessmentAnswerRole().get(j).getAppRole(), roleId))
			return Boolean.FALSE;
	}

	return Boolean.TRUE;
}
 
Example 27
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void populateRolesCombo(UserAssessmentVo voUserAssessment)
{
	form.cmbRoles().clear();
	if(voUserAssessment != null && voUserAssessment.getAssessmentRolesIsNotNull())
	{
		voUserAssessment.getAssessmentRoles().sort(new RoleComparator(SortOrder.ASCENDING));  //wdev-16161
		for (int i = 0; i < voUserAssessment.getAssessmentRoles().size(); i++)
		{
			AssessmentRoleVo voAssessmentRole = voUserAssessment.getAssessmentRoles().get(i);
			form.cmbRoles().newRow(voAssessmentRole, voAssessmentRole.getAppRoleIsNotNull()?voAssessmentRole.getAppRole().getName():"");
		}
	}
}
 
Example 28
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
protected void onCmbRolesValueChanged() throws PresentationLogicException
{
	AssessmentRoleVo voAssessmentRole = form.cmbRoles().getValue();
	UserAssessmentVo voUserAssesment = form.getLocalContext().getUserAssessmentVo();
	if(voAssessmentRole != null && (voAssessmentRole.getAnswerAll() == null || !voAssessmentRole.getAnswerAll().booleanValue()))
	{
		populateGrid(getFilteredOnRoleUserAssessment(voUserAssesment, voAssessmentRole));
	}
	else
	{
		populateGrid(voUserAssesment);
	}
}
 
Example 29
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private UserAssessmentVo getFilteredOnRoleUserAssessment(UserAssessmentVo voUserAssesmentOriginal, AssessmentRoleVo voAssessmentRole)
{
	if(voUserAssesmentOriginal == null)
		return voUserAssesmentOriginal;
	
	UserAssessmentVo voUserAssesment = (UserAssessmentVo) voUserAssesmentOriginal.clone();
	if (voUserAssesment != null && voAssessmentRole != null && voUserAssesment.getAssessmentRoles().size() > 0)
	{
		for (int i = 0; voUserAssesment.getQuestionGroupsIsNotNull() && i < voUserAssesment.getQuestionGroups().size(); i++)
		{
			boolean deleted = true;
			while (deleted)
			{
				deleted = false;
				AssessmentQuestionGroupVo voAssessQuestion = voUserAssesment.getQuestionGroups().get(i);
				for (int j = 0; j < voAssessQuestion.getQuestions().size(); j++)
				{
					AssessmentQuestionVo assessmentQuestionVo = voAssessQuestion.getQuestions().get(j);
					boolean found = isRoleAdded(voAssessmentRole, assessmentQuestionVo);

					if (found == false)
					{
						voAssessQuestion.getQuestions().remove(j);
						deleted = true;
						break;
					}
				}
			}
		}
	}

	return voUserAssesment;
}
 
Example 30
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private boolean isRoleAdded(AssessmentRoleVo voAssessmentRole, AssessmentQuestionVo assessmentQuestionVo)
{
	if(voAssessmentRole == null || assessmentQuestionVo == null)
		return false;

	for (int k = 0; k < assessmentQuestionVo.getAssessmentAnswerRole().size(); k++)
	{
		AppRoleShortVo appRoleVo = assessmentQuestionVo.getAssessmentAnswerRole().get(k).getAppRole();
		if(appRoleVo != null && appRoleVo.equals(voAssessmentRole.getAppRole()))
		{
			return true;
		}
	}
	return false;
}
 
Example 31
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private boolean isVoAdded(AppRoleShortVo voAppRole)
{
	for (int j = 0; j < form.lyrTabs().tabRoles().grdRoles().getRows().size(); j++)
	{
		AssessmentRoleVo voAssessment = form.lyrTabs().tabRoles().grdRoles().getRows().get(j).getValue();
		if(voAssessment != null && voAssessment.getAppRoleIsNotNull())
		{
			if(voAssessment.getAppRole().equals(voAppRole))
				return true;
		}
	}
	
	return false;
}
 
Example 32
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private AssessmentRoleVoCollection getRoles()
{
	AssessmentRoleVoCollection voCollection = new AssessmentRoleVoCollection();
	for (int i = 0; i < form.lyrTabs().tabRoles().grdRoles().getRows().size(); i++)
	{
		grdRolesRow rolesRow = form.lyrTabs().tabRoles().grdRoles().getRows().get(i);
		AssessmentRoleVo voAssessRole = rolesRow.getValue();
		voAssessRole.setAnswerAll(new Boolean(rolesRow.getcolAnswerAll()));
		voCollection.add(voAssessRole);
	}

	return voCollection;
}
 
Example 33
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
@SuppressWarnings("unchecked")
private AssessmentQuestionRoleVoCollection getQuestionRole(AssessmentQuestionVo voAssessmentQuestion)
{
	HashMap map = form.getLocalContext().getAssessmentRoles();
	if (map == null)
		return null;

	AssessmentQuestionRoleVoCollection voColl = new AssessmentQuestionRoleVoCollection();

	AssessmentRoleVoCollection roleVoColl = getRoles();
	for (int i = 0; i < roleVoColl.size(); i++)
	{
		AssessmentRoleVo voAssessRole = roleVoColl.get(i);
		if (voAssessRole.getAnswerAllIsNotNull() && voAssessRole.getAnswerAll().booleanValue() == false)
		{
			AssessmentQuestionVoCollection voAssQColl = (AssessmentQuestionVoCollection) map.get(voAssessRole.getAppRole().getID_AppRole());
			if (voAssQColl != null)
			{
				if (voAssQColl.indexOf(voAssessmentQuestion) >= 0)
				{
					AssessmentQuestionRoleVo voAssessQuestionRole = new AssessmentQuestionRoleVo();
					voAssessQuestionRole.setAppRole(voAssessRole.getAppRole());
					voColl.add(voAssessQuestionRole);
				}
			}
		}
	}

	return voColl;
}
 
Example 34
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   View source code 5 votes vote down vote up
private AssessmentQuestionRoleVoCollection getQuestionRole(AssessmentQuestionVo voAssessmentQuestion, HashMap assessmentRoleMap)
{
	if (assessmentRoleMap == null)
		return null;

	AssessmentQuestionRoleVoCollection voColl = new AssessmentQuestionRoleVoCollection();

	for (int i = 0; roleVoColl != null && i < roleVoColl.size(); i++)
	{
		AssessmentRoleVo voAssessRole = roleVoColl.get(i);
		if (voAssessRole.getAnswerAllIsNotNull() && voAssessRole.getAnswerAll().booleanValue() == false)
		{
			AssessmentQuestionVoCollection voAssQColl = (AssessmentQuestionVoCollection) assessmentRoleMap.get(voAssessRole.getAppRole().getID_AppRole());
			if (voAssQColl != null)
			{
				if (voAssQColl.indexOf(voAssessmentQuestion) >= 0)
				{
					AssessmentQuestionRoleVo voAssessQuestionRole = new AssessmentQuestionRoleVo();
					voAssessQuestionRole.setAppRole(voAssessRole.getAppRole());
					voColl.add(voAssessQuestionRole);
				}
			}
		}
	}

	return voColl;
}
 
Example 35
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private Boolean isQuestionRoleReadOnly(AssessmentQuestionVo voAssessmentQuestion)
{
	Integer roleId = getLoggedInRole();

	UserAssessmentVo voUserAssessment = getCurrentUserAssessment();

	// Check if there is at least one role in the User Assessment
	// If the Role has Answer All = true return false;
	if (roleId != null && voUserAssessment != null)
	{
		for (int i = 0; voUserAssessment != null && i < voUserAssessment.getAssessmentRoles().size(); i++)
		{
			AssessmentRoleVo role = voUserAssessment.getAssessmentRoles().get(i);
			if (userHasRoleAssociated(role.getAppRole(), roleId))
			{
				if (role.getAnswerAllIsNotNull() && role.getAnswerAll().booleanValue())
				{
					return Boolean.FALSE;
				}
			}
		}
	}

	// Find if the AssessmentQuestion has the Role associated with
	for (int j = 0; j < voAssessmentQuestion.getAssessmentAnswerRole().size(); j++)
	{
		if (userHasRoleAssociated(voAssessmentQuestion.getAssessmentAnswerRole().get(j).getAppRole(), roleId))
			return Boolean.FALSE;
	}

	return Boolean.TRUE;
}
 
Example 36
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void populateRolesCombo(UserAssessmentVo voUserAssessment)
{
	form.cmbRoles().clear();
	if(voUserAssessment != null && voUserAssessment.getAssessmentRolesIsNotNull())
	{
		voUserAssessment.getAssessmentRoles().sort(new RoleComparator(SortOrder.ASCENDING));  //wdev-16161
		for (int i = 0; i < voUserAssessment.getAssessmentRoles().size(); i++)
		{
			AssessmentRoleVo voAssessmentRole = voUserAssessment.getAssessmentRoles().get(i);
			form.cmbRoles().newRow(voAssessmentRole, voAssessmentRole.getAppRoleIsNotNull()?voAssessmentRole.getAppRole().getName():"");
		}
	}
}
 
Example 37
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
protected void onCmbRolesValueChanged() throws PresentationLogicException
{
	AssessmentRoleVo voAssessmentRole = form.cmbRoles().getValue();
	UserAssessmentVo voUserAssesment = form.getLocalContext().getUserAssessmentVo();
	if(voAssessmentRole != null && (voAssessmentRole.getAnswerAll() == null || !voAssessmentRole.getAnswerAll().booleanValue()))
	{
		populateGrid(getFilteredOnRoleUserAssessment(voUserAssesment, voAssessmentRole));
	}
	else
	{
		populateGrid(voUserAssesment);
	}
}
 
Example 38
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private UserAssessmentVo getFilteredOnRoleUserAssessment(UserAssessmentVo voUserAssesmentOriginal, AssessmentRoleVo voAssessmentRole)
{
	if(voUserAssesmentOriginal == null)
		return voUserAssesmentOriginal;
	
	UserAssessmentVo voUserAssesment = (UserAssessmentVo) voUserAssesmentOriginal.clone();
	if (voUserAssesment != null && voAssessmentRole != null && voUserAssesment.getAssessmentRoles().size() > 0)
	{
		for (int i = 0; voUserAssesment.getQuestionGroupsIsNotNull() && i < voUserAssesment.getQuestionGroups().size(); i++)
		{
			boolean deleted = true;
			while (deleted)
			{
				deleted = false;
				AssessmentQuestionGroupVo voAssessQuestion = voUserAssesment.getQuestionGroups().get(i);
				for (int j = 0; j < voAssessQuestion.getQuestions().size(); j++)
				{
					AssessmentQuestionVo assessmentQuestionVo = voAssessQuestion.getQuestions().get(j);
					boolean found = isRoleAdded(voAssessmentRole, assessmentQuestionVo);

					if (found == false)
					{
						voAssessQuestion.getQuestions().remove(j);
						deleted = true;
						break;
					}
				}
			}
		}
	}

	return voUserAssesment;
}
 
Example 39
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private boolean isRoleAdded(AssessmentRoleVo voAssessmentRole, AssessmentQuestionVo assessmentQuestionVo)
{
	if(voAssessmentRole == null || assessmentQuestionVo == null)
		return false;

	for (int k = 0; k < assessmentQuestionVo.getAssessmentAnswerRole().size(); k++)
	{
		AppRoleShortVo appRoleVo = assessmentQuestionVo.getAssessmentAnswerRole().get(k).getAppRole();
		if(appRoleVo != null && appRoleVo.equals(voAssessmentRole.getAppRole()))
		{
			return true;
		}
	}
	return false;
}
 
Example 40
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private boolean isVoAdded(AppRoleShortVo voAppRole)
{
	for (int j = 0; j < form.lyrTabs().tabRoles().grdRoles().getRows().size(); j++)
	{
		AssessmentRoleVo voAssessment = form.lyrTabs().tabRoles().grdRoles().getRows().get(j).getValue();
		if(voAssessment != null && voAssessment.getAppRoleIsNotNull())
		{
			if(voAssessment.getAppRole().equals(voAppRole))
				return true;
		}
	}
	
	return false;
}