Recent

Author Topic: Multiple Guess Exam  (Read 2987 times)

greertr

  • Full Member
  • ***
  • Posts: 113
    • Virtual Pilot Dashboard
Multiple Guess Exam
« on: September 08, 2017, 03:23:37 pm »
I need to develop a little exam with perhaps 10-20 questions, standard multiple guess format, select an answer a-d.
Is anyone aware of a component that would make this task easier?  At first glance, I'm drawn to the radio group...but there might be another better way.

Comments/ideas would be appreciated.

thx in adv

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Multiple Guess Exam
« Reply #1 on: September 08, 2017, 03:29:13 pm »
As a first building block make a TQuestion component that displays the question and a TRadioGroup with possible answers.
property Question: String, property Answers: TStrings, property Choice: Integer/Char?

After that you can make a TQuestions, which has an array of TQuestion and a LoadFromFile and SaveToFile method?

Bart

greertr

  • Full Member
  • ***
  • Posts: 113
    • Virtual Pilot Dashboard
Re: Multiple Guess Exam
« Reply #2 on: September 08, 2017, 05:02:57 pm »
I'm working on developing the exam, just using radio boxes...problem is, i need to do 25 questions and have the user vertically scroll down on the page when he/she gets near the bottom of the page...is there a lazarus setting - i cant scroll down past the bottom of the IDE form to post more questions.
« Last Edit: September 08, 2017, 05:11:02 pm by greertr »

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Multiple Guess Exam
« Reply #3 on: September 08, 2017, 06:21:25 pm »
what kind of a page? Is this a TSheet for a page control, the form, a panel, a scroll box, something else? For example you could use data aware controls to hold the questions and answers, and use a TControlGrid as container which can auto scroll the questions for you( with a bit of fiddling I have to admit). if you are using the form as parent for all your question setting the autoscroll property to true it will show scroll bars when a control's right or bottom side is outside the current view/client area. For other containers that do not support auto scroll you can use a scroll box as parent.
And finally there is the case of a frame which I'm not very certain that it supports autoscroll you will have to check for your self.
« Last Edit: September 08, 2017, 06:23:33 pm by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

greertr

  • Full Member
  • ***
  • Posts: 113
    • Virtual Pilot Dashboard
Re: Multiple Guess Exam
« Reply #4 on: September 08, 2017, 06:38:48 pm »
well imalready solving the issue by having five questions per form, five forms, each linking to the next.

however, my question still exists as a point of curiosity...I was wanting to have all 25 questions on one long scrolling form.

but in the ide, u apparently can't scroll past the form length - i played with various form lengths in the Obj Insp, but the ide just doesn't allow scrolling on the draft form, although the executable form could be scrolled
« Last Edit: September 08, 2017, 07:35:53 pm by greertr »

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Multiple Guess Exam
« Reply #5 on: September 08, 2017, 06:45:02 pm »
well imalready solving the issue by having five questions per form, five forms, each linking to the next.

however, my question still exists as a point of curiosity...I was wanting to have all 25 questions on one long scrolling form.

but in th eide, u apparently can't scroll past the form lenth - i played with various form lenths uin the Obj Insp, but the ide just doesnt all scrolling on the draft form, although the executable form could be scrolled
I see your point. The easy way out is to locate the property VertScrollbar in object inspector open the brunch and set its position there. As far as I can tell it scrolls at design time.

Edit:
I consider the mentioned behavior a bug but it might be by design nonetheless you might want to report a bug either in this forum on the announcement of the RC 4 or the bugtracker see the 4th link on your top left portion of the forum page.
« Last Edit: September 08, 2017, 06:51:47 pm by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Noodly

  • Jr. Member
  • **
  • Posts: 70
Re: Multiple Guess Exam
« Reply #6 on: September 08, 2017, 08:30:22 pm »
Scrolling a component beyond the bottom of the form doesn't seem to work in design mode.

I added a panel to a blank form and set the form's AutoScroll to true.

Don't align the panel just yet, but set it's height greater than the form (e.g. twice as high).

I then added buttons and had to "push" the panel up by clicking and holding the left mouse button and moving the panel upwards to get towards the bottom of the panel. Because the panel is not yet aligned it will "wobble" around a bit, but just add keep adding your other components on top in the right places.

Finally I set the panel align to alBottom, otherwise it won't be scrolled when executed.

Now run the project and you can scroll beyond the bottom of the form.

Example source attached.
« Last Edit: September 08, 2017, 10:04:00 pm by Noodly »
Windows 10 Home, Lazarus 2.02 (svn 60954), FPC 3.04

 

TinyPortal © 2005-2018