Add daily study missions
This commit is contained in:
@@ -17,7 +17,8 @@ public sealed class ReviewQueueController(
|
||||
QuestionBookmarkStore bookmarks,
|
||||
CreditStore credits,
|
||||
MasteryAwardService masteryAwards,
|
||||
StudySessionStore studySessions) : ControllerBase
|
||||
StudySessionStore studySessions,
|
||||
DailyMissionStore dailyMissions) : ControllerBase
|
||||
{
|
||||
[HttpPost("next")]
|
||||
public async Task<IActionResult> Next([FromBody] ReviewQueueNextRequest req)
|
||||
@@ -107,6 +108,8 @@ public sealed class ReviewQueueController(
|
||||
awards.AddRange(studySession.Summary.CoinAwards.Where(value =>
|
||||
value.ReasonCode == CreditReasonCodes.SessionGoalComplete
|
||||
&& awards.All(existing => existing.ReasonCode != value.ReasonCode)));
|
||||
var missionResult = await dailyMissions.RecordReviewAsync(userId, result.Attempt);
|
||||
if (missionResult is not null) awards.AddRange(missionResult.CreditAwards);
|
||||
return Ok(new ReviewQueueAttemptResponse
|
||||
{
|
||||
QuestionExternalId = question.ExternalId,
|
||||
@@ -116,7 +119,8 @@ public sealed class ReviewQueueController(
|
||||
Credits = await credits.GetStatusAsync(userId),
|
||||
CreditAwards = awards,
|
||||
StudySessionProgress = studySession?.Progress,
|
||||
SessionSummary = studySession?.Summary
|
||||
SessionSummary = studySession?.Summary,
|
||||
DailyMissions = missionResult?.State
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user