Webmaster Forumu - Webmaster Zone

Geri git   Webmaster Forumu - Webmaster Zone > Webmaster Zone > Programlama Dilleri > PHP
Şifrenizimi Unuttunuz? Bize Katılın!

Cevapla
Görüntüleme: 800 - Cevaplar: 4  
LinkBack Seçenekler Stil
  #1 (permalink)  
Alt 08-09-2007, 18:01:27
aLieN - ait Kullanıcı Resmi (Avatar)
aLieN aLieN isimli üyemiz çevrimdışıdır. (Offline)
Webmaster
No Status
 
Üyelik tarihi: 31/5/2007
Yaş: 28
Mesajlar: 23
iTrader: (0)
Tecrübe Puanı: 0
Puanları: 20
aLieN üyemiz henüz acemi
Standart Online Test PHP

Merhabalar

Elimde online bir test script'i var çok basit 1 quiz.php ve questions.xml araçılığıyla çalışmakta,

Tek bir sorunum var, teste başladıkdan sonra şıkları cevapladığında altta diğer soruya geç, butonu var. Ben bunu liste halinde gösterip en sonra Hesapla bölümü oluşturmak istiyorum. Bildiğimiz sınavlardaki test kağıtları gibi liste halinde olması için kodda ne gibi bir değişiklik yapmak gerekiyor.

Alıntı:
<?
// iQuiz v1.0 - a simple quiz script
// You may change any of this script but please do not remove the link at the bottom of the page
$xmlFile = "questions.xml";
// header and footer
$headerFile = "header.htm";
$footerFile = "footer.htm";
// XML Section
$data = implode("", file($xmlFile));
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, $data, $values, $tags);
xml_parser_free($parser);
$questionNo = 0;
foreach ($values as $key=>$val) {
// save value to "questions" array if this is a TEXT tag
if ($val[tag] == "TEXT") {
$questions[$questionNo]['text'] = $val[value];
}
// save value to "questions" array if this is a CHOICES tag
if ($val[tag] == "CHOICES") {
$questions[$questionNo]['choices'] = $val[value];
}
// save value to "questions" array if this is an ANSWER tag
if ($val[tag] == "ANSWER") {
$questions[$questionNo]['answer'] = $val[value];
// increment question counter variable
$questionNo++;
}
}
import_request_variables("p", "post_");
include($headerFile);
if (!isset($post_answers)) {
echo "<b>" . $questions[0]['text'] . "</b>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
// split choices into "choices" array
$choices = explode(", ", $questions[0]['choices']);
// print text field if there are no choices
if (count($choices) == 1) {
echo "<input type=\"text\" name=\"answers[0]\" size=10>\n";
}
// print radio fields if there are multiple choices
else {
// print a radio button for each choice
for ($i = 0; $i < count($choices); $i++) {
echo "<input type=\"radio\" name=\"answers[0]\" value=\"" . $choices[$i] . "\"> " . $choices[$i] . "<br>\n";
}
}
echo "<input type=\"submit\" value=\"Next Question\">\n";
echo "</form>\n";
}

//
// PRINT NEXT QUESTION
//
elseif (count($questions) > count($post_answers)) {
// get number of next question
$nextQuestion = count($post_answers);
// print question
echo "<b>" . $questions[$nextQuestion]['text'] . "</b>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
// print answers to previous questions as hidden form fields
for ($i = 0; $i < count($post_answers); $i++) {
echo "<input type=\"hidden\" name=\"answers[$i]\" value=\"$post_answers[$i]\">\n";
}
// split choices into "choices" array
$choices = explode(", ", $questions[$nextQuestion]['choices']);
// print text field if there are no choices
if (count($choices) == 1) {
echo "<input type=\"text\" name=\"answers[$nextQuestion]\" size=10>\n";
}
// print radio fields if there are multiple choices
else {
// print a radio button for each choice
for ($i = 0; $i < count($choices); $i++) {
echo "<input type=\"radio\" name=\"answers[$nextQuestion]\" value=\"" . $choices[$i] . "\">" . $choices[$i] . "<br>\n";
}
}
// print appropriate button label
if (count($questions) == count($post_answers) + 1) {
echo "<input type=\"submit\" value=\"Calculate Score\">\n";
}
else {
echo "<input type=\"submit\" value=\"Next Question\">\n";
}
echo "</form>\n";
}

