~humaid/question

A library of classes which allows you to create questions easily for Console Applications.
fdb2f4e3 — Humaid AlQassimi 5 years ago
Update README.md
94e78caf — hmksq 5 years ago
Added C# class
ed406822 — Humaid AlQassimi 5 years ago
Added how to use section

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~humaid/question
read/write
git@git.sr.ht:~humaid/question

You can also use your local clone with git send-email.

#Question

A library of classes which allows you to create questions easily for Console Applications!

#How to use

#VB.NET

' Clone the object
Dim MyQuestion As Question

' Initialize
MyQuestion = New Question(
1, '  Question number/ID, will be displayed to user
"What is CIL?", ' The Question
"Code Intermedia Language", ' Option A
"Common Interface Locale", ' Option B
"Common Intermediate Language", ' Option C (Correct answer)
"Common Integer Language", ' Option D
Question.QuestionOption.C) ' The correct answer (In the case, C)

' Display the question
MyQuestion.Run()

' Check if the user passed that question
If MyQuestion.Passed Then
    Console.WriteLine("Good job!")
Else
    Console.WriteLine("You could do better next time!")
End If

#CSharp

// Clone the object
Question myQuestion;

// Initialize
myQuestion = new Question(
    1, // Question number/ID, will be displayed to user
    "What is CIL?", // The Question
    "Code Intermedia Language", // Option A
    "Common Interface Locale", // Option B
    "Common Intermediate Language", // Option C (Correct answer)
    "Common Integer Language", // Option D
    Question.QuestionOption.C); // The correct answer (In this case, C)

// Display the question
myQuestion.Run();

// Check if the user passed that question
if (myQuestion.passed())
{
    Console.WriteLine("Good Job!");
} 
else {
    Console.WriteLine("You could do better next time!");
}