Search in sources :

Example 11 with QTIStatisticSearchParams

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());
}
Also used : QTIStatisticSearchParams(org.olat.ims.qti.statistics.QTIStatisticSearchParams) QTIItemObject(org.olat.ims.qti.export.helper.QTIItemObject) StatisticsItem(org.olat.ims.qti.statistics.model.StatisticsItem) Test(org.junit.Test)

Example 12 with QTIStatisticSearchParams

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());
}
Also used : QTIStatisticSearchParams(org.olat.ims.qti.statistics.QTIStatisticSearchParams) StatisticAssessment(org.olat.ims.qti.statistics.model.StatisticAssessment) Test(org.junit.Test)

Example 13 with QTIStatisticSearchParams

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));
}
Also used : QTIStatisticSearchParams(org.olat.ims.qti.statistics.QTIStatisticSearchParams) Test(org.junit.Test)

Example 14 with QTIStatisticSearchParams

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);
}
Also used : QTI21DeliveryOptions(org.olat.ims.qti21.QTI21DeliveryOptions) QTIStatisticSearchParams(org.olat.ims.qti.statistics.QTIStatisticSearchParams) QTI21Service(org.olat.ims.qti21.QTI21Service) OLATResourceable(org.olat.core.id.OLATResourceable) QTI21StatisticSearchParams(org.olat.ims.qti21.model.QTI21StatisticSearchParams) QTI21StatisticResourceResult(org.olat.ims.qti21.ui.statistics.QTI21StatisticResourceResult) QTIStatisticResourceResult(org.olat.ims.qti.statistics.QTIStatisticResourceResult) QTI21StatisticsSecurityCallback(org.olat.ims.qti21.ui.statistics.QTI21StatisticsSecurityCallback) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 15 with QTIStatisticSearchParams

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);
}
Also used : QTIStatisticSearchParams(org.olat.ims.qti.statistics.QTIStatisticSearchParams) QTIItemObject(org.olat.ims.qti.export.helper.QTIItemObject) StatisticsItem(org.olat.ims.qti.statistics.model.StatisticsItem) Test(org.junit.Test)

Aggregations

QTIStatisticSearchParams (org.olat.ims.qti.statistics.QTIStatisticSearchParams)20 Test (org.junit.Test)16 RepositoryEntry (org.olat.repository.RepositoryEntry)10 Identity (org.olat.core.id.Identity)6 QTIItemObject (org.olat.ims.qti.export.helper.QTIItemObject)6 StatisticsItem (org.olat.ims.qti.statistics.model.StatisticsItem)6 OLATResourceable (org.olat.core.id.OLATResourceable)4 QTIResultSet (org.olat.ims.qti.QTIResultSet)4 QTIStatisticResourceResult (org.olat.ims.qti.statistics.QTIStatisticResourceResult)4 StatisticAssessment (org.olat.ims.qti.statistics.model.StatisticAssessment)4 QTI21StatisticSearchParams (org.olat.ims.qti21.model.QTI21StatisticSearchParams)4 QTI21StatisticResourceResult (org.olat.ims.qti21.ui.statistics.QTI21StatisticResourceResult)4 QTI21StatisticsSecurityCallback (org.olat.ims.qti21.ui.statistics.QTI21StatisticsSecurityCallback)4 QTIResult (org.olat.ims.qti.QTIResult)2 QTIStatisticResult (org.olat.ims.qti.statistics.model.QTIStatisticResult)2 QTIStatisticResultSet (org.olat.ims.qti.statistics.model.QTIStatisticResultSet)2 QTI21DeliveryOptions (org.olat.ims.qti21.QTI21DeliveryOptions)2 QTI21Service (org.olat.ims.qti21.QTI21Service)2