Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Help on this one please

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help on this one please

    I�m planning to create an application for students to take a GRE practice test online.
    I have the following tables:

    tblCourse
    {CourseID} (AutoIncrement �AI)
    {CourseName} (Character)

    tblThemes
    {ThemeID} (AI)
    {CourseID}(Numeric)
    {ThemeName}(Character)
    {Explanation}(Memo)

    tblExercises
    {ExerciseID}(AI)
    {ThemeID}(N)
    {Exercise}(Memo)

    I want it to be a Multiple Choice practice test and those choices presented to the student must be at random from a to d one of them being the correct one. I know I need another field or fields in the tblExercises table, but I don�t know how to accomplish this. I�m new to Alpha and I have no knowledge of XBasic� any help would be appreciate it.

    For example:
    Student 1 sees this:

    1. Find the value of X in 2x + 5 = 11
    a. 8
    b. 4
    c. 3
    d. -3


    Student 2 sees this:

    1. Find the value of X in 2x + 5 = 11
    a. -3
    b. 8
    c. 4
    d. 3
    Correct answer is 3� for Student 1 is c and for student 2 is d.

    #2
    Re: Help on this one please

    This one's a toughy! I'm sure some smart person will give you a better answer than my conceptual one. Conceptually, I would put Qs & 4-A's all in the same table (5-fields minimum). Then you need a student [1:M] student_answer tables/set (I assume this is desktop, but same principle w. grids). Using xbasic generate 4 child records for each student question, where the 4 possible answers are randomized by some kind of algorithm (rand() function maybe?). Definitely tricky!
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com


    Comment


      #3
      Re: Help on this one please

      you got me on the Xbasic part, but in your tables you could have something like this...

      Tables -

      tableQuestions:
      • {Id}(int/UUID)
      • {ExcerciseId}(int/UUID)
      • {QuestionText}(Character)


      tableAnswers:
      • {Id}(int/UUID)
      • {QuestionId}(int/UUID)
      • {AnswerText}(Character)
      • {Correct}(Logical)


      So the logic of this is that you can search the answers table to find all the answers for the Question that you are on by Id and get all the answers for that question. Then you can create a random number generator that selects a the positions for each answer. You also set a variable somewhere that will tell you what position you put the correct answer in.

      Comment


        #4
        Re: Help on this one please

        Thanks to both... I'll take your approach Benjamin, lets see now who can help me with the XBasic code.

        Comment


          #5
          Re: Help on this one please

          You're welcome to pick this apart but I was looking at a different approach.

          tableQuestions:
          {Id}(int/UUID)
          {ExcerciseId}(int/UUID)
          {QuestionText}(Character)
          {True_answer}
          {Choices} 'like "8,4,3,-3"

          The udf scramble() returns "ABCD" in some order.

          Code:
          FUNCTION scramble AS C ( )
          	choices = "ABCD"
          	its  = ceiling(rand()*100)
          	FOR i = 1 TO its
          		choices = *transpose(choices,ceiling(mod(rand()*100,4)),ceiling(mod(rand()*100,4)))
          	next i
          	scramble = choices
          END FUNCTION
          The function disp returns a paired up list to show.

          Code:
          FUNCTION disp AS C (tchoices AS C )
          	lets = scramble()
          	disp = ""
          	i = 1
          	for each foo in comma_to_crlf(tchoices)
          		disp = disp + substr(lets,i,1)+". "+foo.value+crlf()
          		i = i + 1
          	next
          	disp = sortsubstr(disp,crlf())
          END FUNCTION
          Examples from the interactive..


          Code:
          ? disp("3,8,4,-3")
          = A. 8
          B. -3
          C. 3
          D. 4
          
          ? disp("3,8,4,-3")
          = A. -3
          B. 3
          C. 8
          D. 4
          
          
          ? disp("3,8,4,-3")
          = A. 8
          B. 3
          C. -3
          D. 4
          
          
          ? disp("3,8,4,-3")
          = A. -3
          B. 8
          C. 4
          D. 3
          The usage to generate a list of choices for a given question would be

          disp(choices)

          where choices is the field in the current record.
          There can be only one.

          Comment


            #6
            Re: Help on this one please

            That is great! I am glad to see that. I will add that little bit to my kit bag.

            Comment


              #7
              Re: Help on this one please

              Great! I'll let you know if I managed to do it! Thanks!

              Comment


                #8
                Re: Help on this one please

                Nice job, Stan.
                Peter
                AlphaBase Solutions, LLC

                [email protected]
                https://www.alphabasesolutions.com


                Comment


                  #9
                  Re: Help on this one please

                  Thanks.

                  Actually there is nothing to prevent two sequential uses of the disp function from returning the same choices. With only 24 possible combinations there is some likelihood that it will occur. I think the process will get you where you need to be though.

                  More examples should anyone else be looking.

                  Code:
                  ? disp("one,seven,nine,thirteen")
                  = A. nine
                  B. thirteen
                  C. seven
                  D. one
                  
                  ? disp("one,seven,nine,thirteen")
                  = A. seven
                  B. one
                  C. nine
                  D. thirteen
                  
                  
                  ? disp("a,a and c,c and d,none of these")
                  = A. none of these
                  B. a
                  C. a and c
                  D. c and d
                  
                  ? disp("a,a and c,c and d,none of these")
                  = A. c and d
                  B. none of these
                  C. a and c
                  D. a
                  
                  ? disp("a,a and c,c and d,none of these")
                  = A. a
                  B. a and c
                  C. c and d
                  D. none of these
                  There can be only one.

                  Comment


                    #10
                    Re: Help on this one please

                    Yes, but when a test is generated it is almost impossible to get two exact tests.

                    Comment


                      #11
                      Re: Help on this one please

                      Very unlikely, true.
                      There can be only one.

                      Comment


                        #12
                        Re: Help on this one please

                        If you can't tell, I'm having a slow Friday.

                        Modified the scramble function to accept a numeric parameter indicating how many letter choices to use.

                        Code:
                        FUNCTION scramble AS C (cnt as n )
                        	choices = substr("ABCDEFGHIJKLMNOPQRSTUVWXYZ",1,cnt)
                        	its  = ceiling(rand()*100)
                        	FOR i = 1 TO its
                        		choices = *transpose(choices,ceiling(mod(rand()*100,cnt)),ceiling(mod(rand()*100,cnt)))
                        	next i
                        	scramble = choices
                        END FUNCTION
                        Then modified the disp function to pick up the number of choices in the tchoices parameter.

                        Code:
                        FUNCTION disp AS C (tchoices AS C )
                        	cnt = w_count(tchoices,",")
                        	lets = scramble(cnt)
                        	disp = ""
                        	i = 1
                        	for each foo in comma_to_crlf(tchoices)
                        		disp = disp + substr(lets,i,1)+". "+foo.value+crlf()
                        		i = i + 1
                        	next
                        	disp = sortsubstr(disp,crlf())
                        END FUNCTION

                        Code:
                        ? disp("one,two,three,four,five,six,seven")
                        = A. two
                        B. seven
                        C. three
                        D. five
                        E. six
                        F. four
                        G. one
                        
                        ? disp("one,two,three,four,five,six,seven")
                        = A. two
                        B. five
                        C. one
                        D. seven
                        E. four
                        F. three
                        G. six
                        
                        
                        ? disp("red,orange,yellow,green,blue,indigo,violet,mauve,cerise,vermillion,rose,crimson")
                        = A. violet
                        B. cerise
                        C. blue
                        D. yellow
                        E. mauve
                        F. rose
                        G. red
                        H. vermillion
                        I. indigo
                        J. orange
                        K. crimson
                        L. green
                        
                        ? disp("red,orange,yellow,green,blue,indigo,violet,mauve,cerise,vermillion,rose,crimson")
                        = A. green
                        B. yellow
                        C. orange
                        D. rose
                        E. indigo
                        F. violet
                        G. cerise
                        H. vermillion
                        I. crimson
                        J. red
                        K. blue
                        L. mauve
                        You probably don't want that many choices, but you can have them if you do. Also means you can

                        Code:
                        ? disp("true,false")
                        = A. true
                        B. false
                        
                        ? disp("true,false")
                        = A. false
                        B. true
                        Last edited by Stan Mathews; 03-12-2010, 03:04 PM.
                        There can be only one.

                        Comment


                          #13
                          Re: Help on this one please

                          This is getting better ;) Thanks!

                          Comment


                            #14
                            Re: Help on this one please

                            I will add that little bit to my kit bag
                            Definitely in my "Help" file as well---

                            Thank you Stan.

                            This will most likely at some time be yet another code snippet that I will use to create my own without having to reinvent the wheel---in fact it has been a rare occurence that I have NOT found code on the messageboard or help file to serve as a base for my own to modify! (now if only the webside had as many samples!....just needs a bit more time I guess to catch up).
                            Mike
                            __________________________________________
                            It is only when we forget all our learning that we begin to know.
                            It's not what you look at that matters, it's what you see.
                            Henry David Thoreau
                            __________________________________________



                            Comment

                            Working...
                            X