Index: lams_common/src/java/org/lamsfoundation/lams/qb/dao/hibernate/QbDAO.java =================================================================== diff -u -ra877783c149792ee254d184632ae890d32dab40e -r83fc3f4fbaa1c8985a2ecdaa48627c489b515a66 --- lams_common/src/java/org/lamsfoundation/lams/qb/dao/hibernate/QbDAO.java (.../QbDAO.java) (revision a877783c149792ee254d184632ae890d32dab40e) +++ lams_common/src/java/org/lamsfoundation/lams/qb/dao/hibernate/QbDAO.java (.../QbDAO.java) (revision 83fc3f4fbaa1c8985a2ecdaa48627c489b515a66) @@ -43,25 +43,25 @@ private static final String FIND_ANSWER_STATS_BY_QB_QUESTION = "SELECT COALESCE(a.qb_option_uid, aa.question_option_uid) AS opt, COUNT(a.answer_uid) " + "FROM lams_qb_tool_question AS tq JOIN lams_qb_tool_answer AS a USING (tool_question_uid) " + "LEFT JOIN tl_lascrt11_answer_log AS sa ON a.answer_uid = sa.uid " - + "LEFT JOIN tl_lascrt11_session AS ss ON sa.session_id = ss.session_id " + + "LEFT JOIN tl_lascrt11_session AS ss ON sa.session_id = ss.session_id AND ss.scratching_finished = 1 " + "LEFT JOIN tl_lascrt11_user AS su ON ss.uid = su.session_uid " + "LEFT JOIN tl_laasse10_option_answer AS aa ON a.answer_uid = aa.question_result_uid AND aa.answer_boolean = 1 " + "WHERE tq.qb_question_uid = :qbQuestionUid GROUP BY opt HAVING opt IS NOT NULL"; - private static final String FIND_ANSWERS_BY_ACTIVITY = "SELECT COALESCE(mcu.que_usr_id, su.user_id, au.user_id), " + private static final String FIND_ANSWERS_BY_ACTIVITY = "SELECT COALESCE(mcu.que_usr_id, su.user_id, au.user_id) AS user_id, " + "COALESCE(a.qb_option_uid, aa.question_option_uid) AS opt " + "FROM lams_learning_activity AS act JOIN lams_qb_tool_question AS tq USING (tool_content_id) " + "JOIN lams_qb_tool_answer AS a USING (tool_question_uid) " + "LEFT JOIN tl_lamc11_usr_attempt AS mca ON a.answer_uid = mca.uid " + "LEFT JOIN tl_lamc11_que_usr AS mcu ON mca.que_usr_id = mcu.uid " + "LEFT JOIN tl_lascrt11_answer_log AS sa ON a.answer_uid = sa.uid " - + "LEFT JOIN tl_lascrt11_session AS ss ON sa.session_id = ss.session_id " - + "LEFT JOIN tl_lascrt11_user AS su ON ss.uid = su.session_uid " + + "LEFT JOIN tl_lascrt11_session AS ss ON sa.session_id = ss.session_id AND ss.scratching_finished = 1 " + + "LEFT JOIN tl_lascrt11_user AS su ON ss.uid = su.session_uid AND su.session_finished = 1 " + "LEFT JOIN tl_laasse10_option_answer AS aa ON a.answer_uid = aa.question_result_uid AND aa.answer_boolean = 1 " + "LEFT JOIN tl_laasse10_question_result AS aq ON a.answer_uid = aq.uid " - + "LEFT JOIN tl_laasse10_assessment_result AS ar ON aq.result_uid = ar.uid " - + "LEFT JOIN tl_laasse10_user AS au ON ar.user_uid = au.uid " - + "WHERE act.activity_id = :activityId AND tq.qb_question_uid = :qbQuestionUid HAVING opt IS NOT NULL"; + + "LEFT JOIN tl_laasse10_assessment_result AS ar ON aq.result_uid = ar.uid AND ar.finish_date IS NOT NULL AND ar.latest = 1 " + + "LEFT JOIN tl_laasse10_user AS au ON ar.user_uid = au.uid AND au.session_finished = 1 " + + "WHERE act.activity_id = :activityId AND tq.qb_question_uid = :qbQuestionUid HAVING opt IS NOT NULL AND user_id IS NOT NULL"; private static final String FIND_BURNING_QUESTIONS = "SELECT b.question, COUNT(bl.uid) FROM ScratchieBurningQuestion b LEFT OUTER JOIN " + "BurningQuestionLike AS bl ON bl.burningQuestion = b WHERE b.scratchieItem.qbQuestion.uid = :qbQuestionUid " Index: lams_common/src/java/org/lamsfoundation/lams/qb/dto/QbStatsActivityDTO.java =================================================================== diff -u -r89279cb44b252167269043889b3c3c0a4164e0bb -r83fc3f4fbaa1c8985a2ecdaa48627c489b515a66 --- lams_common/src/java/org/lamsfoundation/lams/qb/dto/QbStatsActivityDTO.java (.../QbStatsActivityDTO.java) (revision 89279cb44b252167269043889b3c3c0a4164e0bb) +++ lams_common/src/java/org/lamsfoundation/lams/qb/dto/QbStatsActivityDTO.java (.../QbStatsActivityDTO.java) (revision 83fc3f4fbaa1c8985a2ecdaa48627c489b515a66) @@ -7,7 +7,7 @@ private ToolActivity activity; private QbQuestion qbQuestion; private String monitorURL; - private Integer participantCount; + private int participantCount; private Double difficultyIndex; private Double discriminationIndex; private Double pointBiserial; @@ -36,12 +36,12 @@ this.monitorURL = monitorURL; } - public Integer getParticipantCount() { + public int getParticipantCount() { return participantCount; } - public void setParticipantCount(Integer testParticipantCount) { - this.participantCount = testParticipantCount; + public void setParticipantCount(int participantCount) { + this.participantCount = participantCount; } public Double getDifficultyIndex() { Index: lams_common/src/java/org/lamsfoundation/lams/qb/service/QbService.java =================================================================== diff -u -r6ab5362f57823898853d4c3c61450504a1bc857c -r83fc3f4fbaa1c8985a2ecdaa48627c489b515a66 --- lams_common/src/java/org/lamsfoundation/lams/qb/service/QbService.java (.../QbService.java) (revision 6ab5362f57823898853d4c3c61450504a1bc857c) +++ lams_common/src/java/org/lamsfoundation/lams/qb/service/QbService.java (.../QbService.java) (revision 83fc3f4fbaa1c8985a2ecdaa48627c489b515a66) @@ -235,7 +235,6 @@ QbStatsActivityDTO activityDTO = new QbStatsActivityDTO(); activityDTO.setActivity(activity); - activityDTO.setParticipantCount(participantCount); String monitorUrl = "/lams/" + lamsCoreToolService.getToolMonitoringURL(lessonId, activity) + "&contentFolderID=" + learningDesign.getContentFolderID(); @@ -245,6 +244,12 @@ if (participantCount >= Configuration.getAsInt(ConfigurationKeys.QB_STATS_MIN_PARTICIPANTS)) { // mapping of user ID -> option UID Map activityAnswers = qbDAO.getAnswersForActivity(activity.getActivityId(), qbQuestionUid); + // take only learners who finished (not only submitted) this activity + userLessonGrades = userLessonGrades.stream().filter(g -> activityAnswers.containsKey(g.getLearner().getUserId())) + .collect(Collectors.toList()); + participantCount = userLessonGrades.size(); + activityDTO.setParticipantCount(participantCount); + // see who answered correctly Set correctUserIds = new HashSet<>(); for (Entry answer : activityAnswers.entrySet()) { Index: lams_tool_assessment/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -raa932dd995a61adeed918456c6257a4a9a9cea74 -r83fc3f4fbaa1c8985a2ecdaa48627c489b515a66 --- lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision aa932dd995a61adeed918456c6257a4a9a9cea74) +++ lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 83fc3f4fbaa1c8985a2ecdaa48627c489b515a66) @@ -351,7 +351,7 @@ message.qb.modified.update = The question in Question Bank will be updated message.qb.modified.version = A new version of the question will be created in Question Bank message.qb.modified.new = A new question will be created in Question Bank -label.qb.stats = Item analysis +label.qb.stats = Post-activity item analysis label.qb.participant.count = Test participant count label.qb.difficulty.index = Difficulty index label.qb.discrimination.index = Discrimination index @@ -429,7 +429,7 @@ label.group.stats = Groups Analytics label.median.mark = Median: label.modes.mark = Mode: -label.qb.stats.tooltip = Item analysis is a technique that analyses the student answers to evaluate the effectiveness of questions in an exam. +label.qb.stats.tooltip = Item analysis is a technique that analyses the student answers to evaluate the effectiveness of questions in an exam. Only students who finished the activity are taken into consideration. label.qb.difficulty.index.tooltip = The difficulty index represents a percentage of the students responses that answered the question correctly. This metric takes a value between 0 and 1. High values indicate that the question is easy, while low values indicate that is difficult. label.qb.discrimination.index.tooltip = Discrimination index measures how well a question distinguishes between students with more knowledge or skill from those with less. Values close to +1 indicate that the question does a good job of discriminating between high performers and low performers. label.qb.point.biserial.tooltip = Point-biserial measures the correlation between the scores on the entire exam and the scores on the single question (where 1 = correct answer and 0 = incorrect answer). A large correlation indicates that a question is measuring the same construct as the overall exam measures. Index: lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -raa932dd995a61adeed918456c6257a4a9a9cea74 -r83fc3f4fbaa1c8985a2ecdaa48627c489b515a66 --- lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision aa932dd995a61adeed918456c6257a4a9a9cea74) +++ lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 83fc3f4fbaa1c8985a2ecdaa48627c489b515a66) @@ -351,7 +351,7 @@ message.qb.modified.update = The question in Question Bank will be updated message.qb.modified.version = A new version of the question will be created in Question Bank message.qb.modified.new = A new question will be created in Question Bank -label.qb.stats = Item analysis +label.qb.stats = Post-activity item analysis label.qb.participant.count = Test participant count label.qb.difficulty.index = Difficulty index label.qb.discrimination.index = Discrimination index @@ -429,7 +429,7 @@ label.group.stats = Groups Analytics label.median.mark = Median: label.modes.mark = Mode: -label.qb.stats.tooltip = Item analysis is a technique that analyses the student answers to evaluate the effectiveness of questions in an exam. +label.qb.stats.tooltip = Item analysis is a technique that analyses the student answers to evaluate the effectiveness of questions in an exam. Only students who finished the activity are taken into consideration. label.qb.difficulty.index.tooltip = The difficulty index represents a percentage of the students responses that answered the question correctly. This metric takes a value between 0 and 1. High values indicate that the question is easy, while low values indicate that is difficult. label.qb.discrimination.index.tooltip = Discrimination index measures how well a question distinguishes between students with more knowledge or skill from those with less. Values close to +1 indicate that the question does a good job of discriminating between high performers and low performers. label.qb.point.biserial.tooltip = Point-biserial measures the correlation between the scores on the entire exam and the scores on the single question (where 1 = correct answer and 0 = incorrect answer). A large correlation indicates that a question is measuring the same construct as the overall exam measures. Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dao/hibernate/ScratchieSessionDAOHibernate.java =================================================================== diff -u -r5aabc63ac1eb20bb16e7b586981129b3208323e3 -r83fc3f4fbaa1c8985a2ecdaa48627c489b515a66 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dao/hibernate/ScratchieSessionDAOHibernate.java (.../ScratchieSessionDAOHibernate.java) (revision 5aabc63ac1eb20bb16e7b586981129b3208323e3) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dao/hibernate/ScratchieSessionDAOHibernate.java (.../ScratchieSessionDAOHibernate.java) (revision 83fc3f4fbaa1c8985a2ecdaa48627c489b515a66) @@ -52,6 +52,7 @@ private static final String LOAD_MARKS = "SELECT mark FROM tl_lascrt11_session session " + " JOIN tl_lascrt11_scratchie scratchie ON session.scratchie_uid = scratchie.uid " + " WHERE session.scratching_finished = 1 AND scratchie.content_id = :toolContentId"; + private static final String FIND_MARK_STATS = "SELECT MIN(mark) min_grade, AVG(mark) avg_grade, MAX(mark) max_grade, COUNT(mark) num_complete " + " FROM tl_lascrt11_session session " + " JOIN tl_lascrt11_scratchie scratchie ON session.scratchie_uid = scratchie.uid "