Skip to content

Commit

Permalink
Merge branch 'introduce-algebraic-expression-system' into learner-ana…
Browse files Browse the repository at this point in the history
…lytics-pt0-temp-arrangement

Conflicts:
	app/BUILD.bazel
	app/src/main/java/org/oppia/android/app/application/ApplicationComponent.kt
	app/src/main/res/values/untranslated_strings.xml
	domain/src/main/java/org/oppia/android/domain/exploration/ExplorationProgressController.kt
	domain/src/main/java/org/oppia/android/domain/oppialogger/BUILD.bazel
	domain/src/main/java/org/oppia/android/domain/oppialogger/analytics/BUILD.bazel
	domain/src/main/java/org/oppia/android/domain/oppialogger/exceptions/BUILD.bazel
	domain/src/main/java/org/oppia/android/domain/util/BUILD.bazel
	domain/src/test/java/org/oppia/android/domain/classify/AnswerClassificationControllerTest.kt
	domain/src/test/java/org/oppia/android/domain/exploration/ExplorationDataControllerTest.kt
	domain/src/test/java/org/oppia/android/domain/exploration/ExplorationProgressControllerTest.kt
	domain/src/test/java/org/oppia/android/domain/locale/BUILD.bazel
	domain/src/test/java/org/oppia/android/domain/oppialogger/analytics/AnalyticsControllerTest.kt
	domain/src/test/java/org/oppia/android/domain/platformparameter/syncup/PlatformParameterSyncUpWorkerTest.kt
	domain/src/test/java/org/oppia/android/domain/profile/ProfileManagementControllerTest.kt
	domain/src/test/java/org/oppia/android/domain/question/QuestionAssessmentProgressControllerTest.kt
	domain/src/test/java/org/oppia/android/domain/question/QuestionTrainingControllerTest.kt
	scripts/assets/file_content_validation_checks.textproto
	scripts/assets/test_file_exemptions.textproto
	scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt
	testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleCustomContextTest.kt
	testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleOmissionTest.kt
	testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleTest.kt
	third_party/maven_install.json
	utility/src/main/java/org/oppia/android/util/platformparameter/PlatformParameterConstants.kt
  • Loading branch information
BenHenning committed Mar 18, 2022
2 parents 8a8bdc8 + b77e8ad commit 3d6c716
Show file tree
Hide file tree
Showing 607 changed files with 58,642 additions and 9,852 deletions.
9 changes: 9 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ git_repository(
remote = "https://github.com/oppia/androidsvg",
)

# A custom fork of KotliTeX that removes resources artifacts that break the build, and updates the
# min target SDK version to be compatible with Oppia.
git_repository(
name = "kotlitex",
commit = "108a12fd8743a09936d614ca7d012c8f079bad62",
remote = "https://github.com/oppia/kotlitex",
shallow_since = "1647554845 -0700",
)

