Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa-binesh committed Oct 4, 2023
1 parent 6a2eaeb commit 0b87589
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions models/course.model.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,15 @@ func UserBoughtCoursesWithExpirationDateAndQuestionsCount(userID uint) (*[]Cours
var subjectsQuestionsCount int
var subjectTraditionalsCount int
var subjectNextGenerationsCount int
var systemWithQuestionsCount []SystemWithQuestionsCount
var subjectsWithQuestionsCount []SubjectWithQuestionsCount





var TraditionalSubjects NestedSubjectsWithQuestionsCount
var NextGenerationSubjects NestedSubjectsWithQuestionsCount
for i := 0; i < len(userBoughtCourses); i++ {
for _, subject := range userBoughtCourses[i].Course.Subjects {
for _, subject := range userBoughtCourses[i].Course.ParentCourse.Subjects {
var systemWithQuestionsCount []SystemWithQuestionsCount
var subjectsWithQuestionsCount []SubjectWithQuestionsCount
systemWithQuestionsCount = nil
systemsQuestionsCount = 0
systemTraditionalsCount = 0
Expand Down Expand Up @@ -254,7 +254,7 @@ func UserBoughtCoursesWithExpirationDateAndQuestionsCount(userID uint) (*[]Cours
if subject.Type == GENERAL_TYPE_TRADITIONAL {
TraditionalSubjects.Subjects = append(TraditionalSubjects.Subjects, subjectsWithQuestionsCount...)
} else {
NextGenerationSubjects.Subjects = append(TraditionalSubjects.Subjects, subjectsWithQuestionsCount...)
NextGenerationSubjects.Subjects = append(NextGenerationSubjects.Subjects, subjectsWithQuestionsCount...)
}
}
courseWithQuestionsCount := ConvertCourseToCourseWithQuestionsCounts(*userBoughtCourses[i].Course.ParentCourse)
Expand Down

0 comments on commit 0b87589

Please sign in to comment.