Skip to content

Commit

Permalink
✨ (GEK): Add Xylophone actvities
Browse files Browse the repository at this point in the history
  • Loading branch information
HPezz committed Nov 29, 2023
1 parent c22ebd4 commit c979c94
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Leka - iOS Monorepo
# Copyright 2023 APF France handicap
# SPDX-License-Identifier: Apache-2.0

id: cd5d93afbd8f4071b25479cd6372a7a9
name: Xylophone Heptatonic
description: L'objectif est de jouer de la musique à l'aide du xylophone
image: activity_color_recognition_1
sequence:
- exercises:
- instructions: Joue du xylophone avec Leka
interface: instrument
payload:
instrument: xylophone
scale: majorHeptatonic
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Leka - iOS Monorepo
# Copyright 2023 APF France handicap
# SPDX-License-Identifier: Apache-2.0

id: 264d720bf8904043b97d5d7b3d0e7124
name: Xylophone Pentatonic
description: L'objectif est de jouer de la musique à l'aide du xylophone
image: activity_color_recognition_1
sequence:
- exercises:
- instructions: Joue du xylophone avec Leka
interface: instrument
payload:
instrument: xylophone
scale: majorPentatonic
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ let kActivities: [Activity] = [
ContentKit.decodeActivity("remote-standard"),
ContentKit.decodeActivity("remote-arrow"),
ContentKit.decodeActivity("activity-hideAndSeek"),
ContentKit.decodeActivity("activity-xylophone-pentatonic"),
ContentKit.decodeActivity("activity-xylophone-heptatonic"),
]

struct GEKNewSystemView: View {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Leka - iOS Monorepo
// Copyright 2023 APF France handicap
// SPDX-License-Identifier: Apache-2.0

public enum InstrumentSampler {

public struct Payload: Codable {
public let instrument: String
public let scale: String

enum CodingKeys: String, CodingKey {

Check failure on line 11 in Modules/ContentKit/Sources/Exercise/Exercice+InstrumentSampler.swift

View workflow job for this annotation

GitHub Actions / lint

Types should be nested at most 1 level deep (nesting)

Check failure on line 11 in Modules/ContentKit/Sources/Exercise/Exercice+InstrumentSampler.swift

View workflow job for this annotation

GitHub Actions / lint

Types should be nested at most 1 level deep (nesting)
case instrument, scale
}

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)

self.instrument = try container.decode(String.self, forKey: .instrument)
self.scale = try container.decode(String.self, forKey: .scale)
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extension Exercise {
case remoteStandard
case remoteArrow
case hideAndSeek
case instrument
}

}
1 change: 1 addition & 0 deletions Modules/ContentKit/Sources/Exercise/Exercise+Payload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ extension DragAndDropIntoZones.Payload: ExercisePayloadProtocol {}
extension DragAndDropToAssociate.Payload: ExercisePayloadProtocol {}
extension AudioRecordingPlayer.Payload: ExercisePayloadProtocol {}
extension HideAndSeek.Payload: ExercisePayloadProtocol {}
extension InstrumentSampler.Payload: ExercisePayloadProtocol {}
3 changes: 3 additions & 0 deletions Modules/ContentKit/Sources/Exercise/Exercise.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public struct Exercise: Codable {
case (.hideAndSeek, .none):
payload = try container.decode(HideAndSeek.Payload.self, forKey: .payload)

case (.instrument, .none):
payload = try container.decode(InstrumentSampler.Payload.self, forKey: .payload)

case (.remoteStandard, .none),
(.remoteArrow, .none):
payload = nil
Expand Down

0 comments on commit c979c94

Please sign in to comment.