From 5174215ac67f07af309dae5c7710bf24f83c5219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 11 Jan 2020 15:22:02 +0100 Subject: [PATCH] Version19.116 --- swad_HTML.c | 31 +++++++++++++++++----- swad_HTML.h | 2 ++ swad_MFU.c | 4 +-- swad_account.c | 4 +-- swad_announcement.c | 2 +- swad_assignment.c | 4 +-- swad_attendance.c | 4 +-- swad_centre_config.c | 16 ++--------- swad_changelog.h | 4 ++- swad_duplicate.c | 2 +- swad_enrolment.c | 2 +- swad_figure.c | 4 +-- swad_file_browser.c | 2 +- swad_game.c | 12 +++++---- swad_group.c | 6 ++--- swad_info.c | 4 +-- swad_layout.c | 2 +- swad_logo.c | 2 +- swad_map.c | 4 +-- swad_match.c | 14 +++++----- swad_match_result.c | 12 ++++----- swad_message.c | 10 +++---- swad_password.c | 4 +-- swad_photo.c | 2 +- swad_profile.c | 14 +++++----- swad_report.c | 6 ++--- swad_search.c | 2 +- swad_statistic.c | 14 +++++----- swad_string.c | 16 +++++++++-- swad_string.h | 1 + swad_survey.c | 10 +++---- swad_test.c | 42 ++++++++++++++++++----------- swad_test_import.c | 14 +++++----- swad_text.c | 63 -------------------------------------------- swad_user.c | 12 ++++----- 35 files changed, 161 insertions(+), 186 deletions(-) diff --git a/swad_HTML.c b/swad_HTML.c index a48314fa..8821019e 100644 --- a/swad_HTML.c +++ b/swad_HTML.c @@ -1228,14 +1228,14 @@ void HTM_INPUT_FLOAT (const char *Name,double Min,double Max, Str_SetDecimalPointToUS (); // To print the floating point as a dot HTM_TxtF ("%ld", MFU_DECREASE_FACTOR,MFU_MIN_SCORE, Gbl.Usrs.Me.UsrDat.UsrCod,ActCod); diff --git a/swad_account.c b/swad_account.c index 3c9fa507..0ec4c496 100644 --- a/swad_account.c +++ b/swad_account.c @@ -150,7 +150,7 @@ static void Acc_ShowFormCheckIfIHaveAccount (const char *Title) /***** Form to request user's ID for possible account already created *****/ Frm_StartForm (ActChkUsrAcc); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_ID); + HTM_TxtColonNBSP (Txt_ID); HTM_INPUT_TEXT ("ID",ID_MAX_CHARS_USR_ID,"",false, "size=\"18\" required=\"required\""); HTM_LABEL_End (); @@ -285,7 +285,7 @@ static void Acc_WriteRowEmptyAccount (unsigned NumUsr,const char *ID,struct UsrD HTM_TD_Begin ("class=\"DAT_N LT COLOR%u\"",Gbl.RowEvenOdd); HTM_TxtF ("%s: %s",Txt_ID,ID); HTM_BR (); - HTM_TxtF ("%s: ",Txt_Name); + HTM_TxtColonNBSP (Txt_Name); if (UsrDat->FullName[0]) { HTM_STRONG_Begin (); diff --git a/swad_announcement.c b/swad_announcement.c index f62e378e..75518376 100644 --- a/swad_announcement.c +++ b/swad_announcement.c @@ -415,7 +415,7 @@ void Ann_ShowFormAnnouncement (void) HTM_TR_Begin (NULL); HTM_TD_Begin ("class=\"%s RT\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Users); + HTM_TxtColonNBSP (Txt_Users); HTM_TD_End (); HTM_TD_Begin ("class=\"DAT LT\""); diff --git a/swad_assignment.c b/swad_assignment.c index 0642defc..1f60b91c 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -1629,8 +1629,8 @@ static void Asg_GetAndWriteNamesOfGrpsAssociatedToAsg (struct Assignment *Asg) /***** Write heading *****/ HTM_DIV_Begin ("class=\"%s\"",Asg->Hidden ? "ASG_GRP_LIGHT" : "ASG_GRP"); - HTM_TxtF ("%s: ",NumRows == 1 ? Txt_Group : - Txt_Groups); + HTM_TxtColonNBSP (NumRows == 1 ? Txt_Group : + Txt_Groups); /***** Write groups *****/ if (NumRows) // Groups found... diff --git a/swad_attendance.c b/swad_attendance.c index 779b9b90..91765756 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -1482,8 +1482,8 @@ static void Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (struct AttendanceEve /***** Write heading *****/ HTM_DIV_Begin ("class=\"%s\"",Att->Hidden ? "ASG_GRP_LIGHT" : "ASG_GRP"); - HTM_TxtF ("%s: ",NumGrps == 1 ? Txt_Group : - Txt_Groups); + HTM_TxtColonNBSP (NumGrps == 1 ? Txt_Group : + Txt_Groups); /***** Write groups *****/ if (NumGrps) // Groups found... diff --git a/swad_centre_config.c b/swad_centre_config.c index 3938213c..78553d12 100644 --- a/swad_centre_config.c +++ b/swad_centre_config.c @@ -883,7 +883,7 @@ void CtrCfg_RequestPhoto (void) /***** Upload photo *****/ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_File_with_the_photo); + HTM_TxtColonNBSP (Txt_File_with_the_photo); HTM_INPUT_FILE (Fil_NAME_OF_PARAM_FILENAME_ORG,"image/*",true,NULL); HTM_LABEL_End (); @@ -1145,7 +1145,6 @@ void CtrCfg_RenameCentreFull (void) void CtrCfg_ChangeCtrLatitude (void) { - extern const char *Txt_The_new_latitude_is_X; char LatitudeStr[64]; double NewLatitude; @@ -1157,9 +1156,6 @@ void CtrCfg_ChangeCtrLatitude (void) CtrCfg_UpdateCtrCoordinateDB (Gbl.Hierarchy.Ctr.CtrCod,"Latitude",NewLatitude); Gbl.Hierarchy.Ctr.Coord.Latitude = NewLatitude; - /***** Write message to show the change made *****/ - Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_latitude_is_X,NewLatitude); - /***** Show the form again *****/ CtrCfg_ShowConfiguration (); } @@ -1170,7 +1166,6 @@ void CtrCfg_ChangeCtrLatitude (void) void CtrCfg_ChangeCtrLongitude (void) { - extern const char *Txt_The_new_longitude_is_X; char LongitudeStr[64]; double NewLongitude; @@ -1182,9 +1177,6 @@ void CtrCfg_ChangeCtrLongitude (void) CtrCfg_UpdateCtrCoordinateDB (Gbl.Hierarchy.Ctr.CtrCod,"Longitude",NewLongitude); Gbl.Hierarchy.Ctr.Coord.Longitude = NewLongitude; - /***** Write message to show the change made *****/ - Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_longitude_is_X,NewLongitude); - /***** Show the form again *****/ CtrCfg_ShowConfiguration (); } @@ -1195,7 +1187,6 @@ void CtrCfg_ChangeCtrLongitude (void) void CtrCfg_ChangeCtrAltitude (void) { - extern const char *Txt_The_new_altitude_is_X; char AltitudeStr[64]; double NewAltitude; @@ -1207,9 +1198,6 @@ void CtrCfg_ChangeCtrAltitude (void) CtrCfg_UpdateCtrCoordinateDB (Gbl.Hierarchy.Ctr.CtrCod,"Altitude",NewAltitude); Gbl.Hierarchy.Ctr.Coord.Altitude = NewAltitude; - /***** Write message to show the change made *****/ - Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_altitude_is_X,NewAltitude); - /***** Show the form again *****/ CtrCfg_ShowConfiguration (); } @@ -1224,7 +1212,7 @@ static void CtrCfg_UpdateCtrCoordinateDB (long CtrCod, /***** Update database changing old coordinate by new coordinate *****/ Str_SetDecimalPointToUS (); // To write the decimal point as a dot DB_QueryUPDATE ("can not update a coordinate of a centre", - "UPDATE centres SET %s='%lg' WHERE CtrCod=%ld", + "UPDATE centres SET %s='%.15lg' WHERE CtrCod=%ld", CoordField,NewCoord,CtrCod); Str_SetDecimalPointToLocal (); // Return to local system } diff --git a/swad_changelog.h b/swad_changelog.h index c288d5b8..4bbe098c 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -492,7 +492,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.115.1 (2020-01-11)" +#define Log_PLATFORM_VERSION "SWAD 19.116 (2020-01-11)" #define CSS_FILE "swad19.115.css" #define JS_FILE "swad19.91.1.js" /* @@ -501,6 +501,8 @@ ps2pdf source.ps destination.pdf // TODO: No se puede entrar con DNI '1' suponiendo que no tenga password ¿por qué? // TODO: Mapas más estrechos en móvil + Version 19.116: Jan 11, 2020 Changes in number of digits printed in doubles. + Code refactoring related to printing some strings. (278506 lines) Version 19.115.1: Jan 11, 2020 Fixed bug in edition of degrees. (278531 lines) Version 19.115: Jan 09, 2020 Map column in listing of institutions. Fixed bug in edition of timetable, reported by Miguel Damas Hermoso. diff --git a/swad_duplicate.c b/swad_duplicate.c index ac1abfc8..43d958c1 100644 --- a/swad_duplicate.c +++ b/swad_duplicate.c @@ -200,7 +200,7 @@ void Dup_ListDuplicateUsrs (void) Lay_ShowErrorAndExit ("Wrong number of informants."); if (NumInformants > 1) { - HTM_TxtF ("%s: ",Txt_Informants); + HTM_TxtColonNBSP (Txt_Informants); HTM_Unsigned (NumInformants); HTM_BR (); } diff --git a/swad_enrolment.c b/swad_enrolment.c index d5cd9f9a..c8eeba35 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -380,7 +380,7 @@ void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction,void (*FuncParams) FuncParams (); HTM_LABEL_Begin ("for=\"OtherUsrIDNickOrEMail\" class=\"%s RM\"", The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_nick_email_or_ID); + HTM_TxtColonNBSP (Txt_nick_email_or_ID); HTM_LABEL_End (); HTM_INPUT_TEXT ("OtherUsrIDNickOrEMail",Cns_MAX_CHARS_EMAIL_ADDRESS,"",false, diff --git a/swad_figure.c b/swad_figure.c index 126ce733..c91aa8be 100644 --- a/swad_figure.c +++ b/swad_figure.c @@ -207,7 +207,7 @@ void Fig_ReqShowFigures (void) /***** Compute stats for anywhere, degree or course? *****/ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Scope); + HTM_TxtColonNBSP (Txt_Scope); Gbl.Scope.Allowed = 1 << Hie_SYS | 1 << Hie_CTY | 1 << Hie_INS | @@ -222,7 +222,7 @@ void Fig_ReqShowFigures (void) /***** Type of statistic *****/ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Statistic); + HTM_TxtColonNBSP (Txt_Statistic); HTM_SELECT_Begin (false, "name=\"FigureType\""); for (FigureType = (Fig_FigureType_t) 0; diff --git a/swad_file_browser.c b/swad_file_browser.c index 412de2df..0c6905d2 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -8374,7 +8374,7 @@ static void Brw_PutFormToCreateAFolder (const char FileNameToShow[NAME_MAX + 1]) /***** Folder *****/ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Folder); + HTM_TxtColonNBSP (Txt_Folder); HTM_INPUT_TEXT ("NewFolderName",Brw_MAX_CHARS_FOLDER,"",false, "size=\"30\" required=\"required\""); HTM_LABEL_End (); diff --git a/swad_game.c b/swad_game.c index 63ecab1d..a3d8fdd7 100644 --- a/swad_game.c +++ b/swad_game.c @@ -516,9 +516,11 @@ static void Gam_ShowOneGame (struct Game *Game,bool ShowOnlyThisGame) /* Number of questions and maximum grade */ HTM_DIV_Begin ("class=\"%s\"",Game->Hidden ? "ASG_GRP_LIGHT" : "ASG_GRP"); - HTM_TxtF ("%s: %u",Txt_No_of_questions,Game->NumQsts); + HTM_TxtColonNBSP (Txt_No_of_questions); + HTM_Unsigned (Game->NumQsts); HTM_BR (); - HTM_TxtF ("%s: %lg",Txt_Maximum_grade,Game->MaxGrade); + HTM_TxtColonNBSP (Txt_Maximum_grade); + HTM_Double (Game->MaxGrade); HTM_DIV_End (); HTM_TD_End (); @@ -537,7 +539,7 @@ static void Gam_ShowOneGame (struct Game *Game,bool ShowOnlyThisGame) "BT_LINK LT ASG_TITLE", NULL); if (ShowOnlyThisGame) - HTM_TxtF ("%s: ",Txt_Matches); + HTM_TxtColonNBSP (Txt_Matches); HTM_Unsigned (Game->NumMchs); HTM_BUTTON_End (); Frm_EndForm (); @@ -1432,7 +1434,7 @@ static void Gam_CreateGame (struct Game *Game,const char *Txt) "INSERT INTO gam_games" " (CrsCod,Hidden,UsrCod,MaxGrade,Title,Txt)" " VALUES" - " (%ld,'N',%ld,%lg,'%s','%s')", + " (%ld,'N',%ld,%.15lg,'%s','%s')", Gbl.Hierarchy.Crs.CrsCod, Gbl.Usrs.Me.UsrDat.UsrCod, Game->MaxGrade, @@ -1458,7 +1460,7 @@ static void Gam_UpdateGame (struct Game *Game,const char *Txt) DB_QueryUPDATE ("can not update game", "UPDATE gam_games" " SET CrsCod=%ld," - "MaxGrade=%lg," + "MaxGrade=%.15lg," "Title='%s'," "Txt='%s'" " WHERE GamCod=%ld", diff --git a/swad_group.c b/swad_group.c index 6e06f514..b8b930cd 100644 --- a/swad_group.c +++ b/swad_group.c @@ -171,8 +171,8 @@ void Grp_WriteNamesOfSelectedGrps (void) struct GroupData GrpDat; /***** Show the selected groups *****/ - HTM_TxtF ("%s: ",Gbl.Crs.Grps.LstGrpsSel.NumGrps == 1 ? Txt_Group : - Txt_Groups); + HTM_TxtColonNBSP (Gbl.Crs.Grps.LstGrpsSel.NumGrps == 1 ? Txt_Group : + Txt_Groups); for (NumGrpSel = 0; NumGrpSel < Gbl.Crs.Grps.LstGrpsSel.NumGrps; NumGrpSel++) @@ -2335,7 +2335,7 @@ static void Grp_WriteGrpHead (struct GroupType *GrpTyp) if (asprintf (&Id,"open_time_%u",UniqueId) < 0) Lay_NotEnoughMemoryExit (); HTM_BR (); - HTM_TxtF ("%s: ",Txt_Opening_of_groups); + HTM_TxtColonNBSP (Txt_Opening_of_groups); HTM_SPAN_Begin ("id=\"%s\"",Id); HTM_SPAN_End (); Dat_WriteLocalDateHMSFromUTC (Id,GrpTyp->OpenTimeUTC, diff --git a/swad_info.c b/swad_info.c index 7678502c..dc7c55d0 100644 --- a/swad_info.c +++ b/swad_info.c @@ -1243,7 +1243,7 @@ void Inf_FormToSendPage (Inf_InfoSrc_t InfoSrc) /***** File *****/ HTM_DIV_Begin ("class=\"CM\""); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_File); + HTM_TxtColonNBSP (Txt_File); HTM_INPUT_FILE (Fil_NAME_OF_PARAM_FILENAME_ORG,".htm,.html,.pdf",false,NULL); HTM_LABEL_End (); HTM_DIV_End (); @@ -1286,7 +1286,7 @@ void Inf_FormToSendURL (Inf_InfoSrc_t InfoSrc) HTM_DIV_Begin ("class=\"CM\""); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_URL); + HTM_TxtColonNBSP (Txt_URL); HTM_INPUT_URL ("InfoSrcURL",Gbl.Crs.Info.URL,false, "size=\"50\""); HTM_LABEL_End (); diff --git a/swad_layout.c b/swad_layout.c index 37be5d9e..5adf5ab2 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -1421,7 +1421,7 @@ static void Lay_WriteAboutZone (void) /***** Questions and problems *****/ HTM_DIV_Begin (NULL); - HTM_TxtF ("%s: ",Txt_Questions_and_problems); + HTM_TxtColonNBSP (Txt_Questions_and_problems); HTM_A_Begin ("href=\"mailto:%s\" class=\"ABOUT\" target=\"_blank\"", Cfg_PLATFORM_RESPONSIBLE_EMAIL); HTM_Txt (Cfg_PLATFORM_RESPONSIBLE_EMAIL); diff --git a/swad_logo.c b/swad_logo.c index aa013eab..440a4819 100644 --- a/swad_logo.c +++ b/swad_logo.c @@ -312,7 +312,7 @@ void Lgo_RequestLogo (Hie_Level_t Scope) /***** Upload logo *****/ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_File_with_the_logo); + HTM_TxtColonNBSP (Txt_File_with_the_logo); HTM_INPUT_FILE (Fil_NAME_OF_PARAM_FILENAME_ORG,"image/png",true,NULL); HTM_LABEL_End (); diff --git a/swad_map.c b/swad_map.c index 137e625d..dacd8dd1 100644 --- a/swad_map.c +++ b/swad_map.c @@ -94,7 +94,7 @@ void Map_CreateMap (const char *ContainerId, /* Let's create a map with pretty Mapbox Streets tiles */ Str_SetDecimalPointToUS (); // To write the decimal point as a dot HTM_TxtF ("\t" - "var mymap = L.map('%s').setView([%lg, %lg], %u);\n", + "var mymap = L.map('%s').setView([%.15lg, %.15lg], %u);\n", ContainerId,Coord->Latitude,Coord->Longitude,Zoom); Str_SetDecimalPointToLocal (); // Return to local system } @@ -140,7 +140,7 @@ void Map_AddMarker (const struct Coordinates *Coord) { Str_SetDecimalPointToUS (); // To write the decimal point as a dot HTM_TxtF ("\t" - "var marker = L.marker([%lg, %lg]).addTo(mymap);\n", + "var marker = L.marker([%.15lg, %.15lg]).addTo(mymap);\n", Coord->Latitude,Coord->Longitude); Str_SetDecimalPointToLocal (); // Return to local system } diff --git a/swad_match.c b/swad_match.c index bc374e33..b754b3ac 100644 --- a/swad_match.c +++ b/swad_match.c @@ -659,8 +659,8 @@ static void Mch_GetAndWriteNamesOfGrpsAssociatedToMatch (const struct Match *Mat /***** Write heading *****/ HTM_DIV_Begin ("class=\"ASG_GRP\""); - HTM_TxtF ("%s: ",NumRows == 1 ? Txt_Group : - Txt_Groups); + HTM_TxtColonNBSP (NumRows == 1 ? Txt_Group : + Txt_Groups); /***** Write groups *****/ if (NumRows) // Groups found... @@ -3134,12 +3134,12 @@ static void Mch_DrawEmptyScoreRow (unsigned NumRow,double MinScore,double MaxSco HTM_TD_Begin ("class=\"MCH_SCO_SCO\""); if (NumRow == 0) { - HTM_Double (MaxScore); + HTM_DoubleFewDigits (MaxScore); HTM_NBSP (); } else if (NumRow == Mch_NUM_ROWS_SCORE - 1) { - HTM_Double (MinScore); + HTM_DoubleFewDigits (MinScore); HTM_NBSP (); } HTM_TD_End (); @@ -3207,7 +3207,7 @@ static void Mch_DrawScoreRow (double Score,double MinScore,double MaxScore, /* Write score */ HTM_TD_Begin ("class=\"MCH_SCO_SCO\""); - HTM_Double (Score); + HTM_DoubleFewDigits (Score); HTM_NBSP (); HTM_TD_End (); @@ -3724,7 +3724,7 @@ void Mch_ReceiveQuestionAnswer (void) " SET EndTime=NOW()," "NumQsts=%u," "NumQstsNotBlank=%u," - "Score='%lf'" + "Score='%.15lg'" " WHERE MchCod=%ld AND UsrCod=%ld", NumQsts,NumQstsNotBlank,TotalScore, Match.MchCod,Gbl.Usrs.Me.UsrDat.UsrCod); @@ -3740,7 +3740,7 @@ void Mch_ReceiveQuestionAnswer (void) "NOW()," // EndTime "%u," // NumQsts "%u," // NumQstsNotBlank - "'%lf')", // Score + "'%.15lg')", // Score Match.MchCod,Gbl.Usrs.Me.UsrDat.UsrCod, NumQsts,NumQstsNotBlank,TotalScore); Str_SetDecimalPointToLocal (); // Return to local system diff --git a/swad_match_result.c b/swad_match_result.c index 7f969a5a..4b12f813 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -816,12 +816,12 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther, Str_SetDecimalPointToUS (); // To get the decimal point as a dot /* Get score (row[5]) */ - if (sscanf (row[5],"%lg",&ScoreInThisResult) != 1) + if (sscanf (row[5],"%lf",&ScoreInThisResult) != 1) ScoreInThisResult = 0.0; TotalScoreOfAllResults += ScoreInThisResult; /* Get maximum grade (row[6]) */ - if (sscanf (row[6],"%lg",&MaxGrade) != 1) + if (sscanf (row[6],"%lf",&MaxGrade) != 1) MaxGrade = 0.0; Str_SetDecimalPointToLocal (); // Return to local system @@ -936,7 +936,7 @@ static void McR_ShowMchResultsSummaryRow (unsigned NumResults, /***** Row title *****/ HTM_TD_Begin ("colspan=\"3\" class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd); - HTM_TxtF ("%s: ",Txt_Matches); + HTM_TxtColonNBSP (Txt_Matches); HTM_Unsigned (NumResults); HTM_TD_End (); @@ -1229,10 +1229,10 @@ void McR_ShowOneMchResult (void) if (ICanViewScore) { HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\""); - HTM_TxtF ("%s: ",Txt_Score); + HTM_TxtColonNBSP (Txt_Score); HTM_Double2Decimals (TotalScore); HTM_BR (); - HTM_TxtF ("%s: ",Txt_Grade); + HTM_TxtColonNBSP (Txt_Grade); Tst_ComputeAndShowGrade (NumQsts,TotalScore,Game.MaxGrade); HTM_DIV_End (); } @@ -1361,7 +1361,7 @@ static void McR_GetMatchResultDataByMchCod (long MchCod,long UsrCod, /* Get score (row[4]) */ Str_SetDecimalPointToUS (); // To get the decimal point as a dot - if (sscanf (row[4],"%lg",Score) != 1) + if (sscanf (row[4],"%lf",Score) != 1) *Score = 0.0; Str_SetDecimalPointToLocal (); // Return to local system } diff --git a/swad_message.c b/swad_message.c index ca53a305..ffd094ef 100644 --- a/swad_message.c +++ b/swad_message.c @@ -2671,7 +2671,7 @@ void Msg_ShowFormToFilterMsgs (void) /***** Filter authors/recipients *****/ HTM_TD_Begin ("class=\"LM\""); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",TxtFromTo[Gbl.Msg.TypeOfMessages]); + HTM_TxtColonNBSP (TxtFromTo[Gbl.Msg.TypeOfMessages]); HTM_INPUT_SEARCH ("FilterFromTo",Usr_MAX_CHARS_FIRSTNAME_OR_SURNAME * 3, Gbl.Msg.FilterFromTo, "size=\"20\""); @@ -2681,7 +2681,7 @@ void Msg_ShowFormToFilterMsgs (void) /***** Filter message content *****/ HTM_TD_Begin ("class=\"LM\""); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_MSG_Content); + HTM_TxtColonNBSP (Txt_MSG_Content); HTM_INPUT_SEARCH ("FilterContent",Msg_MAX_CHARS_FILTER_CONTENT, Gbl.Msg.FilterContent, "size=\"20\""); @@ -3035,7 +3035,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) /***** Write "From:" *****/ HTM_TD_Begin ("class=\"RT MSG_TIT\""); - HTM_TxtF ("%s: ",Txt_MSG_From); + HTM_TxtColonNBSP (Txt_MSG_From); HTM_TD_End (); HTM_TD_Begin ("colspan=\"2\" class=\"LT\""); @@ -3048,7 +3048,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) HTM_TR_Begin (NULL); HTM_TD_Begin ("class=\"RT MSG_TIT\""); - HTM_TxtF ("%s: ",Txt_MSG_To); + HTM_TxtColonNBSP (Txt_MSG_To); HTM_TD_End (); HTM_TD_Begin ("colspan=\"2\" class=\"LT\""); @@ -3061,7 +3061,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) /***** Write "Content:" *****/ HTM_TD_Begin ("class=\"RT MSG_TIT\""); - HTM_TxtF ("%s: ",Txt_MSG_Content); + HTM_TxtColonNBSP (Txt_MSG_Content); HTM_TD_End (); /***** Initialize image *****/ diff --git a/swad_password.c b/swad_password.c index 72d533a7..0d75e237 100644 --- a/swad_password.c +++ b/swad_password.c @@ -283,7 +283,7 @@ void Pwd_ShowFormSendNewPwd (void) /***** User's ID/nickname *****/ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_nick_email_or_ID); + HTM_TxtColonNBSP (Txt_nick_email_or_ID); HTM_INPUT_TEXT ("UsrId",Cns_MAX_CHARS_EMAIL_ADDRESS,Gbl.Usrs.Me.UsrIdLogin,false, "size=\"8\" required=\"required\""); HTM_LABEL_End (); @@ -861,7 +861,7 @@ void Pwd_AskForConfirmationOnDangerousAction (void) /***** Password *****/ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_For_security_enter_your_password); + HTM_TxtColonNBSP (Txt_For_security_enter_your_password); HTM_INPUT_PASSWORD ("OthUsrPwd",NULL,"off",true, NULL); HTM_LABEL_End (); diff --git a/swad_photo.c b/swad_photo.c index e1df055d..3927f898 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -336,7 +336,7 @@ static void Pho_ReqPhoto (const struct UsrData *UsrDat) /***** Form to upload photo *****/ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_File_with_the_photo); + HTM_TxtColonNBSP (Txt_File_with_the_photo); HTM_INPUT_FILE (Fil_NAME_OF_PARAM_FILENAME_ORG,"image/*",true,NULL); HTM_LABEL_End (); diff --git a/swad_profile.c b/swad_profile.c index 588f1a2c..4aea5692 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -208,7 +208,7 @@ void Prf_RequestUserProfile (void) /* By default, the nickname is filled with my nickname If no user logged ==> the nickname is empty */ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Nickname); + HTM_TxtColonNBSP (Txt_Nickname); snprintf (NicknameWithArroba,sizeof (NicknameWithArroba), "@%s", @@ -603,7 +603,7 @@ static void Prf_ShowNumClicks (const struct UsrData *UsrDat, if (UsrFigures->NumDays > 0) { HTM_TxtF (" %s","("); - HTM_Double ((double) UsrFigures->NumClicks / + HTM_DoubleFewDigits ((double) UsrFigures->NumClicks / (double) UsrFigures->NumDays); HTM_TxtF ("/%s ",Txt_day); Prf_ShowRanking (Prf_GetRankingNumClicksPerDay (UsrDat->UsrCod), @@ -643,7 +643,7 @@ static void Prf_ShowNumFileViews (const struct UsrData *UsrDat, if (UsrFigures->NumDays > 0) { HTM_TxtF (" %s","("); - HTM_Double ((double) UsrFigures->NumFileViews / + HTM_DoubleFewDigits ((double) UsrFigures->NumFileViews / (double) UsrFigures->NumDays); HTM_TxtF ("/%s)",Txt_day); } @@ -680,7 +680,7 @@ static void Prf_ShowNumSocialPublications (const struct UsrData *UsrDat, if (UsrFigures->NumDays > 0) { HTM_TxtF (" %s","("); - HTM_Double ((double) UsrFigures->NumSocPub / + HTM_DoubleFewDigits ((double) UsrFigures->NumSocPub / (double) UsrFigures->NumDays); HTM_TxtF ("/%s)",Txt_day); } @@ -717,7 +717,7 @@ static void Prf_ShowNumForumPosts (const struct UsrData *UsrDat, if (UsrFigures->NumDays > 0) { HTM_TxtF (" %s","("); - HTM_Double ((double) UsrFigures->NumForPst / + HTM_DoubleFewDigits ((double) UsrFigures->NumForPst / (double) UsrFigures->NumDays); HTM_TxtF ("/%s)",Txt_day); } @@ -754,7 +754,7 @@ static void Prf_ShowNumMessagesSent (const struct UsrData *UsrDat, if (UsrFigures->NumDays > 0) { HTM_TxtF (" %s","("); - HTM_Double ((double) UsrFigures->NumMsgSnt / + HTM_DoubleFewDigits ((double) UsrFigures->NumMsgSnt / (double) UsrFigures->NumDays); HTM_TxtF ("/%s)",Txt_day); } @@ -1726,7 +1726,7 @@ void Prf_GetAndShowRankingClicksPerDay (void) ItsMe ? "DAT_SMALL_N" : "DAT_SMALL", Gbl.RowEvenOdd); - HTM_Double (NumClicksPerDay); + HTM_DoubleFewDigits (NumClicksPerDay); HTM_TD_End (); HTM_TR_End (); } diff --git a/swad_report.c b/swad_report.c index 77d4024e..f93e0b3b 100644 --- a/swad_report.c +++ b/swad_report.c @@ -304,7 +304,7 @@ static void Rep_TitleReport (struct Rep_CurrentTimeUTC *CurrentTimeUTC) HTM_DIV_Begin ("class=\"TITLE_REPORT DAT\""); /***** User *****/ - HTM_TxtF ("%s: ",Txt_User[Gbl.Usrs.Me.UsrDat.Sex]); + HTM_TxtColonNBSP (Txt_User[Gbl.Usrs.Me.UsrDat.Sex]); HTM_SPAN_Begin ("class=\"DAT_N_BOLD\""); HTM_Txt (Gbl.Usrs.Me.UsrDat.FullName); HTM_SPAN_End (); @@ -313,7 +313,7 @@ static void Rep_TitleReport (struct Rep_CurrentTimeUTC *CurrentTimeUTC) if (CurrentTimeUTC) { HTM_BR (); - HTM_TxtF ("%s: ",Txt_Date); + HTM_TxtColonNBSP (Txt_Date); HTM_SPAN_Begin ("class=\"DAT_N\""); HTM_TxtF ("%s %s UTC",CurrentTimeUTC->StrDate, CurrentTimeUTC->StrTime); @@ -1383,7 +1383,7 @@ static void Rep_WriteDouble (double Num) /***** Write from floating point number to string with the correct accuracy *****/ - Str_DoubleNumToStr (&Str,Num); + Str_DoubleNumToStrFewDigits (&Str,Num); /***** Write number from string to file *****/ fputs (Str,Gbl.F.Rep); diff --git a/swad_search.c b/swad_search.c index 1fd35a86..6a4c446c 100644 --- a/swad_search.c +++ b/swad_search.c @@ -145,7 +145,7 @@ static void Sch_PutFormToSearchWithWhatToSearchAndScope (Act_Action_t Action,Hie current centre, current degree or current course) *****/ HTM_DIV_Begin ("class=\"CM\""); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Scope); + HTM_TxtColonNBSP (Txt_Scope); Gbl.Scope.Allowed = 1 << Hie_SYS | 1 << Hie_CTY | 1 << Hie_INS | diff --git a/swad_statistic.c b/swad_statistic.c index 15eafce6..4221db1f 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -1761,7 +1761,7 @@ static void Sta_ShowNumHitsPerUsr (unsigned long NumRows,MYSQL_RES *mysql_res) BarWidth); HTM_NBSP (); } - HTM_Double (Hits.Num); + HTM_DoubleFewDigits (Hits.Num); HTM_TD_End (); HTM_TR_End (); @@ -1955,7 +1955,7 @@ static void Sta_ShowDistrAccessesPerDayAndHour (unsigned long NumRows,MYSQL_RES } HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Color_of_the_graphic); + HTM_TxtColonNBSP (Txt_Color_of_the_graphic); HTM_SELECT_Begin (true, "name=\"ColorType\""); for (ColorType = (Sta_ColorType_t) 0; @@ -2211,14 +2211,14 @@ static void Sta_DrawBarColors (Sta_ColorType_t ColorType,double HitsMax) HTM_TD_Begin ("colspan=\"%u\" class=\"LOG CB\" style=\"width:%upx;\"", GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5, GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5); - HTM_Double ((double) Interval * HitsMax / 5.0); + HTM_DoubleFewDigits ((double) Interval * HitsMax / 5.0); HTM_TD_End (); } HTM_TD_Begin ("colspan=\"%u\" class=\"LOG RB\" style=\"width:%upx;\"", (GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5)/2, (GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5)/2); - HTM_Double (HitsMax); + HTM_DoubleFewDigits (HitsMax); HTM_TD_End (); HTM_TR_End (); @@ -2260,7 +2260,7 @@ static void Sta_DrawAccessesPerHourForADay (Sta_ColorType_t ColorType,double Hit Sta_SetColor (ColorType,HitsNum[Hour],HitsMax,&R,&G,&B); /***** Write from floating point number to string *****/ - Str_DoubleNumToStr (&Str,HitsNum[Hour]); + Str_DoubleNumToStrFewDigits (&Str,HitsNum[Hour]); /***** Write cell *****/ HTM_TD_Begin ("class=\"LOG LM\" title=\"%s\"" @@ -2730,7 +2730,7 @@ static void Sta_WriteAccessHour (unsigned Hour,struct Sta_Hits *Hits,unsigned Co HTM_TxtF ("%u%%",(unsigned) (((Hits->Num * 100.0) / Hits->Total) + 0.5)); HTM_BR (); - HTM_Double (Hits->Num); + HTM_DoubleFewDigits (Hits->Num); HTM_BR (); BarHeight = (unsigned) (((Hits->Num * 500.0) / Hits->Max) + 0.5); if (BarHeight == 0) @@ -3730,7 +3730,7 @@ static void Sta_DrawBarNumHits (char Color, /***** Write the number of hits *****/ HTM_NBSP (); - HTM_Double (HitsNum); + HTM_DoubleFewDigits (HitsNum); HTM_TxtF (" (%u",(unsigned) (((HitsNum * 100.0) / HitsTotal) + 0.5)); } diff --git a/swad_string.c b/swad_string.c index 4e54701e..dddb735e 100644 --- a/swad_string.c +++ b/swad_string.c @@ -858,11 +858,23 @@ char Str_ConvertToLowerLetter (char Ch) } /*****************************************************************************/ -/** Write a number in floating point with the correct accuracy to a string ***/ +/****************** Write a number in floating point *************************/ /*****************************************************************************/ // Str should be freed after calling this function void Str_DoubleNumToStr (char **Str,double Number) + { + if (asprintf (Str,"%.15lg", + Number) < 0) + Lay_NotEnoughMemoryExit (); + } + +/*****************************************************************************/ +/******* Write a number in floating point with few digits to a string ********/ +/*****************************************************************************/ +// Str should be freed after calling this function + +void Str_DoubleNumToStrFewDigits (char **Str,double Number) { double IntegerPart; double FractionaryPart; @@ -927,7 +939,7 @@ double Str_GetDoubleFromStr (char *Str) (it must have a point, not a comma as decimal separator) *****/ Str_ConvertStrFloatCommaToStrFloatPoint (Str); Str_SetDecimalPointToUS (); // To get the decimal point as a dot - if (sscanf (Str,"%lg",&DoubleNum) != 1) + if (sscanf (Str,"%lf",&DoubleNum) != 1) { // If the string does not hold a valid number... DoubleNum = 0.0; // ...the number is reset to 0 Str[0] = '\0'; // ...and the string is reset to "" diff --git a/swad_string.h b/swad_string.h index 786f0941..e460cf4f 100644 --- a/swad_string.h +++ b/swad_string.h @@ -92,6 +92,7 @@ char Str_ConvertToUpperLetter (char Ch); char Str_ConvertToLowerLetter (char Ch); void Str_DoubleNumToStr (char **Str,double Number); +void Str_DoubleNumToStrFewDigits (char **Str,double Number); void Str_ConvertStrFloatCommaToStrFloatPoint (char *Str); double Str_GetDoubleFromStr (char *Str); void Str_SetDecimalPointToUS (void); diff --git a/swad_survey.c b/swad_survey.c index b21077d3..279687d1 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -528,10 +528,10 @@ static void Svy_ShowOneSurvey (long SvyCod,bool ShowOnlyThisSvyComplete) HTM_DIV_Begin ("class=\"%s\"", Svy.Status.Visible ? "ASG_GRP" : "ASG_GRP_LIGHT"); - HTM_TxtF ("%s: ",Txt_No_of_questions); + HTM_TxtColonNBSP (Txt_No_of_questions); HTM_Unsigned (Svy.NumQsts); HTM_Txt ("; "); - HTM_TxtF ("%s: ",Txt_No_of_users); + HTM_TxtColonNBSP (Txt_No_of_users); HTM_Unsigned (Svy.NumUsrs); HTM_DIV_End (); @@ -601,7 +601,7 @@ static void Svy_ShowOneSurvey (long SvyCod,bool ShowOnlyThisSvyComplete) /* Scope of the survey */ HTM_DIV_Begin ("class=\"%s\"",Svy.Status.Visible ? "ASG_GRP" : "ASG_GRP_LIGHT"); - HTM_TxtF ("%s: ",Txt_Scope); + HTM_TxtColonNBSP (Txt_Scope); switch (Svy.Scope) { case Hie_UNK: // Unknown @@ -2432,8 +2432,8 @@ static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Survey *Svy) /***** Write heading *****/ HTM_DIV_Begin ("class=\"%s\"",Svy->Status.Visible ? "ASG_GRP" : "ASG_GRP_LIGHT"); - HTM_TxtF ("%s: ",NumRows == 1 ? Txt_Group : - Txt_Groups); + HTM_TxtColonNBSP (NumRows == 1 ? Txt_Group : + Txt_Groups); /***** Write groups *****/ if (NumRows) // Groups found... diff --git a/swad_test.c b/swad_test.c index ef46c50a..0d3f9c05 100644 --- a/swad_test.c +++ b/swad_test.c @@ -533,10 +533,10 @@ void Tst_AssessTest (void) if (Gbl.Test.Config.Feedback != Tst_FEEDBACK_NOTHING) { HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\""); - HTM_TxtF ("%s: ",Txt_Score); + HTM_TxtColonNBSP (Txt_Score); HTM_Double2Decimals (TotalScore); HTM_BR (); - HTM_TxtF ("%s: ",Txt_Grade); + HTM_TxtColonNBSP (Txt_Grade); Tst_ComputeAndShowGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX); HTM_DIV_End (); } @@ -1155,7 +1155,7 @@ static void Tst_PutFormToEditQstMedia (struct Media *Media,int NumMediaInForm, UniqueId, (unsigned) Med_ACTION_NEW_MEDIA, OptionsDisabled ? " disabled=\"disabled\"" : ""); - HTM_TxtF ("%s: ",Txt_Change_image_video); + HTM_TxtColonNBSP (Txt_Change_image_video); HTM_LABEL_End (); Med_PutMediaUploader (NumMediaInForm,"TEST_MED_INPUT"); @@ -1210,7 +1210,7 @@ static void Tst_UpdateScoreQst (long QstCod,double ScoreThisQst,bool AnswerIsNot DB_QueryUPDATE ("can not update the score of a question", "UPDATE tst_questions" " SET NumHits=NumHits+1,NumHitsNotBlank=NumHitsNotBlank+1," - "Score=Score+(%lf)" + "Score=Score+(%.15lg)" " WHERE QstCod=%ld", ScoreThisQst,QstCod); else // The answer is blank @@ -3317,7 +3317,11 @@ void Tst_WriteAnswersEdit (long QstCod) FloatNum[i] = Str_GetDoubleFromStr (row[1]); } HTM_SPAN_Begin ("class=\"TEST_EDI\""); - HTM_TxtF ("([%lg; %lg])",FloatNum[0],FloatNum[1]); + HTM_Txt ("(["); + HTM_Double (FloatNum[0]); + HTM_Txt ("; "); + HTM_Double (FloatNum[1]); + HTM_Txt ("])"); HTM_SPAN_End (); break; case Tst_ANS_TRUE_FALSE: @@ -4638,7 +4642,7 @@ static void Tst_WriteFloatAnsAssessTest (struct UsrData *UsrDat, FloatAnsUsr <= FloatAnsCorr[1]) ? "ANS_OK" : "ANS_BAD") : "ANS_0"); - HTM_TxtF ("%lg",FloatAnsUsr); + HTM_Double (FloatAnsUsr); } else // Not a floating point number { @@ -4654,7 +4658,13 @@ static void Tst_WriteFloatAnsAssessTest (struct UsrData *UsrDat, HTM_TD_Begin ("class=\"ANS_0 CM\""); if (Gbl.Test.Config.Feedback == Tst_FEEDBACK_EACH_GOOD_BAD || Gbl.Test.Config.Feedback == Tst_FEEDBACK_FULL_FEEDBACK) - HTM_TxtF ("[%lg; %lg]",FloatAnsCorr[0],FloatAnsCorr[1]); + { + HTM_Txt ("["); + HTM_Double (FloatAnsCorr[0]); + HTM_Txt ("; "); + HTM_Double (FloatAnsCorr[1]); + HTM_Txt ("]"); + } else HTM_Txt ("?"); HTM_TD_End (); @@ -4735,7 +4745,7 @@ static void Tst_WriteScoreStart (unsigned ColSpan) HTM_TR_Begin (NULL); HTM_TD_Begin ("colspan=\"%u\" class=\"DAT_SMALL LM\"",ColSpan); - HTM_TxtF ("%s: ",Txt_Score); + HTM_TxtColonNBSP (Txt_Score); } static void Tst_WriteScoreEnd (void) @@ -5260,7 +5270,7 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], HTM_TD_Begin ("class=\"LT\""); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Integer_number); + HTM_TxtColonNBSP (Txt_Integer_number); snprintf (StrInteger,sizeof (StrInteger), "%ld", Gbl.Test.Answer.Integer); @@ -5461,7 +5471,7 @@ static void Tst_PutFloatInputField (const char *Label,const char *Field, HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); HTM_TxtF ("%s ",Label); snprintf (StrDouble,sizeof (StrDouble), - "%lg", + "%.15lg", Value); HTM_INPUT_TEXT (Field,Tst_MAX_BYTES_FLOAT_ANSWER,StrDouble,false, "size=\"11\" required=\"required\"%s", @@ -6813,7 +6823,7 @@ static void Tst_InsertAnswersIntoDB (void) "INSERT INTO tst_answers" " (QstCod,AnsInd,Answer,Feedback,MedCod,Correct)" " VALUES" - " (%ld,%u,'%lg','',-1,'Y')", + " (%ld,%u,'%.15lg','',-1,'Y')", Gbl.Test.QstCod,i, Gbl.Test.Answer.FloatingPoint[i]); Str_SetDecimalPointToLocal (); // Return to local system @@ -7609,7 +7619,7 @@ static void Tst_StoreScoreOfTestResultInDB (long TstCod, Str_SetDecimalPointToUS (); // To print the floating point as a dot DB_QueryUPDATE ("can not update result of test result", "UPDATE tst_exams" - " SET NumQstsNotBlank=%u,Score='%lf'" + " SET NumQstsNotBlank=%u,Score='%.15lg'" " WHERE TstCod=%ld", NumQstsNotBlank,Score, TstCod); @@ -7950,7 +7960,7 @@ static void Tst_ShowTestResultsSummaryRow (bool ItsMe, /***** Row title *****/ HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd); - HTM_TxtF ("%s: ",Txt_Visible_tests); + HTM_TxtColonNBSP (Txt_Visible_tests); HTM_Unsigned (NumExams); HTM_TD_End (); @@ -8202,10 +8212,10 @@ void Tst_ShowOneTstResult (void) if (ICanViewScore) { HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\""); - HTM_TxtF ("%s: ",Txt_Score); + HTM_TxtColonNBSP (Txt_Score); HTM_Double2Decimals (TotalScore); HTM_BR (); - HTM_TxtF ("%s: ",Txt_Grade); + HTM_TxtColonNBSP (Txt_Grade); Tst_ComputeAndShowGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX); HTM_DIV_End (); } @@ -8389,7 +8399,7 @@ static void Tst_StoreOneTestResultQstInDB (long TstCod,long QstCod,unsigned NumQ "INSERT INTO tst_exam_questions" " (TstCod,QstCod,QstInd,Score,Indexes,Answers)" " VALUES" - " (%ld,%ld,%u,'%lf','%s','%s')", + " (%ld,%ld,%u,'%.15lg','%s','%s')", TstCod,QstCod, NumQst, // 0, 1, 2, 3... Score, diff --git a/swad_test_import.c b/swad_test_import.c index ee64b98b..6f42b8c4 100644 --- a/swad_test_import.c +++ b/swad_test_import.c @@ -141,7 +141,7 @@ void TsI_ShowFormImportQstsFromXML (void) /***** Write a form to import questions *****/ Frm_StartForm (ActImpTstQst); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_XML_file); + HTM_TxtColonNBSP (Txt_XML_file); HTM_INPUT_FILE (Fil_NAME_OF_PARAM_FILENAME_ORG,".xml",true,NULL); HTM_LABEL_End (); Frm_EndForm (); @@ -330,8 +330,8 @@ static void TsI_WriteAnswersOfAQstXML (long QstCod) FloatNum[i] = Str_GetDoubleFromStr (row[1]); } fprintf (Gbl.Test.XML.FileXML,"%s" - "%lg%s" - "%lg%s", + "%.15lg%s" + "%.15lg%s", Txt_NEW_LINE, FloatNum[0],Txt_NEW_LINE, FloatNum[1],Txt_NEW_LINE); @@ -970,9 +970,11 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem, break; case Tst_ANS_FLOAT: HTM_SPAN_Begin ("class=\"%s\"",ClassStem); - HTM_TxtF ("([%lg; %lg])", - Gbl.Test.Answer.FloatingPoint[0], - Gbl.Test.Answer.FloatingPoint[1]); + HTM_Txt ("(["); + HTM_Double (Gbl.Test.Answer.FloatingPoint[0]); + HTM_Txt ("; "); + HTM_Double (Gbl.Test.Answer.FloatingPoint[1]); + HTM_Txt ("])"); HTM_SPAN_End (); break; case Tst_ANS_TRUE_FALSE: diff --git a/swad_text.c b/swad_text.c index c74643f3..bb1e1495 100644 --- a/swad_text.c +++ b/swad_text.c @@ -46588,27 +46588,6 @@ const char *Txt_The_name_of_the_type_of_group_X_has_not_changed = // Warning: it "O nome do tipo de grupo %s não foi alterado."; #endif -const char *Txt_The_new_altitude_is_X = // Warning: it is very important to include %lg in the following sentences -#if L==1 // ca - "La nova altitud és %lg."; -#elif L==2 // de - "Die neue Höhe ist %lg."; -#elif L==3 // en - "The new altitude is %lg."; -#elif L==4 // es - "La nueva altitud es %lg."; -#elif L==5 // fr - "La nouvelle altitude est %lg."; -#elif L==6 // gn - "La nueva altitud es %lg."; // Okoteve traducción -#elif L==7 // it - "La nuova altitudine è %lg."; -#elif L==8 // pl - "Nowa wysokość wynosi %lg."; -#elif L==9 // pt - "O nova altitude é %lg."; -#endif - const char *Txt_The_new_IP_address_is_X = // Warning: it is very important to include %s in the following sentences #if L==1 // ca "La nueva dirección IP es %s."; // Necessita traduccio @@ -46630,27 +46609,6 @@ const char *Txt_The_new_IP_address_is_X = // Warning: it is very important to in "O novo endereço IP é %s."; #endif -const char *Txt_The_new_latitude_is_X = // Warning: it is very important to include %lg in the following sentences -#if L==1 // ca - "La nova latitud és %lg."; -#elif L==2 // de - "Der neue Breitengrad ist %lg."; -#elif L==3 // en - "The new latitude is %lg."; -#elif L==4 // es - "La nueva latitud es %lg."; -#elif L==5 // fr - "La nouvelle latitude est %lg."; -#elif L==6 // gn - "La nueva latitud es %lg."; // Okoteve traducción -#elif L==7 // it - "La nuova latitudine è %lg."; -#elif L==8 // pl - "Nowa szerokość geograficzna wynosi %lg."; -#elif L==9 // pt - "O nova latitude é %lg."; -#endif - const char *Txt_The_new_logo_is_X = // Warning: it is very important to include %s in the following sentences #if L==1 // ca "El nuevo logo es %s."; // Necessita traduccio @@ -46672,27 +46630,6 @@ const char *Txt_The_new_logo_is_X = // Warning: it is very important to include "O novo logotipo é %s."; #endif -const char *Txt_The_new_longitude_is_X = // Warning: it is very important to include %lg in the following sentences -#if L==1 // ca - "La nova longitud és %lg."; -#elif L==2 // de - "Der neue Längengrad ist %lg."; -#elif L==3 // en - "The new longitude is %lg."; -#elif L==4 // es - "La nueva longitud es %lg."; -#elif L==5 // fr - "La nouvelle longitude est %lg."; -#elif L==6 // gn - "La nueva longitud es %lg."; // Okoteve traducción -#elif L==7 // it - "La nuova longitudine è %lg."; -#elif L==8 // pl - "Nowa długość geograficzna wynosi %lg."; -#elif L==9 // pt - "O nova longitude é %lg."; -#endif - const char *Txt_The_nickname_X_has_been_registered_successfully = // Warning: it is very important to include %s in the following sentences #if L==1 // ca "El apodo @%s" diff --git a/swad_user.c b/swad_user.c index f5e8a96d..d2889296 100644 --- a/swad_user.c +++ b/swad_user.c @@ -3527,7 +3527,7 @@ void Usr_ShowFormsLogoutAndRole (void) if (Rol_GetNumAvailableRoles () == 1) { HTM_SPAN_Begin ("class=\"DAT\""); - HTM_TxtF ("%s: ",Txt_Role); + HTM_TxtColonNBSP (Txt_Role); HTM_SPAN_End (); HTM_SPAN_Begin ("class=\"DAT_N_BOLD\""); @@ -3537,7 +3537,7 @@ void Usr_ShowFormsLogoutAndRole (void) else { HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Role); + HTM_TxtColonNBSP (Txt_Role); Rol_PutFormToChangeMyRole (NULL); HTM_LABEL_End (); } @@ -7518,7 +7518,7 @@ void Usr_ListDataAdms (void) Frm_StartForm (ActLstOth); Usr_PutParamListWithPhotos (); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Scope); + HTM_TxtColonNBSP (Txt_Scope); Sco_PutSelectorScope ("ScopeUsr",true); HTM_LABEL_End (); Frm_EndForm (); @@ -7985,7 +7985,7 @@ void Usr_SeeGuests (void) Frm_StartForm (ActLstGst); Usr_PutParamsPrefsAboutUsrList (); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Scope); + HTM_TxtColonNBSP (Txt_Scope); Sco_PutSelectorScope ("ScopeUsr",true); HTM_LABEL_End (); Frm_EndForm (); @@ -8130,7 +8130,7 @@ void Usr_SeeStudents (void) Frm_StartForm (ActLstStd); Usr_PutParamsPrefsAboutUsrList (); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Scope); + HTM_TxtColonNBSP (Txt_Scope); Sco_PutSelectorScope ("ScopeUsr",true); HTM_LABEL_End (); Frm_EndForm (); @@ -8308,7 +8308,7 @@ void Usr_SeeTeachers (void) Frm_StartForm (ActLstTch); Usr_PutParamsPrefsAboutUsrList (); HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s: ",Txt_Scope); + HTM_TxtColonNBSP (Txt_Scope); Sco_PutSelectorScope ("ScopeUsr",true); HTM_LABEL_End (); Frm_EndForm ();