use of org.olat.ims.qti.statistics.QTIStatisticSearchParams in project OpenOLAT by OpenOLAT.
the class QTIStatisticsManagerLargeTest method testItemStatistics_multipleChoice_1.
@Test
public void testItemStatistics_multipleChoice_1() {
QTIItemObject itemObject = itemObjects.get(1);
double maxValue = Double.parseDouble(itemObject.getItemMaxValue());
QTIStatisticSearchParams searchParams = new QTIStatisticSearchParams(olatResource, olatResourceDetail);
StatisticsItem stats = qtim.getItemStatistics(itemObject.getItemIdent(), maxValue, searchParams);
double difficulty = rightAnswersQ2 / (double) numberOfParticipants;
Assert.assertEquals(difficulty, stats.getDifficulty(), 0.1);
Assert.assertEquals(scoreQ2, stats.getAverageScore(), 0.1);
Assert.assertEquals(wrongAnswersQ2, stats.getNumOfIncorrectAnswers());
Assert.assertEquals(numberOfParticipants - wrongAnswersQ2, stats.getNumOfCorrectAnswers());
}
use of org.olat.ims.qti.statistics.QTIStatisticSearchParams in project OpenOLAT by OpenOLAT.
the class QTIStatisticsManagerLargeTest method testStatistics.
@Test
public void testStatistics() {
long start = System.currentTimeMillis();
QTIStatisticSearchParams searchParams = new QTIStatisticSearchParams(olatResource, olatResourceDetail);
StatisticAssessment stats = qtim.getAssessmentStatistics(searchParams);
log.info("Statistics of resource takes (ms): " + (System.currentTimeMillis() - start));
Assert.assertNotNull(stats);
Assert.assertEquals(averageScore, stats.getAverage(), 0.01);
Assert.assertEquals(numberOfParticipants, stats.getNumOfParticipants());
Assert.assertEquals(numberOfTestFailed, stats.getNumOfFailed());
Assert.assertEquals(numberOfTestPassed, stats.getNumOfPassed());
double maxScore = scorePerParticipant.get(scorePerParticipant.size() - 1).doubleValue();
double minScore = scorePerParticipant.get(0).doubleValue();
double range = maxScore - minScore;
Assert.assertEquals(maxScore, stats.getMaxScore(), 0.1);
Assert.assertEquals(minScore, stats.getMinScore(), 0.1);
Assert.assertEquals(range, stats.getRange(), 0.1);
Assert.assertEquals(averageDuration, stats.getAverageDuration(), 2);
Assert.assertTrue(stats.getStandardDeviation() > 0);
Assert.assertTrue(stats.getMedian() > 0);
Assert.assertNotNull(stats.getDurations());
Assert.assertNotNull(stats.getScores());
Assert.assertNotNull(stats.getMode());
Assert.assertFalse(stats.getMode().isEmpty());
}
use of org.olat.ims.qti.statistics.QTIStatisticSearchParams in project OpenOLAT by OpenOLAT.
the class QTIStatisticsManagerLargeTest method testAnswerTexts.
@Test
public void testAnswerTexts() {
QTIStatisticSearchParams searchParams = new QTIStatisticSearchParams(olatResource, olatResourceDetail);
List<String> answers = qtim.getAnswers("QTIEDIT:FIB:1000010792", searchParams);
Assert.assertTrue(answers.containsAll(fibAnswers));
Assert.assertTrue(fibAnswers.containsAll(answers));
}
use of org.olat.ims.qti.statistics.QTIStatisticSearchParams in project OpenOLAT by OpenOLAT.
the class IQSURVCourseNode method createStatisticNodeResult.
@Override
public StatisticResourceResult createStatisticNodeResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, StatisticResourceOption options, QTIType... types) {
if (!isQTITypeAllowed(types))
return null;
Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
OLATResourceable courseOres = OresHelper.createOLATResourceableInstance("CourseModule", courseId);
RepositoryEntry qtiSurveyEntry = getReferencedRepositoryEntry();
if (ImsQTI21Resource.TYPE_NAME.equals(qtiSurveyEntry.getOlatResource().getResourceableTypeName())) {
RepositoryEntry courseEntry = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
QTI21StatisticSearchParams searchParams = new QTI21StatisticSearchParams(qtiSurveyEntry, courseEntry, getIdent());
searchParams.setLimitToGroups(options.getParticipantsGroups());
QTI21DeliveryOptions deliveryOptions = CoreSpringFactory.getImpl(QTI21Service.class).getDeliveryOptions(qtiSurveyEntry);
boolean admin = userCourseEnv.isAdmin();
QTI21StatisticsSecurityCallback secCallback = new QTI21StatisticsSecurityCallback(admin, admin && deliveryOptions.isAllowAnonym());
return new QTI21StatisticResourceResult(qtiSurveyEntry, courseEntry, this, searchParams, secCallback);
}
QTIStatisticSearchParams searchParams = new QTIStatisticSearchParams(courseOres.getResourceableId(), getIdent());
searchParams.setLimitToGroups(options.getParticipantsGroups());
return new QTIStatisticResourceResult(courseOres, this, qtiSurveyEntry, searchParams);
}
use of org.olat.ims.qti.statistics.QTIStatisticSearchParams in project openolat by klemens.
the class QTIStatisticsManagerLargeTest method testItemStatistics_singleChoice_0.
@Test
public void testItemStatistics_singleChoice_0() {
QTIItemObject itemObject = itemObjects.get(0);
double maxValue = Double.parseDouble(itemObject.getItemMaxValue());
QTIStatisticSearchParams searchParams = new QTIStatisticSearchParams(olatResource, olatResourceDetail);
StatisticsItem stats = qtim.getItemStatistics(itemObject.getItemIdent(), maxValue, searchParams);
Assert.assertEquals(scoreQ1, stats.getAverageScore(), 0.1);
}
Aggregations