Skip to content
Snippets Groups Projects
Commit 7261488b authored by srosse's avatar srosse
Browse files

OO-5047: load in assessment tool QTI completion/start data

parent 1d879736
No related branches found
No related tags found
No related merge requests found
...@@ -34,15 +34,21 @@ public class ExtraInfos implements Comparable<ExtraInfos> { ...@@ -34,15 +34,21 @@ public class ExtraInfos implements Comparable<ExtraInfos> {
private Integer compensationExtraTimeInSeconds; private Integer compensationExtraTimeInSeconds;
private final Date start; private final Date start;
private final BigDecimal maxScore; private final BigDecimal maxScore;
private final Double completion;
public ExtraInfos() { public ExtraInfos() {
this(null, null, null); this(null, null, null, null);
} }
public ExtraInfos(Integer extraTimeInSeconds, Date start, BigDecimal maxScore) { public ExtraInfos(Integer extraTimeInSeconds, Date start, Double completion, BigDecimal maxScore) {
this.extraTimeInSeconds = extraTimeInSeconds; this.extraTimeInSeconds = extraTimeInSeconds;
this.start = start; this.start = start;
this.maxScore = maxScore; this.maxScore = maxScore;
this.completion = completion;
}
public Double getCompletion() {
return completion;
} }
public Integer getExtraTimeInSeconds() { public Integer getExtraTimeInSeconds() {
......
...@@ -273,6 +273,12 @@ public class IQIdentityListCourseNodeController extends IdentityListCourseNodeCo ...@@ -273,6 +273,12 @@ public class IQIdentityListCourseNodeController extends IdentityListCourseNodeCo
row.setDetails(infos); row.setDetails(infos);
} }
row.setMaxScore(infos.getMaxScore()); row.setMaxScore(infos.getMaxScore());
if(infos.getCompletion() != null) {
row.getCurrentCompletion().setCompletion(infos.getCompletion());
}
if(infos.getStart() != null) {
row.getCurrentRunStart().setDate(infos.getStart());
}
} }
} }
...@@ -299,12 +305,17 @@ public class IQIdentityListCourseNodeController extends IdentityListCourseNodeCo ...@@ -299,12 +305,17 @@ public class IQIdentityListCourseNodeController extends IdentityListCourseNodeCo
Long identityKey = session.getIdentity().getKey(); Long identityKey = session.getIdentity().getKey();
if(currentIdentityKey == null || !currentIdentityKey.equals(identityKey)) { if(currentIdentityKey == null || !currentIdentityKey.equals(identityKey)) {
Date start = null; Date start = null;
Double completion = null;
Integer extraTimeInSeconds = null; Integer extraTimeInSeconds = null;
if(session.getFinishTime() == null && session.getExtraTime() != null) { if(session.getFinishTime() == null && session.getTerminationTime() == null) {
extraTimeInSeconds = session.getExtraTime();
start = session.getCreationDate(); start = session.getCreationDate();
extraTimeInSeconds = session.getExtraTime();
if(session.getNumOfQuestions() != null && session.getNumOfAnsweredQuestions() != null) {
completion = session.getNumOfAnsweredQuestions().doubleValue() / session.getNumOfQuestions().doubleValue();
}
} }
ExtraInfos infos = new ExtraInfos(extraTimeInSeconds, start, session.getMaxScore());
ExtraInfos infos = new ExtraInfos(extraTimeInSeconds, start, completion, session.getMaxScore());
identityToExtraTime.put(identityKey, infos); identityToExtraTime.put(identityKey, infos);
currentIdentityKey = identityKey; currentIdentityKey = identityKey;
} }
......
...@@ -909,7 +909,7 @@ public class QTI21AssessmentRunController extends BasicController implements Gen ...@@ -909,7 +909,7 @@ public class QTI21AssessmentRunController extends BasicController implements Gen
if(!configRef) { if(!configRef) {
int timeLimit = config.getIntegerSafe(IQEditController.CONFIG_KEY_TIME_LIMIT, -1); int timeLimit = config.getIntegerSafe(IQEditController.CONFIG_KEY_TIME_LIMIT, -1);
if(timeLimit > 0) { if(timeLimit > 0) {
maxTimeLimit = new Long(timeLimit); maxTimeLimit = Long.valueOf(timeLimit);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment