Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix part of #4044: Add protos & testing library for polynomials #4050

Merged
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
17472e7
Copy proto-based changes from #2173.
BenHenning Dec 14, 2021
fe73a2f
Introduce math.proto & refactor math extensions.
BenHenning Dec 15, 2021
d17e3dc
Migrate tests & remove unneeded prefix.
BenHenning Dec 15, 2021
fb61e39
Add needed newline.
BenHenning Dec 15, 2021
acab98b
Some needed Fraction changes.
BenHenning Dec 15, 2021
02e930f
Introduce math expression + equation protos.
BenHenning Dec 15, 2021
e45635d
Add protos + testing lib for commutative exprs.
BenHenning Dec 15, 2021
da5d72d
Add protos & test libs for polynomials.
BenHenning Dec 15, 2021
7c36fdf
Lint fix.
BenHenning Dec 15, 2021
ed290a0
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Dec 15, 2021
70e8039
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Dec 15, 2021
b957284
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Dec 15, 2021
d430f8c
Lint fixes.
BenHenning Dec 15, 2021
d5dd596
Fix broken test post-refactor.
BenHenning Dec 16, 2021
ff813ad
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Dec 16, 2021
a77499c
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Dec 16, 2021
31022f0
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Dec 16, 2021
a1d481d
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Jan 13, 2022
7740c81
Post-merge fix.
BenHenning Jan 13, 2022
929de4f
Add regex check, docs, and resolve TODOs.
BenHenning Jan 14, 2022
e50a50f
Lint fix.
BenHenning Jan 14, 2022
c2726ac
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Jan 14, 2022
ec575b7
Fix failing static checks.
BenHenning Jan 14, 2022
5fe790a
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Jan 14, 2022
1268fc5
Fix broken CI checks.
BenHenning Jan 14, 2022
977eb9e
Lint fixes.
BenHenning Jan 14, 2022
a7ab1a5
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Jan 14, 2022
eed21d5
Add docs & exempted tests.
BenHenning Jan 14, 2022
b1102a3
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Jan 14, 2022
080e7dd
Remove blank line.
BenHenning Jan 14, 2022
904aad8
Add docs + tests.
BenHenning Jan 19, 2022
444d3d0
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Jan 26, 2022
cb5c5d1
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Jan 27, 2022
7a364c3
Address reviewer comments + other stuff.
BenHenning Jan 27, 2022
2c0b9cd
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Jan 27, 2022
4364d7f
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Jan 27, 2022
cfe6cab
Move StringExtensions & fraction parsing.
BenHenning Jan 27, 2022
5e83a33
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Jan 27, 2022
c6cf5f5
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Jan 27, 2022
73dccd8
Address reviewer comments.
BenHenning Jan 27, 2022
b7535fa
Alphabetize test exemptions.
BenHenning Jan 27, 2022
f4cd6cd
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Jan 27, 2022
0287f19
Add missing KDocs.
BenHenning Jan 27, 2022
75103d5
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Jan 27, 2022
52d2605
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Jan 27, 2022
37dbc85
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Jan 27, 2022
65a9fe1
Remove the ComparableOperationList wrapper.
BenHenning Jan 28, 2022
fa4de34
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Jan 28, 2022
d20256c
Use more intentional epsilons for float comparing.
BenHenning Feb 4, 2022
924214d
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Feb 5, 2022
686c4b6
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Feb 5, 2022
1a3cba5
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Feb 5, 2022
bff824e
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Feb 5, 2022
90b05bf
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Feb 5, 2022
09e2aad
Remove failing test.
BenHenning Feb 5, 2022
ecc836e
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Feb 18, 2022
b183d67
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Feb 18, 2022
005d9a0
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Feb 18, 2022
ba198fd
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Feb 18, 2022
1f2b90d
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Feb 18, 2022
fd9ec1f
Fix broken build.
BenHenning Feb 18, 2022
960287d
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Feb 18, 2022
b85567e
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Feb 18, 2022
2ed67c5
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Feb 18, 2022
3744cf2
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Feb 18, 2022
0fc8a1b
Fix broken build post-merge.
BenHenning Feb 18, 2022
e4b92e5
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Feb 18, 2022
9eb1c2d
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Feb 18, 2022
1f3fb48
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Feb 18, 2022
c01f939
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Feb 24, 2022
14f7057
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Feb 24, 2022
b98e1ec
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Feb 24, 2022
b50c40f
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Feb 24, 2022
6d0cc9e
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Feb 24, 2022
1d74aed
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Mar 7, 2022
2ae10ec
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Mar 7, 2022
60670a5
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Mar 7, 2022
473b562
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Mar 7, 2022
73a052f
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Mar 7, 2022
8945c3a
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Mar 17, 2022
391cf22
Post-merge fix.
BenHenning Mar 17, 2022
7918001
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Mar 17, 2022
c29a47c
More post-merge fixes.
BenHenning Mar 17, 2022
19b3800
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Mar 17, 2022
aa4fd38
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Mar 17, 2022
eb2bcc3
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Mar 17, 2022
52862d6
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Mar 25, 2022
cd31247
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Mar 25, 2022
4dbd838
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Mar 25, 2022
deabf3a
Merge branch 'develop' into add-support-for-math-expressions-pt2-math…
BenHenning Mar 26, 2022
8bd89e6
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Mar 26, 2022
06f9cfd
Merge branch 'develop' into add-support-for-math-expressions-pt3-math…
BenHenning Mar 26, 2022
a1284a1
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Mar 26, 2022
2c2328b
Merge branch 'develop' into add-support-for-math-expressions-pt4-comm…
BenHenning Mar 26, 2022
feb901b
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Mar 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,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 @@ -578,8 +578,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 @@ -686,7 +686,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 @@ -738,8 +738,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",
"//app/src/main/java/org/oppia/android/app/testing/activity:test_activity",
"//third_party:androidx_databinding_databinding-adapters",
"//third_party:androidx_databinding_databinding-common",
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 @@ -16,7 +16,7 @@ import org.oppia.android.app.player.state.answerhandling.InteractionAnswerHandle
import org.oppia.android.app.translation.AppLanguageResourceHandler
import org.oppia.android.app.utility.toAccessibleAnswerString
import org.oppia.android.domain.translation.TranslationController
import org.oppia.android.domain.util.toAnswerString
import org.oppia.android.util.math.toAnswerString

