diff --git a/swad_changelog.h b/swad_changelog.h index 1245e550..7fb56a7a 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -487,7 +487,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.33.5 (2019-10-13)" +#define Log_PLATFORM_VERSION "SWAD 19.33.7 (2019-10-13)" #define CSS_FILE "swad19.33.css" #define JS_FILE "swad19.30.js" /* @@ -496,6 +496,8 @@ ps2pdf source.ps destination.pdf // TODO: En un TFG no preasignado con estudiante tiene que salir un triángulo amarillo // TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.) + Version 19.33.7: Oct 13, 2019 Fixed bug in surveys. (245317 lines) + Version 19.33.6: Oct 13, 2019 Fixed bug in exam announcements. (245299 lines) Version 19.33.5: Oct 13, 2019 Fixed bug in file browser. (245298 lines) Version 19.33.4: Oct 13, 2019 Code refactoring in HTML table headings. (245291 lines) Version 19.33.3: Oct 13, 2019 Code refactoring in HTML table headings. (245499 lines) diff --git a/swad_exam.c b/swad_exam.c index 03e8c8a7..8b25ee1d 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -1040,8 +1040,8 @@ static void Exa_ShowExamAnnouncement (long ExaCod, } /***** Start table *****/ - Tbl_TABLE_Begin ("%s CELLS_PAD_2\">", - ClassExaAnnouncement[TypeViewExamAnnouncement][Gbl.ExamAnns.ExaDat.Status]); + Tbl_TABLE_Begin ("%s CELLS_PAD_2", + ClassExaAnnouncement[TypeViewExamAnnouncement][Gbl.ExamAnns.ExaDat.Status]); /***** Institution logo *****/ Tbl_TR_Begin (NULL); diff --git a/swad_survey.c b/swad_survey.c index a816b37c..3a77cccf 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -3278,6 +3278,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy, Svy_WriteQstStem (row[3]); Svy_WriteAnswersOfAQst (Svy,SvyQst,PutFormAnswerSurvey); Tbl_TD_End (); + Tbl_TR_End (); } @@ -3396,6 +3397,7 @@ static void Svy_WriteAnswersOfAQst (struct Survey *Svy, /* Write one row for each answer */ Tbl_TABLE_BeginPadding (5); + for (NumAns = 0; NumAns < NumAnswers; NumAns++) @@ -3461,6 +3463,7 @@ static void Svy_WriteAnswersOfAQst (struct Survey *Svy, /* Free memory allocated for the answer */ Svy_FreeTextChoiceAnswer (SvyQst,NumAns); } + Tbl_TABLE_End (); } @@ -3491,8 +3494,9 @@ static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs) "0 (0%% %s %u)", Txt_of_PART_OF_A_TOTAL,MaxUsrs); - /***** Draw bar with a with proportional to the number of clicks *****/ Tbl_TD_Begin ("class=\"DAT LEFT_TOP\" style=\"width:%upx;\"",Svy_MAX_BAR_WIDTH + 125); + + /***** Draw bar with a with proportional to the number of clicks *****/ if (NumUsrs && MaxUsrs) BarWidth = (unsigned) ((((float) NumUsrs * (float) Svy_MAX_BAR_WIDTH) / (float) MaxUsrs) + 0.5); @@ -3511,9 +3515,8 @@ static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs) /***** Write the number of users *****/ fprintf (Gbl.F.Out,"%s", Gbl.Title); - Tbl_TD_End (); - Tbl_TR_End (); + Tbl_TD_End (); } /*****************************************************************************/ diff --git a/swad_table.c b/swad_table.c index c229516c..d6104347 100644 --- a/swad_table.c +++ b/swad_table.c @@ -51,6 +51,14 @@ extern struct Globals Gbl; /******************************* Private types *******************************/ /*****************************************************************************/ +/*****************************************************************************/ +/***************************** Private vatiables *****************************/ +/*****************************************************************************/ + +static unsigned Tbl_TR_NestingLevel = 0; +static unsigned Tbl_TH_NestingLevel = 0; +static unsigned Tbl_TD_NestingLevel = 0; + /*****************************************************************************/ /***************************** Private prototypes ****************************/ /*****************************************************************************/ @@ -190,6 +198,8 @@ void Tbl_TR_Begin (const char *fmt,...) } else Tbl_TR_BeginWithoutAttr (); + + Tbl_TR_NestingLevel++; } static void Tbl_TR_BeginWithoutAttr (void) @@ -199,7 +209,12 @@ static void Tbl_TR_BeginWithoutAttr (void) void Tbl_TR_End (void) { + if (Tbl_TR_NestingLevel == 0) // No TR open + Lay_ShowErrorAndExit ("Trying to close unopened TR."); + fprintf (Gbl.F.Out,""); + + Tbl_TR_NestingLevel--; } /*****************************************************************************/ @@ -283,6 +298,8 @@ static void Tbl_TH_BeginAttr (const char *fmt,...) } else Tbl_TH_BeginWithoutAttr (); + + Tbl_TH_NestingLevel++; } static void Tbl_TH_BeginWithoutAttr (void) @@ -292,7 +309,12 @@ static void Tbl_TH_BeginWithoutAttr (void) void Tbl_TH_End (void) { + if (Tbl_TH_NestingLevel == 0) // No TH open + Lay_ShowErrorAndExit ("Trying to close unopened TR."); + fprintf (Gbl.F.Out,""); + + Tbl_TH_NestingLevel--; } void Tbl_TH_Empty (unsigned NumColumns) @@ -341,6 +363,8 @@ void Tbl_TD_Begin (const char *fmt,...) } else Tbl_TD_BeginWithoutAttr (); + + Tbl_TD_NestingLevel++; } static void Tbl_TD_BeginWithoutAttr (void) @@ -350,7 +374,12 @@ static void Tbl_TD_BeginWithoutAttr (void) void Tbl_TD_End (void) { + if (Tbl_TD_NestingLevel == 0) // No TH open + Lay_ShowErrorAndExit ("Trying to close unopened TR."); + fprintf (Gbl.F.Out,""); + + Tbl_TD_NestingLevel--; } void Tbl_TD_Empty (unsigned NumColumns)