Skip to content

Maha Alatawi #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions quiz_app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/
3 changes: 3 additions & 0 deletions quiz_app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

- Initial version.
2 changes: 2 additions & 0 deletions quiz_app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.
30 changes: 30 additions & 0 deletions quiz_app/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
28 changes: 28 additions & 0 deletions quiz_app/bin/gitcommands.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'dart:io';

// This function is used to ask the three question
int question3(int degree) {
Map<String, dynamic> question3 = {
"1": "git add, git commit, git push",
"2": "git pull, git push, git commit",
"3": "git init, git add, git commit",
"4": "git clone, git add, git commit"
};
var correctAnswer = "1";

print("What are the three main commands to upload project in GitHub?\n");
print("1: ${question3["1"]}");
print("2: ${question3["2"]}");
print("3: ${question3["3"]}");
print("4: ${question3["4"]}");
print("Enter your answer: ");

var userAnswer = stdin.readLineSync();
if (userAnswer == correctAnswer) {
print("Correct!");
degree++;
} else {
print("Incorrect! The correct answer is: ${question3[correctAnswer]}");
}
return degree;
}
28 changes: 28 additions & 0 deletions quiz_app/bin/gitdef.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'dart:io';

// This function is used to ask the first question
int question1(int degree) {
Map<String, dynamic> question1 = {
"1": "A version control system",
"2": "A programming language",
"3": "A database",
"4": "A software development tool"
};
var correctAnswer = "1";

print("What is Git?\n");
print("1: ${question1["1"]}");
print("2: ${question1["2"]}");
print("3: ${question1["3"]}");
print("4: ${question1["4"]}");
print("Enter your answer: ");

var userAnswer = stdin.readLineSync();
if (userAnswer == correctAnswer) {
print("Correct!");
degree++;
} else {
print("Incorrect! The correct answer is: ${question1[correctAnswer]}");
}
return degree;
}
28 changes: 28 additions & 0 deletions quiz_app/bin/githubdef.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'dart:io';

// This function is used to ask the second question
int question2(int degree) {
Map<String, dynamic> question2 = {
"1": "A database management system (DBMS)",
"2": "A programming language",
"3": "A web-based platform for version control and collaboration",
"4": "An operating system"
};
var correctAnswer = "3";

print("What is GitHub?\n");
print("1: ${question2["1"]}");
print("2: ${question2["2"]}");
print("3: ${question2["3"]}");
print("4: ${question2["4"]}");
print("Enter your answer: ");

var userAnswer = stdin.readLineSync();
if (userAnswer == correctAnswer) {
print("Correct!");
degree++;
} else {
print("Incorrect! The correct answer is: ${question2[correctAnswer]}");
}
return degree;
}
24 changes: 24 additions & 0 deletions quiz_app/bin/githubtf.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'dart:io';

// This function is used to ask the five question
int question5(int degree) {
Map<String, dynamic> question5 = {
"1": "True",
"2": "False",
};
var correctAnswer = "1";

print("GitHub launched on 2008?\n");
print("1: ${question5["1"]}");
print("2: ${question5["2"]}");
print("Enter your answer: ");

var userAnswer = stdin.readLineSync();
if (userAnswer == correctAnswer) {
print("Correct!");
degree++;
} else {
print("Incorrect! The correct answer is: ${question5[correctAnswer]}");
}
return degree;
}
24 changes: 24 additions & 0 deletions quiz_app/bin/gittruefales.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'dart:io';

// This function is used to ask the four question
int question4(int degree) {
Map<String, dynamic> question4 = {
"1": "True",
"2": "False",
};
var correctAnswer = "2";

print("Git created by apple?\n");
print("1: ${question4["1"]}");
print("2: ${question4["2"]}");
print("Enter your answer: ");

var userAnswer = stdin.readLineSync();
if (userAnswer == correctAnswer) {
print("Correct!");
degree++;
} else {
print("Incorrect! The correct answer is: ${question4[correctAnswer]}");
}
return degree;
}
40 changes: 40 additions & 0 deletions quiz_app/bin/quiz_app.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import 'gitdef.dart';
import 'githubdef.dart';
import 'gitcommands.dart';
import 'gittruefales.dart';
import 'githubtf.dart';

void main() {
int degree = 0;
print("_________________________________\n");
print("Quiz: Git and GitHub Quiz");
print("Date: ${DateTime.now()}\n");
print("_________________________________\n");
print(" Welcome to the Git and GitHub quiz\n");
print("This quiz will help you understand Git and GitHub");
print("Good luck!\n\n\n");

print("Question 1: Multiple Choice");
print("_________________________________\n");

degree = question1(degree);
degree = question2(degree);
degree = question3(degree);

print("_________________________________\n");

print("Question 2: True or False");
print("_________________________________\n");

degree = question4(degree);
degree = question5(degree);

print("_________________________________\n");
print("Your final score is: $degree");

if (degree == 5) {
print("Congratulations! You have passed the quiz!");
} else {
print("You have failed the quiz. Please try again.");
}
}
3 changes: 3 additions & 0 deletions quiz_app/lib/quiz_app.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int calculate() {
return 6 * 7;
}
Loading