source-academy / frontend

Frontend of Source Academy, an online experiential environment for computational thinking (React, Redux, Saga, Blueprint)
https://sourceacademy.org
Apache License 2.0
103 stars 167 forks source link

Game: Allow storywriter to customize question prompt of the quiz #3011

Open CYX22222003 opened 3 months ago

CYX22222003 commented 3 months ago

Description

Under the current implementation, the question prompt of the quiz feature is fixed. It will be better if story writer can customize the prompt in the txt file. This may require a modification of the syntax of the txt file as well as the parser. The prompt field in the Question type will be used to capture the value of customized prompt.

https://github.com/source-academy/frontend/blob/10d5a83636a5cffbf621cf2ecb7722739eae922b/src/features/game/quiz/GameQuizConstants.ts#L11

https://github.com/source-academy/frontend/blob/dfe31147471ced6fa9d549def1be1d1d842cde16/src/features/game/quiz/GameQuizType.ts#L8-L14

Related discussion

2919

Sample of quiz

quizzes
    sourceManual
        0
        What is the pre-declared constant for: The Number value for π, the ratio of the circumference of a circle to its diameter?
        answer: 3
        option
            apple_Pi
            @ershk, thinking, left
            ...Are you hungry or something?
        option
            math_Pi
        option
            math_pi
        option
            math_PI

        1
        What is the pre-declared constant for: The Number value for the base-10 logarithm of e, the base of the natural logarithms?
        answer: 2
        option
            math_L10
        option
            math_LOG10
        option
            math_LOG10E
        option
            math_L10E

    telebayConsole
        0
        The first expression is: 100 + 37; What is the simplified form for this expression?
        answer: 3
        option
            13
        option
            37
        option
            100
        option
            137
            @scottie, smile, left
            Great! Looks like that worked.

        1
        The second expression is: (6 + 8) * 7 + 2 * 3; What is the simplified form for this expression?
        answer: 1
        option
            103
        option
            104
            @scottie, smile, left
            Great! Looks like that worked, too.
        option
            300
        option
            378