Skip to content

Commit

Permalink
Don't count autoanswered qs for started status
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Lucidi <[email protected]>
  • Loading branch information
mansam committed Jul 9, 2024
1 parent 8bfd399 commit f8e140b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion assessment/assessment.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (r *Section) Complete() bool {
// Started returns whether any questions in the section have been answered.
func (r *Section) Started() bool {
for _, q := range r.Questions {
if q.Answered() {
if q.Answered() && !q.AutoAnswered() {
return true
}
}
Expand Down Expand Up @@ -194,6 +194,17 @@ func (r *Question) Answered() bool {
return false
}

// AutoAnswered returns whether the question has had an
// answer pre-selected by the system.
func (r *Question) AutoAnswered() bool {
for _, a := range r.Answers {
if a.AutoAnswered {
return true
}
}
return false
}

// Tags returns any tags to be applied based on how the question is answered.
func (r *Question) Tags() (tags []CategorizedTag) {
for _, answer := range r.Answers {
Expand Down

0 comments on commit f8e140b

Please sign in to comment.