hi, I'm trying to develop an app in which I test my users' English knowledge. I shared the source of my project so you can see what I've done. What I need to know is that how can I connect the radio buttons tags to the index of right answer (which I've set in database) within the radio buttons in each question? There are 25 questions and each of them contains three radio buttons and one of them is the right answer according to their indexes set in the database but the problem is whatever I do, only the third radio button is the right answer for the user which is not right. for example the right answer is second radio button (index = 1), but I cannot connect, first the three specific 3 radio buttons to a specific question, and second, the right answer index to the radio button tag. I appreciate your help.
Set up an array with each set of radio buttons placing an number in a single known array location. ( 1 to 3 say)
Then check number in array with the corresponding number in the answer array. if the same correct, if not fail.
Hello rodmcm thank u, but it could be more understandable if u show how codes should be written. I did every single thing I could imagine would solve the problem but not worked and I got the same response, only option three was right which was not in fact.
csv = sq.ExecQuery("SELECT * FROM voc_tbl")
Dim RightAnswerIndex As Int
For i = 0 To csv.RowCount - 1
csv.Position = i
RightAnswerIndex = csv.GetInt("index") '<-- bad field name
Dim p As Panel
p.Initialize("")
listvv.Add(p,230dip, RightAnswerIndex)
p.LoadLayout("ll1")
RBv(RightAnswerIndex)
lblQv.Text = csv.GetString("question")
Next
I did all instructions u mentioned but I'm facing an error. the CustomListView that u uses is a class or a library? what u wrote is this (
listvv.Add(p,230dip, RightAnswerIndex)) but the CustomListView that I use has just 2 fields (listvv.Add(p,RightAnswerIndex)), and the error says object must first be initialized but I've initialized CustomListView
This is what you wrote, because you were using that class.
What I added to your code is what you need to set the tag of the RadioButtons, based on your db table.
I suggested to use the B4X CustomListView because it is "better" (many reasons);
hi, I'm trying to develop an app in which I test my users' English knowledge. I shared the source of my project so you can see what I've done. What I need to know is that how can I connect the radio buttons tags to the index of right answer (which I've set in database) within the radio buttons in each question? There are 25 questions and each of them contains three radio buttons and one of them is the right answer according to their indexes set in the database but the problem is whatever I do, only the third radio button is the right answer for the user which is not right. for example the right answer is second radio button (index = 1), but I cannot connect, first the three specific 3 radio buttons to a specific question, and second, the right answer index to the radio button tag. I appreciate your help.
Someone in the forum today asked for help. He has a series of questions. Each question can have many answers. He wanted the questions to appear one after the other. For each question one could choose an answer and immediately afterwards go to the next. I chose to create a Class. The result is...
This is what you wrote, because you were using that class.
What I added to your code is what you need to set the tag of the RadioButtons, based on your db table.
I suggested to use the B4X CustomListView because it is "better" (many reasons);
It is a pre-installed library library (you just have to select it, but remove the class before) View attachment 93412
thank u but the problem is not solved
this is the error I face
and the picture below shows all my codes
and this picture shows my checked libararies
and this one is my application's UI which I cannot complile right now, and I'd had taken the picture before the shown error
sure yeah but when I do the compression it doesn't lose kilobytes more so that i cannot send it here, what should I do?
this is the error in debug mode
Do you mean that when you use File - Export As Zip the zip file exceeds 500kb?
If so, use some tool (like 7-zip) to remove resource files (image files, mainly) and try to attach them separately.
Error line: 54
If listvv is a xCustomListView, you cannot add to a Panel that way, is must be created and added by Designer.
Do you mean that when you use File - Export As Zip the zip file exceeds 500kb?
If so, use some tool (like 7-zip) to remove resource files (image files, mainly) and try to attach them separately.
thank u, I added the CLV but now I have a question, there r 25 questions in the tab and each question has 3 radio buttons within which one is the correct answer, now how can I control the answers? I want to add a button at the end of the questions (one for all and not one for each) which is enabled only when all the questions are answered (whether true or false) by the user and when it's pressed, a messagebox shows up to inform how many questions out of 25 are answered correctly. how can I control it this way? sorry I'm asking too many questions, but the only reference I can use to learn b4a is this site. thank u. may I communicate u in whatsapp?
I would add some buttons after the xCLV, to complete the compilation of the questionnaire.
In the "Confirm button Click event", I would launch a routine that checks all the questions, analyzing (a For Each loop on the xCLV items) all the xCLV and perhaps highlighting the correct errors and answers in it (add some invisible views to each item).
You could also store the answers in a List, filling it with each click made on the radio buttons.
I would add some buttons after the xCLV, to complete the compilation of the questionnaire.
In the "Confirm button Click event", I would launch a routine that checks all the questions, analyzing (a For Each loop on the xCLV items) all the xCLV and perhaps highlighting the correct errors and answers in it (add some invisible views to each item).
You could also store the answers in a List, filling it with each click made on the radio buttons.