diff --git a/assessment/archetype.go b/assessment/archetype.go index cc905f1c7..d19257c00 100644 --- a/assessment/archetype.go +++ b/assessment/archetype.go @@ -85,7 +85,7 @@ func (r *ArchetypeResolver) Confidence() (confidence int) { // Assessed returns whether the archetype has been fully assessed. func (r *ArchetypeResolver) Assessed() (assessed bool) { if r.questionnaire == nil { - return + return false } assessed = r.questionnaire.Assessed(r.RequiredAssessments()) return diff --git a/assessment/questionnaire.go b/assessment/questionnaire.go index 905520c9e..eb3da056f 100644 --- a/assessment/questionnaire.go +++ b/assessment/questionnaire.go @@ -47,6 +47,9 @@ func (r *QuestionnaireResolver) Required(id uint) (required bool) { // Assessed returns whether a slice contains a completed assessment for each of the required // questionnaires. func (r *QuestionnaireResolver) Assessed(assessments []Assessment) (assessed bool) { + if r.requiredQuestionnaires.Size() == 0 { + return false + } answered := NewSet() for _, a := range assessments { if r.requiredQuestionnaires.Contains(a.QuestionnaireID) {