Skip to content

Commit

Permalink
Merge branch 'main' into dev-ridohendrawan
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridho Saputra authored Apr 14, 2022
2 parents e926da3 + e1a633c commit c45bc8f
Show file tree
Hide file tree
Showing 11 changed files with 180 additions and 24 deletions.
Binary file modified .DS_Store
Binary file not shown.
8 changes: 2 additions & 6 deletions abilitea.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
1569CD7027FF218600DAEA4C /* questionFeederProb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1569CD6F27FF218600DAEA4C /* questionFeederProb.swift */; };
1569CD7227FF21A400DAEA4C /* questionFeederCrit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1569CD7127FF21A400DAEA4C /* questionFeederCrit.swift */; };
15BA4D252805634300C409D3 /* WelcomepageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15BA4D242805634300C409D3 /* WelcomepageViewController.swift */; };
15BA4D27280563EA00C409D3 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15BA4D26280563EA00C409D3 /* SettingsViewController.swift */; };
15BA4D2C2805D3F400C409D3 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 15BA4D2B2805D3F400C409D3 /* SnapKit */; };
498D5FBA28002D8700F80C79 /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = 498D5FB928002D8700F80C79 /* .gitignore */; };
49BC74AD27FF1B4600F8E614 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49BC74AC27FF1B4600F8E614 /* AppDelegate.swift */; };
Expand All @@ -22,10 +21,10 @@
49BC74B427FF1B4600F8E614 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 49BC74B227FF1B4600F8E614 /* Main.storyboard */; };
49BC74B627FF1B4700F8E614 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 49BC74B527FF1B4700F8E614 /* Assets.xcassets */; };
49BC74B927FF1B4700F8E614 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 49BC74B727FF1B4700F8E614 /* LaunchScreen.storyboard */; };
A19A056D280091340087843F /* ModuleCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A19A056C280091340087843F /* ModuleCollectionViewCell.swift */; };
AFECDA54280581DB00F76D78 /* QuestionImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFECDA53280581DB00F76D78 /* QuestionImageCell.swift */; };
AFECF0D82800749600305FEB /* TutorialStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AFECF0D72800749600305FEB /* TutorialStoryboard.storyboard */; };
AFECF0DA280074B700305FEB /* TutorialController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFECF0D9280074B700305FEB /* TutorialController.swift */; };
A19A056D280091340087843F /* ModuleCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A19A056C280091340087843F /* ModuleCollectionViewCell.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -35,7 +34,6 @@
1569CD6F27FF218600DAEA4C /* questionFeederProb.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = questionFeederProb.swift; sourceTree = "<group>"; };
1569CD7127FF21A400DAEA4C /* questionFeederCrit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = questionFeederCrit.swift; sourceTree = "<group>"; };
15BA4D242805634300C409D3 /* WelcomepageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomepageViewController.swift; sourceTree = "<group>"; };
15BA4D26280563EA00C409D3 /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
498D5FB928002D8700F80C79 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = "<group>"; };
49BC74A927FF1B4600F8E614 /* abilitea.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = abilitea.app; sourceTree = BUILT_PRODUCTS_DIR; };
49BC74AC27FF1B4600F8E614 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -45,10 +43,10 @@
49BC74B527FF1B4700F8E614 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
49BC74B827FF1B4700F8E614 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
49BC74BA27FF1B4700F8E614 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A19A056C280091340087843F /* ModuleCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModuleCollectionViewCell.swift; sourceTree = "<group>"; };
AFECDA53280581DB00F76D78 /* QuestionImageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionImageCell.swift; sourceTree = "<group>"; };
AFECF0D72800749600305FEB /* TutorialStoryboard.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = TutorialStoryboard.storyboard; sourceTree = "<group>"; };
AFECF0D9280074B700305FEB /* TutorialController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TutorialController.swift; sourceTree = "<group>"; };
A19A056C280091340087843F /* ModuleCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModuleCollectionViewCell.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -78,7 +76,6 @@
497033C3280019BF0064E36F /* Controller */ = {
isa = PBXGroup;
children = (
15BA4D26280563EA00C409D3 /* SettingsViewController.swift */,
A19A056C280091340087843F /* ModuleCollectionViewCell.swift */,
49BC74B027FF1B4600F8E614 /* ViewController.swift */,
15BA4D242805634300C409D3 /* WelcomepageViewController.swift */,
Expand Down Expand Up @@ -210,7 +207,6 @@
files = (
15BA4D252805634300C409D3 /* WelcomepageViewController.swift in Sources */,
1569CD7227FF21A400DAEA4C /* questionFeederCrit.swift in Sources */,
15BA4D27280563EA00C409D3 /* SettingsViewController.swift in Sources */,
AFECDA54280581DB00F76D78 /* QuestionImageCell.swift in Sources */,
49BC74B127FF1B4600F8E614 /* ViewController.swift in Sources */,
49BC74AD27FF1B4600F8E614 /* AppDelegate.swift in Sources */,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,48 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>SnapKitPlayground (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>SnapKitPlayground (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>SnapKitPlayground (Playground) 3.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>SnapKitPlayground (Playground) 4.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>5</integer>
</dict>
<key>SnapKitPlayground (Playground) 5.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>6</integer>
</dict>
<key>SnapKitPlayground (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>abilitea.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
Expand Down
7 changes: 5 additions & 2 deletions abilitea/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="lEO-nd-pG7">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="lEO-nd-pG7">
<device id="retina6_0" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="collection view cell content view" minToolsVersion="11.0"/>
Expand Down Expand Up @@ -210,6 +210,9 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<tabBarItem key="tabBarItem" title="Homepage" image="icon-home-black" selectedImage="icon-home-white" id="Mc5-CN-PJD"/>
<connections>
<outlet property="testLabel" destination="kBy-4v-hI9" id="Mn4-Lw-Bfw"/>
</connections>
<navigationItem key="navigationItem" id="a6c-ld-yGr"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="u0Z-hm-1yI" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
Expand Down
63 changes: 61 additions & 2 deletions abilitea/Controller/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,34 @@ extension UIColor {
class HomepageViewController: UIViewController, UICollectionViewDelegate,UICollectionViewDataSource {

let occupationSelected = UserDefaults.standard.object(forKey: "occupation") as? String //sebagai data yang bakal dipake buat occupation yang sesuai


var modulCognitivesSD:[String]=["homepage-module-PS-beforeFinish","homepage-module-CT-beforeFinish","homepage-module-AtD-beforeFinish"]
var modulCognitivesGD:[String]=["homepage-module-SR-beforeFinish","homepage-module-CT-beforeFinish","homepage-module-PS-beforeFinish"]
var modulCognitivesAcc:[String]=["homepage-module-NM-beforeFinish","homepage-module-RC-beforeFinish","homepage-module-SR-beforeFinish"]
var modulCognitivesSales:[String]=["homepage-module-SR-beforeFinish","homepage-module-NM-beforeFinish","homepage-module-CT-beforeFinish"]

var modulCognitivesCE:[String] =
["homepage-module-SR-beforeFinish","homepage-module-NM-beforeFinish","homepage-module-PS-beforeFinish"]

var modulCognitivesEE:[String] =
["homepage-module-NM-beforeFinish","homepage-module-CT-beforeFinish","homepage-module-PS-beforeFinish"]

var modulCognitives:[String]=["homepage-module-RC-beforeFinish","homepage-module-PS-beforeFinish","homepage-module-SR-beforeFinish","homepage-module-CT-beforeFinish","homepage-module-NM-beforeFinish","homepage-module-AtD-beforeFinish"]


//Data control
var categoryCheck:Int?
var finished:Bool = false



//outlet countdown

@IBOutlet weak var testLabel: UITextField!
let currDate = Date()
var timeRemainingSeconds:Int = 0
var timeRemaining:String?
var timer = Timer()

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
if(occupationSelected == nil){
return modulCognitives.count //return 6
Expand Down Expand Up @@ -108,6 +129,7 @@ class HomepageViewController: UIViewController, UICollectionViewDelegate,UIColle
// cell.modulCognitive.layer.cornerRadius=50.0
return cell
}


//untuk pengecekkan kategori pada masing-masing occupation terhadap index dalam modulCognitives
func cellClickable(chosen:String){
Expand Down Expand Up @@ -160,7 +182,44 @@ class HomepageViewController: UIViewController, UICollectionViewDelegate,UIColle
var modulCognitives:[String]=["Numberical Reasoning-beforeFinish-FixSize","Problem Solving-beforeFinish-FixSize","Critical Thinking-beforeFinish-FixSize","Reading Comperhension-beforeFinish-FixSize","Attention to Detail-beforeFinish-FixSize","Spatial Reasoning-beforeFinish-FixSize"]

var modulCognitivesFinished:[String]=["Numberical Reasoning-afterFinish-FixSize","Problem Solving-afterFinish-FixSize","Critical Thinking-afterFinish-FixSize","Reading Comperhension-afterFinish-FixSize","Attention to Detail-afterFinish-FixSize","Spatial Reasoning-afterFinish-FixSize"]

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor(hex:0x6B5BE2)
runCountdown()
}

//countdown

func runCountdown(){
timer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(self.countTime), userInfo: nil, repeats: true)

}

@objc func countTime(){
timeRemainingSeconds = 86400 + Int(currDate.timeIntervalSinceNow)
var hour:Int
var minute:Int

hour = timeRemainingSeconds / 3600
minute = timeRemainingSeconds % 3600 / 60

timeRemaining = "\(String(hour)) Hr \(String(minute)) Minutes"

testLabel.text = timeRemaining

if timeRemainingSeconds == 0{
timer.invalidate()
}
}

}


class SettingsViewController: UIViewController {

@IBOutlet weak var Occupation: UITextField!
//inisiasi variable category berdasarkan occupation

override func viewDidLoad() {
super.viewDidLoad()
Expand Down
2 changes: 1 addition & 1 deletion abilitea/Models/questionFeederCrit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct questionFeederCrit{

init(){
//initialize all objects
let question0 = questionStructure(questionImage: nil, questionText: "Statement : In a day of basketball match, the total scores made by a team were 100. Out of these, 60 scores were made by point guards and 20 were made by Lebron James, Conclusions : I. Lebron James is not a Point Guard. II. 60% of the team consist of point guards.", optionA: "Only 1 Conclusion follows", optionB: "Both Conclusions follow.", optionC: "First Conclusion follow while second doesn't", optionD: "Neither of them follow", answer: "Neither of them follow")
let question0 = questionStructure(questionImage: nil, questionText: "Statement : In a day of basketball match, the total scores made by a team were 100. Out of these, 60 scores were made by point guards and 20 were made by Lebron James, Conclusions : I. Lebron James is not a Point Guard. II. 60% of the team consist of point guards.", optionA: "Only 1 Conclusion follows", optionB: "Both Conclusions follow.", optionC: "First Conclusion follow while second doesn't", optionD: "Neither of them follow", answer: "Neither of them follow", category: "Critical Thinking")

arrOfQuestionCrit.append(question0)

Expand Down
Loading

0 comments on commit c45bc8f

Please sign in to comment.