Ignore:
Timestamp:
Jul 6, 2008, 8:20:14 PM (16 years ago)
Author:
Kevin Toppenberg
Message:

Uploading from OR_30_258

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/foia-cprs/CPRS-Chart/fMHTest.pas

    r459 r460  
    3838    procedure GotoQ(x: integer);
    3939  public
     40  MHTestComp: string;
     41  MHA3: boolean;
    4042  end;
    4143
     
    134136      end;
    135137    end;
     138      if frmMHTest.MHTestComp = '' then frmMHTest.MHTestComp := '0';
     139      Result := Result + U + frmMHTest.MHTestComp;
     140      if Result = U then Result := '';
    136141  finally
    137142    frmMHTest.Free;
     
    246251  try
    247252    TstData.Assign(LoadMentalHealthTest(TestName));
     253    if TstData.Strings[0] = '1' then MHA3 := True
     254    else MHA3 := False;
    248255    Screen.Cursor := crHourGlass;
    249256    try
    250257      TstData.Add('99999;X;0');
    251       idx := 0;
     258      idx := 1;
    252259      FMaxLines := 0;
    253260      FInfoText := '';
     
    302309          if(Spec = 'I') then
    303310          begin
    304             AddTxt2Str(FInfoText);
     311           if MHA3 = True then AddTxt2Str(QObj.FText)
     312           else
     313           AddTxt2Str(FInfoText);;
    305314          end
    306315          else
     
    392401    FBuildingControls := TRUE;
    393402    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
    395408      begin
    396409        FInfoLabel := TMemo.Create(Self);
     
    405418      end;
    406419      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;
    409422      BoundsRect.Top := Y;
    410423      BoundsRect.Right := BoundsRect.Left + Wide;
     
    416429      for i := 0 to FObjs.Count-1 do
    417430        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;
    418437    finally
    419438      FBuildingControls := FALSE;
     
    780799var
    781800  i, XCnt, First: integer;
    782   msg: string;
     801  msg, ans, TestStatus: string;
    783802
    784803begin
    785804  msg := '';
     805  ans := '';
    786806  XCnt := 0;
    787807  First := -1;
     808  TestStatus := '2';
     809  MHTestComp := '2';
    788810  for i := 0 to FObjs.Count-1 do
    789811  begin
     812    ans := ans + TMHQuestion(Fobjs[i]).FAnswer;
    790813    if(TMHQuestion(FObjs[i]).FAnswer = Skipped) then
    791814    begin
     
    797820    end;
    798821  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;
    799844  if(XCnt = 0) then
    800845    ModalResult := mrOK
Note: See TracChangeset for help on using the changeset viewer.