Autor Beitrag
Gabberman
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Di 20.09.05 15:41 
Hy @all

ich hab ma wieder ne frage :oops:
Ich schreibe nun an einem Umfragenerstellungsprogramm, welches eigentlich php Seiten erstellen sollte!!! Wenn ich nun bei -Frage erstellen- 3 Fragen mit jeweils einen der vorhandenen Antwortmöglichkeiten eingebe und die dann exportiere exportiert er die Frage mit Zahl antwort zu 100%, die frage mit ja/nein zu 75% und die frage mit text mit 0%. Könnte mir bitte jemand helfen und mir sagen woran das liegt?!?!?!

MfG

Gabberman :lol:


Moderiert von user profile iconChristian S.: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Di 20.09.2005 um 15:46
Einloggen, um Attachments anzusehen!
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 20.09.05 16:51 
Kannst du bitte den Source hier im Forum posten.
Es hat kaum einer Lust, erst etwas runterzuladen um
dann vielleicht festzustellen, dass er es doch nicht weiß.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Gabberman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Do 22.09.05 18:20 
ok:
ausblenden volle Höhe Delphi-Quelltext
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:
procedure TForm2.FormActivate(Sender: TObject);
var
fragedat, test, frage, antwort, antwortphp, zeilenumbruch: string;
i, endoffile, index : integer;
F, G, K : Textfile;
begin
    CreateDir('fragebogen');
    endoffile:=0;
    AssignFile(G, 'fragen/fragen.fbe');
    Reset(G);
    while not Eof(G) do
      begin
        endoffile:= endoffile + 1;
        Readln(G, test);
        Readln(G, test);
      end;
    CloseFile(G);
    AssignFile(K, 'fragen/fragen.fbe');
    Reset(K);
    for i:=1 to endoffile do begin
    fragedat:= 'fragebogen/frage';
    fragedat:= fragedat + inttostr(i);
    fragedat:= fragedat + '.php';
    AssignFile(F, fragedat);
    ReWrite(F);
    exportieren.caption:=fragedat;
    Readln(K, frage);
    Readln(K, antwort);
    ShowMessage(antwort);
    zeilenumbruch:= 'print "<br>";';
    Writeln(F, '<?php');
    frage:= 'print " ' + frage + '";';
    Writeln(F, frage);
    Writeln(F, zeilenumbruch);
    if (antwort=inttostr(0)) or (antwort=inttostr(-1)) then begin
    antwortphp:= 'print "<input type=\"Text\" name=\"antwort\"></input>";';
    Writeln(F, antwortphp);
    end
    else if (antwort=inttostr(2)) then begin
    antwortphp:= 'print "<input type=\"Text\" name=\"antwort\"></input>";';
    Writeln(F, antwortphp);
    end
    else if (antwort=inttostr(1)) then begin
    antwortphp:= 'print "<input type=\"Radio\" name=\"antwort1\">Ja</input>";';
    Writeln(F, antwortphp);
    Writeln(F, zeilenumbruch);
    antwortphp:= 'print "<input type=\"Radio\" name=\"antwort2\">Nein</input>";';
    Writeln(F, antwortphp);
    end;
    Writeln(F, '?>');
    end;
    CloseFile(F);
    CloseFile(K);
    ProgressBar1.max:=100;
    for index:=1 to 100 do ProgressBar1.stepit; // oder .position
    end;



Das war der Quellcode des Exportierten
Gabberman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mo 26.09.05 19:26 
hm,... warum antwortet mir dennn keiner????
BITTE!!!!!!!!!!!!!!
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 27.09.05 09:30 
Hallo!

user profile iconGabberman hat folgendes geschrieben:
Ich schreibe nun an einem Umfragenerstellungsprogramm, welches eigentlich php Seiten erstellen sollte!!!

Bis hier habe ich es ja noch verstanden.

user profile iconGabberman hat folgendes geschrieben:
Wenn ich nun bei -Frage erstellen- 3 Fragen mit jeweils einen der vorhandenen Antwortmöglichkeiten eingebe und die dann exportiere

Was ist "Frage erstellen"? Wo gibst du die Antwortmöglichkeiten ein?

user profile iconGabberman hat folgendes geschrieben:
exportiert er die Frage mit Zahl antwort zu 100%, die frage mit ja/nein zu 75% und die frage mit text mit 0%.

Sorry, auch das habe ich nicht verstanden.

Bei deinem Code hab ich mir allerdings die Frage gestellt warum Du zwei mal die Datei fragen/fragen.fbe einliest. Ich hatte erst gedacht weil du die Anzahl der Fragen wissen musst aber das ist so wie ich gesehen habe nicht der Fall. Warum verarbeitest du die Datei nicht sofort? Außerdem solltest du CloseFile(F); innerhalb der For-Schleife ausführen.

Lg Martin
Gabberman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Sa 15.10.05 19:37 
Wenn ich das Programm fertig hab, könnt ihr es euch alle angucken!!!

MFG

Gabberman lol :D