Skip to content

Commit

Permalink
Fix part of #4064: Learner Analytics platform parameter [Blocked #4114]…
Browse files Browse the repository at this point in the history
… (#4115)

* strings for learner analytics

* platform parameter impl for learner analytics

* nit

* nit

* admin control strings

* device id correction
  • Loading branch information
Sarthak2601 authored Jan 25, 2022
1 parent 55d0669 commit 5ba9864
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import dagger.Module
import dagger.Provides
import org.oppia.android.util.platformparameter.ENABLE_LANGUAGE_SELECTION_UI_DEFAULT_VALUE
import org.oppia.android.util.platformparameter.EnableLanguageSelectionUi
import org.oppia.android.util.platformparameter.LEARNER_STUDY_ANALYTICS
import org.oppia.android.util.platformparameter.LEARNER_STUDY_ANALYTICS_DEFAULT_VALUE
import org.oppia.android.util.platformparameter.LearnerStudyAnalytics
import org.oppia.android.util.platformparameter.PlatformParameterSingleton
import org.oppia.android.util.platformparameter.PlatformParameterValue
import org.oppia.android.util.platformparameter.SPLASH_SCREEN_WELCOME_MSG
Expand Down Expand Up @@ -44,4 +47,13 @@ class PlatformParameterModule {
ENABLE_LANGUAGE_SELECTION_UI_DEFAULT_VALUE
)
}

@Provides
@LearnerStudyAnalytics
fun provideLearnerStudyAnalytics(
platformParameterSingleton: PlatformParameterSingleton
): PlatformParameterValue<Boolean> {
return platformParameterSingleton.getBooleanPlatformParameter(LEARNER_STUDY_ANALYTICS)
?: PlatformParameterValue.createDefaultParameter(LEARNER_STUDY_ANALYTICS_DEFAULT_VALUE)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,22 @@ annotation class EnableLanguageSelectionUi
// TODO(#52): Enable this feature by default once it's completed.
/** Default value for the feature flag corresponding to [EnableLanguageSelectionUi]. */
const val ENABLE_LANGUAGE_SELECTION_UI_DEFAULT_VALUE = false

/**
* Qualifier for the platform parameter that controls the visibility of [ProfileAndDeviceIdActivity]
* and working of learner study related analytics logging.
*/
@Qualifier
annotation class LearnerStudyAnalytics

/**
* Name of the platform parameter that controls the visibility of [ProfileAndDeviceIdActivity]
* and working of learner study related analytics logging.
*/
const val LEARNER_STUDY_ANALYTICS = "learner_study_analytics"

/**
* Default value of the platform parameter that controls the visibility of [ProfileAndDeviceIdActivity]
* and working of learner study related analytics logging.
*/
const val LEARNER_STUDY_ANALYTICS_DEFAULT_VALUE = false

0 comments on commit 5ba9864

Please sign in to comment.