From 14b74242182122c819683a7264e1362214048601 Mon Sep 17 00:00:00 2001
From: Syndamia <kami02882@gmail.com>
Date: Fri, 29 Nov 2019 15:35:13 +0200
Subject: Added "Who wants to be a millionare?" - Africa PowerPoint project

Added the presentation, some README files to explain a bit and added the code (extracted it from the presentation)
---
 .../Extracted code/Slide3.cls                      | 211 +++++++++++++++++++++
 1 file changed, 211 insertions(+)
 create mode 100644 Who wants to become a millionare - Africa (BG)/Extracted code/Slide3.cls

(limited to 'Who wants to become a millionare - Africa (BG)/Extracted code/Slide3.cls')

diff --git a/Who wants to become a millionare - Africa (BG)/Extracted code/Slide3.cls b/Who wants to become a millionare - Africa (BG)/Extracted code/Slide3.cls
new file mode 100644
index 0000000..1f70d63
--- /dev/null
+++ b/Who wants to become a millionare - Africa (BG)/Extracted code/Slide3.cls	
@@ -0,0 +1,211 @@
+VERSION 1.0 CLASS
+BEGIN
+  MultiUse = -1  'True
+END
+Attribute VB_Name = "Slide3"
+Attribute VB_GlobalNameSpace = False
+Attribute VB_Creatable = False
+Attribute VB_PredeclaredId = True
+Attribute VB_Exposed = True
+Dim correctAns As Boolean
+Const currQuestion As Integer = 1
+
+'Button_Click events
+
+Private Sub cmdAnswerA_Click()
+
+If Not (lblSureAbtAns.Visible) Then
+    Mark "A"
+Else
+    Finalize "A"
+End If
+
+End Sub
+
+Private Sub cmdAnswerB_Click()
+
+If Not (lblSureAbtAns.Visible) Then
+    Mark "B"
+Else
+    Finalize "B"
+End If
+
+End Sub
+
+Private Sub cmdAnswerC_Click()
+
+If Not (lblSureAbtAns.Visible) Then
+    Mark "C"
+Else
+    Finalize "C"
+End If
+
+End Sub
+
+Private Sub cmdAnswerD_Click()
+
+If Not (lblSureAbtAns.Visible) Then
+    Mark "D"
+Else
+    Finalize "D"
+End If
+
+End Sub
+
+Private Sub cmdFiftyFifty_Click()
+
+Slide2.UseFiftyFifty
+
+Dim keepWrong As String, currCorrect As String
+keepWrong = Slide2.GetWrongAnsToKeep(currQuestion)
+currCorrect = Slide2.GetCorrAnswer(currQuestion)
+
+EnableAnswer "All", False
+EnableAnswer keepWrong, True
+EnableAnswer currCorrect, True
+
+End Sub
+
+
+Private Sub cmdGiveUp_Click()
+
+Slide2.EndGame 0
+
+End Sub
+
+Private Sub cmdPhoneFriend_Click()
+
+Slide2.UsePhoneFriend
+imgFriendMsg.Visible = False
+
+End Sub
+
+Private Sub cmdAskAudience_Click()
+
+Slide2.UseAskAudience
+imgAskAudience.Visible = False
+
+End Sub
+
+Private Sub cmdContinue_Click()
+   
+If Not (correctAns) Then
+Slide2.EndGame 0
+Else
+SlideShowWindows(1).View.Next
+End If
+   
+End Sub
+
+' Chosing answers
+
+Private Sub Mark(chosenAnswer As String)
+
+ColorAnswer chosenAnswer, "Orange"
+DisabledAllLifeLines True
+cmdGiveUp.Enabled = False
+
+lblSureAbtAns.Visible = True
+
+End Sub
+
+Private Sub Finalize(chosenAnswer As String)
+
+If cmdAnswerA.BackColor <> 0 Or cmdAnswerB.BackColor <> 0 Or cmdAnswerC.BackColor <> 0 Or cmdAnswerD.BackColor <> 0 Then
+    ColorAllAnswers "Black"
+    ColorAnswer chosenAnswer, "Orange"
+End If
+ColorAnswer Slide2.GetCorrAnswer(currQuestion), "Green"
+
+EnableAnswer "All", False
+lblSureAbtAns.Visible = False
+
+If chosenAnswer = Slide2.GetCorrAnswer(currQuestion) Then
+    correctAns = True
+End If
+
+cmdContinue.Visible = True
+    'reloads current slide, continue button can't be pressed sometimes (bug) when made visible
+Application.SlideShowWindows(1).View.GotoSlide Me.SlideIndex
+End Sub
+
+'Changing answer properties
+
+Private Sub ColorAnswer(answer As String, colorName As String)
+
+Select Case answer
+    Case "A": cmdAnswerA.BackColor = Slide2.GetColor(colorName)
+    Case "B": cmdAnswerB.BackColor = Slide2.GetColor(colorName)
+    Case "C": cmdAnswerC.BackColor = Slide2.GetColor(colorName)
+    Case "D": cmdAnswerD.BackColor = Slide2.GetColor(colorName)
+End Select
+
+End Sub
+
+Private Sub ColorAllAnswers(colorName As String)
+
+ColorAnswer "A", colorName
+ColorAnswer "B", colorName
+ColorAnswer "C", colorName
+ColorAnswer "D", colorName
+
+End Sub
+
+Private Sub EnableAnswer(answer As String, isEnabled As Boolean)
+
+Select Case answer
+    Case "A": cmdAnswerA.Enabled = isEnabled
+    Case "B": cmdAnswerB.Enabled = isEnabled
+    Case "C": cmdAnswerC.Enabled = isEnabled
+    Case "D": cmdAnswerD.Enabled = isEnabled
+    Case "All":
+        EnableAnswer "A", isEnabled
+        EnableAnswer "B", isEnabled
+        EnableAnswer "C", isEnabled
+        EnableAnswer "D", isEnabled
+End Select
+
+End Sub
+
+'Public methods
+
+Public Sub DisabledLifeLine(lifeLineName As String, isDisabled As Boolean)
+
+Select Case lifeLineName
+    Case "FiftyFifty": cmdFiftyFifty.Enabled = Not (isDisabled)
+    Case "PhoneFriend": cmdPhoneFriend.Enabled = Not (isDisabled)
+    Case "AskAudience": cmdAskAudience.Enabled = Not (isDisabled)
+End Select
+
+End Sub
+
+Public Sub DisabledAllLifeLines(areDisabled As Boolean)
+
+
+DisabledLifeLine "FiftyFifty", areDisabled
+DisabledLifeLine "PhoneFriend", areDisabled
+DisabledLifeLine "AskAudience", areDisabled
+
+End Sub
+
+Public Sub Reset()
+
+correctAns = False
+
+DisabledAllLifeLines False
+cmdGiveUp.Enabled = True
+EnableAnswer "All", True
+
+ColorAllAnswers "Black"
+
+cmdContinue.Visible = False
+imgFriendMsg.Visible = True
+imgAskAudience.Visible = True
+
+End Sub
+
+Public Property Get GuessedCorrectly()
+    GuessedCorrectly = correctAns
+End Property
+
+'Kamen Mladenov 2019
-- 
cgit v1.2.3

