anzzstuff/kanaquiz

What program do you need to build the program?

Closed this issue · 5 comments

I have made some changes to the program that I want to test out. The problem is that I'm not exactly sure what software is needed to build software, and where I should use the 'npm install' command to install the dependencies?

You need to install Node.js, it comes with the npm command line tool which you use for building. After installing it, you go to command prompt (or equilevant), cd to the kana quiz directory and run npm install and then npm run.

Thanks for the help, that worked. now I only need to find out how to fix these last kinks in my code so it actually compiles. You wouldn't possibly know how to fix this issue here would you?

      className={
        'choose-row'
          + (this.props.groupName.endsWith('_a') || this.props.groupName.endsWith('_s') || this.props.groupName.endsWith('_e') || this.props.groupName.endsWith('_h') || this.props.groupName.endsWith('_d') this.props.groupName.endsWith('_dh') || ? ' alt-row' : '')
          + (['h_group24_a','k_group18_a','k_group29_a'].includes(this.props.groupName) ? ' divider-row' : '')
      }

I tried to add a few more groups to put the kana in put it seems like I misunderstood how to add more correctly as this method here only gives a ' Unexpected token, expected "," '.

I am also not exactly sure how one would add more names for the groups in the code below.

      {
        postfix == '_a' ? 'Alternative characters (ga · ba · kya..)' :
          'Look-alike characters'
      }

Do I just make another line of code like this?

      {
        postfix == '_d' ? 'Test group' :
          'test 2'
      }

The || before ? is in wrong place.
Second question, yeah probably something like that, I don't have the code in front of me right now

Thanks, managed to fix it. The new categories work fine now... mostly. For some reason when i click to open one kana group all of the groups open at once. The same thing happens when I try to close one of them.

I think it might have to do with this part here but I'm not sure yet on how to fix that bug. I'll take another look on it tomorrow.

  toggleAlternative(whichKana, postfix) {
    let show = postfix == '_a' ? this.state.showAlternatives : this.state.showSimilars;
    const idx = show.indexOf(whichKana);
    if(idx >= 0)
      show.splice(idx, 1);
    else
      show.push(whichKana)
    if(postfix == '_d')
      this.setState({showAlternatives: show});
    if(postfix == '_h')
      this.setState({showAlternatives: show});
    if(postfix == '_dh')
      this.setState({showAlternatives: show});
    if(postfix == '_a')
      this.setState({showAlternatives: show});
    if(postfix == '_s')
      this.setState({showAlternatives: show});
    if(postfix == '_e')
      this.setState({showSimilars: show});
  }

Hey, I forked your build here "https://github.com/Apochrosi/kanaquiz" and applied my changes. I also uploaded the exported build unto "https://apochrosi.github.io/kanaquiz/" for you to check out if you have time.

I have still not managed to fix bugs such as trying to open one grouping opens them all or when marking one group of kana all kana gets marked instead. If you have a bit of time in future I would be happy if you could take look and see if you understand why this unintended behaviour happens and show me how to fix it.