Java Code Examples for ims.assessment.vo.AssessmentRoleVo.getAnswerAllIsNotNull()

The following are Jave code examples for showing how to use getAnswerAllIsNotNull() of the ims.assessment.vo.AssessmentRoleVo class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 2
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 3
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
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: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
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   Source Code and License Vote up 6 votes
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 6
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
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 7
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 6 votes
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-linux   File: Logic.java   Source Code and License Vote up 6 votes
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: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
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 10
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
@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 11
Project: AvoinApotti   File: StructuredAssessmentsHelper.java   Source Code and License Vote up 5 votes
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 12
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
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 13
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
@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 14
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License Vote up 5 votes
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 15
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
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 16
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
@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 17
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License Vote up 5 votes
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 18
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 5 votes
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 19
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 5 votes
@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 20
Project: openmaxims-linux   File: StructuredAssessmentsHelper.java   Source Code and License Vote up 5 votes
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;
}