/** [StateItemViewModel] for the ratio expression input interaction. */
class RatioExpressionInputInteractionViewModel(
Expand Down
4 changes: 2 additions & 2 deletions config/config_proto_assets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def generate_supported_languages_configuration_from_text_proto(
names = [supported_language_text_proto_file_name],
proto_dep_name = "languages",
proto_type_name = "SupportedLanguages",
name_prefix = name,
name_prefix = "supported_languages",
asset_dir = "languages",
proto_dep_bazel_target_prefix = "//model",
proto_dep_bazel_target_prefix = "//model/src/main/proto",
proto_package = "model",
)
4 changes: 2 additions & 2 deletions config/src/java/org/oppia/android/config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _SUPPORTED_LANGUAGES_CONFIG_ASSETS = generate_proto_binary_assets(
asset_dir = "languages",
name_prefix = "supported_languages_config_assets",
names = ["supported_languages"],
proto_dep_bazel_target_prefix = "//model",
proto_dep_bazel_target_prefix = "//model/src/main/proto",
proto_dep_name = "languages",
proto_package = "model",
proto_type_name = "SupportedLanguages",
Expand All @@ -21,7 +21,7 @@ _SUPPORTED_REGIONS_CONFIG_ASSETS = generate_proto_binary_assets(
asset_dir = "languages",
name_prefix = "supported_regions_config_assets",
names = ["supported_regions"],
proto_dep_bazel_target_prefix = "//model",
proto_dep_bazel_target_prefix = "//model/src/main/proto",
proto_dep_name = "languages",
proto_package = "model",
proto_type_name = "SupportedRegions",
Expand Down
2 changes: 1 addition & 1 deletion data/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TEST_DEPS = [
"//data/src/main/java/org/oppia/android/data/backends/gae:prod_module",
"//data/src/main/java/org/oppia/android/data/backends/gae/model",
"//data/src/main/java/org/oppia/android/data/persistence:cache_store",
"//model:test_models",
"//model/src/main/proto:test_models",
"//testing",
"//testing/src/main/java/org/oppia/android/testing/network",
"//testing/src/main/java/org/oppia/android/testing/network:test_module",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kt_android_library(
deps = [
":constants",
":network_config_annotations",
"//model:arguments_java_proto_lite",
"//model/src/main/proto:arguments_java_proto_lite",
"//third_party:com_squareup_okhttp3_okhttp",
"//third_party:javax_inject_javax_inject",
"//utility/src/main/java/org/oppia/android/util/extensions:context_extensions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ kt_android_library(
visibility = ["//:oppia_api_visibility"],
deps = [
":dagger",
"//model:profile_java_proto_lite",
"//model/src/main/proto:profile_java_proto_lite",
"//utility",
"//utility/src/main/java/org/oppia/android/util/data:async_data_subscription_manager",
"//utility/src/main/java/org/oppia/android/util/data:async_result",
Expand Down
13 changes: 7 additions & 6 deletions domain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,19 @@ kt_android_library(
"//domain/src/main/java/org/oppia/android/domain/util:asset",
"//domain/src/main/java/org/oppia/android/domain/util:extensions",
"//domain/src/main/java/org/oppia/android/domain/util:retriever",
"//model:exploration_checkpoint_java_proto_lite",
"//model:onboarding_java_proto_lite",
"//model:platform_parameter_java_proto_lite",
"//model:question_java_proto_lite",
"//model:topic_java_proto_lite",
"//model/src/main/proto:exploration_checkpoint_java_proto_lite",
"//model/src/main/proto:onboarding_java_proto_lite",
"//model/src/main/proto:platform_parameter_java_proto_lite",
"//model/src/main/proto:question_java_proto_lite",
"//model/src/main/proto:topic_java_proto_lite",
"//third_party:androidx_work_work-runtime-ktx",
"//utility/src/main/java/org/oppia/android/util/caching:topic_list_to_cache",
"//utility/src/main/java/org/oppia/android/util/data:data_providers",
"//utility/src/main/java/org/oppia/android/util/extensions:bundle_extensions",
"//utility/src/main/java/org/oppia/android/util/extensions:context_extensions",
"//utility/src/main/java/org/oppia/android/util/logging:event_logger",
"//utility/src/main/java/org/oppia/android/util/logging:log_uploader",
"//utility/src/main/java/org/oppia/android/util/math:extensions",
"//utility/src/main/java/org/oppia/android/util/networking:network_connection_util",
"//utility/src/main/java/org/oppia/android/util/parser/html:exploration_html_parser_entity_type",
"//utility/src/main/java/org/oppia/android/util/parser/image:image_parsing_annonations",
Expand Down Expand Up @@ -151,7 +152,7 @@ kt_android_library(
"src/test/java/org/oppia/android/domain/classify/InteractionObjectTestBuilder.kt",
],
deps = [
"//model:question_java_proto_lite",
"//model/src/main/proto:question_java_proto_lite",
],
)

Expand Down
24 changes: 12 additions & 12 deletions domain/domain_assets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,53 +32,53 @@ def generate_assets_list_from_text_protos(
names = topic_list_file_names,
proto_dep_name = "topic",
proto_type_name = "TopicIdList",
name_prefix = name,
name_prefix = "topic_id_list",
asset_dir = "src/main/assets",
proto_dep_bazel_target_prefix = "//model",
proto_dep_bazel_target_prefix = "//model/src/main/proto",
proto_package = "model",
) + generate_proto_binary_assets(
name = name,
names = topic_file_names,
proto_dep_name = "topic",
proto_type_name = "TopicRecord",
name_prefix = name,
name_prefix = "topic_record",
asset_dir = "src/main/assets",
proto_dep_bazel_target_prefix = "//model",
proto_dep_bazel_target_prefix = "//model/src/main/proto",
proto_package = "model",
) + generate_proto_binary_assets(
name = name,
names = subtopic_file_names,
proto_dep_name = "topic",
proto_type_name = "SubtopicRecord",
name_prefix = name,
name_prefix = "subtopic_record",
asset_dir = "src/main/assets",
proto_dep_bazel_target_prefix = "//model",
proto_dep_bazel_target_prefix = "//model/src/main/proto",
proto_package = "model",
) + generate_proto_binary_assets(
name = name,
names = story_file_names,
proto_dep_name = "topic",
proto_type_name = "StoryRecord",
name_prefix = name,
name_prefix = "story_record",
asset_dir = "src/main/assets",
proto_dep_bazel_target_prefix = "//model",
proto_dep_bazel_target_prefix = "//model/src/main/proto",
proto_package = "model",
) + generate_proto_binary_assets(
name = name,
names = skills_file_names,
proto_dep_name = "topic",
proto_type_name = "ConceptCardList",
name_prefix = name,
name_prefix = "concept_card_list",
asset_dir = "src/main/assets",
proto_dep_bazel_target_prefix = "//model",
proto_dep_bazel_target_prefix = "//model/src/main/proto",
proto_package = "model",
) + generate_proto_binary_assets(
name = name,
names = exploration_file_names,
proto_dep_name = "exploration",
proto_type_name = "Exploration",
name_prefix = name,
name_prefix = "exploration",
asset_dir = "src/main/assets",
proto_dep_bazel_target_prefix = "//model",
proto_dep_bazel_target_prefix = "//model/src/main/proto",
proto_package = "model",
)
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ kt_android_library(
deps = [
"//data/src/main/java/org/oppia/android/data/persistence:cache_store",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:oppia_logger",
"//model:topic_java_proto_lite",
"//model/src/main/proto:topic_java_proto_lite",
"//third_party:javax_inject_javax_inject",
"//utility/src/main/java/org/oppia/android/util/data:data_provider",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import org.oppia.android.app.model.WrittenTranslationContext
import org.oppia.android.domain.classify.RuleClassifier
import org.oppia.android.domain.classify.rules.GenericRuleClassifier
import org.oppia.android.domain.classify.rules.RuleClassifierProvider
import org.oppia.android.domain.util.approximatelyEquals
import org.oppia.android.domain.util.toFloat
import org.oppia.android.domain.util.toSimplestForm
import org.oppia.android.util.math.approximatelyEquals
import org.oppia.android.util.math.toDouble
import org.oppia.android.util.math.toSimplestForm
import javax.inject.Inject

/**
Expand Down Expand Up @@ -36,6 +36,7 @@ class FractionInputIsEquivalentToAndInSimplestFormRuleClassifierProvider
input: Fraction,
writtenTranslationContext: WrittenTranslationContext
): Boolean {
return answer.toFloat().approximatelyEquals(input.toFloat()) && answer == input.toSimplestForm()
return answer.toDouble().approximatelyEquals(input.toDouble()) &&
answer == input.toSimplestForm()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import org.oppia.android.app.model.WrittenTranslationContext
import org.oppia.android.domain.classify.RuleClassifier
import org.oppia.android.domain.classify.rules.GenericRuleClassifier
import org.oppia.android.domain.classify.rules.RuleClassifierProvider
import org.oppia.android.domain.util.approximatelyEquals
import org.oppia.android.domain.util.toFloat
import org.oppia.android.util.math.approximatelyEquals
import org.oppia.android.util.math.toDouble
import javax.inject.Inject

/**
Expand All @@ -34,6 +34,6 @@ class FractionInputIsEquivalentToRuleClassifierProvider @Inject constructor(
input: Fraction,
writtenTranslationContext: WrittenTranslationContext
): Boolean {
return answer.toFloat().approximatelyEquals(input.toFloat())
return answer.toDouble().approximatelyEquals(input.toDouble())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.oppia.android.app.model.WrittenTranslationContext
import org.oppia.android.domain.classify.RuleClassifier
import org.oppia.android.domain.classify.rules.GenericRuleClassifier
import org.oppia.android.domain.classify.rules.RuleClassifierProvider
import org.oppia.android.domain.util.toFloat
import org.oppia.android.util.math.toDouble
import javax.inject.Inject

/**
Expand All @@ -33,6 +33,6 @@ class FractionInputIsGreaterThanRuleClassifierProvider @Inject constructor(
input: Fraction,
writtenTranslationContext: WrittenTranslationContext
): Boolean {
return answer.toFloat() > input.toFloat()
return answer.toDouble() > input.toDouble()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.oppia.android.app.model.WrittenTranslationContext
import org.oppia.android.domain.classify.RuleClassifier
import org.oppia.android.domain.classify.rules.GenericRuleClassifier
import org.oppia.android.domain.classify.rules.RuleClassifierProvider
import org.oppia.android.domain.util.toFloat
import org.oppia.android.util.math.toDouble
import javax.inject.Inject

/**
Expand All @@ -33,6 +33,6 @@ class FractionInputIsLessThanRuleClassifierProvider @Inject constructor(
input: Fraction,
writtenTranslationContext: WrittenTranslationContext
): Boolean {
return answer.toFloat() < input.toFloat()
return answer.toDouble() < input.toDouble()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.oppia.android.app.model.WrittenTranslationContext
import org.oppia.android.domain.classify.RuleClassifier
import org.oppia.android.domain.classify.rules.GenericRuleClassifier
import org.oppia.android.domain.classify.rules.RuleClassifierProvider
import org.oppia.android.domain.util.approximatelyEquals
import org.oppia.android.util.math.approximatelyEquals
import javax.inject.Inject

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import org.oppia.android.app.model.WrittenTranslationContext
import org.oppia.android.domain.classify.RuleClassifier
import org.oppia.android.domain.classify.rules.GenericRuleClassifier
import org.oppia.android.domain.classify.rules.RuleClassifierProvider
import org.oppia.android.domain.util.approximatelyEquals
import org.oppia.android.domain.util.toFloat
import org.oppia.android.util.math.approximatelyEquals
import org.oppia.android.util.math.toDouble
import javax.inject.Inject

/**
Expand Down Expand Up @@ -47,7 +47,7 @@ class NumberWithUnitsIsEquivalentToRuleClassifierProvider @Inject constructor(
private fun extractRealValue(number: NumberWithUnits): Double {
return when (number.numberTypeCase) {
NumberWithUnits.NumberTypeCase.REAL -> number.real
NumberWithUnits.NumberTypeCase.FRACTION -> number.fraction.toFloat().toDouble()
NumberWithUnits.NumberTypeCase.FRACTION -> number.fraction.toDouble()
else -> throw IllegalArgumentException("Invalid number type: ${number.numberTypeCase.name}")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.oppia.android.app.model.WrittenTranslationContext
import org.oppia.android.domain.classify.RuleClassifier
import org.oppia.android.domain.classify.rules.GenericRuleClassifier
import org.oppia.android.domain.classify.rules.RuleClassifierProvider
import org.oppia.android.domain.util.approximatelyEquals
import org.oppia.android.util.math.approximatelyEquals
import javax.inject.Inject

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.oppia.android.app.model.WrittenTranslationContext
import org.oppia.android.domain.classify.RuleClassifier
import org.oppia.android.domain.classify.rules.GenericRuleClassifier
import org.oppia.android.domain.classify.rules.RuleClassifierProvider
import org.oppia.android.domain.util.toSimplestForm
import org.oppia.android.util.math.toSimplestForm
import javax.inject.Inject

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kt_android_library(
":display_locale_impl",
":language_config_retriever",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:oppia_logger",
"//model:languages_java_proto_lite",
"//model/src/main/proto:languages_java_proto_lite",
"//utility/src/main/java/org/oppia/android/util/data:async_result",
"//utility/src/main/java/org/oppia/android/util/data:data_provider",
"//utility/src/main/java/org/oppia/android/util/locale:oppia_locale",
Expand Down Expand Up @@ -64,7 +64,7 @@ kt_android_library(
"//domain:domain_testing_visibility",
],
deps = [
"//model:languages_java_proto_lite",
"//model/src/main/proto:languages_java_proto_lite",
"//utility/src/main/java/org/oppia/android/util/locale:oppia_locale",
],
)
Expand All @@ -80,7 +80,7 @@ kt_android_library(
deps = [
":dagger",
"//config/src/java/org/oppia/android/config:languages_config",
"//model:languages_java_proto_lite",
"//model/src/main/proto:languages_java_proto_lite",
"//utility/src/main/java/org/oppia/android/util/caching:annotations",
"//utility/src/main/java/org/oppia/android/util/caching:asset_repository",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ kt_android_library(
":exploration_meta_data_retriever",
"//data/src/main/java/org/oppia/android/data/persistence:cache_store",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:oppia_logger",
"//model:onboarding_java_proto_lite",
"//model/src/main/proto:onboarding_java_proto_lite",
"//third_party:javax_inject_javax_inject",
"//utility/src/main/java/org/oppia/android/util/data:data_provider",
"//utility/src/main/java/org/oppia/android/util/data:data_providers",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kt_android_library(
visibility = ["//domain:__subpackages__"],
deps = [
"//domain/src/main/java/org/oppia/android/domain/oppialogger/analytics:controller",
"//model:event_logger_java_proto_lite",
"//model/src/main/proto:event_logger_java_proto_lite",
"//utility/src/main/java/org/oppia/android/util/logging:console_logger",
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kt_android_library(
deps = [
"//data/src/main/java/org/oppia/android/data/persistence:cache_store",
"//domain/src/main/java/org/oppia/android/domain/oppialogger:storage_module",
"//model:event_logger_java_proto_lite",
"//model/src/main/proto:event_logger_java_proto_lite",
"//utility/src/main/java/org/oppia/android/util/data:data_provider",
"//utility/src/main/java/org/oppia/android/util/logging:console_logger",
"//utility/src/main/java/org/oppia/android/util/logging:event_logger",
Expand Down
Loading