Skip to content

Commit

Permalink
all: smoother pending survey notifications (fixes #4900) (#4901)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
deeppp15 and dogi authored Dec 20, 2024
1 parent 77ae301 commit 29c9864
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 26
targetSdkVersion 34
versionCode 2147
versionName "0.21.47"
versionCode 2148
versionName "0.21.48"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N

val hasUnfinishedSurvey = mRealm.where(RealmStepExam::class.java)
.equalTo("courseId", courseId)
.equalTo("type", "surveys")
.equalTo("type", "survey")
.findAll()
.any { survey -> !TakeCourseFragment.existsSubmission(mRealm, survey.id, "survey") }

Expand Down Expand Up @@ -561,8 +561,9 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N
private fun getSurveyTitlesFromSubmissions(submissions: List<RealmSubmission>): List<String> {
val titles = mutableListOf<String>()
submissions.forEach { submission ->
val examId = submission.parentId?.split("@")?.firstOrNull() ?: ""
val exam = mRealm.where(RealmStepExam::class.java)
.equalTo("id", submission.parentId)
.equalTo("id", examId)
.findFirst()
exam?.name?.let { titles.add(it) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N

val hasUnfinishedSurvey = mRealm.where(RealmStepExam::class.java)
.equalTo("courseId", courseId)
.equalTo("type", "surveys")
.equalTo("type", "survey")
.findAll()
.any { survey -> !TakeCourseFragment.existsSubmission(mRealm, survey.id, "survey") }

Expand Down Expand Up @@ -561,8 +561,9 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N
private fun getSurveyTitlesFromSubmissions(submissions: List<RealmSubmission>): List<String> {
val titles = mutableListOf<String>()
submissions.forEach { submission ->
val examId = submission.parentId?.split("@")?.firstOrNull() ?: ""
val exam = mRealm.where(RealmStepExam::class.java)
.equalTo("id", submission.parentId)
.equalTo("id", examId)
.findFirst()
exam?.name?.let { titles.add(it) }
}
Expand Down

0 comments on commit 29c9864

Please sign in to comment.