Implement true question-based learning progress
The current implementation of the question-based learning progress relies on points assigned to each question's possible answer. For the learning progress, if the maximum number of points for a question has been reached, the answer is recognized as correct.
As it turns out, this implementation suffers from the problem that the answer points might get lost at some point, e.g. if questions are exported and later imported, and no new points are assigned.
Classic solution
Note: This solution for ARSnova v3 was never implemented. It is here for documentation purposes only. However, a somewhat similar solution has been created for v2.
Here is a proposal to implement a true question-based learning progress, which does not rely on an underlying scoring scheme, but rather takes into account the answer options the teacher has marked as correct.
Data flow
- (A) Get a list of all questions available in a Room. Disabled questions should be ignored. This could be implemented using the method
CouchDbContentRepository::findByRoomIdForSpeaker
. (1 database call per Room) - (B) For each question, get all answers: A possibility would be to use
CouchDbAnswerRepository::findStubsByContentId
. There is also a possibility to get answers for multiple content ids, which might also work in this context. (A database calls for the former, 1 for the latter) - (C) Since the previous step only loads answer ids, we need to do another step to load the full answer documents. An option would be to use CouchDB's "bulk get" feature available at the location
/{db}/_bulk_get
, if this is not already implemented by our CouchDB library. (1 database call)
This should result in A+2 database calls for a Room in the worst case, and just 3 in the best case. However, it might be possible that _bulk_get
requests are not cached by CouchDB, resulting in a very expensive call.
Implementation
Straight forward implementation: The database already creates our domain objects, so we simply add a new method isCorrect
to the Answer class which receives the list of AnswerOption
s. The method is responsible for determining if it is a correct answer given the options. The respective calls can all be implemented in the existing QuestionBasedScoreCalculator
.