Skip to content

Commit 15c40cd

Browse files
authored
Update README.md
1 parent cc3c072 commit 15c40cd

File tree

1 file changed

+84
-3
lines changed

1 file changed

+84
-3
lines changed

README.md

+84-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ CheckboxQuestions is a library that provides with different forms of asking ques
2626
</li>
2727
<li><a href="#YesOrNoQuestions">YesOrNoQuestions</a></li>
2828
<li><a href="#MultipleChoiceQuestions">MultipleChoiceQuestions</a></li>
29+
<li><a href="#MultipleAnswerQuestions">MultipleAnswerQuestions</a></li>
2930
<li><a href="#Questions">Questions</a></li>
3031
</ul>
3132

@@ -361,9 +362,83 @@ Returns an int of the selected answer.
361362
### `setQuestion(String question)`
362363
Sets the question text.
363364

365+
# MultipleAnswerQuestions
366+
```xml
367+
<com.aadyad.checkboxquestion.MultipleAnswerQuestion
368+
android:layout_width="wrap_content"
369+
android:layout_height="wrap_content"
370+
app:question_title="Which equations are equivalent to 90 + 30"
371+
app:question_number="10"
372+
app:number_enabled="true"
373+
app:option_text_size="20"
374+
app:question_text_size="25"
375+
app:spacing_between_boxes="30"
376+
app:checkbox_orientation="full_vertical"
377+
app:option_1="91 + 29"
378+
app:option_2="50 + 70"
379+
app:option_3="100 + 20"
380+
app:option_4="99 + 890980"/>
381+
```
382+
383+
## Number Enabled
384+
The `number_enabled` attribute allows you to make the number visible or not.
385+
386+
## Spacing Between Boxes
387+
The `spacing_between_boxes` attribute allows you to choose the spacing between the checkboxes.
388+
389+
## Checkbox Location
390+
The `checkbox_location` attribute allows you to choose whether the checkboxes are to the left, center, or right of the screen. To specify where they are just use `app:checkbox_location="left"`, `app:checkbox_location="center"`, or`app:checkbox_location="right"`.
391+
392+
## Checkbox Orientation
393+
The `checkbox_orientation` attribute allows you to choose whether the checkboxes are stacked or if they are horizontal. To stack them use `app:checkbox_orientation="split_vertical"` to use the horizontally use `app:checkbox_orientation="horizontal"`
394+
395+
## Question Number
396+
The `question_number` attribute allows you to set the number of the question.
397+
398+
## Question Title
399+
The `question_title` attribute allows you to set the question text.
400+
401+
## Question Text Size
402+
The `question_text_size` attribute allows you to set the question text size.
403+
404+
## Option Text Size
405+
The `option_text_size` attribute allows you to set the option text size.
406+
407+
## Options
408+
The `option_1` attribute lets you set the text for option 1.
409+
The `option_2` attribute lets you set the text for option 2.
410+
The `option_3` attribute lets you set the text for option 3.
411+
The `option_4` attribute lets you set the text for option 4.
412+
413+
## Methods
414+
415+
### `setCheckedOption(String option)`
416+
Allows you to choose which option is checked using the option text.
417+
418+
### `setCheckedOption(int option)`
419+
Allows you to choose which option is checked using the index of the option (Starts at 1, NOT 0).
420+
421+
### `doOnValueChanged(Runnable runnable)`
422+
Runs a runnable when a new option is selected.
423+
424+
### `setCheckboxOrientation(int orientation)`
425+
Sets the orientation of the checkboxes.
426+
427+
### `setQuestionTextSize(float questionTextSize)`
428+
Sets the textsize of the question.
429+
430+
### `setOptionTextSize(float optionTextSize)`
431+
Sets the textsize for the options.
432+
433+
### `getAnswer()`
434+
Returns an Integer ArrayList of the selected answer.
435+
436+
### `setQuestion(String question)`
437+
Sets the question text.
438+
364439
# Questions
365440
Questions are an object that allow you to make a QuestionList full of Multiple Choice Questions.
366-
There are 2 constructors for the Question object, which means there are 2 ways to define your Question object
441+
There are 3 constructors for the Question object, which means there are 2 ways to define your Question object
367442

368443
One way:
369444
```java
@@ -380,6 +455,12 @@ Another way to create a Question is:
380455
```java
381456
Question q = new Question("What is the slope intercept equation of a line?", "y = mx + b", Question.MULTIPLE_CHOICE_QUESTION, "x = yb + m", "y = mx + b", "m = yx + b", "b = mx + y");
382457
```
383-
In this example, the second arg is a string of the correct answer. Everything else stays the same.
384458

385-
If there is no answer, the second arg can be set to Question.NO_ANSWER (or 0).
459+
The final way is:
460+
```java
461+
Question q = new Question("What is the slope intercept equation of a line?", new ArrayList<Integer>(Arrays.asList(1, 2, 3)), Question.MULTIPLE_ANSWER_QUESTION, "x = yb + m", "y = mx + b", "m = yx + b", "b = mx + y");
462+
```
463+
464+
In this example, the second arg is an Integer ArrayList of the correct answers. Everything else stays the same.
465+
466+
If there is no answer, the second arg can be set to Question.NO_ANSWER (or 0), or null.

0 commit comments

Comments
 (0)