Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 04-02-2008, 08:45 AM Can anyone do this ?
Skilled Talker

Posts: 50
Name: luke
Trades: 0
Hi all !
I have a website trying to help South Americans to learn english for free.
I want a very simple kind of script, I've been trying to work out how to do it myself but I simply can't.

It should just store about 20 words and their spanish translation. Eg:
red = rojo
green = verde
etc

Then, the visitor types their answer into a text box, and it goes to the next word, until the end when it tells them - you got 14 / 20 right, and resets. Maybe it could even say which words they got wrong. Is this simple? For how much would someone do it.. ?

Thanks a lot !
__________________

Please login or register to view this content. Registration is FREE
lukedahel is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-02-2008, 09:59 AM Re: Can anyone do this ?
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
sounds very simple,

All you need is a database full of words and their translation, then have a simple script to select 20 of them when the user submits it matches them against the translations in the database if they match it tells it.

I can do this really easily, send me a PM.

Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 04-02-2008, 10:24 AM Re: Can anyone do this ?
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Sounds to me like you need a simple if and count.
So in your case, it should be:

PHP Code:
<?php
// Start by putting some variables that I'll edit.
$correctcount 0// The correct count.
$wrongcount 0// The correct count.

$string 'What the user typed'// what the user put.

$word[0] = 'red'$answer[0] = 'rojo'$returned_answer[0] = 'What they put'// Words, with answers
$word[1] = 'green'$answer[1] = 'verde'$returned_answer[1] = 'What they put';

foreach(
$word as $key => $value){ // Go through questions and compare answers.
if($returned_answer[$key] == $answer[$key]){
echo 
"Correct! $value is the same as: $answer[$key]";
$correctcount $correctcount 1// Add to correct counts.
} else {
echo 
"Wrong :( $value is not: $returned_answer[$key], it is $answer[$key]";
$wrongcount $wrongcount 1;// Add to wrong counts.
}
}

echo 
"You got $correctcount out of ".$correctcount+$wrongcount;  // Say the score.

?>
Above it almost exactly what you needed.

Though, you would need to input all the translations yourself into that array.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE

Last edited by rogem002; 04-02-2008 at 12:13 PM..
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 04-02-2008, 11:12 AM Re: Can anyone do this ?
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
^ what he said will work but if would be a bit inflexible. so you would have to manually edit it every time you changed/edited/added/removed a word.

i will explain what i can do etc in the PM
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 04-02-2008, 12:13 PM Re: Can anyone do this ?
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Quote:
Originally Posted by dansgalaxy View Post
^ what he said will work but if would be a bit inflexible. so you would have to manually edit it every time you changed/edited/added/removed a word.

i will explain what i can do etc in the PM
Dans is a good programmer, use him
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 04-02-2008, 12:27 PM Re: Can anyone do this ?
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
Aaah im touched
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 04-02-2008, 01:29 PM Re: Can anyone do this ?
Gilligan's Avatar
Website Designer

Posts: 1,670
Name: Stefan
Location: London, UK
Trades: 0
looks like dan is eager for this job
__________________

Please login or register to view this content. Registration is FREE
Gilligan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Can anyone do this ?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32823 seconds with 12 queries