oppia-android icon indicating copy to clipboard operation
oppia-android copied to clipboard

Solutions need to be generic to all interaction types

Open BenHenning opened this issue 4 years ago • 8 comments

Per https://github.com/oppia/oppia-android/blob/65b1dc8/app/src/main/java/org/oppia/app/player/state/hintsandsolution/HintsAndSolutionAdapter.kt#L160 it seems that solutions are currently only supported for fractions whereas they should be supported for all interaction answer types.

BenHenning avatar May 10 '20 05:05 BenHenning

Hint will always be of type text right ? 🤔

aggarwalpulkit596 avatar May 10 '20 05:05 aggarwalpulkit596

I don't think #1059 full solves this. The text being sent to the correct answer is still assuming that a solution has a numerator and denominator (that's only true for fractions--what about solutions for numeric input or multiple choice?).

As far as I'm aware, hints can be any answer, which means those answers can correspond to any interaction type.

BenHenning avatar May 28 '20 03:05 BenHenning

Also, we should always use strings for formatting text like "/" (Android Studio gives a warning for these cases). We need to update hints to generically handle any interaction answer type, including non-text ones, and we should make sure the answer is formatted in a way that's understandable by the user.

BenHenning avatar May 28 '20 03:05 BenHenning

I don't think #1059 full solves this. The text being sent to the correct answer is still assuming that a solution has a numerator and denominator (that's only true for fractions--what about solutions for numeric input or multiple choice?).

As far as I'm aware, hints can be any answer, which means those answers can correspond to any interaction type.

@BenHenning There are 2 types of correctAnswer one is object and one is string. Object corresponds to fractions based on json files in assets and rest all interaction types as well as other then fractions have correctAnswer type as string.

veena14cs avatar May 29 '20 07:05 veena14cs

Something seems a bit confused here. The bug title says "solutions" but the description talks about "hints". These are two different things.

Hints are always in rich-text format.

Solutions include an "answer" and an "explanation" component. The explanation is always in rich-text format. The type of the "answer" can vary, and it depends on the specific interaction in the corresponding question. The type of the answer would be the same as the type of the answer to the corresponding question (which is string in some cases, and other types of objects in other cases). In multiple-choice I think its an integer. You'll need to check the python definition files in the web codebase to figure out what the type for a particular interaction is.

seanlip avatar May 29 '20 08:05 seanlip

Thanks for pointing out the inconsistency in the description @seanlip -- I fixed that. This is only corresponding to solutions.

@veena14cs as Sean mentioned, solutions are effectively an InteractionObject since they can reveal the answer for any interaction supported by the app. I suggest adding hints & a solution to each state of the prototype exploration as a testbed for verifying this functionality for each interaction that is supported in the app. I'd expect that some of those states would fail today (likely not a crash--I suspect that for non-fractions and non-text answers that the solution will show up as something like "0/0").

BenHenning avatar Jun 09 '20 21:06 BenHenning

Pushing to beta since the current solution seems to work correctly for place values & multiplication topics that we're including in alpha.

BenHenning avatar Aug 20 '20 17:08 BenHenning

Note that this is becoming more of an issue now that we're launching more lessons. Solutions are currently broken for numeric interaction questions (see #3955 for an issue that came up partly because of the lack of generic type handling in solutions, and #3956 which is directly related to this issue).

BenHenning avatar Oct 20 '21 23:10 BenHenning