Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7802407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:15:20+00:00 2026-06-02T01:15:20+00:00

I am working on quiz application . For each question there are multiple options

  • 0

I am working on quiz application. For each question there are multiple options should be selected. For that I have used checkboxes. When check box is checked I am storing the checked id value in arraylist and if unchecked I am removing that id from the arraylist. Also before this I am adding the number of answers for each question in the arraylist and in the next button click I am adding an “|”(or) symbol to differentiate the questions.

So for example 3 questions are displayed….then my arraylist contains

enter image description here

Now for the first question I selected 3 option, for second question I selected 4 options and for third question I didnt select any of the option. So for third question only the number of correct answers and the | symbol is displayed. But now my problem if none of the checkboxes are selected I want to pass a value in the arraylist. How can I do that? Please help me regarding this….Struggling for this since 3 days….

My Code:

cbs[k].setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {

        if (((CheckBox) v).isChecked()) {

            selchkboxlist.add(Integer.toString(v
                    .getId()));

            System.out.println("chkboxlist size"
                    + selchkboxlist.size());

        } 
        else
        {

            selchkboxlist.remove(Integer.toString(v
                    .getId()));
            System.out
                    .println("after delete chkboxlist size"
                            + selchkboxlist.size());
            }

    }
}); 

Will be thankful in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:15:23+00:00Added an answer on June 2, 2026 at 1:15 am

    Then before going to next question check your arraylist..

     int k=yourlist.length();
      if(Integer.parseInt(yourlist.get(k-2))<=4){
     //then it is number of answers and no check box has been checked..
      arraylist.set(k-1,new String("some value to indicate nothing"));
      arraylist.add("|");
    
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on quiz application . For each question there are multiple answers
I have a basic quiz/survey type application I'm working on, and I'd like to
The code is working!! I now have a quiz that does the following: A
I'm trying to grade a quiz application I would like to make. I have
I have little quiz game I've working on and am tracking correct answers. I
I am working on quiz application. It contains 2 types of tests. The first
Newbie error? Im working on a quiz app that uses answer results from a
I'm working to a system called Quiz ... The last thing that remains are
I have created an android quiz application where i have a feature Exam .
I'm working on very big project - quiz system (examination). And have a few

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.