bind(
name = "databinding_annotation_processor",
actual = "//tools/android:compiler_annotation_processor",
Expand Down
40 changes: 32 additions & 8 deletions app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ LISTENERS = [
"src/main/java/org/oppia/android/app/devoptions/RouteToMarkChaptersCompletedListener.kt",
"src/main/java/org/oppia/android/app/devoptions/RouteToMarkStoriesCompletedListener.kt",
"src/main/java/org/oppia/android/app/devoptions/RouteToMarkTopicsCompletedListener.kt",
"src/main/java/org/oppia/android/app/devoptions/RouteToMathExpressionParserTestListener.kt",
"src/main/java/org/oppia/android/app/devoptions/RouteToViewEventLogsListener.kt",
"src/main/java/org/oppia/android/app/drawer/RouteToProfileProgressListener.kt",
"src/main/java/org/oppia/android/app/help/LoadFaqListFragmentListener.kt",
Expand Down Expand Up @@ -182,6 +183,7 @@ VIEW_MODELS_WITH_RESOURCE_IMPORTS = [
"src/main/java/org/oppia/android/app/administratorcontrols/learneranalytics/ProfileListViewModel.kt",
"src/main/java/org/oppia/android/app/administratorcontrols/learneranalytics/SyncStatusItemViewModel.kt",
"src/main/java/org/oppia/android/app/devoptions/forcenetworktype/ForceNetworkTypeViewModel.kt",
"src/main/java/org/oppia/android/app/devoptions/mathexpressionparser/MathExpressionParserViewModel.kt",
"src/main/java/org/oppia/android/app/drawer/NavigationDrawerHeaderViewModel.kt",
"src/main/java/org/oppia/android/app/help/HelpItemViewModel.kt",
"src/main/java/org/oppia/android/app/help/HelpListViewModel.kt",
Expand All @@ -202,12 +204,13 @@ VIEW_MODELS_WITH_RESOURCE_IMPORTS = [
"src/main/java/org/oppia/android/app/onboarding/OnboardingViewModel.kt",
"src/main/java/org/oppia/android/app/ongoingtopiclist/OngoingTopicItemViewModel.kt",
"src/main/java/org/oppia/android/app/options/TextSizeItemViewModel.kt",
"src/main/java/org/oppia/android/app/parser/StringToFractionParser.kt",
"src/main/java/org/oppia/android/app/parser/FractionParsingUiError.kt",
"src/main/java/org/oppia/android/app/parser/StringToNumberParser.kt",
"src/main/java/org/oppia/android/app/parser/StringToRatioParser.kt",
"src/main/java/org/oppia/android/app/player/state/itemviewmodel/DragDropInteractionContentViewModel.kt",
"src/main/java/org/oppia/android/app/player/state/itemviewmodel/FractionInteractionViewModel.kt",
"src/main/java/org/oppia/android/app/player/state/itemviewmodel/ImageRegionSelectionInteractionViewModel.kt",
"src/main/java/org/oppia/android/app/player/state/itemviewmodel/MathExpressionInteractionsViewModel.kt",
"src/main/java/org/oppia/android/app/player/state/itemviewmodel/PreviousResponsesHeaderViewModel.kt",
"src/main/java/org/oppia/android/app/player/state/itemviewmodel/RatioExpressionInputInteractionViewModel.kt",
"src/main/java/org/oppia/android/app/player/state/itemviewmodel/SubmittedAnswerViewModel.kt",
Expand Down Expand Up @@ -248,6 +251,7 @@ VIEW_MODELS = [
"src/main/java/org/oppia/android/app/devoptions/devoptionsitemviewmodel/DeveloperOptionsItemViewModel.kt",
"src/main/java/org/oppia/android/app/devoptions/devoptionsitemviewmodel/DeveloperOptionsModifyLessonProgressViewModel.kt",
"src/main/java/org/oppia/android/app/devoptions/devoptionsitemviewmodel/DeveloperOptionsOverrideAppBehaviorsViewModel.kt",
"src/main/java/org/oppia/android/app/devoptions/devoptionsitemviewmodel/DeveloperOptionsTestParsersViewModel.kt",
"src/main/java/org/oppia/android/app/devoptions/devoptionsitemviewmodel/DeveloperOptionsViewLogsViewModel.kt",
"src/main/java/org/oppia/android/app/devoptions/DeveloperOptionsViewModel.kt",
"src/main/java/org/oppia/android/app/devoptions/forcenetworktype/NetworkTypeItemViewModel.kt",
Expand Down Expand Up @@ -396,6 +400,7 @@ VIEWS_WITH_RESOURCE_IMPORTS = [
VIEWS = [
"src/main/java/org/oppia/android/app/administratorcontrols/learneranalytics/CopyIdMaterialButtonView.kt",
"src/main/java/org/oppia/android/app/customview/interaction/FractionInputInteractionView.kt",
"src/main/java/org/oppia/android/app/customview/interaction/MathExpressionInteractionsView.kt",
"src/main/java/org/oppia/android/app/customview/interaction/NumericInputInteractionView.kt",
"src/main/java/org/oppia/android/app/customview/interaction/TextInputInteractionView.kt",
"src/main/java/org/oppia/android/app/customview/interaction/RatioInputInteractionView.kt",
Expand Down Expand Up @@ -552,6 +557,7 @@ android_library(
resource_files = glob(DATABINDING_LAYOUTS),
visibility = [
"//app/src/main/java/org/oppia/android/app/shim:__pkg__",
"//app/src/main/java/org/oppia/android/app/testing/activity:__pkg__",
],
deps = [
":annotations",
Expand All @@ -561,8 +567,8 @@ android_library(
":views",
"//app/src/main/java/org/oppia/android/app/translation:app_language_activity_injector_provider",
"//app/src/main/java/org/oppia/android/app/translation:app_language_resource_handler",
"//model:interaction_object_java_proto_lite",
"//model:thumbnail_java_proto_lite",
"//model/src/main/proto:interaction_object_java_proto_lite",
"//model/src/main/proto:thumbnail_java_proto_lite",
"//third_party:androidx_annotation_annotation",
"//third_party:androidx_constraintlayout_constraintlayout",
"//third_party:androidx_core_core",
Expand Down Expand Up @@ -593,8 +599,8 @@ kt_android_library(
deps = [
":dagger",
"//domain/src/main/java/org/oppia/android/domain/audio:cellular_audio_dialog_controller",
"//model:question_java_proto_lite",
"//model:topic_java_proto_lite",
"//model/src/main/proto:question_java_proto_lite",
"//model/src/main/proto:topic_java_proto_lite",
"//third_party:androidx_recyclerview_recyclerview",
],
)
Expand Down Expand Up @@ -662,6 +668,7 @@ kt_android_library(
"//app/src/main/java/org/oppia/android/app/viewmodel:observable_view_model",
"//app/src/main/java/org/oppia/android/app/viewmodel:view_model_provider",
"//app/src/main/java/org/oppia/android/app/utility/datetime:date_time_util",
"//app/src/main/java/org/oppia/android/app/utility/math:math_expression_accessibility_util",
"//domain",
"//domain/src/main/java/org/oppia/android/domain/audio:audio_player_controller",
"//domain/src/main/java/org/oppia/android/domain/clipboard:clipboard_controller",
Expand All @@ -674,9 +681,11 @@ kt_android_library(
"//utility/src/main/java/org/oppia/android/util/extensions:context_extensions",
"//utility/src/main/java/org/oppia/android/util/logging/firebase:debug_event_logger",
"//utility/src/main/java/org/oppia/android/util/logging/firebase:debug_module",
"//utility/src/main/java/org/oppia/android/util/math:fraction_parser",
# TODO(#59): Remove 'debug_util_module' once we completely migrate to Bazel from Gradle as
# we can then directly exclude debug files from the build and thus won't be requiring this module.
"//utility/src/main/java/org/oppia/android/util/networking:debug_util_module",
"//utility/src/main/java/org/oppia/android/util/parser/html:html_parser",
],
)

Expand All @@ -702,7 +711,7 @@ android_library(
":view_models",
"//app/src/main/java/org/oppia/android/app/translation:app_language_activity_injector_provider",
"//app/src/main/java/org/oppia/android/app/translation:app_language_resource_handler",
"//model:thumbnail_java_proto_lite",
"//model/src/main/proto:thumbnail_java_proto_lite",
"//third_party:androidx_annotation_annotation",
"//third_party:androidx_constraintlayout_constraintlayout",
"//third_party:androidx_lifecycle_lifecycle-livedata-core",
Expand Down Expand Up @@ -748,13 +757,16 @@ kt_android_library(
"//data/src/main/java/org/oppia/android/data/backends/gae:network_config_prod_module",
"//data/src/main/java/org/oppia/android/data/backends/gae:prod_module",
"//domain/src/main/java/org/oppia/android/domain/classify:interactions_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/algebraicexpressioninput:algebraic_expression_input_rule_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/continueinteraction:continue_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/dragAndDropSortInput:drag_and_drop_sort_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/fractioninput:fraction_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/imageClickInput:image_click_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/itemselectioninput:item_selection_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/mathequationinput:math_equation_input_rule_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/multiplechoiceinput:multiple_choice_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/numberwithunits:number_with_units_rule_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/numericexpressioninput:numeric_expression_input_rule_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/numericinput:numeric_input_rule_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/ratioinput:ratio_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/textinput:text_input_rule_module",
Expand All @@ -765,8 +777,8 @@ kt_android_library(
"//domain/src/main/java/org/oppia/android/domain/oppialogger:startup_listener",
"//domain/src/main/java/org/oppia/android/domain/oppialogger/exceptions:logger_module",
"//domain/src/main/java/org/oppia/android/domain/oppialogger/loguploader:worker_module",
"//model/src/main/proto:arguments_java_proto_lite",
"//domain/src/main/java/org/oppia/android/domain/profile:profile_management_controller",
"//model:arguments_java_proto_lite",
"//domain/src/main/java/org/oppia/android/domain/oppialogger/analytics:prod_module",
"//app/src/main/java/org/oppia/android/app/testing/activity:test_activity",
"//third_party:androidx_databinding_databinding-adapters",
Expand Down Expand Up @@ -795,7 +807,9 @@ kt_android_library(
"//utility/src/main/java/org/oppia/android/util/parser/image:image_parsing_module",
# TODO(#2432): Replace debug_module with prod_module when building the app in prod mode.
"//utility/src/main/java/org/oppia/android/util/networking:debug_module",
"//utility/src/main/java/org/oppia/android/util/logging:console_logger_injector_provider",
"//utility/src/main/java/org/oppia/android/util/statusbar:status_bar_color",
"//utility/src/main/java/org/oppia/android/util/threading:dispatcher_injector_provider",
],
)

Expand Down Expand Up @@ -823,7 +837,10 @@ kt_android_library(
"src/sharedTest/java/org/oppia/android/app/utility/ProgressMatcher.kt",
"src/sharedTest/java/org/oppia/android/app/utility/TabMatcher.kt",
],
visibility = ["//app:__subpackages__"],
visibility = [
":app_testing_visibility",
"//app:__subpackages__",
],
deps = [
":app",
"//testing",
Expand All @@ -839,15 +856,19 @@ TEST_DEPS = [
":test_deps",
"//app/src/main/java/org/oppia/android/app/testing/activity:test_activity",
"//app/src/main/java/org/oppia/android/app/translation/testing:test_module",
"//app/src/main/java/org/oppia/android/app/utility/math:math_expression_accessibility_util",
"//domain",
"//domain/src/main/java/org/oppia/android/domain/audio:audio_player_controller",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/algebraicexpressioninput:algebraic_expression_input_rule_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/continueinteraction:continue_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/dragAndDropSortInput:drag_and_drop_sort_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/fractioninput:fraction_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/imageClickInput:image_click_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/itemselectioninput:item_selection_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/mathequationinput:math_equation_input_rule_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/multiplechoiceinput:multiple_choice_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/numberwithunits:number_with_units_rule_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/numericexpressioninput:numeric_expression_input_rule_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/numericinput:numeric_input_rule_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/ratioinput:ratio_input_module",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/textinput:text_input_rule_module",
Expand All @@ -861,6 +882,8 @@ TEST_DEPS = [
"//testing/src/main/java/org/oppia/android/testing/espresso:konfetti_view_matcher",
"//testing/src/main/java/org/oppia/android/testing/espresso:text_input_action",
"//testing/src/main/java/org/oppia/android/testing/junit:initialize_default_locale_rule",
"//testing/src/main/java/org/oppia/android/testing/math:math_equation_subject",
"//testing/src/main/java/org/oppia/android/testing/math:math_expression_subject",
"//testing/src/main/java/org/oppia/android/testing/mockito",
"//testing/src/main/java/org/oppia/android/testing/network",
"//testing/src/main/java/org/oppia/android/testing/network:test_module",
Expand Down Expand Up @@ -896,6 +919,7 @@ TEST_DEPS = [
"//utility/src/main/java/org/oppia/android/util/accessibility:test_module",
"//utility/src/main/java/org/oppia/android/util/caching:asset_prod_module",
"//utility/src/main/java/org/oppia/android/util/caching/testing:caching_test_module",
"//utility/src/main/java/org/oppia/android/util/math:math_expression_parser",
"//utility/src/main/java/org/oppia/android/util/parser/html:custom_bullet_span",
"//utility/src/main/java/org/oppia/android/util/parser/html:html_parser",
"//utility/src/main/java/org/oppia/android/util/parser/html:html_parser_entity_type_module",
Expand Down
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ dependencies {
'de.hdodenhof:circleimageview:3.0.1',
'nl.dionsegijn:konfetti:1.2.5',
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version",
'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1',
'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1',
'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1',
'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1',
'org.mockito:mockito-core:2.7.22',
)
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
Expand Down Expand Up @@ -172,6 +172,7 @@ dependencies {
'androidx.test.ext:junit:1.1.1',
'com.github.bumptech.glide:mocks:4.11.0',
'com.google.truth:truth:1.1.3',
'com.google.truth.extensions:truth-liteproto-extension:1.1.3',
'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.2.2',
'org.mockito:mockito-android:2.7.22',
'org.robolectric:annotations:4.5',
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@
<activity
android:name=".app.devoptions.forcenetworktype.testing.ForceNetworkTypeTestActivity"
android:theme="@style/OppiaThemeWithoutActionBar" />
<activity
android:name=".app.devoptions.mathexpressionparser.MathExpressionParserActivity"
android:label="@string/math_expression_parser_activity_title"
android:theme="@style/OppiaThemeWithoutActionBar" />
<activity
android:name=".app.resumelesson.ResumeLessonActivity"
android:label="@string/resume_lesson_activity_title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.oppia.android.app.devoptions.markstoriescompleted.MarkStoriesComplete
import org.oppia.android.app.devoptions.markstoriescompleted.testing.MarkStoriesCompletedTestActivity
import org.oppia.android.app.devoptions.marktopicscompleted.MarkTopicsCompletedActivity
import org.oppia.android.app.devoptions.marktopicscompleted.testing.MarkTopicsCompletedTestActivity
import org.oppia.android.app.devoptions.mathexpressionparser.MathExpressionParserActivity
import org.oppia.android.app.devoptions.testing.DeveloperOptionsTestActivity
import org.oppia.android.app.devoptions.vieweventlogs.ViewEventLogsActivity
import org.oppia.android.app.devoptions.vieweventlogs.testing.ViewEventLogsTestActivity
Expand Down Expand Up @@ -140,6 +141,7 @@ interface ActivityComponentImpl :
fun inject(markTopicsCompletedActivity: MarkTopicsCompletedActivity)
fun inject(marginBindableAdaptersTestActivity: MarginBindingAdaptersTestActivity)
fun inject(markTopicsCompletedTestActivity: MarkTopicsCompletedTestActivity)
fun inject(mathExpressionParserActivity: MathExpressionParserActivity)
fun inject(myDownloadsActivity: MyDownloadsActivity)
fun inject(navigationDrawerTestActivity: NavigationDrawerTestActivity)
fun inject(onboardingActivity: OnboardingActivity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ kt_android_library(
"//app:app_visibility",
],
deps = [
"//model:profile_java_proto_lite",
"//model/src/main/proto:profile_java_proto_lite",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ class AdministratorControlsViewModel @Inject constructor(
private fun processGetDeviceSettingsResult(
deviceSettingsResult: AsyncResult<DeviceSettings>
): DeviceSettings {
if (deviceSettingsResult.isFailure()) {
oppiaLogger.e(
"AdministratorControlsFragment",
"Failed to retrieve profile",
deviceSettingsResult.getErrorOrNull()!!
)
return when (deviceSettingsResult) {
is AsyncResult.Failure -> {
oppiaLogger.e(
"AdministratorControlsFragment", "Failed to retrieve profile", deviceSettingsResult.error
)
DeviceSettings.getDefaultInstance()
}
is AsyncResult.Pending -> DeviceSettings.getDefaultInstance()
is AsyncResult.Success -> deviceSettingsResult.value
}
return deviceSettingsResult.getOrDefault(DeviceSettings.getDefaultInstance())
}

private fun processAdministratorControlsList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.oppia.android.app.model.DeviceSettings
import org.oppia.android.app.model.ProfileId
import org.oppia.android.domain.oppialogger.OppiaLogger
import org.oppia.android.domain.profile.ProfileManagementController
import org.oppia.android.util.data.AsyncResult
import org.oppia.android.util.data.DataProviders.Companion.toLiveData

/** [ViewModel] for the recycler view in [AdministratorControlsFragment]. */
Expand All @@ -31,11 +32,11 @@ class AdministratorControlsDownloadPermissionsViewModel(
.observe(
fragment,
Observer {
if (it.isFailure()) {
if (it is AsyncResult.Failure) {
oppiaLogger.e(
"AdministratorControlsFragment",
"Failed to update topic update on wifi permission",
it.getErrorOrNull()!!
it.error
)
}
}
Expand All @@ -49,11 +50,11 @@ class AdministratorControlsDownloadPermissionsViewModel(
).toLiveData().observe(
fragment,
Observer {
if (it.isFailure()) {
if (it is AsyncResult.Failure) {
oppiaLogger.e(
"AdministratorControlsFragment",
"Failed to update topic auto update permission",
it.getErrorOrNull()!!
it.error
)
}
}
Expand Down
Loading

0 comments on commit 3d6c716

Please sign in to comment.