ај че видиме шо че кажи дали че може да помогне
) @
igor108367
Поздрав
Готова скрипта аз ова немам. Пробав да најдам ама тешко. Сепак можам да ти помогнам ако сакаш да ја направиш бидејќи е прилично проста. Се што ти треба е еден тајмер и една променлива која ќе се поместува за вредност еден секоја секунда, текст фајл со една низа на зборови кои ќе ги ставиш во него и после само ги споредуваш и за памтуваш точните и неточните вредности. Само што ќе ти биде полесно со JavaScript да го направиш целиот тој дел. Таму мислам дека е само со php.
Уствари најдов скрипта во ЈаваСкрипт
<script type="text/javascript">
var zaehler = 0;
var pruefstring = 'been live would know little letter man mean give river try that there day his play do eat such kind answer put always very here might by let need away found small any ask good came every help study add will around want part but together call almost white night open different take more idea run plant saw after your without spell state stop make about don\'t above miss not end men carry took were she on began girl oil get old one thought leave is you the all long over at tree feet mother last world even number me us far still water animal their this often so those they to its turn high watch grow then between paper well until and both under does close form much did few time find most page new back we for what have got year her say begin walk look talk can house why important hear made sea school of also right list other go another change enough mile side an now my sentence next second family think follow while car because head America left really start young went soon as only near many set was who see earth people off are point may which country where food has each he boy group work story name in too our line being up be mountain learn four three come light could sound big it\'s use through children out into with eye same air had never song large something sometimes below land write how place own some great read move down Indian or example cut from thing keep first life no tell them city before than seem again him word home picture said should must it way father book hard two when face if hand show along later these just once like ';
var vorausgabe = '<span style="background: #ddd;">been</span> live would know little letter man mean give river try that there day his ';
var wort = pruefstring.split(' ');
var mode = pruefstring.split(' ');
var max_anzahl = wort.length;
var laeufer = 1;
var anzahl_zeichen = 0;
var woerter_richtig = 0;
var woerter_falsch = 0;
var aktiv
var start = 0;
var sekunden = 0;
function time()
{
sekunden++;
if(sekunden <= 60)
document.getElementById('zeitfenster').innerHTML = 60-sekunden;
//Auswertung
if(sekunden >= 60 && start < 2)
{
document.getElementById('info').style.display = 'none';
start = 2;
ausgabe();
}
}
function ausgabe()
{
var punktzahl = 0;
for(j=0; j<mode.length; j++)
{
if(mode[j] == 0)
punktzahl -= wort[j].length;
else if(mode[j] == 1)
punktzahl += wort[j].length;
}
document.getElementById('haupt').innerHTML = '';
document.getElementById('auswertung').style.display = 'block';
document.getElementById('auswertung').innerHTML = '<img src="http://10-fast-fingers.com/filesystem/images/ajax-loader-big.gif" alt="" />';
var pars = 'zeichenzahl='+document.getElementById('zeichenzahl').innerHTML+'&woerter_richtig='+document.getElementById('woerter_richtig').innerHTML+'&woerter_falsch='+document.getElementById('woerter_falsch').innerHTML+'&punktzahl='+punktzahl;
StartRequest(pars);
/*
ausgabe_now = new Ajax.Updater(
'auswertung',
'/auswertung.php',
{
method:'get', parameters:'zeichenzahl='+document.getElementById('zeichenzahl').innerHTML+'&woerter_richtig='+document.getElementById('woerter_richtig').innerHTML+'&woerter_falsch='+document.getElementById('woerter_falsch').innerHTML+'&punktzahl='+punktzahl,
asynchronous:true});
*/
}
function welcheup (e) {
welche(e, false);
}
function welchedown (e) {
welche(e, true);
}
function welche (e, down) {
var e = e || window.event;
if(window.captureEvents) {
var taste = e.which;
} else {
var taste = e.keyCode;
}
if(taste==16 || taste==17 || taste==18)
return;
if(!down) {
anzahl_zeichen++;
document.getElementById('zeichenzahl').innerHTML = anzahl_zeichen;
document.getElementById('woerter_richtig').innerHTML = woerter_richtig;
document.getElementById('woerter_falsch').innerHTML = woerter_falsch;
}
if(start == 0)
{
document.getElementById('neustart').style.display = 'inline';
aktiv = setInterval('time()',1000);
start = 1;
}
if(down ? taste!=13 : taste!=32)
return;
wert = document.getElementById('eingabe').value;
if(taste==32)
{
while(wert.indexOf(" ") != -1) {
mode[zaehler] = wert.substr(0, wort[zaehler].length+1)
== wort[zaehler]+' ';
wert = wert.replace(/^[^ ]* /, "");
woerter_richtig += mode[zaehler];
woerter_falsch += !mode[zaehler];
zaehler++;
check();
}
}
else if(taste==13)
{
mode[zaehler] = wert.substr(0, wort[zaehler].length)
== wort[zaehler];
wert = "";
woerter_richtig += mode[zaehler];
woerter_falsch += !mode[zaehler];
zaehler++;
check();
}
document.getElementById('eingabe').value = wert;
}
if (window.captureEvents) {
window.captureEvents(Event.KEYPRESS);
// auf die eine Zeile vorher (für Netscape 4.X) kommt's nicht an
window.onkeyup=welcheup;
window.onkeydown=welchedown;
} else {
document.onkeyup=welcheup;
document.onkeydown=welchedown;
}
function laden()
{
document.getElementById('vorgabe').innerHTML = vorausgabe;
document.getElementById('zeitfenster').innerHTML = '60';
}
function check()
{
var vorschau = 0;
if(((zaehler+1) % 15) == 0)
laeufer++;
if(laeufer > 1)
vorschau = -1;
var rueck = '';
for(i=(vorschau+((laeufer-1)*15)); i<(15*laeufer); i++)
{
if(zaehler == i)
rueck += '<span style="background: #ddd;">'+wort
+'</span> ';
else
{
if(mode == 0)
rueck += '<span style="color:red">'+wort+'</span>'+' ';
else if(mode == 1)
rueck += '<span style="color:green">'+wort+'</span>'+' ';
else
rueck += wort+' ';
}
}
document.getElementById('vorgabe').innerHTML = rueck;
}
</script>