use of org.olat.course.nodes.QTICourseNode in project OpenOLAT by OpenOLAT.
the class AttemptsRuleEditor method searchAttemptableNodes.
private void searchAttemptableNodes(CourseNode courseNode, List<CourseNode> nodes) {
if (courseNode instanceof AssessableCourseNode) {
AssessableCourseNode assessableCourseNode = (AssessableCourseNode) courseNode;
if (assessableCourseNode.hasAttemptsConfigured()) {
nodes.add(courseNode);
}
} else if (courseNode instanceof QTICourseNode) {
QTICourseNode assessableCourseNode = (QTICourseNode) courseNode;
if (assessableCourseNode.hasAttemptsConfigured()) {
nodes.add(courseNode);
}
}
for (int i = 0; i < courseNode.getChildCount(); i++) {
CourseNode child = (CourseNode) courseNode.getChildAt(i);
searchAttemptableNodes(child, nodes);
}
}
use of org.olat.course.nodes.QTICourseNode in project openolat by klemens.
the class AttemptsRuleEditor method searchAttemptableNodes.
private void searchAttemptableNodes(CourseNode courseNode, List<CourseNode> nodes) {
if (courseNode instanceof AssessableCourseNode) {
AssessableCourseNode assessableCourseNode = (AssessableCourseNode) courseNode;
if (assessableCourseNode.hasAttemptsConfigured()) {
nodes.add(courseNode);
}
} else if (courseNode instanceof QTICourseNode) {
QTICourseNode assessableCourseNode = (QTICourseNode) courseNode;
if (assessableCourseNode.hasAttemptsConfigured()) {
nodes.add(courseNode);
}
}
for (int i = 0; i < courseNode.getChildCount(); i++) {
CourseNode child = (CourseNode) courseNode.getChildAt(i);
searchAttemptableNodes(child, nodes);
}
}
use of org.olat.course.nodes.QTICourseNode in project OpenOLAT by OpenOLAT.
the class IQConfigurationController method doConfirmChangeTestAndSurvey.
/**
* This check if there is some QTI 2.1 results for the current selected test.
*
* @param ureq
* @param newEntry
*/
private void doConfirmChangeTestAndSurvey(UserRequest ureq, RepositoryEntry newEntry) {
try {
RepositoryEntry currentEntry = courseNode.getReferencedRepositoryEntry();
RepositoryEntry courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
int numOfAssessedIdentities = 0;
if (currentEntry != null) {
List<AssessmentTestSession> assessmentTestSessions = qti21service.getAssessmentTestSessions(courseEntry, courseNode.getIdent(), currentEntry);
Set<Identity> assessedIdentities = new HashSet<>();
for (AssessmentTestSession assessmentTestSession : assessmentTestSessions) {
if (StringHelper.containsNonWhitespace(assessmentTestSession.getAnonymousIdentifier())) {
numOfAssessedIdentities++;
} else if (assessmentTestSession.getIdentity() != null) {
assessedIdentities.add(assessmentTestSession.getIdentity());
}
}
numOfAssessedIdentities += assessedIdentities.size();
}
if (numOfAssessedIdentities > 0) {
confirmChangeResourceCtrl = new ConfirmChangeResourceController(ureq, getWindowControl(), course, (QTICourseNode) courseNode, newEntry, currentEntry, numOfAssessedIdentities);
listenTo(confirmChangeResourceCtrl);
cmc = new CloseableModalController(getWindowControl(), translate("close"), confirmChangeResourceCtrl.getInitialComponent());
listenTo(cmc);
cmc.activate();
} else {
doChangeResource(ureq, newEntry);
}
} catch (Exception e) {
logError("", e);
showError("error.resource.corrupted");
}
}
use of org.olat.course.nodes.QTICourseNode in project openolat by klemens.
the class IQConfigurationController method doConfirmChangeTestAndSurvey.
/**
* This check if there is some QTI 2.1 results for the current selected test.
*
* @param ureq
* @param newEntry
*/
private void doConfirmChangeTestAndSurvey(UserRequest ureq, RepositoryEntry newEntry) {
try {
RepositoryEntry currentEntry = courseNode.getReferencedRepositoryEntry();
RepositoryEntry courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
int numOfAssessedIdentities = 0;
if (currentEntry != null) {
List<AssessmentTestSession> assessmentTestSessions = qti21service.getAssessmentTestSessions(courseEntry, courseNode.getIdent(), currentEntry);
Set<Identity> assessedIdentities = new HashSet<>();
for (AssessmentTestSession assessmentTestSession : assessmentTestSessions) {
if (StringHelper.containsNonWhitespace(assessmentTestSession.getAnonymousIdentifier())) {
numOfAssessedIdentities++;
} else if (assessmentTestSession.getIdentity() != null) {
assessedIdentities.add(assessmentTestSession.getIdentity());
}
}
numOfAssessedIdentities += assessedIdentities.size();
}
if (numOfAssessedIdentities > 0) {
confirmChangeResourceCtrl = new ConfirmChangeResourceController(ureq, getWindowControl(), course, (QTICourseNode) courseNode, newEntry, currentEntry, numOfAssessedIdentities);
listenTo(confirmChangeResourceCtrl);
cmc = new CloseableModalController(getWindowControl(), translate("close"), confirmChangeResourceCtrl.getInitialComponent());
listenTo(cmc);
cmc.activate();
} else {
doChangeResource(ureq, newEntry);
}
} catch (Exception e) {
logError("", e);
showError("error.resource.corrupted");
}
}
Aggregations