From c9c299f8567c96ad737b4528190a20fd8dc47d1c Mon Sep 17 00:00:00 2001 From: Guillaume Meinesz <guillaume.meinesz@gmail.com> Date: Thu, 26 Oct 2023 18:17:37 +0200 Subject: [PATCH] Choix QCM : Ajout disposition en grilles de 2 lignes + ajout d'une image de fond d'epreuve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Choix QCM : Ajout disposition en grilles 2 lignes de 3 (ne pas mettre de item.fond pour activer le mode 2 lignes) _ ajout d'une image de fond d'epreuve apparaissant centrée en arrière plan : epreuve.consigne doit etre renseigné par un asset contenant un img_path --- Assets/GD_manager.cs | 13 +- Assets/Positionnement.cs | 138 +++- Assets/Prefabs/ImageEpreuveCentered.prefab | 86 +++ .../Prefabs/ImageEpreuveCentered.prefab.meta | 7 + Assets/QCM_manager.cs | 14 +- Assets/Resources/raven_demo3X2.json | 607 ++++++++++++++++++ Assets/Resources/raven_demo3X2.json.meta | 7 + Assets/Scenes/MainScene.unity | 12 +- Assets/mainManager.cs | 17 +- UserSettings/EditorUserSettings.asset | 4 +- UserSettings/Layouts/default-2022.dwlt | 132 ++-- 11 files changed, 948 insertions(+), 89 deletions(-) create mode 100644 Assets/Prefabs/ImageEpreuveCentered.prefab create mode 100644 Assets/Prefabs/ImageEpreuveCentered.prefab.meta create mode 100644 Assets/Resources/raven_demo3X2.json create mode 100644 Assets/Resources/raven_demo3X2.json.meta diff --git a/Assets/GD_manager.cs b/Assets/GD_manager.cs index 8c4fd44e..8e55c62f 100644 --- a/Assets/GD_manager.cs +++ b/Assets/GD_manager.cs @@ -270,14 +270,19 @@ public class GD_manager : MonoBehaviour { Destroy(mM.posScript.currentlyInstanciatedprefabImagePrincipale.gameObject); } + if (mM.executeAsset(mM.e.consigne, null, true, true)) + { + Debug.Log("on refait apparaitre image pricnipale"); + if (mM.posScript.currentlyInstanciatedImageEpreuveCentered != null) + { + mM.posScript.currentlyInstanciatedImageEpreuveCentered.gameObject.SetActive(true); + + } + } // consigne de l'épreuve (absente du déroulement) if (!mM.epreuveConsignebeenPlayed) { mM.texteCheat.text += " /Epreuve id=" + mM.e.id; mM.epreuveConsignebeenPlayed = true; - if (mM.executeAsset(mM.e.consigne, null, true)) - { - mM.posScript.currentlyInstanciatedprefabImagePrincipale.gameObject.SetActive(true); - } // consigne de l'épreuve (absente du déroulement) mM.executeAsset(mM.e.consigne, mM.playSteps,false); // consigne de l'épreuve (absente du déroulement) } else { playswitch = true; } diff --git a/Assets/Positionnement.cs b/Assets/Positionnement.cs index c16571db..560a37fe 100644 --- a/Assets/Positionnement.cs +++ b/Assets/Positionnement.cs @@ -17,6 +17,7 @@ public class Positionnement : MonoBehaviour private float screenWidth; private float screenHeight; public GameObject prefabImagePrincipale; + public GameObject prefabImageEpreuveCentered; public GameObject prefabBoutonQCM; public GameObject prefabDraggableGD; public GameObject prefabDropZoneGD; @@ -28,6 +29,9 @@ public class Positionnement : MonoBehaviour private Vector2 initialPositionDropZones; private float spriteWidthDropZones; + public GameObject currentlyInstanciatedImageEpreuveCentered; + private float longueurDeLenfiladeDropZones; + private float longueurDeLenfiladeQCM; public void CalculateAlignment(List<groupemementChoixEtPrefabBoutonQCM> listeDeChoix) { screenHeight = mainCamera.orthographicSize * 2.0f; @@ -46,8 +50,8 @@ public class Positionnement : MonoBehaviour } // Calculate the initial X position to center the alignment - float longueurDeLenfilade = (spriteWidthBouton * listeDeChoix.Count) + (screenWidth*spriteSpacingPercentage * (listeDeChoix.Count - 1)); - float startX = -screenWidth / 2.0f + (screenWidth - longueurDeLenfilade) / 2.0f+ spriteWidthBouton/2.0f; + longueurDeLenfiladeQCM = (spriteWidthBouton * listeDeChoix.Count) + (screenWidth*spriteSpacingPercentage * (listeDeChoix.Count - 1)); + float startX = -screenWidth / 2.0f + (screenWidth - longueurDeLenfiladeQCM) / 2.0f+ spriteWidthBouton/2.0f; // Calculate the targetHeight using the corrected formula float targetHeight = -screenHeight / 2.0f + screenHeight * 0.1f + spriteWidthBouton / 2.0f; // on veut que la ligne se trouve à 10% du bas de l'écran @@ -79,8 +83,9 @@ public class Positionnement : MonoBehaviour spriteWidthDropZones = maxSpriteHeightDropZone; // Set the sprite height to the maximum allowed height } // Calculate the initial X position to center the alignment - float longueurDeLenfiladeDropZones = (spriteWidthDropZones * nbDeGD) + (screenWidth * spriteSpacingPercentage * (nbDeGD - 1)); + longueurDeLenfiladeDropZones = (spriteWidthDropZones * nbDeGD) + (screenWidth * spriteSpacingPercentage * (nbDeGD - 1)); float startXDropZones = -screenWidth / 2.0f + (screenWidth - longueurDeLenfiladeDropZones) / 2.0f + spriteWidthDropZones / 2.0f; + Debug.Log("longueurDeLenfiladeDropZones here = " + longueurDeLenfiladeDropZones); // Calculate the targetHeight using the corrected formula float targetHeightDropZones = -screenHeight / 2.0f + screenHeight * 0.5f + spriteWidthDropZones / 2.0f; // on veut que la ligne se trouve à 10% du bas de l'écran @@ -133,6 +138,45 @@ public class Positionnement : MonoBehaviour imagePrincipaleSpriteRenderer.transform.localScale = new Vector3(scaleFactorHeight, scaleFactorHeight, 1.0f); } + public void SetImageEpreuve(Sprite sprite) + { + if (sprite == null) + { + Debug.LogWarning("Le sprite ou le SpriteRenderer est manquant."); + return; + } + if (currentlyInstanciatedImageEpreuveCentered != null) + { + Destroy(currentlyInstanciatedImageEpreuveCentered.gameObject); + } + currentlyInstanciatedImageEpreuveCentered = Instantiate(prefabImageEpreuveCentered, placeWhereToInstantiateThings).gameObject; + SpriteRenderer imageEpreuveSpriteRenderer = currentlyInstanciatedImageEpreuveCentered.gameObject.GetComponent<SpriteRenderer>(); + imageEpreuveSpriteRenderer.sprite = sprite; + // Ajustez la position du sprite pour remplir la partie supérieure de l'écran + screenHeight = mainCamera.orthographicSize * 2.0f; + screenWidth = screenHeight * mainCamera.aspect; + float desiredYPosition = -screenHeight / 2.0f + screenHeight * 0.5f; // 30% du bas de l'écran + + // Obtenez la hauteur du sprite + float spriteHeight = imageEpreuveSpriteRenderer.bounds.size.y; + // Obtenez la largeur du sprite + float spriteWidth = imageEpreuveSpriteRenderer.bounds.size.x; + Debug.Log("spriteHeight=" + spriteHeight + "/ spriteWidth=" + spriteWidth); + float scaleFactorwidth = screenWidth / spriteWidth; + // Calculez le facteur d'échelle pour la hauteur + float scaleFactorHeight = (screenHeight * 1.0f) / spriteHeight; + if (scaleFactorHeight > scaleFactorwidth) + { + scaleFactorHeight = scaleFactorwidth; + } + // Calculez la position Y en fonction de la nouvelle échelle + Vector3 newPosition = new Vector3(0.0f, desiredYPosition, 0); + // Appliquez la nouvelle position + imageEpreuveSpriteRenderer.transform.position = newPosition; + imageEpreuveSpriteRenderer.transform.localScale = new Vector3(scaleFactorHeight, scaleFactorHeight, 1.0f); + } + + public GameObject placeImages(int indexBouton, ChargementJSONStructure.Choix choix, bool dropzone = false) { boutonQCM bt = new boutonQCM(); @@ -201,12 +245,28 @@ public class Positionnement : MonoBehaviour } else { + bt.spriterenderer.sprite = image; bt.boxcoll.size = bt.spriterenderer.bounds.size; - spriteTransform.position = new Vector3( - initialPosition.x + (spriteSpacingPercentage * screenWidth + spriteWidthBouton) * indexBouton, - initialPosition.y, - spriteTransform.position.z); + if (mM.e.modalite == "QCM" && (mM.posScript.currentlyInstanciatedprefabImagePrincipale == null || !mM.posScript.currentlyInstanciatedprefabImagePrincipale.gameObject.activeSelf)) + { + Debug.Log("heeeeeeeeeeeeeeeeeeeerrrre longueurDeLenfiladeQCM=" + longueurDeLenfiladeQCM); + int multiplieurHeight = DetermineParite(indexBouton); + int multiplieurX = DetermineValeur(indexBouton); + spriteTransform.position = new Vector3( + (spriteWidthBouton+ spriteSpacingPercentage*2.0f) * DetermineValeur(indexBouton)- (spriteWidthBouton + spriteSpacingPercentage*2.0f)* GetClosestGreaterEven(mM.list_choix_associed_with_prefabs.Count)/2.0f/2.0f+ spriteWidthBouton/2.0f, + -screenHeight/2.0f+ screenHeight*0.5f + multiplieurHeight * (spriteSpacingPercentage*3.0f+ spriteWidthBouton/2.0f), + spriteTransform.position.z); + } + else + { + Debug.Log("lllllllllllllll"); + spriteTransform.position = new Vector3( + initialPosition.x + (spriteSpacingPercentage * screenWidth + spriteWidthBouton) * indexBouton, + initialPosition.y, + spriteTransform.position.z); + } + // Set the sprite's local scale to match the calculated width float newScaleX = spriteWidthBouton / bt.spriterenderer.bounds.size.x; spriteTransform.localScale = new Vector3(newScaleX, newScaleX, 1.0f); @@ -218,4 +278,68 @@ public class Positionnement : MonoBehaviour return bt.gameObject; } + + public static int DetermineParite(int nombre) + { + if (nombre % 2 == 0) + { + return 1; // Renvoie 1 pour les nombres pairs + } + else + { + return -1; // Renvoie -1 pour les nombres impairs + } + } + + + + public static int DetermineValeur(int nombre) + { + if (nombre == 0 || nombre == 1) + { + return 0; + } + else if (nombre == 2 || nombre == 3) + { + return 1; + } + else if (nombre == 4 || nombre == 5) + { + return 2; + } + else if (nombre == 6 || nombre == 7) + { + return 3; + } + else if (nombre == 8 || nombre == 9) + { + return 4; + } + else if (nombre == 9 || nombre == 10) + { + return 5; + } + // Ajoutez autant de conditions que nécessaire pour couvrir vos intervalles + else + { + return -1; // Si le nombre ne correspond à aucun intervalle, retourne -1 (ou une valeur par défaut de votre choix). + } + } + + public int GetClosestGreaterEven(int inputNumber) + { + // Si l'entier d'entrée est déjà pair, le renvoyer tel quel. + if (inputNumber % 2 == 0) + { + return inputNumber; + } + else + { + // Sinon, retourner le prochain entier pair en ajoutant 1. + return inputNumber + 1; + } + } + + + } diff --git a/Assets/Prefabs/ImageEpreuveCentered.prefab b/Assets/Prefabs/ImageEpreuveCentered.prefab new file mode 100644 index 00000000..3fb08c4c --- /dev/null +++ b/Assets/Prefabs/ImageEpreuveCentered.prefab @@ -0,0 +1,86 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &8891670654556252168 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6073270013685963931} + - component: {fileID: 648746342948430108} + m_Layer: 0 + m_Name: ImageEpreuveCentered + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &6073270013685963931 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8891670654556252168} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &648746342948430108 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8891670654556252168} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: -5 + m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 diff --git a/Assets/Prefabs/ImageEpreuveCentered.prefab.meta b/Assets/Prefabs/ImageEpreuveCentered.prefab.meta new file mode 100644 index 00000000..bfc47398 --- /dev/null +++ b/Assets/Prefabs/ImageEpreuveCentered.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b76941fd0a3f6ae4c8e4ff6f47c9facd +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/QCM_manager.cs b/Assets/QCM_manager.cs index 523a3a5e..d10b6978 100644 --- a/Assets/QCM_manager.cs +++ b/Assets/QCM_manager.cs @@ -46,15 +46,19 @@ public class QCM_manager : MonoBehaviour { Destroy(mM.posScript.currentlyInstanciatedprefabImagePrincipale.gameObject); } + if (mM.executeAsset(mM.e.consigne, null, true,true)) + { + Debug.Log("on refait apparaitre image pricnipale"); + if (mM.posScript.currentlyInstanciatedImageEpreuveCentered != null) + { + mM.posScript.currentlyInstanciatedImageEpreuveCentered.gameObject.SetActive(true); + + } + } // consigne de l'épreuve (absente du déroulement) if (!mM.epreuveConsignebeenPlayed) { mM.texteCheat.text += "\nEpreuve id=" + mM.e.id; mM.epreuveConsignebeenPlayed = true; - if(mM.executeAsset(mM.e.consigne, null, true)) - { - Debug.Log("on refait apparaitre image pricnipale"); - mM.posScript.currentlyInstanciatedprefabImagePrincipale.gameObject.SetActive(true); - } // consigne de l'épreuve (absente du déroulement) mM.executeAsset(mM.e.consigne, mM.playSteps,false); // consigne de l'épreuve (absente du déroulement) } else { playswitch = true; } diff --git a/Assets/Resources/raven_demo3X2.json b/Assets/Resources/raven_demo3X2.json new file mode 100644 index 00000000..7cea297b --- /dev/null +++ b/Assets/Resources/raven_demo3X2.json @@ -0,0 +1,607 @@ +{/*Liste des fichiers utilisés*/ + "assets":{ + "blank":{"snd_path":"General/blank"}, + "ready":{ + "snd_path":"General/Pret", + "img_path":"General/Pret" + }, + "imageEpreuve":{"img_path":"Rime/Bimo"}, + "RavenA1.1":{"img_path":"Raven/A/A1.1"}, + "RavenA1.2":{"img_path":"Raven/A/A1.2J"}, + "RavenA1.3":{"img_path":"Raven/A/A1.3"}, + "RavenA1.4":{"img_path":"Raven/A/A1.4"}, + "RavenA1.5":{"img_path":"Raven/A/A1.5"}, + "RavenA1":{"img_path":"Raven/A/A1"}, + "RavenA2.1":{"img_path":"Raven/A/A2.1J"}, + "RavenA2.2":{"img_path":"Raven/A/A2.2"}, + "RavenA2.3":{"img_path":"Raven/A/A2.3"}, + "RavenA2.4":{"img_path":"Raven/A/A2.4"}, + "RavenA2.5":{"img_path":"Raven/A/A2.5"}, + "RavenA2":{"img_path":"Raven/A/A2"}, + "RavenA3.1":{"img_path":"Raven/A/A3.1"}, + "RavenA3.2":{"img_path":"Raven/A/A3.2"}, + "RavenA3.3":{"img_path":"Raven/A/A3.3"}, + "RavenA3.4":{"img_path":"Raven/A/A3.4"}, + "RavenA3.5":{"img_path":"Raven/A/A3.5J"}, + "RavenA3":{"img_path":"Raven/A/A3"}, + "ready":{ + "snd_path":"General/Pret", + "img_path":"General/Pret" + }, + "introGaleMonstruos":{ + "snd_path":"General/Monde des monstruos", + "img_path":"General/monstruos" + }, + "consRime":{ + "snd_path":"Rime/Consigne_épreuve_rime" + }, + "tutoRimeCons":{ + "snd_path":"Rime/Bimo propose" + }, + "bimo_fond_image":{ + "img_path":"Rime/Bimo" + }, + "bimo+selo":{ + "snd_path":"Rime/bimo aime selo" + }, + "action selo":{ + "snd_path":"Rime/action selo" + }, + "fb+selo":{ + "snd_path":"Rime/bravo bimo" + }, + "ape":{ + "snd_path":"Rime/ape" + }, + "ica":{ + "snd_path":"Rime/ica" + }, + "selo":{ + "snd_path":"Rime/selo" + }, + "et":{ + "snd_path":"General/et" + }, + "food1":{ + "img_path":"General/shape1" + }, + "food2":{ + "img_path":"General/shape2" + }, + "food3":{ + "img_path":"General/shape3" + }, + "food4":{ + "img_path":"General/shape4" + }, + "food5":{ + "img_path":"General/shape5" + }, + "food6":{ + "img_path":"General/shape6" + }, + "zone":{ + "img_path":"General/zone" + }, + "toucherLesChoix":{ + "snd_path":"General/toucheleschoix" + }, + "feedbackplus":{ + "snd_path":"General/feedbackplus" + }, + "feedbackmoins":{ + "snd_path":"General/feedbackmoins" + }, + "cible":{ + "snd_path":"General/cible" + }, + "transition":{ + "snd_path":"General/transition" + }, + "consigneglissedepose":{ + "snd_path":"General/consigneglissedepose" + }, + "consigneglissedeposeepreuve":{ + "snd_path":"General/consigneglissedeposeepreuve" + }, + "consignetest":{ + "snd_path":"General/consignetest" + }, + "consignetraining":{ + "snd_path":"General/consignetraining" + }, + "consignetuto":{ + "snd_path":"General/consignetuto" + }, + "miseenaction":{ + "snd_path":"General/miseenaction" + }, + "explication":{ + "snd_path":"General/explication" + } + }, + /*Début des tests*/ + "sessions":[ + {"epreuves":[ + { + "id":"A", + "titre":"Les fastoches", + "consigne":"imageEpreuve", + "desc":"1ers items faciles pour le test", + "modalite":"QCM", + "randomiser":false, + "items":[ + { + "id":"A1", + "type":"test", + "desc":"disques verts", + "choix":[ + { + "id":"A1.1", + "image":"RavenA1.1", + "son":"blank", + "correct":false + }, + { + "id":"A1.2", + "image":"RavenA1.2", + "son":"blank", + "correct":true + }, + { + "id":"A1.3", + "image":"RavenA1.3", + "son":"blank", + "correct":false + }, + { + "id":"A1.4", + "image":"RavenA1.4", + "son":"blank", + "correct":false + }, + { + "id":"A1.5", + "image":"RavenA1.5", + "son":"blank", + "correct":false + } + ] + }, + { + "id":"A2", + "type":"test", + "fond":"RavenA2", + "desc":"portions de disques verts", + "choix":[ + { + "id":"A2.1", + "image":"RavenA2.1", + "son":"blank", + "correct":true + }, + { + "id":"A2.2", + "image":"RavenA2.2", + "son":"blank", + "correct":false + }, + { + "id":"A2.3", + "image":"RavenA2.3", + "son":"blank", + "correct":false + }, + { + "id":"A2.4", + "image":"RavenA2.4", + "son":"blank", + "correct":false + }, + { + "id":"A2.5", + "image":"RavenA2.5", + "son":"blank", + "correct":false + } + ] + }, + { + "id":"A3", + "type":"test", + "desc":"triangle, rond, carré", + "choix":[ + { + "id":"A3.1", + "image":"RavenA3.1", + "son":"blank", + "correct":false + }, + { + "id":"A3.2", + "image":"RavenA3.2", + "son":"blank", + "correct":false + }, + { + "id":"A3.3", + "image":"RavenA3.3", + "son":"blank", + "correct":false + }, + { + "id":"A3.4", + "image":"RavenA3.4", + "son":"blank", + "correct":false + }, + { + "id":"A3.5", + "image":"RavenA3.5", + "son":"blank", + "correct":true + } + ] + } + ] + } + ] + }, + { + "consigne":"introGaleMonstruos", + "epreuves":[ + { + "id":"rhymejdgmt1", + "titre":"Jugement de rimes", + "desc":"Le sujet entend un mot et choisi celui qui rime avec parmi les propositions", + "modalite":"QCM", + "consigne":"consRime", + "items":[ + { + "id":"tutoRime", + "pret":"ready", + "consigne":"tutoRimeCons", + "choix":[ + { + "id":"tutoRimeIca", + "image":"food1", + "son":"ape", + "correct":false, + "numZone":0, + "imgZone":"zone" + }, + { + "id":"tutoRimeIca", + "image":"food2", + "son":"ica", + "correct":false, + "numZone":1, + "imgZone":"zone" + }, + { + "id":"tutoRimeSelo", + "image":"food3", + "son":"selo", + "correct":true, + "feedback":"fb+selo", + "numZone":2, + "imgZone":"zone" + } + ], + "type":"tuto", + "randomiser":true, + "miseEnAction":"action selo", + "transition":"transition", + "description":"", + "enumerer":true, + "separateurChoix":"", + "surligner":true, + "cible":"bimo+selo", + "bloqueErreurs":false, + "explication":"bimo+selo", + "surlignerExplication":2.0, + "toucherLesChoix":"toucherLesChoix", + "feedbackPlus":"selo", + "feedbackMoins":"ica" + }, + { + "id":"tutoRime", + "pret":"ready", + "consigne":"tutoRimeCons", + "fond":"bimo_fond_image", + "choix":[ + { + "id":"tutoRimeIca", + "image":"food1", + "son":"ape", + "correct":false, + "numZone":0, + "imgZone":"zone" + }, + { + "id":"tutoRimeIca", + "image":"food2", + "son":"ica", + "correct":false, + "numZone":1, + "imgZone":"zone" + }, + { + "id":"tutoRimeSelo", + "image":"food3", + "son":"selo", + "correct":true, + "feedback":"fb+selo", + "numZone":2, + "imgZone":"zone" + } + ], + "type":"training", + "randomiser":true, + "miseEnAction":"action selo", + "transition":"transition", + "description":"", + "enumerer":true, + "separateurChoix":"", + "surligner":true, + "cible":"bimo+selo", + "bloqueErreurs":false, + "explication":"bimo+selo", + "surlignerExplication":2.0, + "toucherLesChoix":"toucherLesChoix", + "feedbackPlus":"selo", + "feedbackMoins":"ica" + }, + { + "id":"tutoRime", + "pret":"ready", + "consigne":"tutoRimeCons", + "fond":"bimo_fond_image", + "choix":[ + { + "id":"tutoRimeIca", + "image":"food1", + "son":"ape", + "correct":false, + "numZone":0, + "imgZone":"zone" + }, + { + "id":"tutoRimeIca", + "image":"food2", + "son":"ica", + "correct":false, + "numZone":1, + "imgZone":"zone" + }, + { + "id":"tutoRimeSelo", + "image":"food3", + "son":"selo", + "correct":true, + "feedback":"fb+selo", + "numZone":2, + "imgZone":"zone" + } + ], + "type":"test", + "randomiser":true, + "miseEnAction":"action selo", + "transition":"transition", + "description":"", + "enumerer":true, + "separateurChoix":"", + "surligner":true, + "cible":"bimo+selo", + "bloqueErreurs":false, + "explication":"bimo+selo", + "surlignerExplication":2.0, + "toucherLesChoix":"toucherLesChoix", + "feedbackPlus":"selo", + "feedbackMoins":"ica" + } + ] + }, + { + "id":"rhymejdgmt1", + "titre":"Jugement de rimes", + "desc":"Le sujet entend un mot et choisi celui qui rime avec parmi les propositions", + "modalite":"GD", + "consigne":"imageEpreuve", + "items":[ + { + "id":"tutoRime", + "pret":"ready", + "consigne":"consignetuto", + "fond":"bimo_fond_image", + "choix":[ + { + "id":"tutoRimeIca", + "image":"food1", + "son":"ape", + "correct":false, + "numZone":0, + "imgZone":"zone" + }, + { + "id":"tutoRimeIca", + "image":"food2", + "son":"ica", + "correct":false, + "numZone":1, + "imgZone":"zone" + }, + { + "id":"tutoRimeSelo", + "image":"food3", + "son":"selo", + "correct":true, + "feedback":"fb+selo", + "numZone":2, + "imgZone":"zone" + } + ], + "type":"tuto", + "randomiser":true, + "miseEnAction":"miseenaction", + "transition":"transition", + "description":"", + "enumerer":true, + "separateurChoix":"", + "surligner":true, + "cible":"cible", + "bloqueErreurs":false, + "explication":"explication", + "surlignerExplication":0.0, + "toucherLesChoix":"toucherLesChoix", + "feedbackPlus":"feedbackplus", + "feedbackMoins":"feedbackmoins" + }, + { + "id":"tutoRime", + "pret":"ready", + "consigne":"consignetraining", + "fond":"bimo_fond_image", + "choix":[ + { + "id":"tutoRimeIca", + "image":"food1", + "son":"ape", + "correct":false, + "numZone":0, + "imgZone":"zone" + }, + { + "id":"tutoRimeIca", + "image":"food2", + "son":"ica", + "correct":false, + "numZone":1, + "imgZone":"zone" + }, + { + "id":"tutoRimeSelo", + "image":"food3", + "son":"selo", + "correct":true, + "feedback":"fb+selo", + "numZone":2, + "imgZone":"zone" + } + ], + "type":"training", + "randomiser":true, + "miseEnAction":"miseenaction", + "transition":"transition", + "description":"", + "enumerer":true, + "separateurChoix":"", + "surligner":true, + "cible":"cible", + "bloqueErreurs":false, + "explication":"explication", + "surlignerExplication":0.0, + "toucherLesChoix":"toucherLesChoix", + "feedbackPlus":"feedbackplus", + "feedbackMoins":"feedbackmoins" + }, + { + "id":"tutoRime", + "pret":"ready", + "consigne":"consignetest", + "fond":"bimo_fond_image", + "choix":[ + { + "id":"tutoRimeIca", + "image":"food1", + "son":"ape", + "correct":false, + "numZone":0, + "imgZone":"zone" + }, + { + "id":"tutoRimeIca", + "image":"food2", + "son":"ica", + "correct":false, + "numZone":1, + "imgZone":"zone" + }, + { + "id":"tutoRimeSelo", + "image":"food3", + "son":"selo", + "correct":true, + "numZone":2, + "imgZone":"zone" + } + ], + "type":"test", + "randomiser":true, + "miseEnAction":"miseenaction", + "transition":"transition", + "description":"", + "enumerer":true, + "separateurChoix":"", + "surligner":true, + "cible":"cible", + "bloqueErreurs":true, + "explication":"explication", + "surlignerExplication":0.0, + "toucherLesChoix":"toucherLesChoix", + "feedbackPlus":"feedbackplus", + "feedbackMoins":"feedbackmoins" + }, + { + "id":"tutoRime", + "pret":"ready", + "consigne":"consignetest", + "fond":"bimo_fond_image", + "choix":[ + { + "id":"tutoRimeIca", + "image":"food1", + "son":"ape", + "correct":false, + "numZone":0, + "imgZone":"zone" + }, + { + "id":"tutoRimeIca", + "image":"food2", + "son":"ica", + "correct":false, + "numZone":1, + "imgZone":"zone" + }, + { + "id":"tutoRimeSelo", + "image":"food3", + "son":"selo", + "correct":true, + "numZone":2, + "imgZone":"zone" + } + ], + "type":"test", + "randomiser":true, + "miseEnAction":"miseenaction", + "transition":"transition", + "description":"", + "enumerer":true, + "separateurChoix":"", + "surligner":true, + "cible":"cible", + "bloqueErreurs":false, + "explication":"explication", + "surlignerExplication":0.0, + "toucherLesChoix":"toucherLesChoix", + "feedbackPlus":"feedbackplus", + "feedbackMoins":"feedbackmoins" + } + ] + } + ] + } + ] +} diff --git a/Assets/Resources/raven_demo3X2.json.meta b/Assets/Resources/raven_demo3X2.json.meta new file mode 100644 index 00000000..b6c94610 --- /dev/null +++ b/Assets/Resources/raven_demo3X2.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e1958a51873a5f743be27c3219aacc42 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index d48c8aef..9a1e4ddb 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -786,7 +786,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3c4520771b043844483afc6db50e0401, type: 3} m_Name: m_EditorClassIdentifier: - jsonFileName: raven + jsonFileName: raven_demo3X2 data: sessions: [] --- !u!82 &761270580 @@ -901,6 +901,7 @@ MonoBehaviour: placeWhereToInstantiateThings: {fileID: 1448299097} mM: {fileID: 761270576} prefabImagePrincipale: {fileID: 8891670654556252168, guid: 853e78dde3b35b14a8280e53f6069fad, type: 3} + prefabImageEpreuveCentered: {fileID: 8891670654556252168, guid: b76941fd0a3f6ae4c8e4ff6f47c9facd, type: 3} prefabBoutonQCM: {fileID: 4803510310350084444, guid: 6bb5b085467c66843ad78ea42a593233, type: 3} prefabDraggableGD: {fileID: 4803510310350084444, guid: 9521614de71f7be40979f0c4472bbe95, type: 3} prefabDropZoneGD: {fileID: 4803510310350084444, guid: da2989e49eaee7848a9519764792bb1c, type: 3} @@ -929,6 +930,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + currentlyInstanciatedImageEpreuveCentered: {fileID: 0} --- !u!114 &761270582 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4760,6 +4762,10 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 8066883370429751300, guid: d2cfb9fe5fe33e648ad7a1a7f16e43f2, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8066883370439370070, guid: d2cfb9fe5fe33e648ad7a1a7f16e43f2, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -5334,11 +5340,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8066883370759840392, guid: d2cfb9fe5fe33e648ad7a1a7f16e43f2, type: 3} propertyPath: m_AnchoredPosition.x - value: -0.000061035156 + value: 0 objectReference: {fileID: 0} - target: {fileID: 8066883370759840392, guid: d2cfb9fe5fe33e648ad7a1a7f16e43f2, type: 3} propertyPath: m_AnchoredPosition.y - value: -0.000030517578 + value: 0 objectReference: {fileID: 0} - target: {fileID: 8066883370759840392, guid: d2cfb9fe5fe33e648ad7a1a7f16e43f2, type: 3} propertyPath: m_LocalEulerAnglesHint.x diff --git a/Assets/mainManager.cs b/Assets/mainManager.cs index bed045ed..6d1f14d6 100644 --- a/Assets/mainManager.cs +++ b/Assets/mainManager.cs @@ -129,7 +129,7 @@ public class mainManager : MonoBehaviour return null; } - public bool executeAsset(string id, Action mafonction, bool img=false) + public bool executeAsset(string id, Action mafonction, bool img=false, bool epreuveStep=false) { Debug.Log("executeAsset " + id); bool anAssetSoundExists = false; @@ -143,7 +143,16 @@ public class mainManager : MonoBehaviour Sprite image = Resources.Load<Sprite>(a.img_path); if (image != null) { - posScript.SetSpriteAndPosition(image); + if (epreuveStep) + { + posScript.SetImageEpreuve(image); + + } + else + { + posScript.SetSpriteAndPosition(image); + + } anAssetSoundExists = true; } } @@ -230,6 +239,10 @@ public class mainManager : MonoBehaviour } public void endItem() { + if (posScript.currentlyInstanciatedImageEpreuveCentered != null) + { + Destroy(posScript.currentlyInstanciatedImageEpreuveCentered.gameObject); + } if (currentItem >= e.items.Count - 1) { // pas d'autre liste d'items dans cette epreuve diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index ae38212c..aab2dbf3 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -21,10 +21,10 @@ EditorUserSettings: value: 5254025f52035803555609204677074444164f7c2f797664757a1861e1e66268 flags: 0 RecentlyUsedSceneGuid-5: - value: 515250075c0c595e5f5a5e71122159444e4e4a2f7a7d7f602f284d66b4b76661 + value: 52045152560d5d025858542140750e44404f4d2b74797431292b1f66b1e5373c flags: 0 RecentlyUsedSceneGuid-6: - value: 52045152560d5d025858542140750e44404f4d2b74797431292b1f66b1e5373c + value: 515250075c0c595e5f5a5e71122159444e4e4a2f7a7d7f602f284d66b4b76661 flags: 0 vcSharedLogLevel: value: 0d5e400f0650 diff --git a/UserSettings/Layouts/default-2022.dwlt b/UserSettings/Layouts/default-2022.dwlt index ab7635e9..fd8a094e 100644 --- a/UserSettings/Layouts/default-2022.dwlt +++ b/UserSettings/Layouts/default-2022.dwlt @@ -119,7 +119,7 @@ MonoBehaviour: m_MinSize: {x: 300, y: 100} m_MaxSize: {x: 24288, y: 16192} vertical: 0 - controlID: 38 + controlID: 100 --- !u!114 &6 MonoBehaviour: m_ObjectHideFlags: 52 @@ -139,12 +139,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 927.2 + width: 1200.8 height: 722.8 m_MinSize: {x: 200, y: 100} m_MaxSize: {x: 16192, y: 16192} vertical: 1 - controlID: 39 + controlID: 64 --- !u!114 &7 MonoBehaviour: m_ObjectHideFlags: 52 @@ -164,12 +164,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 927.2 - height: 455.2 + width: 1200.8 + height: 365.6 m_MinSize: {x: 200, y: 50} m_MaxSize: {x: 16192, y: 8096} vertical: 0 - controlID: 40 + controlID: 19 --- !u!114 &8 MonoBehaviour: m_ObjectHideFlags: 52 @@ -187,8 +187,8 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 311.2 - height: 455.2 + width: 403.2 + height: 365.6 m_MinSize: {x: 201, y: 221} m_MaxSize: {x: 4001, y: 4021} m_ActualView: {fileID: 13} @@ -211,10 +211,10 @@ MonoBehaviour: m_Children: [] m_Position: serializedVersion: 2 - x: 311.2 + x: 403.2 y: 0 - width: 616 - height: 455.2 + width: 797.60004 + height: 365.6 m_MinSize: {x: 202, y: 221} m_MaxSize: {x: 4002, y: 4021} m_ActualView: {fileID: 12} @@ -239,11 +239,11 @@ MonoBehaviour: m_Position: serializedVersion: 2 x: 0 - y: 455.2 - width: 927.2 - height: 267.59998 - m_MinSize: {x: 101, y: 121} - m_MaxSize: {x: 4001, y: 4021} + y: 365.6 + width: 1200.8 + height: 357.19998 + m_MinSize: {x: 100, y: 100} + m_MaxSize: {x: 4000, y: 4000} m_ActualView: {fileID: 16} m_Panes: - {fileID: 15} @@ -265,12 +265,12 @@ MonoBehaviour: m_Children: [] m_Position: serializedVersion: 2 - x: 927.2 + x: 1200.8 y: 0 - width: 608.8 + width: 335.19995 height: 722.8 - m_MinSize: {x: 276, y: 71} - m_MaxSize: {x: 4001, y: 4021} + m_MinSize: {x: 275, y: 50} + m_MaxSize: {x: 4000, y: 4000} m_ActualView: {fileID: 17} m_Panes: - {fileID: 17} @@ -296,10 +296,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 311.2 + x: 403.2 y: 73.6 - width: 614 - height: 434.2 + width: 795.60004 + height: 344.6 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -352,23 +352,23 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 21 - width: 614 - height: 413.2 - m_Scale: {x: 0.31882718, y: 0.31882718} - m_Translation: {x: 307, y: 206.60002} + width: 795.60004 + height: 323.6 + m_Scale: {x: 0.24969137, y: 0.24969137} + m_Translation: {x: 397.80002, y: 161.8} m_MarginLeft: 0 m_MarginRight: 0 m_MarginTop: 0 m_MarginBottom: 0 m_LastShownAreaInsideMargins: serializedVersion: 2 - x: -962.9041 + x: -1593.1669 y: -648 - width: 1925.8082 + width: 3186.3337 height: 1296 m_MinimalGUI: 1 - m_defaultScale: 0.31882718 - m_LastWindowPixelSize: {x: 767.5, y: 542.75} + m_defaultScale: 0.24969137 + m_LastWindowPixelSize: {x: 994.50006, y: 430.75} m_ClearInEditMode: 1 m_NoCameraWarning: 1 m_LowResolutionForAspectRatios: 01000000000000000000 @@ -396,8 +396,8 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 73.6 - width: 310.2 - height: 434.2 + width: 402.2 + height: 344.6 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -411,9 +411,9 @@ MonoBehaviour: m_SceneHierarchy: m_TreeViewState: scrollPos: {x: 0, y: 0} - m_SelectedIDs: d0640000 + m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: e454faffec18fbff2419fbff845dfbff9c7ffbffc687fbff88a7fbff1ecefbff9e23fdff4a2ffdff024ffdff2250fdffba6ffdfff26ffdff14cffdff7efcfdffb81ffeffba75feff8879feffc6f7fefffe18ffffa61dffff483fffffc843fffff646ffffd268ffff5089ffffd8f5ffff16fbffffd6f0000054f100004437010088650100b0a00100ec150200f6a7020076a802007ea90200f8570300625803001a0f0500520f0500e42f050052300500b83005005a700500927005009c700500ae700500c0700500 + m_ExpandedIDs: 14fbffff16fbffff086300001c630000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -457,10 +457,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 332.80002 + x: 403.2 y: 73.6 - width: 670 - height: 425.4 + width: 795.60004 + height: 344.6 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -515,7 +515,7 @@ MonoBehaviour: collapsed: 0 displayed: 0 snapOffset: {x: 0, y: 0} - snapOffsetDelta: {x: 0, y: 24.8} + snapOffsetDelta: {x: 0, y: 0} snapCorner: 1 id: unity-search-toolbar index: 1 @@ -567,7 +567,7 @@ MonoBehaviour: collapsed: 0 displayed: 0 snapOffset: {x: 0, y: 0} - snapOffsetDelta: {x: 0, y: 24.8} + snapOffsetDelta: {x: 0, y: 0} snapCorner: 0 id: Scene View/Light Settings index: 2 @@ -593,7 +593,7 @@ MonoBehaviour: collapsed: 0 displayed: 0 snapOffset: {x: 0, y: 0} - snapOffsetDelta: {x: 0, y: 24.8} + snapOffsetDelta: {x: 0, y: 0} snapCorner: 0 id: Scene View/Cloth Constraints index: 3 @@ -606,7 +606,7 @@ MonoBehaviour: collapsed: 0 displayed: 0 snapOffset: {x: 0, y: 0} - snapOffsetDelta: {x: 0, y: 24.8} + snapOffsetDelta: {x: 0, y: 0} snapCorner: 0 id: Scene View/Cloth Collisions index: 4 @@ -658,7 +658,7 @@ MonoBehaviour: collapsed: 0 displayed: 0 snapOffset: {x: 0, y: 0} - snapOffsetDelta: {x: 0, y: 24.8} + snapOffsetDelta: {x: 0, y: 0} snapCorner: 0 id: Scene View/Occlusion Culling index: 5 @@ -671,7 +671,7 @@ MonoBehaviour: collapsed: 0 displayed: 0 snapOffset: {x: 0, y: 0} - snapOffsetDelta: {x: 0, y: 24.8} + snapOffsetDelta: {x: 0, y: 0} snapCorner: 0 id: Scene View/Physics Debugger index: 6 @@ -684,7 +684,7 @@ MonoBehaviour: collapsed: 0 displayed: 0 snapOffset: {x: 0, y: 0} - snapOffsetDelta: {x: 0, y: 24.8} + snapOffsetDelta: {x: 0, y: 0} snapCorner: 0 id: Scene View/Scene Visibility index: 7 @@ -697,7 +697,7 @@ MonoBehaviour: collapsed: 0 displayed: 0 snapOffset: {x: 0, y: 0} - snapOffsetDelta: {x: 0, y: 24.8} + snapOffsetDelta: {x: 0, y: 0} snapCorner: 0 id: Scene View/Particles index: 8 @@ -806,9 +806,9 @@ MonoBehaviour: m_PlayAudio: 0 m_AudioPlay: 0 m_Position: - m_Target: {x: -1.6429672, y: 1.0992794, z: -0.007348313} + m_Target: {x: 7.8409834, y: 7.2982817, z: -0.13678657} speed: 2 - m_Value: {x: -1.6429672, y: 1.0992794, z: -0.007348313} + m_Value: {x: 7.8409834, y: 7.2982817, z: -0.13678657} m_RenderMode: 0 m_CameraMode: drawMode: 0 @@ -858,9 +858,9 @@ MonoBehaviour: speed: 2 m_Value: {x: 0, y: 0, z: 0, w: 1} m_Size: - m_Target: 1.6008571 + m_Target: 15.176808 speed: 2 - m_Value: 1.6008571 + m_Value: 15.176808 m_Ortho: m_Target: 1 speed: 2 @@ -906,9 +906,9 @@ MonoBehaviour: m_Pos: serializedVersion: 2 x: 0 - y: 506.4 - width: 926.2 - height: 269 + y: 439.2 + width: 1199.8 + height: 336.19998 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -930,7 +930,7 @@ MonoBehaviour: m_SkipHidden: 0 m_SearchArea: 1 m_Folders: - - Assets/Scenes + - Assets/Prefabs m_Globs: [] m_OriginalText: m_ImportLogFlags: 0 @@ -938,16 +938,16 @@ MonoBehaviour: m_ViewMode: 1 m_StartGridSize: 64 m_LastFolders: - - Assets/Scenes + - Assets/Prefabs m_LastFoldersGridSize: -1 m_LastProjectPath: C:\Users\guill\OneDrive\Bureau\LUCIOLE\EVALULU\lulu-testing m_LockTracker: m_IsLocked: 0 m_FolderTreeState: scrollPos: {x: 0, y: 79} - m_SelectedIDs: 98640000 - m_LastClickedID: 25752 - m_ExpandedIDs: 00000000886400008a6400009c64000000ca9a3bffffff7f + m_SelectedIDs: aa830000 + m_LastClickedID: 33706 + m_ExpandedIDs: 000000009a8300009c830000ac83000000ca9a3bffffff7f m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -975,7 +975,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: 00000000886400008a640000 + m_ExpandedIDs: 000000009a8300009c8300009e830000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -1000,8 +1000,8 @@ MonoBehaviour: m_Icon: {fileID: 0} m_ResourceFile: m_ListAreaState: - m_SelectedInstanceIDs: d0640000 - m_LastClickedInstanceID: 25808 + m_SelectedInstanceIDs: 12840000 + m_LastClickedInstanceID: 33810 m_HadKeyboardFocusLastEvent: 1 m_ExpandedInstanceIDs: c6230000 m_RenameOverlay: @@ -1052,9 +1052,9 @@ MonoBehaviour: m_Pos: serializedVersion: 2 x: 0 - y: 528.8 - width: 926.2 - height: 246.59998 + y: 439.2 + width: 1199.8 + height: 336.19998 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -1085,9 +1085,9 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 927.2 + x: 1200.8 y: 73.6 - width: 607.8 + width: 334.19995 height: 701.8 m_SerializedDataModeController: m_DataMode: 0 -- GitLab