//
// CALCULATE AND PRINT SCORE
//
else {
// get number of questions
$noQuestions = count($questions);
// get number of correct answers
for ($i = 0; $i < $noQuestions; $i++) {
// increment "noCorrectAnswers" variable if user has correct answer
if ($questions[$i]['answer'] == $post_answers[$i]) {
$noCorrectAnswers++;
}
}
// calculate score
$score = ($noCorrectAnswers / $noQuestions) * 100;
// round score to nearest whole precentage point
$score = round($score);
// print score
echo "<h2>$score%</h2>\n";
if ($noCorrectAnswers == 0) {
echo "<p>You answered no questions correctly. <a href=" . $PHP_SELF . ">Try again.</a></p>";
}
if ($noCorrectAnswers == 1) {
echo "<p>You answered 1 out of $noQuestions questions correctly. <a href=" . $PHP_SELF . ">Try again.</a></p>";
}
if ($noCorrectAnswers > 1 && $noCorrectAnswers < $noQuestions) {
echo "<p>You answered $noCorrectAnswers out of $noQuestions questions correctly. <a href=" . $PHP_SELF . ">Try again.</a></p>";
}
if ($noCorrectAnswers == $noQuestions) {
echo "<p>You answered all questions correctly!</p>";
}
}

//
// INCLUDE FOOTER FILE
//
include($footerFile);
?>
nasıl ayarlayabilirim bunu teşekkürler.
Alıntı ile Cevapla
  #2 (permalink)  
Alt 08-09-2007, 18:32:23
LastMetaVII - ait Kullanıcı Resmi (Avatar)
LastMetaVII LastMetaVII isimli üyemiz çevrimdışıdır. (Offline)
Webmaster
No Status
 
Üyelik tarihi: 30/4/2007
Nerden: Bursa
Yaş: 21
Mesajlar: 412
iTrader: (1)
Tecrübe Puanı: 45
Puanları: 59
LastMetaVII Helal emin adımlarla ilerliyorsun
Standart Cevap: Online Test PHP

bende bu scripti indirmiştim ama üzerinde durmamıştım .. mesela sorular bitince şu kadar doğru şu kadar yanlış diyor ama önemli olan yanlışları görmek .
Alıntı ile Cevapla
  #3 (permalink)  
Alt 08-09-2007, 18:35:24
aLieN - ait Kullanıcı Resmi (Avatar)
aLieN aLieN isimli üyemiz çevrimdışıdır. (Offline)
Webmaster
No Status
 
Üyelik tarihi: 31/5/2007
Yaş: 28
Mesajlar: 23
iTrader: (0)
Tecrübe Puanı: 0
Puanları: 20
aLieN üyemiz henüz acemi
Standart Cevap: Online Test PHP

Normal bir test sınavında sorular, alt atla

Bu sistemde sorular yanıtlayınca, diğer soruya geç yapıyoruz.

Ben bunu normal test sınav kağıtlarındaki gibi, soruların hepsi alt alta en son dada hesapla bölümünü kullanmak istiyorum

zaten, diğer sorulara geçiş yapıp en sonraki soruda hesapla çıkıyor. ama sorular alt alta değil sayfa sayfa
Alıntı ile Cevapla
  #4 (permalink)  
Alt 08-09-2007, 22:19:09
aLieN - ait Kullanıcı Resmi (Avatar)
aLieN aLieN isimli üyemiz çevrimdışıdır. (Offline)
Webmaster
No Status
 
Üyelik tarihi: 31/5/2007
Yaş: 28
Mesajlar: 23
iTrader: (0)
Tecrübe Puanı: 0
Puanları: 20
aLieN üyemiz henüz acemi
Standart Cevap: Online Test PHP

Arkadaşlar gerçekten buna ihtiyacım var php coder üstadlarım haleldebilirse çok sevinirim beklemekteyim
Alıntı ile Cevapla
  #5 (permalink)  
Alt 09-10-2007, 22:41:28
efikra efikra isimli üyemiz çevrimdışıdır. (Offline)
Webmaster
No Status
 
Üyelik tarihi: 31/10/2007
Yaş: 28
Mesajlar: 124
iTrader: (0)
Tecrübe Puanı: 31
Puanları: 86
efikra Helal emin adımlarla ilerliyorsun
Standart Cevap: Online Test PHP

Arkadaşım sorunu tam anlayamadım
Alıntı ile Cevapla
Cevapla



Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 
Seçenekler
Stil

Yetkileriniz
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 Açık
Smileler Açık
[IMG] Kodları Açık
HTML-KodlarıKapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Açık

Benzer Konular
Konu Konuyu Başlatan Forum Cevaplar Son Mesaj
ECDL Yetkili Test Merkezleri ismailbal Diğer Sertifikalar 1 26-10-2007 08:33:37
Online Test ThêMéssi Webmaster Genel 10 08-07-2007 12:29:11
Flash ile online GTA fatihalp Proje Geliştirme ve Ortaklık 5 12-05-2007 03:53:18
Online Dergi fosch Proje Geliştirme ve Ortaklık 10 28-02-2007 15:45:53


oyun , kontör , türkçe dizin

Bütün Zaman Ayarları WEZ +2 olarak düzenlenmiştir. Şu Anki Saat: 00:13:40 .


Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
Zone Org | 2006-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125