Skip to content

Commit

Permalink
Add CKEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
sonsoleslp committed Jun 23, 2020
1 parent 4456860 commit de032cc
Show file tree
Hide file tree
Showing 584 changed files with 29,226 additions and 417 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
public/js
public/ckeditor
public/apps
public/pdf
public/scorm
13 changes: 8 additions & 5 deletions controllers/escapeRoom_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ exports.new = (_req, res) => {
exports.create = async (req, res) => {
const {title, subject, duration, forbiddenLateSubmissions, description, nmax, teamSize, supportLink, forceLang} = req.body,
authorId = req.session.user && req.session.user.id || 0;

const escapeRoom = models.escapeRoom.build({title, subject, duration, "forbiddenLateSubmissions": forbiddenLateSubmissions === "on", description, supportLink, "nmax": nmax || 0, "teamSize": teamSize || 0, authorId, forceLang}); // Saves only the fields question and answer into the DDBB
const {i18n} = res.locals;

escapeRoom.forceLang = forceLang === "en" || forceLang === "es" ? forceLang : null;

try {
const er = await escapeRoom.save({"fields": ["title", "teacher", "subject", "duration", "description", "forbiddenLateSubmissions", "nmax", "teamSize", "authorId", "supportLink", "invitation", "forceLang"]});

Expand Down Expand Up @@ -277,11 +280,11 @@ exports.teamInterface = (req, res) => {
exports.classInterface = (req, res) => {
const {escapeRoom} = req;

if (escapeRoom.forceLang && req.cookies && req.cookies.locale !== escapeRoom.forceLang) {
res.locals.i18n_texts = escapeRoom.forceLang === "es" ? es : en;
res.locals.i18n_lang = escapeRoom.forceLang === "es" ? "es" : "en";
res.locals.i18n = res.locals.i18n_texts;
}
// if (escapeRoom.forceLang && req.cookies && req.cookies.locale !== escapeRoom.forceLang) {
// res.locals.i18n_texts = escapeRoom.forceLang === "es" ? es : en;
// res.locals.i18n_lang = escapeRoom.forceLang === "es" ? "es" : "en";
// res.locals.i18n = res.locals.i18n_texts;
// }
res.render("escapeRooms/steps/instructions", {escapeRoom, "progress": "class", "endPoint": "class"});
};
// GET /escapeRooms/:escapeRoomId/indications
Expand Down
1 change: 0 additions & 1 deletion helpers/locals.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = function (app) {
return `${zeroPadding(d.getDate())}-${zeroPadding(d.getMonth() + 1)}-${d.getFullYear()} ${zeroPadding(d.getHours())}:${zeroPadding(d.getMinutes())}`;
};


app.locals.formatTime = function (currentDate) {
currentDate.setMinutes(currentDate.getMinutes() + currentDate.getTimezoneOffset());
return `${zeroPadding(currentDate.getHours())}:${zeroPadding(currentDate.getMinutes())}`;
Expand Down
29 changes: 26 additions & 3 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,18 +410,41 @@
},
"team": {
"explanation": "Here you can customize the interface that students will see on their computers when they are playing. You can add any information they need in order to participate: links, images, messages, the first clue, etc.",
"placeholder": "You can add a custom message, images, links...",
"placeholder": "You can add a custom message, images, links... Do not forget to setup when you want to display this information by clicking in the eye icon on the left.",
"title": "Team interface"
},
"class": {
"explanation": "Here you can customize the interface that you'll be able to screen in the classroom for all students to see. It can include the introductory video, the countdown, the leaderboard, etc. If students are participating in the escape room remotely, they will never see the class interface, so you can skip this step.",
"placeholder": "You can choose to project the countdown, an introductory video, etc.",
"placeholder": "Add the information you want to project in the classroom",
"title": "Classroom interface"
},
"indications": {
"explanation": "Here you can customize the information students will see prior to the start of the escape room since the moment the sign up. For instance, you can remind them to bring certain material, tell them to review the course content, or provide them a video to watch.",
"placeholder": "Add custom instructions",
"title": "Pre-activity instructions"
"title": "Pre-activity instructions",
"front": {
"countdown": "Countdown",
"ranking": "Leaderboard",
"progress": "Progress bar",
"textAndMedia": "Text and multimedia",
"reorder": "Drag to reorder",
"delete": "Delete",
"areYouSureDelete":"Are you sure you want to delete this content block? This action cannot be reverted",
"setupVisualization": "Visualization",
"visualizationIntro": "When do you wish to display this content block?",
"visualizationStart": "Right at the beginning",
"visualizationSucceed": "After solving the following puzzles",
"accept": "accept",
"cancel": "cancel",
"dropHere": "Drop now to place the content here",
"theme": "Theme",
"Team": "Team",
"Members":"Members",
"Progress": "Progress",
"Time": "Time",
"Student": "Student"

}
},
"list": {
"edit":"Basic configuration",
Expand Down
28 changes: 25 additions & 3 deletions i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,18 +400,40 @@
},
"team": {
"explanation": "En este apartado puedes personalizar la interfaz que los estudiantes verán en sus pantallas mientras jueguen a la escape room. Puedes añadir una pista inicial, enlaces, imágenes, etc.",
"placeholder": "Añade un mensaje personalizado, imágenes, links...",
"placeholder": "Añade un mensaje personalizado, imágenes, links... No te olvides de configurar cuándo quieres que sea visible esta información haciendo click en el icono del ojo a la izquierda",
"title": "Interfaz de equipo"
},
"class": {
"explanation": "En este apartado puedes personalizar la interfaz que proyectarás en el aula. Puedes añadir elementos como la cuenta atrás, el video introductorio o el ranking. Si los alumnos van a participar en la escape room de forma remota nunca verán esta interfaz, por lo que puedes saltarte este paso.",
"placeholder": "Añade la cuenta atrás, un ranking, el vídeo de presentación, etc.",
"placeholder": "Añade la información que quieras proyectar a los alumnos",
"title": "Interfaz de clase"
},
"indications": {
"explanation": "En este apartado puedes personalizar las instrucciones que los alumnos recibirán antes de que comience la escape room desde el momento en el que se apunten. Por ejemplo, puedes recordarles que traigan algún material, indicarles que repasen parte del contenido de la asignatura o proporcionarles un vídeo para que visualicen.",
"placeholder": "Añade instrucciones previas personalizadas",
"title": "Instrucciones previas"
"title": "Instrucciones previas",
"front": {
"countdown": "Cuenta atrás",
"ranking": "Ranking",
"progress": "Barra de progreso",
"textAndMedia": "Texto y multimedia",
"reorder": "Comienza a arrastrar para reordenar",
"delete": "Borrar",
"areYouSureDelete":"¿Seguro que deseas borrar este contenido? Esta acción es irreversible",
"setupVisualization": "Visualización",
"visualizationIntro": "¿Cuándo deseas mostrar este bloque de contenido?",
"visualizationStart": "Nada más empezar",
"visualizationSucceed": "Al superar los retos",
"accept": "aceptar",
"cancel": "cancelar",
"dropHere": "Suelta para colocarlo aquí",
"theme": "Tema",
"Team": "Equipo",
"Members":"Miembros",
"Progress": "Progreso",
"Time": "Tiempo",
"Student": "Alumno"
}
},
"list": {
"edit":"Configuración básica",
Expand Down
Loading

0 comments on commit de032cc

Please sign in to comment.