diff --git a/css/swad19.82.css b/css/swad19.82.3.css
similarity index 99%
rename from css/swad19.82.css
rename to css/swad19.82.3.css
index b7480b105..d2353a8f9 100644
--- a/css/swad19.82.css
+++ b/css/swad19.82.3.css
@@ -1485,7 +1485,7 @@ a:hover /* Default ==> underlined */
background-image:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.2));
}
-.BT_LINK
+.BT_LINK, .BT_LINK_OFF
{
background:none;
border:none;
@@ -1718,6 +1718,9 @@ a:hover /* Default ==> underlined */
.BANNER {width:150px; height:50px;}
.BANNER_SMALL {width:75px; height:25px;}
+.ICO_BLACK {color:#404040;}
+.ICO_RED {color:#660000;}
+
/****** Contextual links with small icons and text to go to some action ******/
.CONTEXT_MENU
{
@@ -2308,9 +2311,9 @@ a:hover img.CENTRE_PHOTO_SHOW
.DAT_SMALL_NOBR_N {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:black; font-size:12pt; white-space:nowrap;}
.DAT_SMALL_GREY {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#707070; font-size:12pt;}
-.DAT_SMALL_RED {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:red; font-size:12pt;}
+.DAT_SMALL_RED {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#660000; font-size:12pt;}
.DAT_SMALL_PURPLE {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#707070; font-size:12pt;}
-.DAT_SMALL_GREEN {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#008000; font-size:12pt;}
+.DAT_SMALL_GREEN {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#246600; font-size:12pt;}
.DAT_SMALL_BLUE {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#0080FF; font-size:12pt;}
.DAT_SMALL_YELLOW {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#C0C000; font-size:12pt;}
.DAT_SMALL_PINK {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#707070; font-size:12pt;}
@@ -2655,7 +2658,7 @@ a:hover img.CENTRE_PHOTO_SHOW
{
box-sizing:border-box;
float:left;
- width:20%;
+ width:25%;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
@@ -2665,7 +2668,7 @@ a:hover img.CENTRE_PHOTO_SHOW
box-sizing:border-box;
display:table;
float:left;
- width:80%;
+ width:75%;
}
.MCH_TOP
{
@@ -2696,7 +2699,7 @@ a:hover img.CENTRE_PHOTO_SHOW
.MCH_NUM_QST
{
color:#808080;
- font-size:24pt;
+ font-size:28pt;
font-weight:bold;
text-align:center;
vertical-align:top;
@@ -2713,7 +2716,6 @@ a:hover img.CENTRE_PHOTO_SHOW
{
text-align:center;
padding:16pt 0;
- font-size:13pt;
}
.MCH_NUM_ANSWERERS
{
@@ -2732,39 +2734,39 @@ a:hover img.CENTRE_PHOTO_SHOW
}
.MCH_BUTTON_LEFT_CONTAINER
{
- display:table-cell;
+ display:table;
box-sizing:border-box;
float:left;
width:35%;
+ text-align:center;
}
.MCH_BUTTON_CENTER_CONTAINER
{
- display:table-cell;
+ display:table;
box-sizing:border-box;
float:left;
width:30%;
+ text-align:center;
}
.MCH_BUTTON_RIGHT_CONTAINER
{
- display:table-cell;
+ display:table;
box-sizing:border-box;
float:left;
width:35%;
+ text-align:center;
}
.MCH_BUTTON_CONTAINER
{
box-sizing:border-box;
- display:table;
+ display:table-cell;
width:100%;
height:64px;
font-size:28pt;
padding:2px;
- }
-.MCH_BUTTON_CONTAINER a
- {
- text-decoration:none;
- color:#404040;
+ text-align:center;
+ vertical-align:middle;
}
.MCH_BUTTON_ON
{
@@ -2885,7 +2887,7 @@ a:hover img.CENTRE_PHOTO_SHOW
.MCH_STD_BUTTON
{
box-sizing:border-box;
- width:75%;
+ width:100%;
margin:10px auto;
padding:20px;
border-radius:4px;
diff --git a/swad_changelog.h b/swad_changelog.h
index a5fad7374..baa9b1ef8 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -490,14 +490,16 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
-#define Log_PLATFORM_VERSION "SWAD 19.82.2 (2019-12-03)"
-#define CSS_FILE "swad19.82.css"
+#define Log_PLATFORM_VERSION "SWAD 19.82.3 (2019-12-04)"
+#define CSS_FILE "swad19.82.3.css"
#define JS_FILE "swad19.70.js"
/*
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
// TODO: Impedir la creación y edición de proyectos si no son editables.
// TODO: En cada juego, poder listar los resultados en una tabla como la de resultados globales
+ Version 19.82.3: Dec 04, 2019 Code refactoring in matches.
+ Some messages translated. (247840 lines)
Version 19.82.2: Dec 03, 2019 Some messages translated. (247781 lines)
Version 19.82.1: Dec 03, 2019 Fixed bug in surveys.
Fixed bug in statistics.
diff --git a/swad_match.c b/swad_match.c
index 26cd5ae85..5f55bea7e 100644
--- a/swad_match.c
+++ b/swad_match.c
@@ -2236,14 +2236,18 @@ static void Mch_ShowLeftColumnStd (struct Match *Match,
/***** Write number of question *****/
Mch_ShowNumQstInMatch (Match);
- /***** Write if question is answered *****/
- Mch_PutIfAnswered (Match,Answered);
+ if (Match->Status.QstInd > 0 &&
+ Match->Status.QstInd < Mch_AFTER_LAST_QUESTION)
+ {
+ /***** Write whether question is answered or not *****/
+ Mch_PutIfAnswered (Match,Answered);
- if (Match->Status.Playing && // Match is being played
- Match->Status.Showing == Mch_ANSWERS && // Teacher's screen is showing question answers
- Answered) // I have answered this question
- /***** Put icon to view *****/
- Mch_PutIconToRemoveMyAnswer (Match);
+ if (Match->Status.Playing && // Match is being played
+ Match->Status.Showing == Mch_ANSWERS && // Teacher's screen is showing question answers
+ Answered) // I have answered this question
+ /***** Put icon to remove my answet *****/
+ Mch_PutIconToRemoveMyAnswer (Match);
+ }
/***** End left container *****/
HTM_DIV_End ();
@@ -2274,8 +2278,11 @@ static void Mch_ShowRightColumnStd (struct Match *Match,
/***** Update players ******/
if (Mch_RegisterMeAsPlayerInMatch (Match))
- /* Show current question and possible answers */
- Mch_ShowQuestionAndAnswersStd (Match,UsrAnswer,Update);
+ {
+ if (Match->Status.Showing == Mch_ANSWERS) // Teacher's screen is showing question answers
+ /* Show current question and possible answers */
+ Mch_ShowQuestionAndAnswersStd (Match,UsrAnswer,Update);
+ }
else
Ale_ShowAlert (Ale_ERROR,"You can not join this match.");
@@ -2446,17 +2453,12 @@ static void Mch_PutCheckboxResult (struct Match *Match)
Mch_PutParamMchCod (Match->MchCod); // Current match being played
/***** Put icon with link *****/
- HTM_DIV_Begin ("class=\"CONTEXT_OPT\"");
- HTM_A_Begin ("href=\"\" class=\"ICO_HIGHLIGHT\" title=\"%s\" "
- " onclick=\"document.getElementById('%s').submit();return false;\"",
- Txt_View_results,
- Gbl.Form.Id);
+ HTM_BUTTON_SUBMIT_Begin (Txt_View_results,"BT_LINK DAT ICO_HIGHLIGHT",NULL);
HTM_TxtF ("",
Match->Status.ShowQstResults ? "fas fa-toggle-on" :
"fas fa-toggle-off");
HTM_TxtF (" %s",Txt_View_results);
- HTM_A_End ();
- HTM_DIV_End ();
+ HTM_BUTTON_End ();
/***** End form *****/
Frm_EndForm ();
@@ -2472,22 +2474,24 @@ static void Mch_PutCheckboxResult (struct Match *Match)
static void Mch_PutIfAnswered (const struct Match *Match,bool Answered)
{
extern const char *Txt_View_my_answer;
+ extern const char *Txt_MATCH_QUESTION_Answered;
+ extern const char *Txt_MATCH_QUESTION_Unanswered;
/***** Start container *****/
HTM_DIV_Begin ("class=\"MCH_SHOW_RESULTS\"");
/***** Put icon with link *****/
- if (Match->Status.Showing == Mch_ANSWERS &&
- Answered)
+ if (Match->Status.Playing && // Match is being played
+ Match->Status.Showing == Mch_ANSWERS && // Teacher's screen is showing question answers
+ Answered) // I have answered this question
{
/* Start form */
Frm_StartForm (ActSeeMchAnsQstStd);
Mch_PutParamMchCod (Match->MchCod); // Current match being played
- HTM_BUTTON_OnMouseDown_Begin (Txt_View_my_answer,"BT_LINK DAT_SMALL");
+ HTM_BUTTON_OnMouseDown_Begin (Txt_View_my_answer,"BT_LINK DAT_SMALL_GREEN");
HTM_TxtF ("","fas fa-check-circle");
- HTM_TxtF (" %s","Respondida"); // TODO: Need translation!!!!
-
+ HTM_TxtF (" %s",Txt_MATCH_QUESTION_Answered);
HTM_BUTTON_End ();
/* End form */
@@ -2495,14 +2499,15 @@ static void Mch_PutIfAnswered (const struct Match *Match,bool Answered)
}
else
{
- HTM_DIV_Begin ("class=\"DAT_SMALL\"");
+ HTM_DIV_Begin ("class=\"%s\"",Answered ? "DAT_SMALL_GREEN" :
+ "DAT_SMALL_RED");
HTM_TxtF ("",
Answered ? "fas fa-check-circle" :
"fas fa-exclamation-circle",
- Answered ? "Respondida" :
- "No respondida"); // TODO: Need translation!!!!
- HTM_TxtF (" %s",Answered ? "Respondida" :
- "No respondida"); // TODO: Need translation!!!!
+ Answered ? Txt_MATCH_QUESTION_Answered :
+ Txt_MATCH_QUESTION_Unanswered);
+ HTM_TxtF (" %s",Answered ? Txt_MATCH_QUESTION_Answered :
+ Txt_MATCH_QUESTION_Unanswered);
HTM_DIV_End ();
}
@@ -2516,7 +2521,7 @@ static void Mch_PutIfAnswered (const struct Match *Match,bool Answered)
static void Mch_PutIconToRemoveMyAnswer (struct Match *Match)
{
- extern const char *Txt_View_results;
+ extern const char *Txt_Delete_my_answer;
/***** Start container *****/
HTM_DIV_Begin ("class=\"MCH_SHOW_RESULTS\"");
@@ -2528,12 +2533,9 @@ static void Mch_PutIconToRemoveMyAnswer (struct Match *Match)
/***** Put icon with link *****/
HTM_DIV_Begin ("class=\"MCH_BUTTON_CONTAINER\"");
- HTM_A_Begin ("href=\"\" class=\"MCH_BUTTON_ON\" title=\"%s\" "
- " onclick=\"document.getElementById('%s').submit();return false;\"",
- "Eliminar mi respuesta", // TODO: Need translation!!!!
- Gbl.Form.Id);
- HTM_Txt ("");
- HTM_A_End ();
+ HTM_BUTTON_OnMouseDown_Begin (Txt_Delete_my_answer,"BT_LINK MCH_BUTTON_ON ICO_RED");
+ HTM_Txt ("");
+ HTM_BUTTON_End ();
HTM_DIV_End ();
/***** End form *****/
@@ -2659,63 +2661,59 @@ static void Mch_ShowQuestionAndAnswersStd (struct Match *Match,
char *Class;
/***** Show question *****/
- /* Write buttons for answers? */
- if (Match->Status.Showing == Mch_ANSWERS)
+ if (Tst_CheckIfQuestionIsValidForGame (Match->Status.QstCod))
{
- if (Tst_CheckIfQuestionIsValidForGame (Match->Status.QstCod))
+ /***** Get number of options in this question *****/
+ NumOptions = Tst_GetNumAnswersQst (Match->Status.QstCod);
+
+ /***** Begin table *****/
+ HTM_TABLE_BeginWidePadding (8);
+
+ for (NumOpt = 0;
+ NumOpt < NumOptions;
+ NumOpt++)
{
- /***** Get number of options in this question *****/
- NumOptions = Tst_GetNumAnswersQst (Match->Status.QstCod);
+ /***** Start row *****/
+ HTM_TR_Begin (NULL);
- /***** Begin table *****/
- HTM_TABLE_BeginWidePadding (8);
+ /***** Write letter for this option *****/
+ /* Begin table cell */
+ HTM_TD_Begin ("class=\"MCH_STD_CELL\"");
- for (NumOpt = 0;
- NumOpt < NumOptions;
- NumOpt++)
- {
- /***** Start row *****/
- HTM_TR_Begin (NULL);
+ /* Form with button.
+ Sumitting onmousedown instead of default onclick
+ is necessary in order to be fast
+ and not lose clicks due to refresh */
+ Frm_StartForm (ActAnsMchQstStd);
+ Mch_PutParamMchCod (Match->MchCod); // Current match being played
+ Gam_PutParamQstInd (Match->Status.QstInd); // Current question index shown
+ Mch_PutParamNumOpt (NumOpt); // Number of button
- /***** Write letter for this option *****/
- /* Begin table cell */
- HTM_TD_Begin ("class=\"MCH_STD_CELL\"");
+ if (asprintf (&Class,"MCH_STD_BUTTON%s BT_%c",
+ UsrAnswer->NumOpt == (int) NumOpt && // Student's answer
+ Update == Mch_CHANGE_STATUS_BY_STUDENT ? " MCH_STD_ANSWER_SELECTED" :
+ "",
+ 'A' + (char) NumOpt) < 0)
+ Lay_NotEnoughMemoryExit ();
+ HTM_BUTTON_OnMouseDown_Begin (NULL,Class);
+ HTM_TxtF ("%c",'a' + (char) NumOpt);
+ HTM_BUTTON_End ();
+ free (Class);
- /* Form with button.
- Sumitting onmousedown instead of default onclick
- is necessary in order to be fast
- and not lose clicks due to refresh */
- Frm_StartForm (ActAnsMchQstStd);
- Mch_PutParamMchCod (Match->MchCod); // Current match being played
- Gam_PutParamQstInd (Match->Status.QstInd); // Current question index shown
- Mch_PutParamNumOpt (NumOpt); // Number of button
+ Frm_EndForm ();
- if (asprintf (&Class,"MCH_STD_BUTTON%s BT_%c",
- UsrAnswer->NumOpt == (int) NumOpt && // Student's answer
- Update == Mch_CHANGE_STATUS_BY_STUDENT ? " MCH_STD_ANSWER_SELECTED" :
- "",
- 'A' + (char) NumOpt) < 0)
- Lay_NotEnoughMemoryExit ();
- HTM_BUTTON_OnMouseDown_Begin (NULL,Class);
- HTM_TxtF ("%c",'a' + (char) NumOpt);
- HTM_BUTTON_End ();
- free (Class);
+ /* End table cell */
+ HTM_TD_End ();
- Frm_EndForm ();
-
- /* End table cell */
- HTM_TD_End ();
-
- /***** End row *****/
- HTM_TR_End ();
- }
-
- /***** End table *****/
- HTM_TABLE_End ();
+ /***** End row *****/
+ HTM_TR_End ();
}
- else
- Ale_ShowAlert (Ale_ERROR,"Type of answer not valid in a game.");
+
+ /***** End table *****/
+ HTM_TABLE_End ();
}
+ else
+ Ale_ShowAlert (Ale_ERROR,"Type of answer not valid in a game.");
}
/*****************************************************************************/
@@ -2979,11 +2977,9 @@ static void Mch_PutBigButton (Act_Action_t NextAction,const char *Id,
/***** Put icon with link *****/
HTM_DIV_Begin ("class=\"MCH_BUTTON_CONTAINER\"");
- HTM_A_Begin ("href=\"\" class=\"MCH_BUTTON_ON\" title=\"%s\" "
- " onclick=\"document.getElementById('%s').submit();return false;\"",
- Txt,Id);
+ HTM_BUTTON_SUBMIT_Begin (Txt,"BT_LINK MCH_BUTTON_ON ICO_BLACK",NULL);
HTM_TxtF ("",Icon);
- HTM_A_End ();
+ HTM_BUTTON_End ();
HTM_DIV_End ();
/***** End form *****/
@@ -2994,9 +2990,9 @@ static void Mch_PutBigButtonOff (const char *Icon)
{
/***** Put inactive icon *****/
HTM_DIV_Begin ("class=\"MCH_BUTTON_CONTAINER\"");
- HTM_DIV_Begin ("class=\"MCH_BUTTON_OFF\"");
+ HTM_BUTTON_BUTTON_Begin (NULL,"BT_LINK_OFF MCH_BUTTON_OFF ICO_BLACK",NULL);
HTM_TxtF ("",Icon);
- HTM_DIV_End ();
+ HTM_BUTTON_End ();
HTM_DIV_End ();
}
@@ -3006,10 +3002,9 @@ static void Mch_PutBigButtonClose (void)
/***** Put icon with link *****/
HTM_DIV_Begin ("class=\"MCH_BUTTON_CONTAINER\"");
- HTM_A_Begin ("href=\"\" class=\"MCH_BUTTON_ON\" title=\"%s\" "
- " onclick=\"window.close();return false;\"\"",Txt_Close);
+ HTM_BUTTON_BUTTON_Begin (Txt_Close,"BT_LINK MCH_BUTTON_ON ICO_BLACK","window.close();");
HTM_TxtF ("",Mch_ICON_CLOSE);
- HTM_A_End ();
+ HTM_BUTTON_End ();
HTM_DIV_End ();
}
diff --git a/swad_text.c b/swad_text.c
index a71d14776..7092438b6 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -7687,6 +7687,27 @@ const char *Txt_Delete_messages_sent =
"Eliminar mensagens enviadas";
#endif
+const char *Txt_Delete_my_answer =
+#if L==1 // ca
+ "Eliminar la meva resposta";
+#elif L==2 // de
+ "Lösche meine Antwort";
+#elif L==3 // en
+ "Delete my answer";
+#elif L==4 // es
+ "Eliminar mi respuesta";
+#elif L==5 // fr
+ "Supprimer ma réponse";
+#elif L==6 // gn
+ "Eliminar mi respuesta"; // Okoteve traducción
+#elif L==7 // it
+ "Elimina la mia risposta";
+#elif L==8 // pl
+ "Usuń moją odpowiedź";
+#elif L==9 // pt
+ "Excluir minha resposta";
+#endif
+
const char *Txt_Department =
#if L==1 // ca
"Departament";
@@ -18056,6 +18077,48 @@ const char *Txt_MATCH_Paused =
"Pausado";
#endif
+const char *Txt_MATCH_QUESTION_Answered =
+#if L==1 // ca
+ "Resposta";
+#elif L==2 // de
+ "Beantwortet";
+#elif L==3 // en
+ "Answered";
+#elif L==4 // es
+ "Respondida";
+#elif L==5 // fr
+ "Répondue";
+#elif L==6 // gn
+ "Respondida"; // Okoteve traducción
+#elif L==7 // it
+ "Risposta";
+#elif L==8 // pl
+ "Odpowiedziano";
+#elif L==9 // pt
+ "Respondida";
+#endif
+
+const char *Txt_MATCH_QUESTION_Unanswered =
+#if L==1 // ca
+ "No resposta";
+#elif L==2 // de
+ "Unbeantwortete";
+#elif L==3 // en
+ "Unanswered";
+#elif L==4 // es
+ "No respondida";
+#elif L==5 // fr
+ "Pas répondue";
+#elif L==6 // gn
+ "No respondida"; // Okoteve traducción
+#elif L==7 // it
+ "Non risposta";
+#elif L==8 // pl
+ "Nie odpowiedziano";
+#elif L==9 // pt
+ "Não respondida";
+#endif
+
const char *Txt_MATCH_Start =
#if L==1 // ca
"Inici";