From 3cfb2c0753fba3383a03271b5f2acb4fde9e1aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 7 Oct 2019 21:15:14 +0200 Subject: [PATCH] Version19.31.17 --- swad_changelog.h | 3 +- swad_statistic.c | 11 +- swad_survey.c | 152 +++++++++------- swad_syllabus.c | 34 ++-- swad_test.c | 423 +++++++++++++++++++++++++++------------------ swad_test_import.c | 27 +-- swad_timetable.c | 38 ++-- swad_user.c | 44 +++-- swad_zip.c | 32 ++-- 9 files changed, 463 insertions(+), 301 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index b89cf0c0..060734ea 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.31.16 (2019-10-07)" +#define Log_PLATFORM_VERSION "SWAD 19.31.17 (2019-10-07)" #define CSS_FILE "swad19.29.css" #define JS_FILE "swad19.30.js" /* @@ -495,6 +495,7 @@ ps2pdf source.ps destination.pdf // TODO: Un TFG preasignado sin 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.31.17: Oct 07, 2019 Code refactoring in HTML tables. (247221 lines) Version 19.31.16: Oct 07, 2019 Code refactoring in HTML tables. (247185 lines) Version 19.31.15: Oct 07, 2019 Code refactoring in HTML tables. (247153 lines) Version 19.31.14: Oct 07, 2019 Code refactoring in HTML tables. (247138 lines) diff --git a/swad_statistic.c b/swad_statistic.c index f12a8aa8..f3d3a12b 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -3714,7 +3714,7 @@ static void Sta_ShowNumHitsPerCentre (unsigned long NumRows, Sta_DrawBarNumHits ('o', // orange background Hits.Num,Hits.Max,Hits.Total,375); - Tbl_StartRow (); + Tbl_EndRow (); } } @@ -3802,8 +3802,8 @@ static void Sta_ShowNumHitsPerDegree (unsigned long NumRows, fprintf (Gbl.F.Out,""); if (DegCod > 0) fprintf (Gbl.F.Out,"%lu",++Ranking); - fprintf (Gbl.F.Out," " - ""); + fprintf (Gbl.F.Out," "); + Tbl_EndCell (); /* Write degree */ Sta_WriteDegree (DegCod); @@ -3813,7 +3813,7 @@ static void Sta_ShowNumHitsPerDegree (unsigned long NumRows, Sta_DrawBarNumHits ('o', // orange background Hits.Num,Hits.Max,Hits.Total,375); - Tbl_StartRow (); + Tbl_EndRow (); } } @@ -3958,7 +3958,7 @@ static void Sta_ShowNumHitsPerCourse (unsigned long NumRows, Sta_DrawBarNumHits ('o', // orange background Hits.Num,Hits.Max,Hits.Total,375); - Tbl_StartRow (); + Tbl_EndRow (); } } @@ -4032,6 +4032,7 @@ static void Sta_DrawBarNumHits (char Color, fprintf (Gbl.F.Out,"0 (0"); fprintf (Gbl.F.Out,"%%) "); + Tbl_EndCell (); } diff --git a/swad_survey.c b/swad_survey.c index dedc35fc..be44785e 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -483,10 +483,10 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, "" - "", + "", UniqueId,Svy.TimeUTC[Svy_START_TIME], (unsigned) Gbl.Prefs.DateFormat,Txt_Today); + Tbl_EndCell (); /* End date/time */ fprintf (Gbl.F.Out,"" "writeLocalDateHMSFromUTC('svy_date_end_%u',%ld," "%u,'
','%s',false,true,0x7);" - "" - "", + "", UniqueId,Svy.TimeUTC[Svy_END_TIME], (unsigned) Gbl.Prefs.DateFormat,Txt_Today); + Tbl_EndCell (); /* Survey title */ fprintf (Gbl.F.Out,"%s: %u; %s: %u" - "", + fprintf (Gbl.F.Out,"
%s: %u; %s: %u
", Svy.Status.Visible ? "ASG_GRP" : "ASG_GRP_LIGHT", Txt_No_of_questions, Svy.NumQsts, Txt_No_of_users, Svy.NumUsrs); + Tbl_EndCell (); /* Status of the survey */ fprintf (Gbl.F.Out,"" - ""); + Tbl_EndCell (); /* Scope of the survey */ fprintf (Gbl.F.Out,"
%s: ", @@ -654,11 +657,12 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, Txt,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to rigorous HTML Str_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links - fprintf (Gbl.F.Out,"
%s
" - "", + fprintf (Gbl.F.Out,"
%s
", Svy.Status.Visible ? "DAT" : "DAT_LIGHT", Txt); + Tbl_EndCell (); + Tbl_EndRow (); /***** Write questions of this survey *****/ @@ -1858,31 +1862,37 @@ void Svy_RequestCreatOrEditSvy (void) /***** Scope of the survey *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "", + "", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_Scope); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); Svy_SetDefaultAndAllowedScope (&Svy); Sco_GetScope ("ScopeSvy"); Sco_PutSelectorScope ("ScopeSvy",false); Tbl_EndCell (); + Tbl_EndRow (); /***** Survey title *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "" + "", + The_ClassFormInBox[Gbl.Prefs.Theme], + Txt_Title); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" "" - "", - The_ClassFormInBox[Gbl.Prefs.Theme], - Txt_Title, + " required=\"required\" />", Svy_MAX_CHARS_SURVEY_TITLE,Svy.Title); + Tbl_EndCell (); + Tbl_EndRow (); /***** Survey start and end dates *****/ @@ -1890,33 +1900,39 @@ void Svy_RequestCreatOrEditSvy (void) /***** Survey text *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "" - "" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); + Tbl_EndRow (); /***** Users' roles who can answer the survey *****/ Tbl_StartRow (); - fprintf (Gbl.F.Out,"%s:" - "" - "", + + fprintf (Gbl.F.Out,"%s:", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_Users); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); Rol_WriteSelectorRoles (1 << Rol_STD | 1 << Rol_NET | 1 << Rol_TCH, Svy.Roles, false,false); Tbl_EndCell (); + Tbl_EndRow (); /***** Groups *****/ @@ -2036,17 +2052,20 @@ static void Svy_ShowLstGrpsToEditSurvey (long SvyCod) { /***** Start box and table *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_Groups); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); Box_StartBoxTable ("95%",NULL,NULL, NULL,Box_NOT_CLOSABLE,0); /***** First row: checkbox to select the whole course *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" - "", + "", Txt_The_whole_course,Gbl.Hierarchy.Crs.ShrtName); + Tbl_EndCell (); + Tbl_EndRow (); /***** List the groups for each group type *****/ @@ -2679,27 +2699,32 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst, /***** Stem *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "" + "", + The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Wording); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" "" - "", - The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Wording, + "", Txt); + Tbl_EndCell (); + Tbl_EndRow (); /***** Type of answer *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", The_ClassFormInBox[Gbl.Prefs.Theme], - Txt_Type, + Txt_Type); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", The_ClassFormInBox[Gbl.Prefs.Theme]); for (AnsType = (Svy_AnswerType_t) 0; AnsType < Svy_NUM_ANS_TYPES; @@ -2717,6 +2742,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst, Txt_SURVEY_STR_ANSWER_TYPES[AnsType]); } Tbl_EndCell (); + Tbl_EndRow (); /***** Answers *****/ @@ -2731,12 +2757,13 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst, NumAns < Svy_MAX_ANSWERS_PER_QUESTION; NumAns++) { - /* Label with the number of the answer */ Tbl_StartRow (); + + /* Label with the number of the answer */ fprintf (Gbl.F.Out,"" - "" - "", + "", NumAns,The_ClassFormInBox[Gbl.Prefs.Theme],NumAns + 1); + Tbl_EndCell (); /* Answer text */ fprintf (Gbl.F.Out,"" @@ -2745,8 +2772,9 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst, NumAns,NumAns); if (SvyQst->AnsChoice[NumAns].Text) fprintf (Gbl.F.Out,"%s",SvyQst->AnsChoice[NumAns].Text); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); + Tbl_EndRow (); } Tbl_EndTable (); @@ -3247,17 +3275,17 @@ static void Svy_ListSvyQuestions (struct Survey *Svy, if (sscanf (row[1],"%u",&(SvyQst->QstInd)) != 1) Lay_ShowErrorAndExit ("Error: wrong question index."); fprintf (Gbl.F.Out,"" - "%u" - "", + "%u", Gbl.RowEvenOdd,SvyQst->QstInd + 1); + Tbl_EndCell (); /* Write the question type (row[2]) */ SvyQst->AnswerType = Svy_ConvertFromStrAnsTypDBToAnsTyp (row[2]); fprintf (Gbl.F.Out,"" - "%s" - "", + "%s", Gbl.RowEvenOdd, Txt_SURVEY_STR_ANSWER_TYPES[SvyQst->AnswerType]); + Tbl_EndCell (); /* Write the stem (row[3]) and the answers of this question */ fprintf (Gbl.F.Out,"", @@ -3418,26 +3446,26 @@ static void Svy_WriteAnswersOfAQst (struct Survey *Svy, else // SvyQst->AnswerType == Svy_ANS_MULTIPLE_CHOICE fprintf (Gbl.F.Out,"checkbox\""); fprintf (Gbl.F.Out," id=\"Ans%010u_%010u\" name=\"Ans%010u\"" - " value=\"%u\" />" - "", + " value=\"%u\" />", (unsigned) SvyQst->QstCod,NumAns,(unsigned) SvyQst->QstCod, NumAns); + Tbl_EndCell (); } /* Write the number of option */ fprintf (Gbl.F.Out,"" "" - "", + "", (unsigned) SvyQst->QstCod,NumAns,NumAns + 1); + Tbl_EndCell (); /* Write the text of the answer */ fprintf (Gbl.F.Out,"" - "" - "", + "", (unsigned) SvyQst->QstCod,NumAns, SvyQst->AnsChoice[NumAns].Text); + Tbl_EndCell (); /* Show stats of this answer */ if (Svy->Status.ICanViewResults) @@ -3497,8 +3525,10 @@ static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs) BarWidth); /***** Write the number of users *****/ - fprintf (Gbl.F.Out,"%s", + fprintf (Gbl.F.Out,"%s", Gbl.Title); + Tbl_EndCell (); + Tbl_EndRow (); } diff --git a/swad_syllabus.c b/swad_syllabus.c index a3fc4c72..18c6ba72 100644 --- a/swad_syllabus.c +++ b/swad_syllabus.c @@ -600,9 +600,11 @@ static void Syl_ShowRowSyllabus (unsigned NumItem, if (Gbl.Syllabus.EditionIsActive) { if (NewItem) - fprintf (Gbl.F.Out,"" - "", + { + fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd); + Tbl_EndCell (); + } else { /***** Icon to remove the row *****/ @@ -702,9 +704,11 @@ static void Syl_ShowRowSyllabus (unsigned NumItem, { /***** Indent depending on the level *****/ if (Level > 1) - fprintf (Gbl.F.Out,"" - "", + { + fprintf (Gbl.F.Out,"", Level - 1,Gbl.RowEvenOdd); + Tbl_EndCell (); + } /***** Code of the item *****/ fprintf (Gbl.F.Out,"",StrItemCod); + fprintf (Gbl.F.Out,"%s ",StrItemCod); + Tbl_EndCell (); /***** Text of the item *****/ fprintf (Gbl.F.Out,"" - "%s" - "", + "%s", LstItemsSyllabus.NumLevels - Level + 1, StyleSyllabus[Level], Gbl.RowEvenOdd, Text); + Tbl_EndCell (); } /***** End of the row *****/ @@ -885,15 +890,19 @@ static void Syl_PutFormItemSyllabus (bool NewItem,unsigned NumItem,int Level,int /***** Indent depending on the level *****/ if (Level > 1) - fprintf (Gbl.F.Out,"" - "", + { + fprintf (Gbl.F.Out,"", Level - 1,Gbl.RowEvenOdd); + Tbl_EndCell (); + } /***** Write the code of the item *****/ if (NewItem) // If the item is new (not stored in the file) ==> it has not a number - fprintf (Gbl.F.Out,"" - "", + { + fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd,Level * Syl_WIDTH_NUM_SYLLABUS); + Tbl_EndCell (); + } else { fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out," "); + Tbl_EndCell (); } /***** Text of the item *****/ diff --git a/swad_test.c b/swad_test.c index 8d1e6d97..c514f740 100644 --- a/swad_test.c +++ b/swad_test.c @@ -354,23 +354,26 @@ void Tst_ShowFormAskTst (void) /***** Number of questions to generate ****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" - "" - "" + "", + The_ClassFormInBox[Gbl.Prefs.Theme],Txt_No_of_questions); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" "" - ""); + fprintf (Gbl.F.Out," />"); + Tbl_EndCell (); + Tbl_EndRow (); Tbl_EndTable (); @@ -993,14 +996,17 @@ static void Tst_ShowTestResultAfterAssess (long TstCod,unsigned *NumQstsNotBlank { /***** Question does not exists *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%u" - "" - "" - "%s" - "", - Gbl.RowEvenOdd,NumQst + 1, + "%u", + Gbl.RowEvenOdd,NumQst + 1); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + "%s", Gbl.RowEvenOdd,Txt_Question_removed); + Tbl_EndCell (); + Tbl_EndRow (); } @@ -1036,8 +1042,9 @@ static void Tst_WriteQstAndAnsTest (Tst_ActionToDoWithQuestions_t ActionToDoWith Tst_QstConstructor (); Gbl.Test.QstCod = QstCod; - /***** Write number of question *****/ Tbl_StartRow (); + + /***** Write number of question *****/ fprintf (Gbl.F.Out,"" "
%u
", Gbl.RowEvenOdd, @@ -1045,9 +1052,9 @@ static void Tst_WriteQstAndAnsTest (Tst_ActionToDoWithQuestions_t ActionToDoWith /***** Write answer type (row[2]) *****/ Gbl.Test.AnswerType = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[2]); - fprintf (Gbl.F.Out,"
%s
" - "", + fprintf (Gbl.F.Out,"
%s
", Txt_TST_STR_ANSWER_TYPES[Gbl.Test.AnswerType]); + Tbl_EndCell (); /***** Write stem (row[4]) *****/ fprintf (Gbl.F.Out,"", @@ -1693,13 +1700,13 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res, row[1] TagTxt row[2] TagHidden */ + Tbl_StartRow (); /***** Label *****/ - Tbl_StartRow (); fprintf (Gbl.F.Out,"" - "%s:" - "", + "%s:", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Tags); + Tbl_EndCell (); /***** Select all tags *****/ fprintf (Gbl.F.Out,"" "" - "", + "", Txt_All_tags); + Tbl_EndCell (); + Tbl_EndRow (); /***** Select tags one by one *****/ @@ -1744,8 +1753,8 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res, fprintf (Gbl.F.Out,"eye.svg\" alt=\"%s\" title=\"%s", Txt_Tag_allowed, Txt_Tag_allowed); - fprintf (Gbl.F.Out,"\" class=\"ICO_HIDDEN ICO16x16\" />" - ""); + fprintf (Gbl.F.Out,"\" class=\"ICO_HIDDEN ICO16x16\" />"); + Tbl_EndCell (); } fprintf (Gbl.F.Out,"" "" - "", + "", row[1]); + Tbl_EndCell (); + Tbl_EndRow (); } @@ -1913,12 +1923,14 @@ static void Tst_ShowFormConfigTst (void) /***** Tests are visible from plugins? *****/ Tbl_StartTablePadding (2); Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_Plugins); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); for (Pluggable = Tst_PLUGGABLE_NO; Pluggable <= Tst_PLUGGABLE_YES; Pluggable++) @@ -1934,16 +1946,19 @@ static void Tst_ShowFormConfigTst (void) Txt_TST_PLUGGABLE[Pluggable]); } Tbl_EndCell (); + Tbl_EndRow (); /***** Number of questions *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_No_of_questions); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); Tbl_StartTablePadding (2); Tst_PutInputFieldNumQst ("NumQstMin",Txt_minimum, Gbl.Test.Config.Min); // Minimum number of questions @@ -1953,33 +1968,39 @@ static void Tst_ShowFormConfigTst (void) Gbl.Test.Config.Max); // Maximum number of questions Tbl_EndTable (); Tbl_EndCell (); + Tbl_EndRow (); /***** Minimum time between consecutive tests, per question *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" - "" - "" + "", + The_ClassFormInBox[Gbl.Prefs.Theme], + Txt_Minimum_time_seconds_per_question_between_two_tests); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" "" - "", - The_ClassFormInBox[Gbl.Prefs.Theme], - Txt_Minimum_time_seconds_per_question_between_two_tests, + " required=\"required\" />", Gbl.Test.Config.MinTimeNxtTstPerQst); + Tbl_EndCell (); + Tbl_EndRow (); /***** Feedback to students *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Feedback_to_students); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); for (Feedback = (Tst_Feedback_t) 0; Feedback < Tst_NUM_TYPES_FEEDBACK; Feedback++) @@ -1995,6 +2016,7 @@ static void Tst_ShowFormConfigTst (void) Txt_TST_STR_FEEDBACK[Feedback]); } Tbl_EndCell (); + Tbl_EndRow (); Tbl_EndTable (); @@ -2016,18 +2038,21 @@ static void Tst_PutInputFieldNumQst (const char *Field,const char *Label, unsigned Value) { Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "" + "", + Field,Label); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" "" - "", - Field,Label, + " required=\"required\" />", Field,Field, Value); + Tbl_EndCell (); + Tbl_EndRow (); } @@ -2313,12 +2338,13 @@ static void Tst_ShowFormAnswerTypes (unsigned NumCols) char UnsignedStr[10 + 1]; const char *Ptr; - /***** Label *****/ Tbl_StartRow (); + + /***** Label *****/ fprintf (Gbl.F.Out,"" - "%s:" - "", + "%s:", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Types_of_answers); + Tbl_EndCell (); /***** Select all types of answers *****/ fprintf (Gbl.F.Out,""); Tbl_StartTablePadding (2); + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" - "", + "", Txt_All_types_of_answers); + Tbl_EndCell (); + Tbl_EndRow (); /***** Type of answer *****/ @@ -2346,6 +2375,7 @@ static void Tst_ShowFormAnswerTypes (unsigned NumCols) AnsType++) { Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" - "", + "", Txt_TST_STR_ANSWER_TYPES[AnsType]); + Tbl_EndCell (); + Tbl_EndRow (); } @@ -2913,15 +2944,15 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows, /* Write answer type (row[2]) */ Gbl.Test.AnswerType = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[2]); - fprintf (Gbl.F.Out,"
%s
" - "", + fprintf (Gbl.F.Out,"
%s
", Txt_TST_STR_ANSWER_TYPES[Gbl.Test.AnswerType]); + Tbl_EndCell (); /* Write question code */ fprintf (Gbl.F.Out,"" - "%ld " - "", + "%ld ", Gbl.RowEvenOdd,Gbl.Test.QstCod); + Tbl_EndCell (); /* Write the date (row[1] has the UTC date-time) */ TimeUTC = Dat_GetUNIXTimeFromStr (row[1]); @@ -2930,11 +2961,11 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows, "" - "", + "", UniqueId,Gbl.RowEvenOdd, UniqueId,(long) TimeUTC, (unsigned) Gbl.Prefs.DateFormat,Txt_Today); + Tbl_EndCell (); /* Write the question tags */ fprintf (Gbl.F.Out,"", @@ -3001,9 +3032,9 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows, /* Write number of times this question has been answered */ fprintf (Gbl.F.Out,"" - "%lu" - "", + "%lu", Gbl.RowEvenOdd,NumHitsThisQst); + Tbl_EndCell (); /* Write average score */ fprintf (Gbl.F.Out,"", @@ -3017,10 +3048,10 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows, /* Write number of times this question has been answered (not blank) */ fprintf (Gbl.F.Out,"" - "%lu" - "", + "%lu", Gbl.RowEvenOdd, NumHitsNotBlankThisQst); + Tbl_EndCell (); /* Write average score (not blank) */ fprintf (Gbl.F.Out,"", @@ -3151,15 +3182,15 @@ static void Tst_ListOneOrMoreQuestionsForSelection (unsigned long NumRows, /* Write number of question */ fprintf (Gbl.F.Out,"" - "%lu " - "", + "%lu ", Gbl.RowEvenOdd,NumRow + 1); + Tbl_EndCell (); /* Write question code */ fprintf (Gbl.F.Out,"" - "%ld " - "", + "%ld ", Gbl.RowEvenOdd,Gbl.Test.QstCod); + Tbl_EndCell (); /* Write the date (row[1] has the UTC date-time) */ TimeUTC = Dat_GetUNIXTimeFromStr (row[1]); @@ -3168,11 +3199,11 @@ static void Tst_ListOneOrMoreQuestionsForSelection (unsigned long NumRows, "" - "", + "", UniqueId,Gbl.RowEvenOdd, UniqueId,(long) TimeUTC, (unsigned) Gbl.Prefs.DateFormat,Txt_Today); + Tbl_EndCell (); /* Write the question tags */ fprintf (Gbl.F.Out,"", @@ -3183,10 +3214,10 @@ static void Tst_ListOneOrMoreQuestionsForSelection (unsigned long NumRows, /* Write the question type (row[2]) */ Gbl.Test.AnswerType = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[2]); fprintf (Gbl.F.Out,"" - "%s " - "", + "%s ", Gbl.RowEvenOdd, Txt_TST_STR_ANSWER_TYPES[Gbl.Test.AnswerType]); + Tbl_EndCell (); /* Write if shuffle is enabled (row[3]) */ fprintf (Gbl.F.Out,"", @@ -3428,9 +3459,9 @@ void Tst_WriteAnswersEdit (long QstCod) /* Write the number of option */ fprintf (Gbl.F.Out,"" - "%c) " - "", + "%c) ", 'a' + (char) NumOpt); + Tbl_EndCell (); /* Write the text of the answer and the image */ fprintf (Gbl.F.Out,"" @@ -3446,8 +3477,9 @@ void Tst_WriteAnswersEdit (long QstCod) fprintf (Gbl.F.Out,"
"); if (LengthFeedback) fprintf (Gbl.F.Out,"%s",Feedback); - fprintf (Gbl.F.Out,"
" - ""); + fprintf (Gbl.F.Out,"
"); + Tbl_EndCell (); + Tbl_EndRow (); /* Free memory allocated for the answer and the feedback */ @@ -3763,6 +3795,7 @@ static void Tst_WriteChoiceAnsViewTest (unsigned NumQst,long QstCod,bool Shuffle /***** Write selectors and letter of this option *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,""); snprintf (ParamName,sizeof (ParamName), "Ind%06u", @@ -3775,17 +3808,18 @@ static void Tst_WriteChoiceAnsViewTest (unsigned NumQst,long QstCod,bool Shuffle NumQst,Gbl.Test.Answer.NumOptions); else // Gbl.Test.AnswerType == Tst_ANS_MULTIPLE_CHOICE fprintf (Gbl.F.Out,"checkbox\""); - fprintf (Gbl.F.Out," id=\"Ans%06u_%u\" name=\"Ans%06u\" value=\"%u\" />" - "", + fprintf (Gbl.F.Out," id=\"Ans%06u_%u\" name=\"Ans%06u\" value=\"%u\" />", NumQst,NumOpt, NumQst,Index); + Tbl_EndCell (); + fprintf (Gbl.F.Out,"" "" - "", + "", NumQst,NumOpt, 'a' + (char) NumOpt); + Tbl_EndCell (); /***** Write the option text *****/ fprintf (Gbl.F.Out,"" @@ -3876,8 +3910,9 @@ static void Tst_WriteChoiceAnsAssessTest (struct UsrData *UsrDat, Ans.Class = "ANS_0"; Ans.Str = "•"; } - fprintf (Gbl.F.Out,"%s", + fprintf (Gbl.F.Out,"%s", Ans.Class,Txt_TST_Answer_given_by_the_user,Ans.Str); + Tbl_EndCell (); } else // This answer has NOT been selected by the user Tbl_PutEmptyCells (1); @@ -3887,19 +3922,25 @@ static void Tst_WriteChoiceAnsAssessTest (struct UsrData *UsrDat, Gbl.Test.Config.Feedback == Tst_FEEDBACK_FULL_FEEDBACK) { if (Gbl.Test.Answer.Options[Indexes[NumOpt]].Correct) - fprintf (Gbl.F.Out,"•", + { + fprintf (Gbl.F.Out,"•", Txt_TST_Answer_given_by_the_teachers); + Tbl_EndCell (); + } else Tbl_PutEmptyCells (1); } else - fprintf (Gbl.F.Out,"?"); + { + fprintf (Gbl.F.Out,"?"); + Tbl_EndCell (); + } /* Answer letter (a, b, c,...) */ fprintf (Gbl.F.Out,"" - "%c) " - "", + "%c) ", 'a' + (char) NumOpt); + Tbl_EndCell (); /* Answer text and feedback */ fprintf (Gbl.F.Out,"" @@ -4211,10 +4252,10 @@ static void Tst_WriteChoiceAnsViewMatch (long MchCod,unsigned QstInd,long QstCod fprintf (Gbl.F.Out,"" "
" "%c" - "
" - "", + "", 'A' + (char) NumOpt, 'a' + (char) NumOpt); + Tbl_EndCell (); /***** Write the option text and the result *****/ fprintf (Gbl.F.Out,"" @@ -4377,9 +4418,9 @@ static void Tst_WriteTextAnsAssessTest (struct UsrData *UsrDat, { /* Answer letter (a, b, c,...) */ fprintf (Gbl.F.Out,"" - "%c) " - "", + "%c) ", 'a' + (char) NumOpt); + Tbl_EndCell (); /* Answer text and feedback */ fprintf (Gbl.F.Out,"" @@ -4686,13 +4727,14 @@ static void Tst_WriteHeadUserCorrect (struct UsrData *UsrDat) extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%s" - "", - Txt_User[UsrDat->Sex], + "%s", + Txt_User[UsrDat->Sex]); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + "%s", Txt_ROLES_PLURAL_Abc[Rol_TCH][Usr_SEX_UNKNOWN]); + Tbl_EndCell (); } /*****************************************************************************/ @@ -4711,8 +4753,8 @@ static void Tst_WriteScoreStart (unsigned ColSpan) static void Tst_WriteScoreEnd (void) { - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); Tbl_EndRow (); } @@ -5082,11 +5124,13 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], /***** Write the tags *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Tags); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); Tbl_StartTablePadding (2); // Table for tags for (NumTag = 0; @@ -5126,23 +5170,24 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], fprintf (Gbl.F.Out,"", Gbl.Test.Tags.Txt[NumTag],Gbl.Test.Tags.Txt[NumTag]); fprintf (Gbl.F.Out,"" - "" - "", + "", Txt_new_tag); + Tbl_EndCell (); /***** Input of a new tag *****/ fprintf (Gbl.F.Out,"" "" - "", + " onchange=\"changeSelTag('%u')\" />", NumTag,NumTag,Tst_MAX_CHARS_TAG,Gbl.Test.Tags.Txt[NumTag],NumTag); + Tbl_EndCell (); Tbl_EndRow (); } Tbl_EndTable (); // Table for tags Tbl_EndCell (); + Tbl_EndRow (); /* Free structure that stores the query result */ @@ -5150,16 +5195,18 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], /***** Stem and image *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "" + "", + The_ClassFormInBox[Gbl.Prefs.Theme], + Txt_Wording); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" "
", - The_ClassFormInBox[Gbl.Prefs.Theme], - Txt_Wording, Stem); Tst_PutFormToEditQstMedia (&Gbl.Test.Media,-1, false); @@ -5175,18 +5222,21 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], if (Feedback[0]) fprintf (Gbl.F.Out,"%s",Feedback); fprintf (Gbl.F.Out,"" - "" - ""); + ""); + Tbl_EndCell (); + Tbl_EndRow (); /***** Type of answer *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", The_ClassFormInBox[Gbl.Prefs.Theme], - Txt_Type, + Txt_Type); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", The_ClassFormInBox[Gbl.Prefs.Theme]); for (AnsType = (Tst_AnswerType_t) 0; AnsType < Tst_NUM_ANS_TYPES; @@ -5203,27 +5253,31 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], Txt_TST_STR_ANSWER_TYPES[AnsType]); } Tbl_EndCell (); + Tbl_EndRow (); /***** Answers *****/ /* Integer answer */ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "" + "%s:", + The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Answers); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" "" - ""); + ""); + Tbl_EndCell (); + Tbl_EndRow (); /* Floating point answer */ @@ -5248,7 +5302,9 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], /* Questions can be shuffled? */ Tbl_StartRow (); + Tbl_PutEmptyCells (1); + fprintf (Gbl.F.Out,"" "" - "", + "", Txt_Shuffle); + Tbl_EndCell (); + Tbl_EndRow (); /* Simple or multiple choice answers */ @@ -5288,8 +5345,9 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], DisplayRightColumn = NumOpt < 2 || // Display at least the two first options AnswerHasContent; - /***** Left column: selectors *****/ Tbl_StartRow (); + + /***** Left column: selectors *****/ fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd); @@ -5392,8 +5450,9 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], ""); /* End of right column */ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); + Tbl_EndRow (); } Tbl_EndTable (); // Table with choice answers @@ -7453,12 +7512,15 @@ void Tst_SelUsrsToViewUsrsTstResults (void) /***** Put list of users to select some of them *****/ Tbl_StartTableCenterPadding (2); + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", - The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Users, + "%s:", + The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Users); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", The_ClassFormInBox[Gbl.Prefs.Theme]); Tbl_StartTablePadding (2); Usr_ListUsersToSelect (Rol_TCH); @@ -7466,6 +7528,7 @@ void Tst_SelUsrsToViewUsrsTstResults (void) Usr_ListUsersToSelect (Rol_STD); Tbl_EndTable (); Tbl_EndCell (); + Tbl_EndRow (); /***** Starting and ending dates in the search *****/ @@ -7799,11 +7862,11 @@ static void Tst_ShowTstResults (struct UsrData *UsrDat) "" - "", + "", UniqueId,ClassDat,Gbl.RowEvenOdd, UniqueId,(long) TimeUTC, (unsigned) Gbl.Prefs.DateFormat,Txt_Today); + Tbl_EndCell (); /* Get number of questions (row[3]) */ if (sscanf (row[3],"%u",&NumQstsInThisTest) != 1) @@ -7958,10 +8021,10 @@ static void Tst_ShowTestResultsSummaryRow (bool ItsMe, /***** Row title *****/ fprintf (Gbl.F.Out,"" - "%s: %u" - "", + "%s: %u", Gbl.RowEvenOdd, Txt_Visible_tests,NumExams); + Tbl_EndCell (); /***** Write total number of questions *****/ fprintf (Gbl.F.Out,"", @@ -8004,8 +8067,9 @@ static void Tst_ShowTestResultsSummaryRow (bool ItsMe, Tbl_EndCell (); /***** Last cell *****/ - fprintf (Gbl.F.Out,"", + fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd); + Tbl_EndCell (); /***** End row *****/ Tbl_EndRow (); @@ -8117,11 +8181,13 @@ void Tst_ShowOneTstResult (void) /* User */ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", Txt_ROLES_SINGUL_Abc[Gbl.Usrs.Other.UsrDat.Roles.InCurrentCrs.Role][Gbl.Usrs.Other.UsrDat.Sex]); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); ID_WriteUsrIDs (&Gbl.Usrs.Other.UsrDat,NULL); fprintf (Gbl.F.Out," %s", Gbl.Usrs.Other.UsrDat.Surname1); @@ -8137,42 +8203,52 @@ void Tst_ShowOneTstResult (void) NULL, "PHOTO45x60",Pho_ZOOM,false); Tbl_EndCell (); + Tbl_EndRow (); /* Test date */ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "" + "%s:", + Txt_Date); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" "" - "", - Txt_Date,TstTimeUTC, + "", + TstTimeUTC, (unsigned) Gbl.Prefs.DateFormat,Txt_Today); + Tbl_EndCell (); + Tbl_EndRow (); /* Number of questions */ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "" - "%u (%u %s)" - "", - Txt_Questions, + "%s:", + Txt_Questions); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + "%u (%u %s)", Gbl.Test.NumQsts,NumQstsNotBlank,Txt_non_blank_QUESTIONS); + Tbl_EndCell (); + Tbl_EndRow (); /* Score */ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", Txt_Score); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); if (ICanViewScore) fprintf (Gbl.F.Out,"%.2lf (%.2lf", TotalScore, @@ -8180,19 +8256,24 @@ void Tst_ShowOneTstResult (void) 0.0); else fprintf (Gbl.F.Out,"? (?"); // No feedback - fprintf (Gbl.F.Out," %s %u)", + fprintf (Gbl.F.Out," %s %u)", Txt_out_of_PART_OF_A_SCORE,Tst_SCORE_MAX); + Tbl_EndCell (); + Tbl_EndRow (); /* Tags present in this test */ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", Txt_Tags); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); Tst_ShowTstTagsPresentInATestResult (TstCod); Tbl_EndCell (); + Tbl_EndRow (); /***** Write answers and solutions *****/ @@ -8265,14 +8346,17 @@ void Tst_ShowTestResult (struct UsrData *UsrDat, { /***** Question has been edited *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%u" - "" - "" - "%s" - "", - Gbl.RowEvenOdd,NumQst + 1, + "%u", + Gbl.RowEvenOdd,NumQst + 1); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + "%s", Gbl.RowEvenOdd,Txt_Question_modified); + Tbl_EndCell (); + Tbl_EndRow (); } else @@ -8293,14 +8377,17 @@ void Tst_ShowTestResult (struct UsrData *UsrDat, { /***** Question does not exists *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%u" - "" - "" - "%s" - "", - Gbl.RowEvenOdd,NumQst + 1, + "%u", + Gbl.RowEvenOdd,NumQst + 1); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + "%s", Gbl.RowEvenOdd,Txt_Question_removed); + Tbl_EndCell (); + Tbl_EndRow (); } diff --git a/swad_test_import.c b/swad_test_import.c index 48453db2..3f9e7f4d 100644 --- a/swad_test_import.c +++ b/swad_test_import.c @@ -1021,8 +1021,7 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem, fprintf (Gbl.F.Out,"" "\"%s\"" - "", + " class=\"CONTEXT_ICO_16x16\" />", Gbl.RowEvenOdd, Cfg_URL_ICON_PUBLIC, QuestionExists ? "tr16x16.gif" : @@ -1031,6 +1030,7 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem, Txt_New_question, QuestionExists ? Txt_Existing_question : Txt_New_question); + Tbl_EndCell (); /***** Write number of question *****/ fprintf (Gbl.F.Out,"", @@ -1051,14 +1051,17 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem, NumTag++) { Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - " • " - "" - "" - "%s" - "", - ClassData, + " • ", + ClassData); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + "%s", ClassData,Gbl.Test.Tags.Txt[NumTag]); + Tbl_EndCell (); + Tbl_EndRow (); } Tbl_EndTable (); @@ -1071,10 +1074,10 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem, /***** Write the question type *****/ fprintf (Gbl.F.Out,"" - "%s " - "", + "%s ", ClassData,Gbl.RowEvenOdd, Txt_TST_STR_ANSWER_TYPES[Gbl.Test.AnswerType]); + Tbl_EndCell (); /***** Write if shuffle is enabled *****/ fprintf (Gbl.F.Out,"", @@ -1165,9 +1168,9 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem, /* Write the number of option */ fprintf (Gbl.F.Out,"" - "%c) " - "", + "%c) ", ClassData,'a' + (char) NumOpt); + Tbl_EndCell (); /* Write the text and the feedback of the answer */ fprintf (Gbl.F.Out,"" diff --git a/swad_timetable.c b/swad_timetable.c index e4a70364..e94e9d9e 100644 --- a/swad_timetable.c +++ b/swad_timetable.c @@ -1133,21 +1133,25 @@ static void TT_DrawTimeTable (void) /***** Row with day names *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%02u:00" - "", + "%02u:00", TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN, Gbl.TimeTable.Config.Range.Hours.Start); + Tbl_EndCell (); + TT_DrawCellAlignTimeTable (); TT_TimeTableDrawDaysCells (); TT_DrawCellAlignTimeTable (); + fprintf (Gbl.F.Out,"" - "%02u:00" - "", + "%02u:00", TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN, Gbl.TimeTable.Config.Range.Hours.Start); + Tbl_EndCell (); + Tbl_EndRow (); /***** Get list of groups types and groups in this course *****/ @@ -1273,7 +1277,10 @@ static void TT_TimeTableDrawAdjustRow (void) unsigned Minicolumn; Tbl_StartRow (); - fprintf (Gbl.F.Out,""); + + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); + TT_DrawCellAlignTimeTable (); for (Weekday = 0; Weekday < TT_DAYS_PER_WEEK; @@ -1281,9 +1288,15 @@ static void TT_TimeTableDrawAdjustRow (void) for (Minicolumn = 0; Minicolumn < TT_NUM_MINICOLUMNS_PER_DAY; Minicolumn++) - fprintf (Gbl.F.Out,""); + { + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); + } TT_DrawCellAlignTimeTable (); - fprintf (Gbl.F.Out,""); + + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); + Tbl_EndRow (); } @@ -1305,13 +1318,13 @@ static void TT_TimeTableDrawDaysCells (void) fprintf (Gbl.F.Out,"" - "%s" - "", + "%s", TT_NUM_MINICOLUMNS_PER_DAY, Weekday == 6 ? "TT_SUNDAY" : // Sunday drawn in red "TT_DAY", // Monday to Saturday TT_PERCENT_WIDTH_OF_A_DAY, Txt_DAYS_CAPS[Weekday]); + Tbl_EndCell (); } } @@ -1322,12 +1335,12 @@ static void TT_TimeTableDrawDaysCells (void) static void TT_TimeTableDrawHourCell (unsigned Hour,unsigned Min,const char *Align) { fprintf (Gbl.F.Out,"" - "%02u:%02u" - "", + "%02u:%02u", Min ? "TT_HOUR_SMALL" : "TT_HOUR_BIG", Align, Hour,Min); + Tbl_EndCell (); } /*****************************************************************************/ @@ -1412,7 +1425,8 @@ static unsigned TT_CalculateColsToDrawInCell (bool TopCall, static void TT_DrawCellAlignTimeTable (void) { - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); } /*****************************************************************************/ diff --git a/swad_user.c b/swad_user.c index d0113247..9db9ab30 100644 --- a/swad_user.c +++ b/swad_user.c @@ -3657,23 +3657,23 @@ void Usr_WriteRowUsrMainData (unsigned NumUsr,struct UsrData *UsrDat, else fprintf (Gbl.F.Out,"BM%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," %s\" title=\"%s\">" - "%s" - "", + "%s", UsrDat->Accepted ? "USR_LIST_NUM_N" : "USR_LIST_NUM", UsrDat->Accepted ? Txt_Enrolment_confirmed : Txt_Enrolment_not_confirmed, UsrDat->Accepted ? "✓" : "✗"); + Tbl_EndCell (); /***** Write number of user in the list *****/ fprintf (Gbl.F.Out,"" - "%u" - "", + "%u", UsrDat->Accepted ? "USR_LIST_NUM_N" : "USR_LIST_NUM", BgColor, NumUsr); + Tbl_EndCell (); if (Gbl.Usrs.Listing.WithPhotos) { @@ -3737,7 +3737,8 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat) fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd); ID_WriteUsrIDs (UsrDat,NULL); - fprintf (Gbl.F.Out," "); + fprintf (Gbl.F.Out," "); + Tbl_EndCell (); /***** Write rest of guest's main data *****/ Ins.InsCod = UsrDat->InsCod; @@ -3841,7 +3842,8 @@ static void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames) "DAT_SMALL", Gbl.RowEvenOdd); ID_WriteUsrIDs (UsrDat,NULL); - fprintf (Gbl.F.Out," "); + fprintf (Gbl.F.Out," "); + Tbl_EndCell (); /***** Write rest of main student's data *****/ Ins.InsCod = UsrDat->InsCod; @@ -3960,7 +3962,8 @@ static void Usr_WriteRowTchAllData (struct UsrData *UsrDat) "DAT_SMALL", Gbl.RowEvenOdd); ID_WriteUsrIDs (UsrDat,NULL); - fprintf (Gbl.F.Out," "); + fprintf (Gbl.F.Out," "); + Tbl_EndCell (); /***** Write rest of main teacher's data *****/ Ins.InsCod = UsrDat->InsCod; @@ -4017,9 +4020,9 @@ static void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat) /***** Write number of user *****/ fprintf (Gbl.F.Out,"" - "%u" - "", + "%u", Gbl.RowEvenOdd,NumUsr); + Tbl_EndCell (); if (Gbl.Usrs.Listing.WithPhotos) { @@ -4039,7 +4042,8 @@ static void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat) "DAT_SMALL", Gbl.RowEvenOdd); ID_WriteUsrIDs (UsrDat,NULL); - fprintf (Gbl.F.Out," "); + fprintf (Gbl.F.Out," "); + Tbl_EndCell (); /***** Write rest of main administrator's data *****/ Ins.InsCod = UsrDat->InsCod; @@ -4141,8 +4145,8 @@ static void Usr_WriteUsrData (const char *BgColor, fprintf (Gbl.F.Out,""); /***** End container and table cell *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); } /*****************************************************************************/ @@ -6937,8 +6941,10 @@ void Usr_ListAllDataStds (void) NumCol < NumColumnsCardAndGroups; NumCol++) if (NumCol != 1 || Gbl.Usrs.Listing.WithPhotos) // Skip photo column if I don't want it in listing - fprintf (Gbl.F.Out,"" - ""); + { + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); + } for (NumField = 0; NumField < Gbl.Crs.Records.LstFields.Num; NumField++) @@ -7238,9 +7244,12 @@ unsigned Usr_ListUsrsFound (Rol_Role_t Role, Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM) // Only admins can view the courses { Tbl_StartRow (); - fprintf (Gbl.F.Out,"" - "", - Gbl.RowEvenOdd, + + fprintf (Gbl.F.Out,"", + Gbl.RowEvenOdd); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", Usr_NUM_MAIN_FIELDS_DATA_USR-2, Gbl.RowEvenOdd); if (Role == Rol_UNK) @@ -7252,6 +7261,7 @@ unsigned Usr_ListUsrsFound (Rol_Role_t Role, else Crs_GetAndWriteCrssOfAUsr (&UsrDat,Role); Tbl_EndCell (); + Tbl_EndRow (); } diff --git a/swad_zip.c b/swad_zip.c index 1fd1161e..f330824f 100644 --- a/swad_zip.c +++ b/swad_zip.c @@ -577,8 +577,7 @@ static void ZIP_ShowLinkToDownloadZIP (const char *FileName,const char *URL, "\"%s\"" - "" - "", + "", URL,FileName, CfG_URL_ICON_FILEXT_PUBLIC, Txt_ZIP_file, @@ -587,30 +586,36 @@ static void ZIP_ShowLinkToDownloadZIP (const char *FileName,const char *URL, Cfg_URL_ICON_PUBLIC, Txt_Download, Txt_Download); + Tbl_EndCell (); Tbl_EndRow (); /***** Filename *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "" - "%s" - "", - The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Filename, + "%s:", + The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Filename); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + "%s", URL,FileName,FileName); + Tbl_EndCell (); + Tbl_EndRow (); /***** Write the file size *****/ Fil_WriteFileSizeFull ((double) FileSize,FileSizeStr); Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "" - "%s", + "%s:", The_ClassFormInBox[Gbl.Prefs.Theme], - Txt_File_size, + Txt_File_size); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + "%s", FileSizeStr); if (UncompressedSize) { @@ -619,6 +624,7 @@ static void ZIP_ShowLinkToDownloadZIP (const char *FileName,const char *URL, FileSizeStr,Txt_FILE_uncompressed); } Tbl_EndCell (); + Tbl_EndRow (); /***** End table and box *****/