Skip to content

Commit

Permalink
Merge pull request #644 from StepicOrg/release/1.111
Browse files Browse the repository at this point in the history
Release 1.111
  • Loading branch information
ivan-magda authored Feb 4, 2020
2 parents 13aa195 + 90d0b41 commit ce6f49d
Show file tree
Hide file tree
Showing 172 changed files with 3,619 additions and 1,219 deletions.
6 changes: 3 additions & 3 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def shared_pods
pod 'Alamofire', '4.9.1'
pod 'Atributika', '4.9.4'
pod 'SwiftyJSON', '5.0.0'
pod 'SDWebImage', '5.5.1'
pod 'SDWebImage', '5.5.2'
pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '2.x'
pod 'Logging', '1.2.0'
pod 'Fabric', '1.10.2'
Expand All @@ -35,7 +35,7 @@ def all_pods
pod 'Firebase/Analytics' , '6.14.0'
pod 'Firebase/RemoteConfig', '6.14.0'

pod 'YandexMobileMetrica/Dynamic', '3.8.2'
pod 'YandexMobileMetrica/Dynamic', '3.9.2'
pod 'Amplitude-iOS', '4.9.3'
pod 'Branch', '0.31.0'

Expand All @@ -54,7 +54,7 @@ def all_pods

pod 'Presentr', '1.9'

pod 'Agrume', '5.6.0'
pod 'Agrume', '5.6.1'
pod 'Highlightr', '2.1.0'
pod 'TTTAttributedLabel', '2.0.0'
pod 'lottie-ios', '2.5.3'
Expand Down
32 changes: 16 additions & 16 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- ActionSheetPicker-3.0 (2.4.0)
- Agrume (5.6.0):
- Agrume (5.6.1):
- SwiftyGif
- Alamofire (4.9.1)
- Amplitude-iOS (4.9.3)
Expand Down Expand Up @@ -158,9 +158,9 @@ PODS:
- Protobuf (3.11.2)
- Quick (2.2.0)
- Reveal-SDK (24)
- SDWebImage (5.5.1):
- SDWebImage/Core (= 5.5.1)
- SDWebImage/Core (5.5.1)
- SDWebImage (5.5.2):
- SDWebImage/Core (= 5.5.2)
- SDWebImage/Core (5.5.2)
- SnapKit (5.0.1)
- STRegex (2.1.0)
- SVGKit (2.1.0):
Expand All @@ -179,16 +179,16 @@ PODS:
- TUSafariActivity (1.0.4)
- URITemplate (3.0.0)
- VK-ios-sdk (1.5.1)
- YandexMobileMetrica/Dynamic (3.8.2):
- YandexMobileMetrica/Dynamic/Core (= 3.8.2)
- YandexMobileMetrica/Dynamic/Crashes (= 3.8.2)
- YandexMobileMetrica/Dynamic/Core (3.8.2)
- YandexMobileMetrica/Dynamic/Crashes (3.8.2):
- YandexMobileMetrica/Dynamic (3.9.2):
- YandexMobileMetrica/Dynamic/Core (= 3.9.2)
- YandexMobileMetrica/Dynamic/Crashes (= 3.9.2)
- YandexMobileMetrica/Dynamic/Core (3.9.2)
- YandexMobileMetrica/Dynamic/Crashes (3.9.2):
- YandexMobileMetrica/Dynamic/Core

DEPENDENCIES:
- ActionSheetPicker-3.0 (= 2.4.0)
- Agrume (= 5.6.0)
- Agrume (= 5.6.1)
- Alamofire (= 4.9.1)
- Amplitude-iOS (= 4.9.3)
- Atributika (= 4.9.4)
Expand Down Expand Up @@ -220,7 +220,7 @@ DEPENDENCIES:
- PromiseKit (= 6.13.0)
- Quick (= 2.2.0)
- Reveal-SDK
- SDWebImage (= 5.5.1)
- SDWebImage (= 5.5.2)
- SnapKit (= 5.0.1)
- STRegex (= 2.1.0)
- SVGKit (from `https://github.com/SVGKit/SVGKit.git`, branch `2.x`)
Expand All @@ -233,7 +233,7 @@ DEPENDENCIES:
- TTTAttributedLabel (= 2.0.0)
- TUSafariActivity (= 1.0.4)
- VK-ios-sdk (= 1.5.1)
- YandexMobileMetrica/Dynamic (= 3.8.2)
- YandexMobileMetrica/Dynamic (= 3.9.2)

SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
Expand Down Expand Up @@ -319,7 +319,7 @@ CHECKOUT OPTIONS:

SPEC CHECKSUMS:
ActionSheetPicker-3.0: c68e1f8355828b4e1c823fa87185aacfef5e6fe3
Agrume: c3e5858b50bbfb32611898624d7da017f992f1db
Agrume: 101c9874313f9e33b70c477e094e40a2f7e56910
Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18
Amplitude-iOS: 122e026c44db8460e5efcf84859aa290a0ae9786
Atributika: 643a248e2dd8b4d74b23b53ea31393cab0a01d94
Expand Down Expand Up @@ -368,7 +368,7 @@ SPEC CHECKSUMS:
Protobuf: dd1aaea7140debfe4dd0683fb8ef208e527ae153
Quick: 7fb19e13be07b5dfb3b90d4f9824c855a11af40e
Reveal-SDK: 5d7e56b8f018c0a88b3a2c10bf68d598bbd3b071
SDWebImage: 1245d058b7b8f59adef7a6da6bbafd4f1ab67041
SDWebImage: 4d5c027c935438f341ed33dbac53ff9f479922ca
SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb
STRegex: dfa420d93d8c1402956233b3879ec1fc14b45fbe
SVGKit: 8a2fc74258bdb2abb54d3b65f3dd68b0277a9c4d
Expand All @@ -383,8 +383,8 @@ SPEC CHECKSUMS:
TUSafariActivity: afc55a00965377939107ce4fdc7f951f62454546
URITemplate: 58e0d47f967006c5d59888af5356c4a8ed3b197d
VK-ios-sdk: 62a10b6571fbcda0657f455fedce7fedf55b4cd0
YandexMobileMetrica: edb00e8af2903290e142ba4c488adf8d394e828a
YandexMobileMetrica: ea82087806f175981c9eccbb8e35f1d4ee35d788

PODFILE CHECKSUM: ddd8fc897562a54318454d89332f656049ae9093
PODFILE CHECKSUM: cd262647e966daed303a0675002ffac8f97cf697

COCOAPODS: 1.8.4
250 changes: 156 additions & 94 deletions Stepic.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Stepic/AchievementBadgeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ final class AchievementBadgeView: UIView {

circleProgressLayer.path = circlePath.cgPath
circleProgressLayer.fillColor = nil
circleProgressLayer.strokeColor = UIColor.stepicGreen.cgColor
circleProgressLayer.strokeColor = UIColor.stepikGreen.cgColor
circleProgressLayer.lineWidth = progressWidth

circleView.layer.addSublayer(circleProgressLayer)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ final class ActiveSplitTestsContainer {
)

static func setActiveTestsGroups() {
self.splitTestingService.fetchSplitTest(AboutCourseStringSplitTest.self).setSplitTestGroup()
self.splitTestingService.fetchSplitTest(ExploreSearchBarStyleSplitTest.self).setSplitTestGroup()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import Foundation

final class ExploreSearchBarStyleSplitTest: SplitTestProtocol {
typealias GroupType = Group

static let identifier = "explore_search_bar_style"
static let minParticipatingStartVersion = "1.111"

var currentGroup: Group
var analytics: ABAnalyticsServiceProtocol

init(currentGroup: Group, analytics: ABAnalyticsServiceProtocol) {
self.currentGroup = currentGroup
self.analytics = analytics
}

enum Group: String, SplitTestGroupProtocol {
case control = "control"
case test = "test"

static var groups: [Group] = [.control, .test]

var searchBarStyle: SearchBarStyle {
switch self {
case .control:
return .legacy
case .test:
return .new
}
}
}

enum SearchBarStyle {
case new
case legacy
}
}
1 change: 1 addition & 0 deletions Stepic/ApiDataDownloader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ final class ApiDataDownloader {
static let courseReviewSummaries = CourseReviewSummariesAPI()
static let courses = CoursesAPI()
static let discussionProxies = DiscussionProxiesAPI()
static let discussionThreads = DiscussionThreadsAPI()
static let enrollments = EnrollmentsAPI()
static let lastSteps = LastStepsAPI()
static let lessons = LessonsAPI()
Expand Down
6 changes: 3 additions & 3 deletions Stepic/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
AmplitudeAnalyticsEvents.Launch.firstTime.send()
}

if StepicApplicationsInfo.inAppUpdatesAvailable {
if StepikApplicationsInfo.inAppUpdatesAvailable {
self.checkForUpdates()
}

Expand Down Expand Up @@ -240,8 +240,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
if ApplicationDelegate.shared.application(app, open: url, options: options) {
return true
}
if url.scheme == "vk\(StepicApplicationsInfo.SocialInfo.AppIds.vk)"
|| url.scheme == "fb\(StepicApplicationsInfo.SocialInfo.AppIds.facebook)" {
if url.scheme == "vk\(StepikApplicationsInfo.SocialInfo.AppIds.vk)"
|| url.scheme == "fb\(StepikApplicationsInfo.SocialInfo.AppIds.facebook)" {
return true
}

Expand Down
61 changes: 39 additions & 22 deletions Stepic/Attempt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,25 @@ final class Attempt: JSONSerializable {
var timeLeft: String?
var user: Int?

var json: JSON {
[
JSONKey.step.rawValue: step
]
}

func update(json: JSON) {
id = json["id"].intValue
datasetUrl = json["dataset_url"].string
time = json["time"].string
status = json["status"].string
step = json["step"].intValue
timeLeft = json["time_left"].string
user = json["user"].int
self.id = json[JSONKey.id.rawValue].intValue
self.datasetUrl = json[JSONKey.datasetURL.rawValue].string
self.time = json[JSONKey.time.rawValue].string
self.status = json[JSONKey.status.rawValue].string
self.step = json[JSONKey.step.rawValue].intValue
self.timeLeft = json[JSONKey.timeLeft.rawValue].string
self.user = json[JSONKey.user.rawValue].int
}

func hasEqualId(json: JSON) -> Bool { id == json["id"].int }
func hasEqualId(json: JSON) -> Bool {
self.id == json[JSONKey.id.rawValue].int
}

init(step: Int) {
self.step = step
Expand All @@ -42,30 +50,28 @@ final class Attempt: JSONSerializable {
}

func initDataset(json: JSON, stepName: String) {
dataset = getDatasetFromJSON(json, stepName: stepName)
self.dataset = self.getDatasetFromJSON(json, stepName: stepName)
}

init(json: JSON, stepName: String) {
id = json["id"].intValue
dataset = nil
datasetUrl = json["dataset_url"].string
time = json["time"].string
status = json["status"].string
step = json["step"].intValue
timeLeft = json["time_left"].string
user = json["user"].int
dataset = getDatasetFromJSON(json["dataset"], stepName: stepName)
self.id = json[JSONKey.id.rawValue].intValue
self.dataset = nil
self.datasetUrl = json[JSONKey.datasetURL.rawValue].string
self.time = json[JSONKey.time.rawValue].string
self.status = json[JSONKey.status.rawValue].string
self.step = json[JSONKey.step.rawValue].intValue
self.timeLeft = json[JSONKey.timeLeft.rawValue].string
self.user = json[JSONKey.user.rawValue].int
self.dataset = self.getDatasetFromJSON(json[JSONKey.dataset.rawValue], stepName: stepName)
}

var json: JSON { ["step": step] }

private func getDatasetFromJSON(_ json: JSON, stepName: String) -> Dataset? {
switch stepName {
case "choice" :
case "choice":
return ChoiceDataset(json: json)
case "math", "string", "number", "code", "sql":
return String(json: json)
case "sorting" :
case "sorting":
return SortingDataset(json: json)
case "free-answer":
return FreeAnswerDataset(json: json)
Expand All @@ -75,4 +81,15 @@ final class Attempt: JSONSerializable {
return nil
}
}

enum JSONKey: String {
case id
case datasetURL = "dataset_url"
case time
case status
case step
case timeLeft = "time_left"
case user
case dataset
}
}
4 changes: 2 additions & 2 deletions Stepic/AttemptsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class AttemptsAPI: APIEndpoint {

return Promise { seal in
self.manager.request(
"\(StepicApplicationsInfo.apiURL)/\(self.name)",
"\(StepikApplicationsInfo.apiURL)/\(self.name)",
method: .get,
parameters: parameters,
encoding: URLEncoding.default,
Expand Down Expand Up @@ -98,7 +98,7 @@ final class AttemptsAPI: APIEndpoint {
}

return self.manager.request(
"\(StepicApplicationsInfo.apiURL)/attempts",
"\(StepikApplicationsInfo.apiURL)/attempts",
method: .get,
parameters: params,
encoding: URLEncoding.default,
Expand Down
Loading

0 comments on commit ce6f49d

Please sign in to comment.