Skip to content

Commit 301f976

Browse files
committed
new functions and license added
1 parent 92ba65e commit 301f976

File tree

6 files changed

+37
-41
lines changed

6 files changed

+37
-41
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
## 0.0.1
22

3-
* First release of Quiz App.
3+
* First release of Quiz package.
4+
5+
## 0.0.2
6+
7+
* getter functions added
8+
9+

LICENSE

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
MIT License
1+
clause BSD License.
22

3-
Copyright (c) 2022 Mahesh Jadhav
3+
Copyright <2022> <Mahesh Jadhav>
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
116

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
7+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
148

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
9+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10+
11+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Simple and useful package to create multiple choice quizes or questions in your
1515

1616
## Features
1717

18-
Use it to create quizes
18+
- Easy to read and
19+
- Simple to use
1920

2021
## Getting started
2122

@@ -26,11 +27,8 @@ create objects of class Quizzy in your app and then use it to build quizes
2627
Quizzy q1=Quizzy('question text',['multiple','options'],1);
2728
q1.checkAns(1);
2829
```dart
29-
const like = 'sample';
3030
```
3131

3232
## Additional information
3333

34-
TODO: Tell users more about the package: where to find more information, how to
35-
contribute to the package, how to file issues, what response they can expect
36-
from the package authors, and more.
34+

lib/quiz.dart

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
library quiz;
22

33
class Quiz {
4-
String? questiontext;
5-
List? options;
6-
int? ans;
7-
Quiz(q, o, a) {
8-
questiontext = q;
9-
options = o;
10-
ans = a;
4+
String _questiontext = '';
5+
List _options = [];
6+
int _ans = 0;
7+
Quiz(String q, List o, int a) {
8+
_questiontext = q;
9+
_options = o;
10+
_ans = a;
1111
}
12-
bool checkAns(int userchoice) {
13-
return options![ans!-1] == options![userchoice-1];
12+
get getQue {
13+
return _questiontext;
1414
}
1515

16-
}
16+
get getOpt {
17+
return _options;
18+
}
19+
20+
get getAns {
21+
return _options[_ans - 1];
22+
}
23+
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: quiz
22
description: A new Flutter package project.
3-
version: 0.0.1
3+
version: 0.0.2
44
homepage: https://github.com/ursmaheshj/quiz.git
55

66
environment:

test/quiz_test.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
import 'package:flutter_test/flutter_test.dart';
2-
3-
//import 'package:quiz/quiz.dart';
4-
5-
void main() {
6-
test('adds one to input values', () {});
7-
}

0 commit comments

Comments
 (0)