I want to make quiz in line chatbot the example question is
The name of Indonesia's President since independence day:
1. _____
2. _____
3. _____
4. _____
5. _____
6. _____
7. _____
and when the user give input the third president, "Habibie". So the output will be like this.
The name of Indonesia's President since independence day:
1. _____
2. _____
3. Habibie
4. _____
5. _____
6. _____
7. _____
What I have tried:
I make code like this.
String[] Answer1 = new String[7];
Key1 = new String[]{"Soekarno", "Soeharto, "Habibie", "Gusdur", "Megawati", "SBY", "Jokowi"};
String[] Answer1 = new String[7];
Aswer1 = new String[]{" ", " ", " ", " ", " ", " ", " "};
int i;
for (i = 0; i < Key1.length; i++);
//Jump to else if
else if(textMessageContent.getText().equalsIgnoreCase("First Quiz")){
replyText(messageEvent.getReplyToken(),"Nama-Nama Presiden RI: \n1. _____ \n2. _____ \n3. _____ \n4. _____ \n5. _____ \n6. _____ \n7. _____");
else if(textMessageContent.getText() == valueOf(Key1[i])) {
Answer1[i] = textMessageContent.getText();
replyText(messageEvent.getReplyToken(), "The name of Indonesia's President since independence day:" + Answer1[i]);
but actually does't work. Please give me the solution. I'm so confuse