Changeset 460 for cprs/branches/foia-cprs/CPRS-Chart/fMHTest.pas
- Timestamp:
- Jul 6, 2008, 8:20:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/foia-cprs/CPRS-Chart/fMHTest.pas
r459 r460 38 38 procedure GotoQ(x: integer); 39 39 public 40 MHTestComp: string; 41 MHA3: boolean; 40 42 end; 41 43 … … 134 136 end; 135 137 end; 138 if frmMHTest.MHTestComp = '' then frmMHTest.MHTestComp := '0'; 139 Result := Result + U + frmMHTest.MHTestComp; 140 if Result = U then Result := ''; 136 141 finally 137 142 frmMHTest.Free; … … 246 251 try 247 252 TstData.Assign(LoadMentalHealthTest(TestName)); 253 if TstData.Strings[0] = '1' then MHA3 := True 254 else MHA3 := False; 248 255 Screen.Cursor := crHourGlass; 249 256 try 250 257 TstData.Add('99999;X;0'); 251 idx := 0;258 idx := 1; 252 259 FMaxLines := 0; 253 260 FInfoText := ''; … … 302 309 if(Spec = 'I') then 303 310 begin 304 AddTxt2Str(FInfoText); 311 if MHA3 = True then AddTxt2Str(QObj.FText) 312 else 313 AddTxt2Str(FInfoText);; 305 314 end 306 315 else … … 392 401 FBuildingControls := TRUE; 393 402 try 394 if(not assigned(FInfoLabel)) then 403 Wide := sbMain.Width - (Gap * 2) - ScrollBarWidth - 4; 404 Y := gap - sbMain.VertScrollBar.Position; 405 if MHA3 = False then 406 begin 407 if(not assigned(FInfoLabel)) then 395 408 begin 396 409 FInfoLabel := TMemo.Create(Self); … … 405 418 end; 406 419 BoundsRect := FInfoLabel.BoundsRect; 407 Wide := sbMain.Width - (Gap * 2) - ScrollBarWidth - 4;408 Y := Gap - sbMain.VertScrollBar.Position;420 //Wide := sbMain.Width - (Gap * 2) - ScrollBarWidth - 4; 421 //Y := gap - sbMain.VertScrollBar.Position; 409 422 BoundsRect.Top := Y; 410 423 BoundsRect.Right := BoundsRect.Left + Wide; … … 416 429 for i := 0 to FObjs.Count-1 do 417 430 TMHQuestion(FObjs[i]).BuildControls(Y, Wide); 431 end 432 else 433 begin 434 inc(Y, 1); 435 for i := 0 to FObjs.Count-1 do TMHQuestion(FObjs[i]).BuildControls(Y, Wide); 436 end; 418 437 finally 419 438 FBuildingControls := FALSE; … … 780 799 var 781 800 i, XCnt, First: integer; 782 msg : string;801 msg, ans, TestStatus: string; 783 802 784 803 begin 785 804 msg := ''; 805 ans := ''; 786 806 XCnt := 0; 787 807 First := -1; 808 TestStatus := '2'; 809 MHTestComp := '2'; 788 810 for i := 0 to FObjs.Count-1 do 789 811 begin 812 ans := ans + TMHQuestion(Fobjs[i]).FAnswer; 790 813 if(TMHQuestion(FObjs[i]).FAnswer = Skipped) then 791 814 begin … … 797 820 end; 798 821 end; 822 if(XCnt = FObjs.Count) then ModalResult := mrOK; 823 TestStatus := VerifyMentalHealthTestComplete(Self.Caption, ans); 824 if Piece(TestStatus,U,1) <> '2' then 825 begin 826 if Piece(TestStatus,U,1)='1' then 827 begin 828 ModalResult := mrOK; 829 MHTestComp := '1'; 830 EXIT; 831 end; 832 if Piece(TestStatus,U,1)='0' then 833 begin 834 MHTestComp := '0'; 835 msg := Piece(TestStatus,u,2); 836 msg := 'The following questions have not been answered:' + CRLF + CRLF + ' ' + msg; 837 if(InfoBox(msg + CRLF + CRLF + 'Answer skipped questions?', 'Skipped Questions', 838 MB_YESNO or MB_ICONQUESTION) = IDYES) then GotoQ(First) 839 else 840 ModalResult := mrOK; 841 EXIT; 842 end; 843 end; 799 844 if(XCnt = 0) then 800 845 ModalResult := mrOK
Note:
See TracChangeset
for help on using the changeset viewer.