Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REBASED+hugo/feature/Add ColorBingo #442

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "pictogram_leka_action.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Leka - iOS Monorepo
# Copyright 2023 APF France handicap
# SPDX-License-Identifier: Apache-2.0

id: 4c32759202294558a6e09cafb5703bc6
name: Color Bingo
description: L'objectif est de toucher la couleur affichée sur Leka
image: activity_color_recognition_1
sequence:
- exercises:
- instructions: Touche la couleur de Leka
type: selection
interface: robotThenTouchToSelect
gameplay: selectAllRightAnswers
payload:
action:
type: robot
value:
type: color
value: blue
choices:
- value: blue
type: color
isRightAnswer: true

- instructions: Touche la couleur de Leka
type: selection
interface: robotThenTouchToSelect
gameplay: selectAllRightAnswers
payload:
action:
type: robot
value:
type: color
value: green
choices:
- value: green
type: color
isRightAnswer: true
- value: blue
type: color

- instructions: Touche la couleur de Leka
type: selection
interface: robotThenTouchToSelect
gameplay: selectAllRightAnswers
payload:
action:
type: robot
value:
type: color
value: red
choices:
- value: red
type: color
isRightAnswer: true
- value: green
type: color
- value: blue
type: color

- instructions: Touche la couleur de Leka
type: selection
interface: robotThenTouchToSelect
gameplay: selectAllRightAnswers
payload:
action:
type: robot
value:
type: color
value: yellow
choices:
- value: yellow
type: color
isRightAnswer: true
- value: red
type: color
- value: green
type: color
- value: blue
type: color

- instructions: Touche la couleur de Leka
type: selection
interface: robotThenTouchToSelect
gameplay: selectAllRightAnswers
payload:
action:
type: robot
value:
type: color
value: orange
choices:
- value: orange
type: color
isRightAnswer: true
- value: yellow
type: color
- value: red
type: color
- value: green
type: color
- value: blue
type: color

- instructions: Touche la couleur de Leka
type: selection
interface: robotThenTouchToSelect
gameplay: selectAllRightAnswers
payload:
action:
type: robot
value:
type: color
value: yellow
choices:
- value: purple
type: color
- value: orange
type: color
- value: yellow
type: color
isRightAnswer: true
- value: red
type: color
- value: green
type: color
- value: blue
type: color
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// Leka - iOS Monorepo
// Copyright 2023 APF France handicap
// SPDX-License-Identifier: Apache-2.0

import ContentKit
import GameEngineKit
import SwiftUI

let kActivities: [Activity] = [
// ? Filename format
// ? touchToSelect: activity-touchToSelect-<number_of_answers>-<answer_type>
// ? dragAndDrop: activity-dragAndDrop-<number_of_zones>-<number_of_answers>-<answer_type>

ContentKit.decodeActivity("activity-touchToSelect-one_right_answer-colors"),
ContentKit.decodeActivity("activity-touchToSelect-one_right_answer-colors-shuffle_choices"),
ContentKit.decodeActivity("activity-touchToSelect-one_right_answer-colors-shuffle_sequences"),
ContentKit.decodeActivity("activity-touchToSelect-one_right_answer-image"),
ContentKit.decodeActivity("activity-touchToSelect-one_right_answer-mixed"),
// ContentKit.decodeActivity("activity-touchToSelect-multipe_right_answers-mixed"),
ContentKit.decodeActivity("activity-touchToSelect-multipe_right_answers-colors"),
// ContentKit.decodeActivity("activity-touchToSelect-multipe_right_answers-images"),
// ContentKit.decodeActivity("activity-touchToSelect-multipe_right_answers-mixed"),

ContentKit.decodeActivity("activity-listenThenTouchToSelect-mixed-images"),
ContentKit.decodeActivity("activity-observeThenTouchToSelect-mixed-colors"),

ContentKit.decodeActivity("activity-dragAndDrop-one_zone-one_right_answer-image"),
// ContentKit.decodeActivity("activity-dragAndDrop-one_zone-one_right_answer-colors"),
// ContentKit.decodeActivity("activity-dragAndDrop-one_zone-one_right_answer-mixed"),
// ContentKit.decodeActivity("activity-dragAndDrop-one_zone-multiple_right_answer-images"),
// ContentKit.decodeActivity("activity-dragAndDrop-one_zone-multiple_right_answer-colors"),
// ContentKit.decodeActivity("activity-dragAndDrop-one_zone-multiple_right_answer-mixed"),

// ContentKit.decodeActivity("activity-dragAndDrop-two_zones-one_right_answer-image"),
// ContentKit.decodeActivity("activity-dragAndDrop-two_zones-one_right_answer-colors"),
// ContentKit.decodeActivity("activity-dragAndDrop-two_zones-one_right_answer-mixed"),
ContentKit.decodeActivity("activity-dragAndDrop-two_zones-multiple_right_answers-images"),
// ContentKit.decodeActivity("activity-dragAndDrop-two_zones-multiple_right_answer-colors"),
// ContentKit.decodeActivity("activity-dragAndDrop-two_zones-multiple_right_answer-mixed"),

ContentKit.decodeActivity("activity-medley"),
ContentKit.decodeActivity("activity-colorBingo"),
]

struct GEKNewSystemView: View {

@EnvironmentObject var router: Router

@State var currentActivity: Activity?

var body: some View {
NavigationStack {
ScrollView {
VStack(spacing: 30) {
ForEach(kActivities, id: \.id) { activity in
Button(activity.name) {
currentActivity = activity
}
}
}
.fullScreenCover(item: $currentActivity) {
currentActivity = nil
} content: { activity in
ActivityView(viewModel: ActivityViewViewModel(activity: activity))
}
.buttonStyle(.borderedProminent)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .navigationBarLeading, content: { backButton })
ToolbarItem(placement: .principal) { navigationTitleView }
}
}
}
}

private var navigationTitleView: some View {
HStack(spacing: 4) {
Text("Leka Activity UI Explorer")
}
.font(.system(size: 17, weight: .bold))
.foregroundColor(.accentColor)
}

private var backButton: some View {
Button(
action: {
router.currentVersion = .versionSelector
},
label: {
HStack(spacing: 4) {
Image(systemName: "chevron.left")
Text("Retour")
}
}
)
.tint(.accentColor)
}

}

#Preview {
GEKNewSystemView()
.environmentObject(Router())
}

This file was deleted.

2 changes: 1 addition & 1 deletion Apps/LekaActivityUIExplorer/Sources/SwitchBoard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct SwitchBoard: View {
FirstActivityModelIterationView()
.transition(.opacity)
case .gameEngineKitNewSystem:
GameEngineKitNewSystemView()
GEKNewSystemView()
.transition(.opacity)
}
}
Expand Down
1 change: 1 addition & 0 deletions Modules/ContentKit/Sources/Activity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

public enum Interface: String, Codable {
case touchToSelect
case robotThenTouchToSelect
case listenThenTouchToSelect
case observeThenTouchToSelect
case dragAndDrop
Expand All @@ -63,7 +64,7 @@
case selection(SelectionPayload)
case dragAndDrop(DragAndDropPayload)

// TODO(@ladislas): see if we can decode based on interface in Exercise

Check failure on line 67 in Modules/ContentKit/Sources/Activity.swift

View workflow job for this annotation

GitHub Actions / lint

TODOs should be resolved ((@ladislas): see if we can dec...) (todo)
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CustomKeys.self)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "pictogram_leka_action.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Loading