You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem
Wrong code
fun main() {
println(Quiz.progressText)
}
Correct code
fun main() {
println(Quiz.StudentProgress.progressText)
}
In which lesson and step of the codelab can this issue be found?
[6. 新しいプロパティとメソッドでクラスを拡張する]
3
I mean 6-3
How to reproduce?
data class Question(
val questionText: String,
val answer: T,
val difficulty: Difficulty
)
enum class Difficulty {
EASY, MEDIUM, HARD
}
class Quiz {
val question1 = Question("Quoth the raven ___", "nevermore", Difficulty.MEDIUM)
val question2 = Question("The sky is green. True or false", false, Difficulty.EASY)
val question3 = Question("How many days are there between full moons?", 28, Difficulty.HARD)
object StudentProgress {
var total: Int = 10
var answered: Int = 3
}
}
val Quiz.StudentProgress.progressText: String
get() = "${answered} of ${total} answered"
fun main() {
// below is incorrect
println(Quiz.progressText)
// correct code is below
println(Quiz.StudentProgress.progressText)
Name of the Codelab or Codelab URL
https://developer.android.com/codelabs/basic-android-kotlin-compose-generics?hl=ja&continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-3-pathway-1%3Fhl%3Dja%26_gl%3D1*m31xei*_up*MQ..*_ga*MTIwMjg2MzcwOC4xNzM0OTQyMTEy*_ga_6HH9YJMN9M*MTczNDk2MjQ4Ny4yLjAuMTczNDk2MjQ4Ny4wLjAuMTAwNjEwNDE1NA..%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-generics&_gl=1*1powsb*_up*MQ..*_ga*MTIwMjg2MzcwOC4xNzM0OTQyMTEy*_ga_6HH9YJMN9M*MTczNDk2MjQ4Ny4yLjAuMTczNDk2MjQ4Ny4wLjAuMTAwNjEwNDE1NA..#5
Describe the problem
Wrong code
fun main() {
println(Quiz.progressText)
}
Correct code
fun main() {
println(Quiz.StudentProgress.progressText)
}
In which lesson and step of the codelab can this issue be found?
[6. 新しいプロパティとメソッドでクラスを拡張する]
3
I mean 6-3
How to reproduce?
data class Question(
val questionText: String,
val answer: T,
val difficulty: Difficulty
)
enum class Difficulty {
EASY, MEDIUM, HARD
}
class Quiz {
val question1 = Question("Quoth the raven ___", "nevermore", Difficulty.MEDIUM)
val question2 = Question("The sky is green. True or false", false, Difficulty.EASY)
val question3 = Question("How many days are there between full moons?", 28, Difficulty.HARD)
}
val Quiz.StudentProgress.progressText: String
get() = "${answered} of ${total} answered"
fun main() {
// below is incorrect
println(Quiz.progressText)
}
Versions
Kotlin Playground
Additional information
codelab: basic-android-compose-training-add-scrollable-list
The text was updated successfully, but these errors were encountered: