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「字庫練習」輸入框:末題再答、題目重碼、下一題效率、提示效率 #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

IepIweidieng
Copy link
Contributor

@IepIweidieng IepIweidieng commented Oct 3, 2023

  • 修正答對任何字庫末題後,再答末題會強制判定爲錯誤的問題。
    • 實際上是無法回答已答對的題目的字的問題。
  • 修正同字庫重碼字被略過的問題。
    • 實際上只影響到第 0 個字庫的「叭」(與「只」的倉頡碼重複,皆爲「口金」/rc)。

… again

It is possible to input a character from other questions.

However, it was not possible to input a character from any passed question,
because these characters were removed from the input table.

This caused an issue for the last question,
since the "next" question of the last question is currently itself.

This issue is fixed by separating the input table and the question list.

* MapCharacterTable()
    * add this.questList (init-ed to have the same content as this.table)
* MapCharacterTable.prototype.getCharacterAndAlphabet()
    * make the previous question deleted from this.questList instead
This prevents the user from wrongly pressing Space right after pressing Enter.

* inputBar.oninput()
    * reset visualBar.node.textContent on pressing Enter
…dvancing O(1) time

The question 叭 (口金; rc) was inaccessible
due to its Cangjie code being the same as 只 (口金; rc).

This issue is fixed by using an Array for MapCharacterTable.questList.

* MapCharacterTable()
    * make this.questList an array (LIFO)
    * reverse the iteration of `this.questList`-building `for` loop
* MapCharacterTable.prototype.getCharacterAndAlphabet()
    * simplify question advancing by using Array.prototype.pop()
    * overwrite input table with the answer of the current question
      for handling characters with the same Cangjie code within the same stage
* initialize hintBar with attrs hintState & hideState
* hintBar.newHintState()
    * initialize this.hintState & this.hideState
* hintBar.hintCharacter()
    * cache hintState into `this`
    * cache hideState into `this`
    * avoid string comparisons by accessing & modifying this.hideState instead
@IepIweidieng IepIweidieng force-pushed the fix-composeExercise-input-behavior branch 2 times, most recently from df41973 to e5370ac Compare October 3, 2023 10:49
@IepIweidieng IepIweidieng changed the title fix「字庫練習」輸入框:末題再答、下一題效率、提示效率、題目重碼 fix「字庫練習」輸入框:末題再答、題目重碼、下一題效率、提示效率 Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant