Skip to content

Commit

Permalink
Merge pull request #1032 from StepicOrg/release/1.187
Browse files Browse the repository at this point in the history
Release 1.187
  • Loading branch information
ivan-magda authored Aug 25, 2021
2 parents 532275f + fa49c3f commit 4b94ca2
Show file tree
Hide file tree
Showing 109 changed files with 4,454 additions and 248 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"
ruby "2.6.5"

gem "fastlane", "2.191.0"
gem "fastlane", "2.192.0"
gem "cocoapods", "1.10.2"
gem "generamba", "1.5.0"

Expand Down
20 changes: 11 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.1.1)
aws-partitions (1.484.0)
aws-sdk-core (3.119.0)
aws-partitions (1.490.0)
aws-sdk-core (3.119.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.46.0)
aws-sdk-core (~> 3, >= 3.119.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.98.0)
aws-sdk-s3 (1.99.0)
aws-sdk-core (~> 3, >= 3.119.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
Expand Down Expand Up @@ -60,11 +60,11 @@ GEM
netrc (~> 0.11)
public_suffix
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.4)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.4.0)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-search (1.0.1)
cocoapods-trunk (1.5.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
Expand Down Expand Up @@ -110,7 +110,7 @@ GEM
faraday_middleware (1.1.0)
faraday (~> 1.0)
fastimage (2.2.5)
fastlane (2.191.0)
fastlane (2.192.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand All @@ -136,6 +136,7 @@ GEM
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
naturally (~> 2.2)
optparse (~> 0.1.1)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
Expand Down Expand Up @@ -172,7 +173,7 @@ GEM
retriable (>= 2.0, < 4.a)
rexml
webrick
google-apis-iamcredentials_v1 (0.6.0)
google-apis-iamcredentials_v1 (0.7.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-playcustomapp_v1 (0.5.0)
google-apis-core (>= 0.4, < 2.a)
Expand Down Expand Up @@ -211,7 +212,7 @@ GEM
liquid (4.0.0)
memoist (0.16.2)
mini_magick (4.11.0)
mini_mime (1.1.0)
mini_mime (1.1.1)
minitest (5.14.4)
molinillo (0.6.6)
multi_json (1.15.0)
Expand All @@ -220,6 +221,7 @@ GEM
nap (1.1.0)
naturally (2.2.1)
netrc (0.11.0)
optparse (0.1.1)
os (1.1.1)
plist (3.6.0)
public_suffix (4.0.6)
Expand Down Expand Up @@ -279,7 +281,7 @@ PLATFORMS

DEPENDENCIES
cocoapods (= 1.10.2)
fastlane (= 2.191.0)
fastlane (= 2.192.0)
fastlane-plugin-firebase_app_distribution
generamba (= 1.5.0)

Expand Down
186 changes: 173 additions & 13 deletions Stepic.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
argument = "-FIRAnalyticsDebugEnabled"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-_UIConstraintBasedLayoutLogUnsatisfiable NO"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-com.apple.CoreData.ConcurrencyDebug 1"
isEnabled = "NO">
Expand Down
4 changes: 2 additions & 2 deletions Stepic/Info-Develop.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.186-develop</string>
<string>1.187-develop</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down Expand Up @@ -62,7 +62,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>359</string>
<string>362</string>
<key>FacebookAppID</key>
<string>171127739724012</string>
<key>FacebookDisplayName</key>
Expand Down
4 changes: 2 additions & 2 deletions Stepic/Info-Production.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.186</string>
<string>1.187</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down Expand Up @@ -62,7 +62,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>359</string>
<string>362</string>
<key>FacebookAppID</key>
<string>171127739724012</string>
<key>FacebookDisplayName</key>
Expand Down
4 changes: 2 additions & 2 deletions Stepic/Info-Release.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.186-release</string>
<string>1.187-release</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down Expand Up @@ -62,7 +62,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>359</string>
<string>362</string>
<key>FacebookAppID</key>
<string>171127739724012</string>
<key>FacebookDisplayName</key>
Expand Down
16 changes: 16 additions & 0 deletions Stepic/Legacy/Analytics/Events/AmplitudeAnalyticsEvents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,22 @@ extension AnalyticsEvent {
)
}

// MARK: - Review -

static let reviewSelectDifferentSubmissionClicked = AmplitudeAnalyticsEvent(
name: "Review Select Different Submission"
)

static let reviewSendCurrentSubmissionClicked = AmplitudeAnalyticsEvent(name: "Review Send Current Submission")

static let reviewSolveAgainClicked = AmplitudeAnalyticsEvent(name: "Review Solve Again")

static let reviewQuizTryAgainClicked = AmplitudeAnalyticsEvent(name: "Review Quiz Try Again")

static let reviewStartReviewClicked = AmplitudeAnalyticsEvent(name: "Review Start Review")

static let reviewViewReviewClicked = AmplitudeAnalyticsEvent(name: "Review View Review")

// MARK: - Downloads -

static let downloadsScreenOpened = AmplitudeAnalyticsEvent(name: "Downloads screen opened")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ final class ChoiceReply: Reply {
[JSONKey.choices.rawValue: self.choices]
}

override var isEmpty: Bool { self.choices.isEmpty }

override var hash: Int {
self.choices.hashValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ final class CodeReply: Reply {
]
}

override var isEmpty: Bool { self.code.trimmed().isEmpty }

override var hash: Int {
var result = self.code.hashValue
result = result &* 31 &+ self.languageName.hashValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ final class FillBlanksReply: Reply {
[JSONKey.blanks.rawValue: self.blanks]
}

override var isEmpty: Bool { self.blanks.isEmpty }

override var hash: Int {
self.blanks.hashValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ final class FreeAnswerReply: Reply {
]
}

override var isEmpty: Bool { self.text.trimmed().isEmpty }

override var hash: Int {
self.text.hashValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ final class MatchingReply: Reply {
[JSONKey.ordering.rawValue: self.ordering]
}

override var isEmpty: Bool { self.ordering.isEmpty }

override var hash: Int {
self.ordering.hashValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ final class MathReply: Reply {
[JSONKey.formula.rawValue: self.formula]
}

override var isEmpty: Bool { self.formula.isEmpty }

override var hash: Int {
self.formula.hashValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ final class NumberReply: Reply {
[JSONKey.number.rawValue: self.number]
}

override var isEmpty: Bool { self.number.trimmed().isEmpty }

override var hash: Int {
self.number.hashValue
}
Expand Down
2 changes: 2 additions & 0 deletions Stepic/Legacy/Model/AttemptsSumbissions/Replies/Reply.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class Reply: NSObject, NSSecureCoding {

var dictValue: [String: Any] { [:] }

var isEmpty: Bool { false }

override var description: String { "Reply(\(self.dictValue))" }

override init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ final class SQLReply: Reply {
[JSONKey.solveSQL.rawValue: self.code]
}

override var isEmpty: Bool { self.code.trimmed().isEmpty }

override var hash: Int {
self.code.hashValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ final class SortingReply: Reply {
[JSONKey.ordering.rawValue: self.ordering]
}

override var isEmpty: Bool { self.ordering.isEmpty }

override var hash: Int {
self.ordering.hashValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ final class TableReply: Reply {
]
}

override var isEmpty: Bool { self.choices.isEmpty }

override var hash: Int {
self.choices.hashValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ final class TextReply: Reply {
[JSONKey.text.rawValue: self.text]
}

override var isEmpty: Bool { self.text.trimmed().isEmpty }

override var hash: Int {
self.text.hashValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ extension Step {
}
}

var instructionType: String? {
var instructionTypeString: String? {
get {
self.managedInstructionType
}
Expand Down
9 changes: 8 additions & 1 deletion Stepic/Legacy/Model/Entities/Step/Step.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ final class Step: NSManagedObject, ManagedObject, IDFetchable {
return CourseType(rawValue: needsPlanStringValue)
}

var instructionType: InstructionType? {
if let instructionTypeString = self.instructionTypeString {
return InstructionType(rawValue: instructionTypeString)
}
return nil
}

required convenience init(json: JSON) {
self.init(entity: Step.entity, insertInto: CoreDataHelper.shared.context)
self.initialize(json)
Expand All @@ -27,7 +34,7 @@ final class Step: NSManagedObject, ManagedObject, IDFetchable {
self.isEnabled = json[JSONKey.isEnabled.rawValue].bool ?? true
self.sessionID = json[JSONKey.session.rawValue].int
self.instructionID = json[JSONKey.instruction.rawValue].int
self.instructionType = json[JSONKey.instructionType.rawValue].string
self.instructionTypeString = json[JSONKey.instructionType.rawValue].string
self.needsPlan = json[JSONKey.needsPlan.rawValue].string

if let doReview = json[JSONKey.actions.rawValue][JSONKey.doReview.rawValue].string {
Expand Down
6 changes: 6 additions & 0 deletions Stepic/Legacy/Model/Network/Endpoints/InstructionsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ final class InstructionsAPI: APIEndpoint {
.request(requestEndpoint: "\(self.name)/\(id)", withManager: self.manager)
.map(InstructionsResponse.init)
}

func getInstructions(ids: [Int]) -> Promise<InstructionsResponse> {
self.retrieve
.request(requestEndpoint: self.name, ids: ids, withManager: self.manager)
.map(InstructionsResponse.init)
}
}
26 changes: 26 additions & 0 deletions Stepic/Legacy/Model/Network/Endpoints/ReviewSessionsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@ import SwiftyJSON
final class ReviewSessionsAPI: APIEndpoint {
override var name: String { "review-sessions" }

func createReviewSession(submissionID: Submission.IdType, blockName: String?) -> Promise<ReviewSessionResponse> {
let body = [
JSONKey.reviewSession.rawValue: [
JSONKey.submission.rawValue: submissionID
]
]

return self.create
.request(requestEndpoint: self.name, bodyJSONObject: body, withManager: self.manager)
.map { ReviewSessionResponse(json: $0, blockName: blockName ?? "") }
}

func createReviewSession(instructionID: Int, blockName: String?) -> Promise<ReviewSessionResponse> {
let body = [
JSONKey.reviewSession.rawValue: [
JSONKey.instruction.rawValue: instructionID
]
]

return self.create
.request(requestEndpoint: self.name, bodyJSONObject: body, withManager: self.manager)
.map { ReviewSessionResponse(json: $0, blockName: blockName ?? "") }
}

/// Get review sessions by ids.
///
/// - Parameter ids: The identifiers array of the review sessions to fetch.
Expand Down Expand Up @@ -35,5 +59,7 @@ final class ReviewSessionsAPI: APIEndpoint {
private enum JSONKey: String {
case user
case instruction
case reviewSession
case submission
}
}
Loading

0 comments on commit 4b94ca2

Please sign in to comment.