diff --git a/swad_changelog.h b/swad_changelog.h
index b82c15c2..6606e0f1 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.35 (2019-10-10)"
+#define Log_PLATFORM_VERSION "SWAD 19.31.36 (2019-10-10)"
#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.36: Oct 10, 2019 Code refactoring in HTML tables. (246620 lines)
Version 19.31.35: Oct 10, 2019 Code refactoring in HTML tables. (246629 lines)
Version 19.31.34: Oct 10, 2019 Code refactoring in HTML tables. (246628 lines)
Version 19.31.33: Oct 09, 2019 Code refactoring in HTML tables. (246688 lines)
diff --git a/swad_test.c b/swad_test.c
index c52a1833..fb1dd342 100644
--- a/swad_test.c
+++ b/swad_test.c
@@ -355,14 +355,14 @@ void Tst_ShowFormAskTst (void)
/***** Number of questions to generate ****/
Tbl_StartRow ();
- fprintf (Gbl.F.Out,"
");
+ Tbl_StartCellAttr ("class=\"RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,""
"%s:"
" ",
The_ClassFormInBox[Gbl.Prefs.Theme],Txt_No_of_questions);
Tbl_EndCell ();
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out," ",Gbl.RowEvenOdd);
+ Tbl_StartCellAttr ("class=\"BIG_INDEX RIGHT_TOP COLOR%u\"",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"%u",NumQst + 1);
Tbl_EndCell ();
- fprintf (Gbl.F.Out," ",Gbl.RowEvenOdd);
+ Tbl_StartCellAttr ("class=\"DAT_LIGHT LEFT_TOP COLOR%u\"",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"%s",Txt_Question_removed);
Tbl_EndCell ();
@@ -1043,7 +1043,7 @@ static void Tst_WriteQstAndAnsTest (Tst_ActionToDoWithQuestions_t ActionToDoWith
Tbl_StartRow ();
/***** Write number of question *****/
- fprintf (Gbl.F.Out," ",Gbl.RowEvenOdd);
+ Tbl_StartCellAttr ("class=\"RIGHT_TOP COLOR%u\"",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"%u
",NumQst + 1);
/***** Write answer type (row[2]) *****/
@@ -1053,7 +1053,7 @@ static void Tst_WriteQstAndAnsTest (Tst_ActionToDoWithQuestions_t ActionToDoWith
Tbl_EndCell ();
/***** Write stem (row[4]) *****/
- fprintf (Gbl.F.Out," ",Gbl.RowEvenOdd);
+ Tbl_StartCellAttr ("class=\"LEFT_TOP COLOR%u\"",Gbl.RowEvenOdd);
Tst_WriteQstStem (row[4],"TEST_EXA");
/***** Get and show media (row[6]) *****/
@@ -1698,22 +1698,22 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res,
Tbl_StartRow ();
/***** Label *****/
- fprintf (Gbl.F.Out," ",The_ClassFormInBox[Gbl.Prefs.Theme]);
+ Tbl_StartCellAttr ("class=\"RIGHT_TOP %s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_Tags);
Tbl_EndCell ();
/***** Select all tags *****/
if (NumCols > 1)
- fprintf (Gbl.F.Out," ",NumCols);
+ Tbl_StartCellAttr ("colspan=\"%u\" class=\"LEFT_TOP\"",NumCols);
else
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"LEFT_TOP\"");
Tbl_StartTablePadding (2);
Tbl_StartRow ();
if (!ShowOnlyEnabledTags)
Tbl_PutEmptyCells (1);
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,""
" ");
+ Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out," ");
Tbl_EndCell ();
}
- fprintf (Gbl.F.Out,"");
+
+ Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,""
" ");
+ Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
Frm_StartForm (ActRenTag);
Par_PutHiddenParamString ("OldTagTxt",row[1]);
fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"BM\"");
Frm_StartForm (ActEnableTag);
Par_PutHiddenParamLong ("TagCod",TagCod);
snprintf (Gbl.Title,sizeof (Gbl.Title),
@@ -1871,7 +1874,7 @@ static void Tst_PutIconDisable (long TagCod,const char *TagTxt)
{
extern const char *Txt_Tag_X_allowed_Click_to_disable_it;
- fprintf (Gbl.F.Out,"");
+ Tbl_StartCellAttr ("class=\"BM\"");
Frm_StartForm (ActDisableTag);
Par_PutHiddenParamLong ("TagCod",TagCod);
snprintf (Gbl.Title,sizeof (Gbl.Title),
@@ -1918,11 +1921,11 @@ static void Tst_ShowFormConfigTst (void)
Tbl_StartTablePadding (2);
Tbl_StartRow ();
- fprintf (Gbl.F.Out," ",The_ClassFormInBox[Gbl.Prefs.Theme]);
+ Tbl_StartCellAttr ("class=\"%s RIGHT_TOP\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_Plugins);
Tbl_EndCell ();
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"LEFT_BOTTOM\"");
for (Pluggable = Tst_PLUGGABLE_NO;
Pluggable <= Tst_PLUGGABLE_YES;
Pluggable++)
@@ -1944,11 +1947,11 @@ static void Tst_ShowFormConfigTst (void)
/***** Number of questions *****/
Tbl_StartRow ();
- fprintf (Gbl.F.Out," ",The_ClassFormInBox[Gbl.Prefs.Theme]);
+ Tbl_StartCellAttr ("class=\"%s RIGHT_TOP\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_No_of_questions);
Tbl_EndCell ();
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"LEFT_BOTTOM\"");
Tbl_StartTablePadding (2);
Tst_PutInputFieldNumQst ("NumQstMin",Txt_minimum,
Gbl.Test.Config.Min); // Minimum number of questions
@@ -1964,7 +1967,7 @@ static void Tst_ShowFormConfigTst (void)
/***** Minimum time between consecutive tests, per question *****/
Tbl_StartRow ();
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"RIGHT_TOP\"");
fprintf (Gbl.F.Out,""
"%s:"
" ",
@@ -1972,7 +1975,7 @@ static void Tst_ShowFormConfigTst (void)
Txt_Minimum_time_seconds_per_question_between_two_tests);
Tbl_EndCell ();
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"LEFT_BOTTOM\"");
fprintf (Gbl.F.Out," ",The_ClassFormInBox[Gbl.Prefs.Theme]);
+ Tbl_StartCellAttr ("class=\"%s RIGHT_TOP\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_Feedback_to_students);
Tbl_EndCell ();
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"LEFT_BOTTOM\"");
for (Feedback = (Tst_Feedback_t) 0;
Feedback < Tst_NUM_TYPES_FEEDBACK;
Feedback++)
@@ -2028,12 +2031,12 @@ static void Tst_PutInputFieldNumQst (const char *Field,const char *Label,
{
Tbl_StartRow ();
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%s ",
Field,Label);
Tbl_EndCell ();
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out," ",The_ClassFormInBox[Gbl.Prefs.Theme]);
+ Tbl_StartCellAttr ("class=\"RIGHT_TOP %s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_Types_of_answers);
Tbl_EndCell ();
/***** Select all types of answers *****/
if (NumCols > 1)
- fprintf (Gbl.F.Out," ",NumCols);
+ Tbl_StartCellAttr ("colspan=\"%u\" class=\"LEFT_TOP\"",NumCols);
else
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"LEFT_TOP\"");
Tbl_StartTablePadding (2);
Tbl_StartRow ();
- fprintf (Gbl.F.Out," ");
+ Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,""
" ");
+ Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,""
" ",Gbl.RowEvenOdd);
+
+ /***** Icons *****/
+ Tbl_StartCellAttr ("class=\"BT%u\"",Gbl.RowEvenOdd);
/* Write icon to remove the question */
Frm_StartForm (ActReqRemTstQst);
@@ -2925,7 +2929,7 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows,
Tbl_EndCell ();
/* Write number of question */
- fprintf (Gbl.F.Out,"",Gbl.RowEvenOdd);
+ Tbl_StartCellAttr ("class=\"RIGHT_TOP COLOR%u\"",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"%lu
",NumRow + 1);
/* Write answer type (row[2]) */
@@ -2935,14 +2939,14 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows,
Tbl_EndCell ();
/* Write question code */
- fprintf (Gbl.F.Out," ",Gbl.RowEvenOdd);
+ Tbl_StartCellAttr ("class=\"DAT_SMALL CENTER_TOP COLOR%u\"",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"%ld ",Gbl.Test.QstCod);
Tbl_EndCell ();
/* Write the date (row[1] has the UTC date-time) */
TimeUTC = Dat_GetUNIXTimeFromStr (row[1]);
- fprintf (Gbl.F.Out," ",
- UniqueId,Gbl.RowEvenOdd);
+ Tbl_StartCellAttr ("id=\"tst_date_%u\" class=\"DAT_SMALL CENTER_TOP COLOR%u\"",
+ UniqueId,Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"