Investigate offering selection when submitting
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
IVLE |
Triaged
|
High
|
Unassigned |
Bug Description
In ivle.webapp.
return Store.of(
).one()
That means, find the offering as follows:
- Find the subject S with the short name matching the second-level directory in the user's repo (FAIL if the user is not in a directory named after a known subject),
- Find all offerings O for subject S,
- Drop any offering which is not a) in a "current" semester, AND b) the user is not enrolled in,
- Fail if the offering set O is empty. Otherwise, take one offering, and return it.
There are a few problems with this:
- Many failure conditions (not in a subject directory, user not enrolled, or user enrolled in an offering which is not current). With the fix for bug #526853, we handle this by giving a vague error message. We should detect exactly why it failed.
- Possibility of multiple offerings matching the query. If there are two offerings of the same subject which are both in a "current" semester for some reason, then it is undefined which offering is being submitted to. I don't know what .one() does if there are multiple results (error, or just pick one?). We should figure out a strategy for handling this case.