Skip to content

Commit

Permalink
fixing open challenge error
Browse files Browse the repository at this point in the history
  • Loading branch information
dlopezalvas committed Nov 24, 2023
1 parent a484de2 commit 6d75d65
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/emberCommunication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type EmberExecutableChallenge = {
estiloToolbox?: "sinCategorias",
solucionInicial?: string
titulo: string,
nombre: string,
enunciado: string,
consignaInicial: string,
customCover: string,
Expand Down Expand Up @@ -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) => {

Expand All @@ -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),
Expand Down

0 comments on commit 6d75d65

Please sign in to comment.