dtommy79 Posted June 29, 2015 Share Posted June 29, 2015 Hi, I'd like to create a simple script that would do the following: It would be a word learning script (to learn new vocabulary in a foreign language).This is how it should work: let's say 10 words (in my language) are displayed randomly and I have to write the meaning of those words in English next to it. For example, in my language 'apple' means 'alma'The script would display:alma => ___________I'd have to write apple on the empty line or text field. If it's correct a green checkmark would appear next to it, if not a red cross.I should be able to add the correct word pairs into the script, and it would display 10 word pairs randomly when I refresh the file in the browser. I'd appreciate if someone could point me into the right direction. Thanks Quote Link to comment Share on other sites More sharing options...
fastsol Posted June 29, 2015 Share Posted June 29, 2015 Well this could be fairly easy or complicated depending on how many different words you're talking about and whether you have a direct word-to-word correlation between the 2 languages. There may be some language api out there that has the word pairs already, otherwise you're kind of left to the making it yourself word for word, which would be extremely time consuming depending again on how large a vocabulary you want. Beyond that it becomes easy to actually handle the checking and refreshing a word list. 1. Create an array or words to display and store those in a session var. 2. Output the session array with text boxes for the user to type in the answer. 3. Submit the form and check that the answers match the session array. 4. If the answers match, create a new session array of words and re-output those to the user, and so on. If you are wanting this to happen without refreshing the page, so the answer is validated as the user moves to the next word, you'll need to use javascript and ajax to do the checking live as they type. All of this is really pretty easy stuff and there are tons of tutorials about the similar concepts used to do this, just need to google it or my favorite is to check out phpacademy on youtube. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.