From 6d75d652699c83cb8acce0c7dca36168a1fa8241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diana=20L=C3=B3pez=20Alvas?= Date: Fri, 24 Nov 2023 17:34:15 -0300 Subject: [PATCH] fixing open challenge error --- src/emberCommunication.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/emberCommunication.ts b/src/emberCommunication.ts index b8ee19a4..f20b8df5 100644 --- a/src/emberCommunication.ts +++ b/src/emberCommunication.ts @@ -9,6 +9,7 @@ export type EmberExecutableChallenge = { estiloToolbox?: "sinCategorias", solucionInicial?: string titulo: string, + nombre: string, enunciado: string, consignaInicial: string, customCover: string, @@ -39,6 +40,10 @@ export namespace Ember { const blob = await content.blob() return URL.createObjectURL(blob) } + function textToCamelCase(texto: string) { + return texto.replace(/\b\w/g, (match) => match.toUpperCase()).replace(/\s+/g, ''); + } + export const importChallenge = async (importedChallenge: SerializedChallenge) => { @@ -49,6 +54,7 @@ export namespace Ember { debugging: importedChallenge.stepByStep, solucionInicial: importedChallenge.predefinedSolution, titulo: importedChallenge.title, + nombre: textToCamelCase(importedChallenge.title), enunciado: importedChallenge.statement.description, consignaInicial: importedChallenge.statement.clue || "", customCover: await sceneCover(importedChallenge.scene.type),