Version 14.125.1

This commit is contained in:
Antonio Cañas Vargas 2015-09-03 17:14:30 +02:00
parent 65718d4e7b
commit ef7765e47e
12 changed files with 335 additions and 457 deletions

View File

@ -103,12 +103,13 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 14.125 (2015/09/03)" #define Log_PLATFORM_VERSION "SWAD 14.125.1 (2015/09/03)"
// Number of lines (includes comments but not blank lines) has been got with the following command: // Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/* /*
Version 14.125: Sep 03, 2015 Changes in styles. (? lines) Version 14.125.1: Sep 03, 2015 Changes in styles. (184399 lines)
Version 14.125: Sep 03, 2015 Changes in styles. (184521 lines)
Version 14.124.10:Sep 02, 2015 Changes in styles. (184571 lines) Version 14.124.10:Sep 02, 2015 Changes in styles. (184571 lines)
Version 14.124.9: Sep 02, 2015 Changes in styles. (184584 lines) Version 14.124.9: Sep 02, 2015 Changes in styles. (184584 lines)
Version 14.124.8: Sep 02, 2015 Changes in styles. (184635 lines) Version 14.124.8: Sep 02, 2015 Changes in styles. (184635 lines)

View File

@ -1021,254 +1021,224 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat
NumTchs = Usr_GetNumUsrsInCrs (Rol_TEACHER,CrsCod); NumTchs = Usr_GetNumUsrsInCrs (Rol_TEACHER,CrsCod);
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s LEFT_MIDDLE\"" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE\"" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE\"" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"DAT_SMALL LEFT_MIDDLE\"" "<td class=\"DAT_SMALL LEFT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"<a href=\"%s/?crs=%ld&amp;act=%ld\" target=\"_blank\">" "<a href=\"%s/?crs=%ld&amp;act=%ld\" target=\"_blank\">"
"%s/?crs=%ld&amp;act=%ld" "%s/?crs=%ld&amp;act=%ld"
"</a>" "</a>"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE\"" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE\"" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE\"" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE\"" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE\"" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE\"" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE\"" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE\"" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE\"" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE\"" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE\"" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE\"" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%lu" "%lu"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE\"" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%lu" "%lu"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE\"" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE\"" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE\"" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE\"" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE\"" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE\"" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE\"" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE\"" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%lu" "%lu"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE\"" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%lu" "%lu"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE\"" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE\"" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE\"" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE\"" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"</tr>", "</tr>",
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
row[0], row[0],
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
row[1], row[1],
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
row[3], row[3],
Gbl.ColorRows[Gbl.RowEvenOdd],Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, Gbl.RowEvenOdd,Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod,
Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod,
NumTchs != 0 ? "DAT_SMALL_GREEN" : NumTchs != 0 ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
NumTchs, NumTchs,
NumStds != 0 ? "DAT_SMALL_GREEN" : NumStds != 0 ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
NumStds, NumStds,
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Indicators.CountIndicators, Indicators.CountIndicators,
"DAT_SMALL_GREEN",Gbl.ColorRows[Gbl.RowEvenOdd], "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereIsSyllabus ? Txt_YES : Indicators.ThereIsSyllabus ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.ColorRows[Gbl.RowEvenOdd], "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereIsSyllabus ? "" : Indicators.ThereIsSyllabus ? "" :
Txt_NO, Txt_NO,
(Indicators.SyllabusLecSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (Indicators.SyllabusLecSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusLecSrc], Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusLecSrc],
(Indicators.SyllabusPraSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (Indicators.SyllabusPraSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusPraSrc], Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusPraSrc],
(Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc], Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc],
"DAT_SMALL_GREEN",Gbl.ColorRows[Gbl.RowEvenOdd], "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereAreAssignments ? Txt_YES : Indicators.ThereAreAssignments ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.ColorRows[Gbl.RowEvenOdd], "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereAreAssignments ? "" : Indicators.ThereAreAssignments ? "" :
Txt_NO, Txt_NO,
(Indicators.NumAssignments != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumAssignments != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Indicators.NumAssignments, Indicators.NumAssignments,
(Indicators.NumFilesAssignments != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumFilesAssignments != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Indicators.NumFilesAssignments, Indicators.NumFilesAssignments,
(Indicators.NumFilesWorks != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumFilesWorks != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Indicators.NumFilesWorks, Indicators.NumFilesWorks,
"DAT_SMALL_GREEN",Gbl.ColorRows[Gbl.RowEvenOdd], "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereIsOnlineTutoring ? Txt_YES : Indicators.ThereIsOnlineTutoring ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.ColorRows[Gbl.RowEvenOdd], "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereIsOnlineTutoring ? "" : Indicators.ThereIsOnlineTutoring ? "" :
Txt_NO, Txt_NO,
(Indicators.NumThreads != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumThreads != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Indicators.NumThreads, Indicators.NumThreads,
(Indicators.NumPosts != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumPosts != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Indicators.NumPosts, Indicators.NumPosts,
(Indicators.NumMsgsSentByTchs != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumMsgsSentByTchs != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Indicators.NumMsgsSentByTchs, Indicators.NumMsgsSentByTchs,
"DAT_SMALL_GREEN",Gbl.ColorRows[Gbl.RowEvenOdd], "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereAreMaterials ? Txt_YES : Indicators.ThereAreMaterials ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.ColorRows[Gbl.RowEvenOdd], "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereAreMaterials ? "" : Indicators.ThereAreMaterials ? "" :
Txt_NO, Txt_NO,
(Indicators.NumFilesInDownloadZones != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumFilesInDownloadZones != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Indicators.NumFilesInDownloadZones, Indicators.NumFilesInDownloadZones,
(Indicators.NumFilesInCommonZones != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumFilesInCommonZones != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Indicators.NumFilesInCommonZones, Indicators.NumFilesInCommonZones,
"DAT_SMALL_GREEN",Gbl.ColorRows[Gbl.RowEvenOdd], "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereIsAssessment ? Txt_YES : Indicators.ThereIsAssessment ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.ColorRows[Gbl.RowEvenOdd], "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereIsAssessment ? "" : Indicators.ThereIsAssessment ? "" :
Txt_NO, Txt_NO,
(Indicators.AssessmentSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (Indicators.AssessmentSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Txt_INFO_SRC_SHORT_TEXT[Indicators.AssessmentSrc], Txt_INFO_SRC_SHORT_TEXT[Indicators.AssessmentSrc],
(Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc]); Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc]);
break; break;
} }

View File

@ -112,20 +112,19 @@ void Mrk_GetAndWriteNumRowsHeaderAndFooter (Brw_FileType_t FileType,
struct MarksProperties Marks; struct MarksProperties Marks;
if (FileType == Brw_IS_FOLDER) if (FileType == Brw_IS_FOLDER)
fprintf (Gbl.F.Out,"<td style=\"background-color:%s;\"></td>" fprintf (Gbl.F.Out,"<td class=\"COLOR%u\"></td>"
"<td style=\"background-color:%s;\"></td>", "<td class=\"COLOR%u\"></td>",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
else // File or link else // File or link
{ {
/***** Get number of rows in header or footer *****/ /***** Get number of rows in header or footer *****/
Mrk_GetNumRowsHeaderAndFooter (&Marks); Mrk_GetNumRowsHeaderAndFooter (&Marks);
/***** Write the number of rows of header *****/ /***** Write the number of rows of header *****/
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
" style=\"background-color:%s;\">",
The_ClassFormNoWrap[Gbl.Prefs.Theme], The_ClassFormNoWrap[Gbl.Prefs.Theme],
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
if (Gbl.CurrentCrs.Grps.GrpCod > 0) // Group zone if (Gbl.CurrentCrs.Grps.GrpCod > 0) // Group zone
{ {
@ -138,22 +137,21 @@ void Mrk_GetAndWriteNumRowsHeaderAndFooter (Brw_FileType_t FileType,
fprintf (Gbl.F.Out,"&nbsp;%s: " fprintf (Gbl.F.Out,"&nbsp;%s: "
"<input type=\"text\" name=\"%s\"" "<input type=\"text\" name=\"%s\""
" size=\"1\" maxlength=\"5\" value=\"%u\"" " size=\"1\" maxlength=\"5\" value=\"%u\""
" class=\"%s\" style=\"background-color:%s\"" " class=\"%s COLOR%u\""
" onchange=\"javascript:document.getElementById('%s').submit();\" />", " onchange=\"javascript:document.getElementById('%s').submit();\" />",
Txt_TABLE_Header, Txt_TABLE_Header,
Mrk_HeadOrFootStr[Brw_HEADER],Marks.Header, Mrk_HeadOrFootStr[Brw_HEADER],Marks.Header,
Gbl.FileBrowser.InputStyle, Gbl.FileBrowser.InputStyle,
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.FormId); Gbl.FormId);
Brw_ParamListFiles (FileType,PathInTree,FileName); Brw_ParamListFiles (FileType,PathInTree,FileName);
Act_FormEnd (); Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/***** Write the number of rows of footer *****/ /***** Write the number of rows of footer *****/
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
" style=\"background-color:%s;\">",
The_ClassFormNoWrap[Gbl.Prefs.Theme], The_ClassFormNoWrap[Gbl.Prefs.Theme],
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
if (Gbl.CurrentCrs.Grps.GrpCod > 0) // Group zone if (Gbl.CurrentCrs.Grps.GrpCod > 0) // Group zone
{ {
@ -166,12 +164,12 @@ void Mrk_GetAndWriteNumRowsHeaderAndFooter (Brw_FileType_t FileType,
fprintf (Gbl.F.Out,"&nbsp;%s: " fprintf (Gbl.F.Out,"&nbsp;%s: "
"<input type=\"text\" name=\"%s\"" "<input type=\"text\" name=\"%s\""
" size=\"1\" maxlength=\"5\" value=\"%u\"" " size=\"1\" maxlength=\"5\" value=\"%u\""
" class=\"%s\" style=\"background-color:%s\"" " class=\"%s COLOR%u\""
" onchange=\"javascript:document.getElementById('%s').submit();\" />", " onchange=\"javascript:document.getElementById('%s').submit();\" />",
Txt_TABLE_Footer, Txt_TABLE_Footer,
Mrk_HeadOrFootStr[Brw_FOOTER],Marks.Footer, Mrk_HeadOrFootStr[Brw_FOOTER],Marks.Footer,
Gbl.FileBrowser.InputStyle, Gbl.FileBrowser.InputStyle,
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.FormId); Gbl.FormId);
Brw_ParamListFiles (FileType,PathInTree,FileName); Brw_ParamListFiles (FileType,PathInTree,FileName);
Act_FormEnd (); Act_FormEnd ();

View File

@ -1999,16 +1999,14 @@ static void Pho_ShowOrPrintListDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint)
/***** Show logo and name of this degree *****/ /***** Show logo and name of this degree *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"DAT RIGHT_MIDDLE\"" "<td class=\"DAT RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"%u" "%u"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd],++NumDegsNotEmpty); Gbl.RowEvenOdd,++NumDegsNotEmpty);
/***** Show logo and name of this degree *****/ /***** Show logo and name of this degree *****/
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
if (SeeOrPrint == Pho_DEGREES_SEE) if (SeeOrPrint == Pho_DEGREES_SEE)
fprintf (Gbl.F.Out,"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">", fprintf (Gbl.F.Out,"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
Deg.WWW,Deg.FullName); Deg.WWW,Deg.FullName);
@ -2026,9 +2024,8 @@ static void Pho_ShowOrPrintListDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint)
{ {
/***** Show average photo of students belonging to this degree *****/ /***** Show average photo of students belonging to this degree *****/
Pho_GetNumStdsInDegree (Deg.DegCod,Sex,&NumStds,&NumStdsWithPhoto); Pho_GetNumStdsInDegree (Deg.DegCod,Sex,&NumStds,&NumStdsWithPhoto);
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
if (Gbl.Usrs.Listing.WithPhotos) if (Gbl.Usrs.Listing.WithPhotos)
Pho_ShowDegreeAvgPhotoAndStat (&Deg,SeeOrPrint,Sex,NumStds,NumStdsWithPhoto,&DateAvgPhoto); Pho_ShowDegreeAvgPhotoAndStat (&Deg,SeeOrPrint,Sex,NumStds,NumStdsWithPhoto,&DateAvgPhoto);
else else

View File

@ -1318,10 +1318,13 @@ void Prf_ShowRankingFigure (const char *Query)
/***** Show row *****/ /***** Show row *****/
fprintf (Gbl.F.Out,"<tr>"); fprintf (Gbl.F.Out,"<tr>");
Prf_ShowUsrInRanking (&UsrDat,Rank); Prf_ShowUsrInRanking (&UsrDat,Rank);
fprintf (Gbl.F.Out,"<td class=\"RIGHT_MIDDLE\" style=\"height:40px;" fprintf (Gbl.F.Out,"<td class=\"RIGHT_MIDDLE COLOR%u\""
" background-color:%s;\">%ld</td>" " style=\"height:40px;\">"
"%ld"
"</td>"
"</tr>", "</tr>",
Gbl.ColorRows[Gbl.RowEvenOdd],Figure); Gbl.RowEvenOdd,
Figure);
} }
fprintf (Gbl.F.Out,"</table>"); fprintf (Gbl.F.Out,"</table>");
@ -1460,9 +1463,9 @@ void Prf_GetAndShowRankingClicksPerDay (void)
/***** Show row *****/ /***** Show row *****/
fprintf (Gbl.F.Out,"<tr>"); fprintf (Gbl.F.Out,"<tr>");
Prf_ShowUsrInRanking (&UsrDat,Rank); Prf_ShowUsrInRanking (&UsrDat,Rank);
fprintf (Gbl.F.Out,"<td class=\"RIGHT_MIDDLE\" style=\"height:40px;" fprintf (Gbl.F.Out,"<td class=\"RIGHT_MIDDLE COLOR%u\""
" background-color:%s;\">", " style=\"height:40px;\">",
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
Str_WriteFloatNum (NumClicksPerDay); Str_WriteFloatNum (NumClicksPerDay);
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"</tr>"); "</tr>");
@ -1489,15 +1492,15 @@ void Prf_ShowUsrInRanking (const struct UsrData *UsrDat,unsigned Rank)
char PhotoURL[PATH_MAX+1]; char PhotoURL[PATH_MAX+1];
bool Visible = Pri_ShowIsAllowed (UsrDat->ProfileVisibility,UsrDat->UsrCod); bool Visible = Pri_ShowIsAllowed (UsrDat->ProfileVisibility,UsrDat->UsrCod);
fprintf (Gbl.F.Out,"<td class=\"RANK RIGHT_MIDDLE\" style=\"height:40px;" fprintf (Gbl.F.Out,"<td class=\"RANK RIGHT_MIDDLE COLOR%u\""
" background-color:%s;\">" " style=\"height:40px;\">"
"#%u" "#%u"
"</td>" "</td>"
"<td style=\"width:28px; height:40px;" "<td class=\"COLOR%u\""
" background-color:%s;\">", " style=\"width:28px; height:40px;\">",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Rank, Rank,
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
/***** Check if I can see the public profile *****/ /***** Check if I can see the public profile *****/
if (Visible) if (Visible)
@ -1510,8 +1513,8 @@ void Prf_ShowUsrInRanking (const struct UsrData *UsrDat,unsigned Rank)
} }
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"<td style=\"height:40px; background-color:%s;\">", "<td class=\"COLOR%u\" style=\"height:40px;\">",
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
/***** Put form to go to public profile *****/ /***** Put form to go to public profile *****/
if (Visible) if (Visible)

View File

@ -1567,12 +1567,12 @@ void Rec_ShowCrsRecord (Rec_RecordViewType_t TypeOfView,struct UsrData *UsrDat)
/* Name of the field */ /* Name of the field */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s LEFT_TOP\"" "<td class=\"%s LEFT_TOP COLOR%u\""
" style=\"width:%upx; background-color:%s;\">" " style=\"width:%upx;\">"
"%s:", "%s:",
ICanEdit ? The_ClassForm[Gbl.Prefs.Theme] : ICanEdit ? The_ClassForm[Gbl.Prefs.Theme] :
"DAT_REC_SMALL", "DAT_REC_SMALL",
Col1Width,Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,Col1Width,
Gbl.CurrentCrs.Records.LstFields.Lst[NumField].Name); Gbl.CurrentCrs.Records.LstFields.Lst[NumField].Name);
if (TypeOfView == Rec_RECORD_LIST) if (TypeOfView == Rec_RECORD_LIST)
fprintf (Gbl.F.Out,"<span class=\"DAT_SMALL\"> (%s)</span>", fprintf (Gbl.F.Out,"<span class=\"DAT_SMALL\"> (%s)</span>",
@ -1589,9 +1589,9 @@ void Rec_ShowCrsRecord (Rec_RecordViewType_t TypeOfView,struct UsrData *UsrDat)
ThisFieldHasText = false; ThisFieldHasText = false;
/***** Write form, text, or nothing depending on the user's role and the visibility of the field... */ /***** Write form, text, or nothing depending on the user's role and the visibility of the field... */
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP\" style=\"width:%upx;" fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP COLOR%u\""
" background-color:%s;\">", " style=\"width:%upx;\">",
ClassData,Col2Width,Gbl.ColorRows[Gbl.RowEvenOdd]); ClassData,Gbl.RowEvenOdd,Col2Width);
if (ICanEdit) // Show with form if (ICanEdit) // Show with form
{ {
fprintf (Gbl.F.Out,"<textarea name=\"Field%ld\" rows=\"%u\"" fprintf (Gbl.F.Out,"<textarea name=\"Field%ld\" rows=\"%u\""

View File

@ -1613,39 +1613,34 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
/* Write the number of row */ /* Write the number of row */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"LOG RIGHT_TOP\"" "<td class=\"LOG RIGHT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%ld&nbsp;" "%ld&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd],NumRow); Gbl.RowEvenOdd,NumRow);
/* Write the user's ID if user is a student */ /* Write the user's ID if user is a student */
fprintf (Gbl.F.Out,"<td class=\"LOG CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LOG CENTER_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
ID_WriteUsrIDs (&UsrDat,(RoleFromLog == Rol_STUDENT)); ID_WriteUsrIDs (&UsrDat,(RoleFromLog == Rol_STUDENT));
fprintf (Gbl.F.Out,"&nbsp;</td>"); fprintf (Gbl.F.Out,"&nbsp;</td>");
/* Write the first name and the surnames */ /* Write the first name and the surnames */
fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s&nbsp;" "%s&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd],UsrDat.FullName); Gbl.RowEvenOdd,UsrDat.FullName);
/* Write the user's role */ /* Write the user's role */
fprintf (Gbl.F.Out,"<td class=\"LOG CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LOG CENTER_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s&nbsp;" "%s&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
RoleFromLog < Rol_NUM_ROLES ? Txt_ROLES_SINGUL_Abc[RoleFromLog][UsrDat.Sex] : RoleFromLog < Rol_NUM_ROLES ? Txt_ROLES_SINGUL_Abc[RoleFromLog][UsrDat.Sex] :
"?"); "?");
/* Write the date (in row[3] is the date in YYYYMMDDHHMMSS format) */ /* Write the date (in row[3] is the date in YYYYMMDDHHMMSS format) */
fprintf (Gbl.F.Out,"<td class=\"LOG CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LOG CENTER_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
Dat_WriteDate (row[3]); Dat_WriteDate (row[3]);
fprintf (Gbl.F.Out,"&nbsp;"); fprintf (Gbl.F.Out,"&nbsp;");
Dat_WriteHourMinute (&row[3][8]); Dat_WriteHourMinute (&row[3][8]);
@ -1656,22 +1651,19 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
if (sscanf (row[4],"%ld",&ActCod) != 1) if (sscanf (row[4],"%ld",&ActCod) != 1)
Lay_ShowErrorAndExit ("Wrong action code."); Lay_ShowErrorAndExit ("Wrong action code.");
if (ActCod >= 0) if (ActCod >= 0)
fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s&nbsp;" "%s&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Act_GetActionTextFromDB (ActCod,ActTxt)); Act_GetActionTextFromDB (ActCod,ActTxt));
else else
fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"?&nbsp;" "?&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
/* Write the comments of the access */ /* Write the comments of the access */
fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
Sta_WriteLogComments (LogCod); Sta_WriteLogComments (LogCod);
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"</tr>"); "</tr>");
@ -1770,16 +1762,14 @@ static void Sta_ShowNumAccessesPerUsr (unsigned long NumRows,MYSQL_RES *mysql_re
/* Write the number of row */ /* Write the number of row */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"LOG RIGHT_TOP\"" "<td class=\"LOG RIGHT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%ld&nbsp;" "%ld&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd],NumRow); Gbl.RowEvenOdd,NumRow);
/* Show the photo */ /* Show the photo */
fprintf (Gbl.F.Out,"<td class=\"CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"CENTER_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
@ -1787,25 +1777,22 @@ static void Sta_ShowNumAccessesPerUsr (unsigned long NumRows,MYSQL_RES *mysql_re
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write the user's ID if user is a student in current course */ /* Write the user's ID if user is a student in current course */
fprintf (Gbl.F.Out,"<td class=\"LOG CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LOG CENTER_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
ID_WriteUsrIDs (&UsrDat,(UsrDat.RoleInCurrentCrsDB == Rol_STUDENT)); ID_WriteUsrIDs (&UsrDat,(UsrDat.RoleInCurrentCrsDB == Rol_STUDENT));
fprintf (Gbl.F.Out,"&nbsp;</td>"); fprintf (Gbl.F.Out,"&nbsp;</td>");
/* Write the name and the surnames */ /* Write the name and the surnames */
fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s&nbsp;" "%s&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd],UsrDat.FullName); Gbl.RowEvenOdd,UsrDat.FullName);
/* Write user's role */ /* Write user's role */
fprintf (Gbl.F.Out,"<td class=\"LOG CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LOG CENTER_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s&nbsp;" "%s&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Txt_ROLES_SINGUL_Abc[UsrDat.RoleInCurrentCrsDB][UsrDat.Sex]); Txt_ROLES_SINGUL_Abc[UsrDat.RoleInCurrentCrsDB][UsrDat.Sex]);
/* Write the number of clicks */ /* Write the number of clicks */
@ -1820,9 +1807,8 @@ static void Sta_ShowNumAccessesPerUsr (unsigned long NumRows,MYSQL_RES *mysql_re
} }
else else
BarWidth = 0; BarWidth = 0;
fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
if (BarWidth) if (BarWidth)
fprintf (Gbl.F.Out,"<img src=\"%s/%c1x14.gif\"" fprintf (Gbl.F.Out,"<img src=\"%s/%c1x14.gif\""
" alt=\"\" title=\"\"" " alt=\"\" title=\"\""

View File

@ -345,15 +345,14 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh
/***** Start date/time *****/ /***** Start date/time *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s LEFT_TOP\"", "<td class=\"%s LEFT_TOP",
Svy.Status.Visible ? (Svy.Status.Open ? "DATE_GREEN" : Svy.Status.Visible ? (Svy.Status.Open ? "DATE_GREEN" :
"DATE_RED") : "DATE_RED") :
(Svy.Status.Open ? "DATE_GREEN_LIGHT" : (Svy.Status.Open ? "DATE_GREEN_LIGHT" :
"DATE_RED_LIGHT")); "DATE_RED_LIGHT"));
if (!ShowOnlyThisSvyComplete) if (!ShowOnlyThisSvyComplete)
fprintf (Gbl.F.Out," style=\"background-color:%s;\"", fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]); fprintf (Gbl.F.Out,"\">"
fprintf (Gbl.F.Out,">"
"%02u/%02u/%02u<br />" "%02u/%02u/%02u<br />"
"%02u:%02u h" "%02u:%02u h"
"</td>", "</td>",
@ -364,15 +363,14 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh
Svy.DateTimes[Svy_START_TIME].Time.Minute); Svy.DateTimes[Svy_START_TIME].Time.Minute);
/***** End date/time *****/ /***** End date/time *****/
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP\"", fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP",
Svy.Status.Visible ? (Svy.Status.Open ? "DATE_GREEN" : Svy.Status.Visible ? (Svy.Status.Open ? "DATE_GREEN" :
"DATE_RED") : "DATE_RED") :
(Svy.Status.Open ? "DATE_GREEN_LIGHT" : (Svy.Status.Open ? "DATE_GREEN_LIGHT" :
"DATE_RED_LIGHT")); "DATE_RED_LIGHT"));
if (!ShowOnlyThisSvyComplete) if (!ShowOnlyThisSvyComplete)
fprintf (Gbl.F.Out," style=\"background-color:%s;\"", fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]); fprintf (Gbl.F.Out,"\">"
fprintf (Gbl.F.Out,">"
"%02u/%02u/%02u<br />" "%02u/%02u/%02u<br />"
"%02u:%02u h" "%02u:%02u h"
"</td>", "</td>",
@ -383,11 +381,10 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh
Svy.DateTimes[Svy_END_TIME ].Time.Minute); Svy.DateTimes[Svy_END_TIME ].Time.Minute);
/***** Survey title *****/ /***** Survey title *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP\""); fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP");
if (!ShowOnlyThisSvyComplete) if (!ShowOnlyThisSvyComplete)
fprintf (Gbl.F.Out," style=\"background-color:%s;\"", fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]); fprintf (Gbl.F.Out,"\">");
fprintf (Gbl.F.Out,">");
/* Put form to view survey */ /* Put form to view survey */
Act_FormStart (ActSeeOneSvy); Act_FormStart (ActSeeOneSvy);
@ -413,22 +410,20 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh
Svy.NumUsrs); Svy.NumUsrs);
/***** Status of the survey *****/ /***** Status of the survey *****/
fprintf (Gbl.F.Out,"<td rowspan=\"2\" class=\"LEFT_TOP\""); fprintf (Gbl.F.Out,"<td rowspan=\"2\" class=\"LEFT_TOP");
if (!ShowOnlyThisSvyComplete) if (!ShowOnlyThisSvyComplete)
fprintf (Gbl.F.Out," style=\"background-color:%s;\"", fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]); fprintf (Gbl.F.Out,"\">");
fprintf (Gbl.F.Out,">");
Svy_WriteStatus (&Svy); Svy_WriteStatus (&Svy);
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"</tr>"); "</tr>");
/***** Write second row of data of this survey *****/ /***** Write second row of data of this survey *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\" class=\"LEFT_TOP\""); "<td colspan=\"2\" class=\"LEFT_TOP");
if (!ShowOnlyThisSvyComplete) if (!ShowOnlyThisSvyComplete)
fprintf (Gbl.F.Out," style=\"background-color:%s;\"", fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]); fprintf (Gbl.F.Out,"\">");
fprintf (Gbl.F.Out,">");
/* Author of the survey */ /* Author of the survey */
Svy_WriteAuthor (&Svy); Svy_WriteAuthor (&Svy);
@ -438,10 +433,9 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh
Svy_PutFormsToRemEditOneSvy (Svy.SvyCod,Svy.Status.Visible); Svy_PutFormsToRemEditOneSvy (Svy.SvyCod,Svy.Status.Visible);
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"<td style=\"text-align:left; vertical-align:top;"); "<td class=\"LEFT_TOP");
if (!ShowOnlyThisSvyComplete) if (!ShowOnlyThisSvyComplete)
fprintf (Gbl.F.Out," background-color:%s;", fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
fprintf (Gbl.F.Out,"\">"); fprintf (Gbl.F.Out,"\">");
/* Scope of the survey */ /* Scope of the survey */
@ -511,8 +505,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh
} }
else else
{ {
fprintf (Gbl.F.Out," style=\"background-color:%s;\">", fprintf (Gbl.F.Out," class=\"COLOR%u\">",Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
/* Possible button to answer this survey */ /* Possible button to answer this survey */
if (Svy.Status.ICanAnswer) if (Svy.Status.ICanAnswer)
@ -2987,8 +2980,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ
if (Svy->Status.ICanEdit) if (Svy->Status.ICanEdit)
{ {
/* Write icon to remove the question */ /* Write icon to remove the question */
fprintf (Gbl.F.Out,"<td class=\"BT%u\">", fprintf (Gbl.F.Out,"<td class=\"BT%u\">",Gbl.RowEvenOdd);
Gbl.RowEvenOdd);
Act_FormStart (ActRemSvyQst); Act_FormStart (ActRemSvyQst);
Svy_PutParamSvyCod (Svy->SvyCod); Svy_PutParamSvyCod (Svy->SvyCod);
Svy_PutParamQstCod (SvyQst->QstCod); Svy_PutParamQstCod (SvyQst->QstCod);
@ -2999,8 +2991,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write icon to edit the question */ /* Write icon to edit the question */
fprintf (Gbl.F.Out,"<td class=\"BT%u\">", fprintf (Gbl.F.Out,"<td class=\"BT%u\">",Gbl.RowEvenOdd);
Gbl.RowEvenOdd);
Act_FormStart (ActEdiOneSvyQst); Act_FormStart (ActEdiOneSvyQst);
Svy_PutParamSvyCod (Svy->SvyCod); Svy_PutParamSvyCod (Svy->SvyCod);
Svy_PutParamQstCod (SvyQst->QstCod); Svy_PutParamQstCod (SvyQst->QstCod);
@ -3016,18 +3007,16 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ
/* Write index of question inside survey (row[1]) */ /* Write index of question inside survey (row[1]) */
if (sscanf (row[1],"%u",&(SvyQst->QstInd)) != 1) if (sscanf (row[1],"%u",&(SvyQst->QstInd)) != 1)
Lay_ShowErrorAndExit ("Error: wrong question index."); Lay_ShowErrorAndExit ("Error: wrong question index.");
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%u" "%u"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd],SvyQst->QstInd+1); Gbl.RowEvenOdd,SvyQst->QstInd+1);
/* Write the question type (row[2]) */ /* Write the question type (row[2]) */
SvyQst->AnswerType = Svy_ConvertFromStrAnsTypDBToAnsTyp (row[2]); SvyQst->AnswerType = Svy_ConvertFromStrAnsTypDBToAnsTyp (row[2]);
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s", "%s",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Txt_SURVEY_STR_ANSWER_TYPES[SvyQst->AnswerType]); Txt_SURVEY_STR_ANSWER_TYPES[SvyQst->AnswerType]);
/* Write the stem (row[3]) */ /* Write the stem (row[3]) */
@ -3114,12 +3103,11 @@ static void Svy_WriteQstStem (const char *Stem,const char *TextStyle)
HeadingRigorousHTML,LengthHeading,false); HeadingRigorousHTML,LengthHeading,false);
/* Write the stem */ /* Write the stem */
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"<div style=\"text-align:justify;\">" "<div style=\"text-align:justify;\">"
"<tt>%s</tt>" "<tt>%s</tt>"
"</div>", "</div>",
TextStyle,Gbl.ColorRows[Gbl.RowEvenOdd],HeadingRigorousHTML); TextStyle,Gbl.RowEvenOdd,HeadingRigorousHTML);
/* Free memory allocated for the stem */ /* Free memory allocated for the stem */
free ((void *) HeadingRigorousHTML); free ((void *) HeadingRigorousHTML);

View File

@ -547,9 +547,9 @@ static void Syl_ShowRowSyllabus (Inf_InfoType_t InfoType,unsigned NumItem,int Le
if (Gbl.CurrentCrs.Syllabus.EditionIsActive) if (Gbl.CurrentCrs.Syllabus.EditionIsActive)
{ {
if (NewItem) if (NewItem)
fprintf (Gbl.F.Out,"<td colspan=\"5\" style=\"background-color:%s;\">" fprintf (Gbl.F.Out,"<td colspan=\"5\" class=\"COLOR%u\">"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
else else
{ {
/***** Icon to remove the row *****/ /***** Icon to remove the row *****/
@ -681,32 +681,32 @@ static void Syl_ShowRowSyllabus (Inf_InfoType_t InfoType,unsigned NumItem,int Le
} }
if (Gbl.CurrentCrs.Syllabus.EditionIsActive) if (Gbl.CurrentCrs.Syllabus.EditionIsActive)
Syl_PutFormItemSyllabus (InfoType,NewItem,NumItem,Level,CodItem,Text,Gbl.ColorRows[Gbl.RowEvenOdd]); Syl_PutFormItemSyllabus (InfoType,NewItem,NumItem,Level,CodItem,Text,
Gbl.ColorRows[Gbl.RowEvenOdd]);
else else
{ {
/***** Indent depending on the level *****/ /***** Indent depending on the level *****/
if (Level > 1) if (Level > 1)
fprintf (Gbl.F.Out,"<td colspan=\"%d\" style=\"background-color:%s;\">" fprintf (Gbl.F.Out,"<td colspan=\"%d\" class=\"COLOR%u\">"
"</td>", "</td>",
Level - 1,Gbl.ColorRows[Gbl.RowEvenOdd]); Level - 1,Gbl.RowEvenOdd);
/***** Code of the item *****/ /***** Code of the item *****/
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\""
" style=\"width:%dpx; background-color:%s;\">", " style=\"width:%dpx;\">",
StyleSyllabus[Level], StyleSyllabus[Level],Gbl.RowEvenOdd,
Level * Syl_WIDTH_NUM_SYLLABUS,Gbl.ColorRows[Gbl.RowEvenOdd]); Level * Syl_WIDTH_NUM_SYLLABUS);
if (Level == 1) if (Level == 1)
fprintf (Gbl.F.Out,"&nbsp;"); fprintf (Gbl.F.Out,"&nbsp;");
fprintf (Gbl.F.Out,"%s&nbsp;</td>",StrItemCod); fprintf (Gbl.F.Out,"%s&nbsp;</td>",StrItemCod);
/***** Text of the item *****/ /***** Text of the item *****/
fprintf (Gbl.F.Out,"<td colspan=\"%d\" class=\"%s LEFT_TOP\"" fprintf (Gbl.F.Out,"<td colspan=\"%d\" class=\"%s LEFT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>", "</td>",
LstItemsSyllabus.NumLevels - Level + 1, LstItemsSyllabus.NumLevels - Level + 1,
StyleSyllabus[Level], StyleSyllabus[Level],
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Text); Text);
} }

View File

@ -894,20 +894,18 @@ static void Tst_ShowTstResultAfterAssess (long TstCod,unsigned *NumQstsNotBlank,
else else
/***** Question does not exists *****/ /***** Question does not exists *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"DAT_LIGHT RIGHT_TOP\"" "<td class=\"DAT_LIGHT RIGHT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%u.&nbsp;" "%u.&nbsp;"
"</td>" "</td>"
"<td style=\"background-color:%s;\">" "<td class=\"COLOR%u\">"
"</td>" "</td>"
"<td class=\"DAT_LIGHT LEFT_TOP\"" "<td class=\"DAT_LIGHT LEFT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"</tr>", "</tr>",
Gbl.ColorRows[Gbl.RowEvenOdd],NumQst + 1, Gbl.RowEvenOdd,NumQst + 1,
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.ColorRows[Gbl.RowEvenOdd],Txt_Question_removed); Gbl.RowEvenOdd,Txt_Question_removed);
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
@ -936,26 +934,23 @@ static void Tst_WriteQstAndAnsExam (unsigned NumQst,long QstCod,MYSQL_ROW row,
/***** Write number of question *****/ /***** Write number of question *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"DAT_N RIGHT_TOP\"" "<td class=\"DAT_N RIGHT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%u.&nbsp;" "%u.&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
NumQst + 1); NumQst + 1);
/***** Write answer type (row[2]) *****/ /***** Write answer type (row[2]) *****/
Gbl.Test.AnswerType = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[2]); Gbl.Test.AnswerType = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[2]);
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL LEFT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s&nbsp;" "%s&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Txt_TST_STR_ANSWER_TYPES[Gbl.Test.AnswerType]); Txt_TST_STR_ANSWER_TYPES[Gbl.Test.AnswerType]);
/***** Write stem (row[4]), answers depending on shuffle (row[3]) and feedback (row[5]) *****/ /***** Write stem (row[4]), answers depending on shuffle (row[3]) and feedback (row[5]) *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
Tst_WriteQstStem (row[4],"TEST_EXA"); Tst_WriteQstStem (row[4],"TEST_EXA");
if (Gbl.CurrentAct == ActSeeTst) if (Gbl.CurrentAct == ActSeeTst)
Tst_WriteAnswersOfAQstSeeExam (NumQst,QstCod,(Str_ConvertToUpperLetter (row[3][0]) == 'Y')); Tst_WriteAnswersOfAQstSeeExam (NumQst,QstCod,(Str_ConvertToUpperLetter (row[3][0]) == 'Y'));
@ -2483,8 +2478,7 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m
/* Write icon to remove the question */ /* Write icon to remove the question */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"BT%u\">", "<td class=\"BT%u\">",Gbl.RowEvenOdd);
Gbl.RowEvenOdd);
Act_FormStart (ActRemTstQst); Act_FormStart (ActRemTstQst);
Sta_WriteParamsDatesSeeAccesses (); Sta_WriteParamsDatesSeeAccesses ();
Tst_WriteParamEditQst (); Tst_WriteParamEditQst ();
@ -2497,8 +2491,7 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write icon to edit the question */ /* Write icon to edit the question */
fprintf (Gbl.F.Out,"<td class=\"BT%u\">", fprintf (Gbl.F.Out,"<td class=\"BT%u\">",Gbl.RowEvenOdd);
Gbl.RowEvenOdd);
Act_FormStart (ActEdiOneTstQst); Act_FormStart (ActEdiOneTstQst);
Par_PutHiddenParamLong ("QstCod",QstCod); Par_PutHiddenParamLong ("QstCod",QstCod);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/edit16x16.gif\"" fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/edit16x16.gif\""
@ -2510,48 +2503,42 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write number of question */ /* Write number of question */
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%lu&nbsp;" "%lu&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd],NumRow + 1); Gbl.RowEvenOdd,NumRow + 1);
/* Write question code */ /* Write question code */
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%ld&nbsp;" "%ld&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd],QstCod); Gbl.RowEvenOdd,QstCod);
/* Write the date (row[1] has the date in format YYYYMMDDHHMMSS) */ /* Write the date (row[1] has the date in format YYYYMMDDHHMMSS) */
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
Dat_WriteDate (row[1]); Dat_WriteDate (row[1]);
fprintf (Gbl.F.Out,"<br />"); fprintf (Gbl.F.Out,"<br />");
Dat_WriteHourMinute (&row[1][8]); Dat_WriteHourMinute (&row[1][8]);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write the question tags */ /* Write the question tags */
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
Tst_GetAndWriteTagsQst (QstCod); Tst_GetAndWriteTagsQst (QstCod);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write the question type (row[2]) */ /* Write the question type (row[2]) */
Gbl.Test.AnswerType = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[2]); Gbl.Test.AnswerType = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[2]);
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s&nbsp;" "%s&nbsp;"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Txt_TST_STR_ANSWER_TYPES[Gbl.Test.AnswerType]); Txt_TST_STR_ANSWER_TYPES[Gbl.Test.AnswerType]);
/* Write if shuffle is enabled (row[3]) */ /* Write if shuffle is enabled (row[3]) */
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
if (Gbl.Test.AnswerType == Tst_ANS_UNIQUE_CHOICE || if (Gbl.Test.AnswerType == Tst_ANS_UNIQUE_CHOICE ||
Gbl.Test.AnswerType == Tst_ANS_MULTIPLE_CHOICE) Gbl.Test.AnswerType == Tst_ANS_MULTIPLE_CHOICE)
{ {
@ -2573,9 +2560,8 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write the stem (row[4]), the feedback (row[5]) and the answers */ /* Write the stem (row[4]), the feedback (row[5]) and the answers */
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
Tst_WriteQstStem (row[4],"TEST_EDI"); Tst_WriteQstStem (row[4],"TEST_EDI");
Tst_WriteQstFeedback (row[5],"TEST_EDI_LIGHT"); Tst_WriteQstFeedback (row[5],"TEST_EDI_LIGHT");
Tst_WriteAnswersOfAQstEdit (QstCod); Tst_WriteAnswersOfAQstEdit (QstCod);
@ -2596,16 +2582,14 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m
setlocale (LC_NUMERIC,"es_ES.utf8"); // Return to spanish system (TODO: this should be internationalized!!!!!!!) setlocale (LC_NUMERIC,"es_ES.utf8"); // Return to spanish system (TODO: this should be internationalized!!!!!!!)
/* Write number of times this question has been answered */ /* Write number of times this question has been answered */
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%lu" "%lu"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd],NumHitsThisQst); Gbl.RowEvenOdd,NumHitsThisQst);
/* Write average score */ /* Write average score */
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
if (NumHitsThisQst) if (NumHitsThisQst)
fprintf (Gbl.F.Out,"%.2f",TotalScoreThisQst / fprintf (Gbl.F.Out,"%.2f",TotalScoreThisQst /
(double) NumHitsThisQst); (double) NumHitsThisQst);
@ -2614,17 +2598,15 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write number of times this question has been answered (not blank) */ /* Write number of times this question has been answered (not blank) */
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%lu" "%lu"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
NumHitsNotBlankThisQst); NumHitsNotBlankThisQst);
/* Write average score (not blank) */ /* Write average score (not blank) */
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL CENTER_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
if (NumHitsNotBlankThisQst) if (NumHitsNotBlankThisQst)
fprintf (Gbl.F.Out,"%.2f",TotalScoreThisQst / fprintf (Gbl.F.Out,"%.2f",TotalScoreThisQst /
(double) NumHitsNotBlankThisQst); (double) NumHitsNotBlankThisQst);
@ -6231,9 +6213,8 @@ static void Tst_ShowResultsOfTestExams (struct UsrData *UsrDat)
fprintf (Gbl.F.Out,"<tr>"); fprintf (Gbl.F.Out,"<tr>");
/* Write date and time (row[2] holds date and time in YYYYMMDDHHMMSS format) */ /* Write date and time (row[2] holds date and time in YYYYMMDDHHMMSS format) */
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", ClassDat,Gbl.RowEvenOdd);
ClassDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
Dat_WriteDate (row[2]); Dat_WriteDate (row[2]);
fprintf (Gbl.F.Out,"&nbsp;"); fprintf (Gbl.F.Out,"&nbsp;");
Dat_WriteHourMinute (&row[2][8]); Dat_WriteHourMinute (&row[2][8]);
@ -6269,33 +6250,29 @@ static void Tst_ShowResultsOfTestExams (struct UsrData *UsrDat)
setlocale (LC_NUMERIC,"es_ES.utf8"); // Return to spanish system (TODO: this should be internationalized!!!!!!!) setlocale (LC_NUMERIC,"es_ES.utf8"); // Return to spanish system (TODO: this should be internationalized!!!!!!!)
/* Write number of questions */ /* Write number of questions */
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", ClassDat,Gbl.RowEvenOdd);
ClassDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
if (ICanViewExam) if (ICanViewExam)
fprintf (Gbl.F.Out,"%u",NumQstsInThisExam); fprintf (Gbl.F.Out,"%u",NumQstsInThisExam);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write number of questions not blank */ /* Write number of questions not blank */
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", ClassDat,Gbl.RowEvenOdd);
ClassDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
if (ICanViewExam) if (ICanViewExam)
fprintf (Gbl.F.Out,"%u",NumQstsNotBlankInThisExam); fprintf (Gbl.F.Out,"%u",NumQstsNotBlankInThisExam);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write score */ /* Write score */
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", ClassDat,Gbl.RowEvenOdd);
ClassDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
if (ICanViewScore) if (ICanViewScore)
fprintf (Gbl.F.Out,"%.2lf",ScoreInThisExam); fprintf (Gbl.F.Out,"%.2lf",ScoreInThisExam);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write average score per question */ /* Write average score per question */
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", ClassDat,Gbl.RowEvenOdd);
ClassDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
if (ICanViewScore) if (ICanViewScore)
fprintf (Gbl.F.Out,"%.2lf", fprintf (Gbl.F.Out,"%.2lf",
NumQstsInThisExam ? ScoreInThisExam / (double) NumQstsInThisExam : NumQstsInThisExam ? ScoreInThisExam / (double) NumQstsInThisExam :
@ -6303,9 +6280,8 @@ static void Tst_ShowResultsOfTestExams (struct UsrData *UsrDat)
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write score over Tst_SCORE_MAX */ /* Write score over Tst_SCORE_MAX */
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", ClassDat,Gbl.RowEvenOdd);
ClassDat,Gbl.ColorRows[Gbl.RowEvenOdd]);
if (ICanViewScore) if (ICanViewScore)
fprintf (Gbl.F.Out,"%.2lf", fprintf (Gbl.F.Out,"%.2lf",
NumQstsInThisExam ? ScoreInThisExam * Tst_SCORE_MAX / (double) NumQstsInThisExam : NumQstsInThisExam ? ScoreInThisExam * Tst_SCORE_MAX / (double) NumQstsInThisExam :
@ -6313,9 +6289,8 @@ static void Tst_ShowResultsOfTestExams (struct UsrData *UsrDat)
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Link to show this exam */ /* Link to show this exam */
fprintf (Gbl.F.Out,"<td class=\"RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"RIGHT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
if (ICanViewExam) if (ICanViewExam)
{ {
Act_FormStart (Gbl.CurrentAct == ActSeeMyTstExa ? ActSeeOneTstExaMe : Act_FormStart (Gbl.CurrentAct == ActSeeMyTstExa ? ActSeeOneTstExaMe :
@ -6341,51 +6316,46 @@ static void Tst_ShowResultsOfTestExams (struct UsrData *UsrDat)
Gbl.Test.Config.FeedbackType != Tst_FEEDBACK_NOTHING); Gbl.Test.Config.FeedbackType != Tst_FEEDBACK_NOTHING);
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"DAT_N RIGHT_TOP\"" "<td class=\"DAT_N RIGHT_TOP COLOR%u\""
" style=\"background-color:%s;" " style=\"border-style:solid none none none;"
" border-style:solid none none none;"
" border-width:1px;\">" " border-width:1px;\">"
"%s: %u" "%s: %u"
"</td>", "</td>",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Txt_Visible_exams,NumExamsVisibleByTchs); Txt_Visible_exams,NumExamsVisibleByTchs);
/* Write total number of questions */ /* Write total number of questions */
fprintf (Gbl.F.Out,"<td class=\"DAT_N RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_N RIGHT_TOP COLOR%u\""
" style=\"background-color:%s;" " style=\"border-style:solid none none none;"
" border-style:solid none none none;"
" border-width:1px;\">", " border-width:1px;\">",
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
if (NumExamsVisibleByTchs) if (NumExamsVisibleByTchs)
fprintf (Gbl.F.Out,"%u",NumTotalQsts); fprintf (Gbl.F.Out,"%u",NumTotalQsts);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write total number of questions not blank */ /* Write total number of questions not blank */
fprintf (Gbl.F.Out,"<td class=\"DAT_N RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_N RIGHT_TOP COLOR%u\""
" style=\"background-color:%s;" " style=\"order-style:solid none none none;"
" border-style:solid none none none;"
" border-width:1px;\">", " border-width:1px;\">",
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
if (NumExamsVisibleByTchs) if (NumExamsVisibleByTchs)
fprintf (Gbl.F.Out,"%u",NumTotalQstsNotBlank); fprintf (Gbl.F.Out,"%u",NumTotalQstsNotBlank);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write total score */ /* Write total score */
fprintf (Gbl.F.Out,"<td class=\"DAT_N RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_N RIGHT_TOP COLOR%u\""
" style=\"background-color:%s;" " style=\"border-style:solid none none none;"
" border-style:solid none none none;"
" border-width:1px;\">", " border-width:1px;\">",
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
if (ICanViewScore) if (ICanViewScore)
fprintf (Gbl.F.Out,"%.2lf",TotalScoreOfAllExams); fprintf (Gbl.F.Out,"%.2lf",TotalScoreOfAllExams);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write average score per question */ /* Write average score per question */
fprintf (Gbl.F.Out,"<td class=\"DAT_N RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_N RIGHT_TOP COLOR%u\""
" style=\"background-color:%s;" " style=\"border-style:solid none none none;"
" border-style:solid none none none;"
" border-width:1px;\">", " border-width:1px;\">",
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
if (ICanViewScore) if (ICanViewScore)
fprintf (Gbl.F.Out,"%.2lf", fprintf (Gbl.F.Out,"%.2lf",
NumTotalQsts ? TotalScoreOfAllExams / (double) NumTotalQsts : NumTotalQsts ? TotalScoreOfAllExams / (double) NumTotalQsts :
@ -6393,11 +6363,10 @@ static void Tst_ShowResultsOfTestExams (struct UsrData *UsrDat)
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write score over Tst_SCORE_MAX */ /* Write score over Tst_SCORE_MAX */
fprintf (Gbl.F.Out,"<td class=\"DAT_N RIGHT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"DAT_N RIGHT_TOP COLOR%u\""
" style=\"background-color:%s;" " style=\"border-style:solid none none none;"
" border-style:solid none none none;"
" border-width:1px;\">", " border-width:1px;\">",
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
if (ICanViewScore) if (ICanViewScore)
fprintf (Gbl.F.Out,"%.2lf", fprintf (Gbl.F.Out,"%.2lf",
NumTotalQsts ? TotalScoreOfAllExams * Tst_SCORE_MAX / (double) NumTotalQsts : NumTotalQsts ? TotalScoreOfAllExams * Tst_SCORE_MAX / (double) NumTotalQsts :
@ -6405,26 +6374,26 @@ static void Tst_ShowResultsOfTestExams (struct UsrData *UsrDat)
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Last cell */ /* Last cell */
fprintf (Gbl.F.Out,"<td style=\"background-color:%s;\"></td>" fprintf (Gbl.F.Out,"<td class=\"COLOR%u\"></td>"
"</tr>", "</tr>",
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
} }
else else
fprintf (Gbl.F.Out,"<td style=\"background-color:%s;\"></td>" fprintf (Gbl.F.Out,"<td class=\"COLOR%u\"></td>"
"<td style=\"background-color:%s;\"></td>" "<td class=\"COLOR%u\"></td>"
"<td style=\"background-color:%s;\"></td>" "<td class=\"COLOR%u\"></td>"
"<td style=\"background-color:%s;\"></td>" "<td class=\"COLOR%u\"></td>"
"<td style=\"background-color:%s;\"></td>" "<td class=\"COLOR%u\"></td>"
"<td style=\"background-color:%s;\"></td>" "<td class=\"COLOR%u\"></td>"
"<td style=\"background-color:%s;\"></td>" "<td class=\"COLOR%u\"></td>"
"</tr>", "</tr>",
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.ColorRows[Gbl.RowEvenOdd]); Gbl.RowEvenOdd);
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
@ -6445,9 +6414,8 @@ static void Tst_ShowDataUsr (struct UsrData *UsrDat,unsigned NumExams)
fprintf (Gbl.F.Out,"<td "); fprintf (Gbl.F.Out,"<td ");
if (NumExams) if (NumExams)
fprintf (Gbl.F.Out,"rowspan=\"%u\"",NumExams + 1); fprintf (Gbl.F.Out,"rowspan=\"%u\"",NumExams + 1);
fprintf (Gbl.F.Out," class=\"LEFT_TOP\"" fprintf (Gbl.F.Out," class=\"LEFT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
@ -6458,11 +6426,10 @@ static void Tst_ShowDataUsr (struct UsrData *UsrDat,unsigned NumExams)
fprintf (Gbl.F.Out,"<td "); fprintf (Gbl.F.Out,"<td ");
if (NumExams) if (NumExams)
fprintf (Gbl.F.Out,"rowspan=\"%u\"",NumExams + 1); fprintf (Gbl.F.Out,"rowspan=\"%u\"",NumExams + 1);
fprintf (Gbl.F.Out," class=\"LEFT_TOP\"" fprintf (Gbl.F.Out," class=\"LEFT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
Act_FormStart (UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ? ActSeeRecOneStd : Act_FormStart (UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ? ActSeeRecOneStd :
ActSeeRecOneTch); ActSeeRecOneTch);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (UsrDat->FullName,"MSG_AUT"); Act_LinkFormSubmit (UsrDat->FullName,"MSG_AUT");
@ -6707,19 +6674,17 @@ static void Tst_ShowExamTstResult (const char *TstTime)
if (ThisQuestionHasBeenEdited) if (ThisQuestionHasBeenEdited)
/***** Question has been edited *****/ /***** Question has been edited *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"DAT_LIGHT RIGHT_TOP\"" "<td class=\"DAT_LIGHT RIGHT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%u.&nbsp;" "%u.&nbsp;"
"</td>" "</td>"
"<td style=\"background-color:%s;\"></td>" "<td class=\"COLOR%u\"></td>"
"<td class=\"DAT_LIGHT LEFT_TOP\"" "<td class=\"DAT_LIGHT LEFT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"</tr>", "</tr>",
Gbl.ColorRows[Gbl.RowEvenOdd],NumQst + 1, Gbl.RowEvenOdd,NumQst + 1,
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.ColorRows[Gbl.RowEvenOdd],Txt_Question_modified); Gbl.RowEvenOdd,Txt_Question_modified);
else else
{ {
/***** Get the code of question (row[0]) *****/ /***** Get the code of question (row[0]) *****/
@ -6735,19 +6700,17 @@ static void Tst_ShowExamTstResult (const char *TstTime)
else else
/***** Question does not exists *****/ /***** Question does not exists *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"DAT_LIGHT RIGHT_TOP\"" "<td class=\"DAT_LIGHT RIGHT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%u.&nbsp;" "%u.&nbsp;"
"</td>" "</td>"
"<td style=\"background-color:%s;\"></td>" "<td class=\"COLOR%u\"></td>"
"<td class=\"DAT_LIGHT LEFT_TOP\"" "<td class=\"DAT_LIGHT LEFT_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s" "%s"
"</td>" "</td>"
"</tr>", "</tr>",
Gbl.ColorRows[Gbl.RowEvenOdd],NumQst + 1, Gbl.RowEvenOdd,NumQst + 1,
Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.RowEvenOdd,
Gbl.ColorRows[Gbl.RowEvenOdd],Txt_Question_removed); Gbl.RowEvenOdd,Txt_Question_removed);
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);

View File

@ -1033,17 +1033,15 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem,
Txt_New_question); Txt_New_question);
/***** Write number of question *****/ /***** Write number of question *****/
fprintf (Gbl.F.Out,"<td class=\"%s CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s CENTER_TOP COLOR%u\">",
" style=\"background-color:%s;\">", ClassData,Gbl.RowEvenOdd);
ClassData,Gbl.ColorRows[Gbl.RowEvenOdd]);
if (!QuestionExists) if (!QuestionExists)
fprintf (Gbl.F.Out,"%u&nbsp;",++NumNonExistingQst); fprintf (Gbl.F.Out,"%u&nbsp;",++NumNonExistingQst);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/***** Write the question tags *****/ /***** Write the question tags *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
if (Gbl.Test.NumTags) if (Gbl.Test.NumTags)
{ {
/***** Write the tags *****/ /***** Write the tags *****/
@ -1070,17 +1068,15 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem,
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/***** Write the question type *****/ /***** Write the question type *****/
fprintf (Gbl.F.Out,"<td class=\"%s CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"%s CENTER_TOP COLOR%u\">"
" style=\"background-color:%s;\">"
"%s&nbsp;" "%s&nbsp;"
"</td>", "</td>",
ClassData,Gbl.ColorRows[Gbl.RowEvenOdd], ClassData,Gbl.RowEvenOdd,
Txt_TST_STR_ANSWER_TYPES[Gbl.Test.AnswerType]); Txt_TST_STR_ANSWER_TYPES[Gbl.Test.AnswerType]);
/***** Write if shuffle is enabled *****/ /***** Write if shuffle is enabled *****/
fprintf (Gbl.F.Out,"<td class=\"CENTER_TOP\"" fprintf (Gbl.F.Out,"<td class=\"CENTER_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
if (Gbl.Test.AnswerType == Tst_ANS_UNIQUE_CHOICE || if (Gbl.Test.AnswerType == Tst_ANS_UNIQUE_CHOICE ||
Gbl.Test.AnswerType == Tst_ANS_MULTIPLE_CHOICE) Gbl.Test.AnswerType == Tst_ANS_MULTIPLE_CHOICE)
/* Put an icon that indicates whether shuffle is enabled or not */ /* Put an icon that indicates whether shuffle is enabled or not */
@ -1096,9 +1092,8 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem,
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/***** Write the stem and the answers *****/ /***** Write the stem and the answers *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP\"" fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
Gbl.ColorRows[Gbl.RowEvenOdd]);
Tst_WriteQstStem (Stem,ClassStem); Tst_WriteQstStem (Stem,ClassStem);
Tst_WriteQstFeedback (Feedback,"TEST_EDI_LIGHT"); Tst_WriteQstFeedback (Feedback,"TEST_EDI_LIGHT");
switch (Gbl.Test.AnswerType) switch (Gbl.Test.AnswerType)

View File

@ -2600,7 +2600,6 @@ static void Usr_InsertMyLastData (void)
static void Usr_WriteRowGstMainData (unsigned NumUsr,struct UsrData *UsrDat) static void Usr_WriteRowGstMainData (unsigned NumUsr,struct UsrData *UsrDat)
{ {
const char *BgColor;
char PhotoURL[PATH_MAX+1]; char PhotoURL[PATH_MAX+1];
bool ShowPhoto; bool ShowPhoto;
char MailLink[7+Usr_MAX_BYTES_USR_EMAIL+1]; // mailto:mail_address char MailLink[7+Usr_MAX_BYTES_USR_EMAIL+1]; // mailto:mail_address
@ -2611,10 +2610,8 @@ static void Usr_WriteRowGstMainData (unsigned NumUsr,struct UsrData *UsrDat)
/***** Checkbox to select user *****/ /***** Checkbox to select user *****/
// Two colors are used alternatively to better distinguish the rows // Two colors are used alternatively to better distinguish the rows
BgColor = Gbl.ColorRows[Gbl.RowEvenOdd]; fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE COLOR%u\">",
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\"" Gbl.RowEvenOdd);
" style=\"background-color:%s;\">",
BgColor);
Usr_PutCheckboxToSelectUser (Rol__GUEST_,UsrDat->EncryptedUsrCod,false); Usr_PutCheckboxToSelectUser (Rol__GUEST_,UsrDat->EncryptedUsrCod,false);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
@ -2628,18 +2625,16 @@ static void Usr_WriteRowGstMainData (unsigned NumUsr,struct UsrData *UsrDat)
Gbl.Prefs.IconsURL); Gbl.Prefs.IconsURL);
/***** Write number of user in the list *****/ /***** Write number of user in the list *****/
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL RIGHT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"&nbsp;%u&nbsp;" "&nbsp;%u&nbsp;"
"</td>", "</td>",
BgColor,NumUsr); Gbl.RowEvenOdd,NumUsr);
if (Gbl.Usrs.Listing.WithPhotos) if (Gbl.Usrs.Listing.WithPhotos)
{ {
/***** Show student's photo *****/ /***** Show student's photo *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
BgColor);
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
@ -2651,18 +2646,17 @@ static void Usr_WriteRowGstMainData (unsigned NumUsr,struct UsrData *UsrDat)
Usr_RestrictLengthMainData (true,UsrDat,MailLink); Usr_RestrictLengthMainData (true,UsrDat,MailLink);
/****** Write user's IDs ******/ /****** Write user's IDs ******/
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"%s LEFT_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">",
UsrDat->Accepted ? "DAT_SMALL_N" : UsrDat->Accepted ? "DAT_SMALL_N" :
"DAT_SMALL", "DAT_SMALL",
BgColor); Gbl.RowEvenOdd);
ID_WriteUsrIDs (UsrDat,(Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER)); ID_WriteUsrIDs (UsrDat,(Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER));
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/***** Write rest of main student's data *****/ /***** Write rest of main student's data *****/
Ins.InsCod = UsrDat->InsCod; Ins.InsCod = UsrDat->InsCod;
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA); Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA);
Usr_WriteMainUsrDataExceptUsrID (UsrDat,BgColor,true, Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd],true,
UsrDat->Email[0] ? MailLink : UsrDat->Email[0] ? MailLink :
NULL, NULL,
Ins.ShortName, Ins.ShortName,
@ -2787,7 +2781,6 @@ void Usr_WriteRowStdMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutChe
static void Usr_WriteRowGstAllData (struct UsrData *UsrDat) static void Usr_WriteRowGstAllData (struct UsrData *UsrDat)
{ {
const char *BgColor;
char PhotoURL[PATH_MAX+1]; char PhotoURL[PATH_MAX+1];
bool ShowPhoto; bool ShowPhoto;
struct Institution Ins; struct Institution Ins;
@ -2795,15 +2788,13 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat)
struct Department Dpt; struct Department Dpt;
/***** Start row *****/ /***** Start row *****/
BgColor = Gbl.ColorRows[Gbl.RowEvenOdd]; // Two colors are used alternatively to better distinguish the rows
fprintf (Gbl.F.Out,"<tr>"); fprintf (Gbl.F.Out,"<tr>");
if (Gbl.Usrs.Listing.WithPhotos) if (Gbl.Usrs.Listing.WithPhotos)
{ {
/***** Show guest's photo *****/ /***** Show guest's photo *****/
fprintf (Gbl.F.Out,"<td class=\"LDEFT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
BgColor);
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
@ -2812,16 +2803,15 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat)
} }
/****** Write user's ID ******/ /****** Write user's ID ******/
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL LEFT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL LEFT_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
BgColor);
ID_WriteUsrIDs (UsrDat,true); ID_WriteUsrIDs (UsrDat,true);
fprintf (Gbl.F.Out,"&nbsp;</td>"); fprintf (Gbl.F.Out,"&nbsp;</td>");
/***** Write rest of guest's main data *****/ /***** Write rest of guest's main data *****/
Ins.InsCod = UsrDat->InsCod; Ins.InsCod = UsrDat->InsCod;
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA); Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA);
Usr_WriteMainUsrDataExceptUsrID (UsrDat,BgColor,true,NULL,Ins.ShortName,NULL); Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd],true,NULL,Ins.ShortName,NULL);
/***** Write the rest of the data of the guest *****/ /***** Write the rest of the data of the guest *****/
if (UsrDat->Tch.CtrCod > 0) if (UsrDat->Tch.CtrCod > 0)
@ -2829,7 +2819,7 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat)
Ctr.CtrCod = UsrDat->Tch.CtrCod; Ctr.CtrCod = UsrDat->Tch.CtrCod;
Ctr_GetDataOfCentreByCod (&Ctr); Ctr_GetDataOfCentreByCod (&Ctr);
} }
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->Tch.CtrCod > 0 ? Ctr.FullName : UsrDat->Tch.CtrCod > 0 ? Ctr.FullName :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
@ -2838,39 +2828,39 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat)
Dpt.DptCod = UsrDat->Tch.DptCod; Dpt.DptCod = UsrDat->Tch.DptCod;
Dpt_GetDataOfDepartmentByCod (&Dpt); Dpt_GetDataOfDepartmentByCod (&Dpt);
} }
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->Tch.DptCod > 0 ? Dpt.FullName : UsrDat->Tch.DptCod > 0 ? Dpt.FullName :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->Tch.Office[0] ? UsrDat->Tch.Office : UsrDat->Tch.Office[0] ? UsrDat->Tch.Office :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->Tch.OfficePhone[0] ? UsrDat->Tch.OfficePhone : UsrDat->Tch.OfficePhone[0] ? UsrDat->Tch.OfficePhone :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->LocalAddress[0] ? UsrDat->LocalAddress : UsrDat->LocalAddress[0] ? UsrDat->LocalAddress :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->LocalPhone[0] ? UsrDat->LocalPhone : UsrDat->LocalPhone[0] ? UsrDat->LocalPhone :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->FamilyAddress[0] ? UsrDat->FamilyAddress : UsrDat->FamilyAddress[0] ? UsrDat->FamilyAddress :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->FamilyPhone[0] ? UsrDat->FamilyPhone : UsrDat->FamilyPhone[0] ? UsrDat->FamilyPhone :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->OriginPlace[0] ? UsrDat->OriginPlace : UsrDat->OriginPlace[0] ? UsrDat->OriginPlace :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->StrBirthday[0] ? UsrDat->StrBirthday : UsrDat->StrBirthday[0] ? UsrDat->StrBirthday :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
@ -2887,7 +2877,6 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat)
void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames) void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames)
{ {
const char *BgColor;
char PhotoURL[PATH_MAX+1]; char PhotoURL[PATH_MAX+1];
bool ShowPhoto; bool ShowPhoto;
unsigned NumGrpTyp,NumField; unsigned NumGrpTyp,NumField;
@ -2900,15 +2889,13 @@ void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames)
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM; Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM;
/***** Start row *****/ /***** Start row *****/
BgColor = Gbl.ColorRows[Gbl.RowEvenOdd]; // Two colors are used alternatively to better distinguish the rows
fprintf (Gbl.F.Out,"<tr>"); fprintf (Gbl.F.Out,"<tr>");
if (Gbl.Usrs.Listing.WithPhotos) if (Gbl.Usrs.Listing.WithPhotos)
{ {
/***** Show student's photo *****/ /***** Show student's photo *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
BgColor);
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
@ -2917,46 +2904,45 @@ void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames)
} }
/****** Write user's ID ******/ /****** Write user's ID ******/
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"%s LEFT_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">",
UsrDat->Accepted ? "DAT_SMALL_N" : UsrDat->Accepted ? "DAT_SMALL_N" :
"DAT_SMALL", "DAT_SMALL",
BgColor); Gbl.RowEvenOdd);
ID_WriteUsrIDs (UsrDat,(Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER)); ID_WriteUsrIDs (UsrDat,(Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER));
fprintf (Gbl.F.Out,"&nbsp;</td>"); fprintf (Gbl.F.Out,"&nbsp;</td>");
/***** Write rest of main student's data *****/ /***** Write rest of main student's data *****/
Ins.InsCod = UsrDat->InsCod; Ins.InsCod = UsrDat->InsCod;
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA); Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA);
Usr_WriteMainUsrDataExceptUsrID (UsrDat,BgColor,ShowData,NULL,Ins.ShortName,NULL); Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd],ShowData,NULL,Ins.ShortName,NULL);
/***** Write the rest of the data of the student *****/ /***** Write the rest of the data of the student *****/
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->LocalAddress[0] ? (ShowData ? UsrDat->LocalAddress : UsrDat->LocalAddress[0] ? (ShowData ? UsrDat->LocalAddress :
"********") : "********") :
"&nbsp;", "&nbsp;",
NULL,true,UsrDat->Accepted); NULL,true,UsrDat->Accepted);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->LocalPhone[0] ? (ShowData ? UsrDat->LocalPhone : UsrDat->LocalPhone[0] ? (ShowData ? UsrDat->LocalPhone :
"********") : "********") :
"&nbsp;", "&nbsp;",
NULL,true,UsrDat->Accepted); NULL,true,UsrDat->Accepted);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->FamilyAddress[0] ? (ShowData ? UsrDat->FamilyAddress : UsrDat->FamilyAddress[0] ? (ShowData ? UsrDat->FamilyAddress :
"********") : "********") :
"&nbsp;", "&nbsp;",
NULL,true,UsrDat->Accepted); NULL,true,UsrDat->Accepted);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->FamilyPhone[0] ? (ShowData ? UsrDat->FamilyPhone : UsrDat->FamilyPhone[0] ? (ShowData ? UsrDat->FamilyPhone :
"********") : "********") :
"&nbsp;", "&nbsp;",
NULL,true,UsrDat->Accepted); NULL,true,UsrDat->Accepted);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->OriginPlace[0] ? (ShowData ? UsrDat->OriginPlace : UsrDat->OriginPlace[0] ? (ShowData ? UsrDat->OriginPlace :
"********") : "********") :
"&nbsp;", "&nbsp;",
NULL,true,UsrDat->Accepted); NULL,true,UsrDat->Accepted);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->StrBirthday[0] ? (ShowData ? UsrDat->StrBirthday : UsrDat->StrBirthday[0] ? (ShowData ? UsrDat->StrBirthday :
"********") : "********") :
"&nbsp;", "&nbsp;",
@ -2971,7 +2957,7 @@ void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames)
if (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].NumGrps) // If current course tiene groups of este type if (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].NumGrps) // If current course tiene groups of este type
{ {
Grp_GetNamesGrpsStdBelongsTo (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod,UsrDat->UsrCod,GroupNames); Grp_GetNamesGrpsStdBelongsTo (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod,UsrDat->UsrCod,GroupNames);
Usr_WriteUsrData (BgColor,GroupNames,NULL,true,UsrDat->Accepted); Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],GroupNames,NULL,true,UsrDat->Accepted);
} }
/***** Fields of the record dependientes of the course *****/ /***** Fields of the record dependientes of the course *****/
@ -2989,7 +2975,7 @@ void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames)
} }
else else
Text[0] = '\0'; Text[0] = '\0';
Usr_WriteUsrData (BgColor,Text,NULL,false,UsrDat->Accepted); Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],Text,NULL,false,UsrDat->Accepted);
/* Free structure that stores the query result */ /* Free structure that stores the query result */
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
@ -3109,7 +3095,6 @@ static void Usr_WriteRowTchMainData (unsigned NumUsr,struct UsrData *UsrDat,bool
void Usr_WriteRowTchAllData (struct UsrData *UsrDat) void Usr_WriteRowTchAllData (struct UsrData *UsrDat)
{ {
const char *BgColor;
char PhotoURL[PATH_MAX+1]; char PhotoURL[PATH_MAX+1];
bool ShowPhoto; bool ShowPhoto;
struct Institution Ins; struct Institution Ins;
@ -3121,14 +3106,12 @@ void Usr_WriteRowTchAllData (struct UsrData *UsrDat)
struct Department Dpt; struct Department Dpt;
/***** Start row *****/ /***** Start row *****/
BgColor = Gbl.ColorRows[Gbl.RowEvenOdd]; // Two colors are used alternatively to better distinguish the rows
fprintf (Gbl.F.Out,"<tr>"); fprintf (Gbl.F.Out,"<tr>");
if (Gbl.Usrs.Listing.WithPhotos) if (Gbl.Usrs.Listing.WithPhotos)
{ {
/***** Show teacher's photo *****/ /***** Show teacher's photo *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
BgColor);
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
@ -3137,18 +3120,17 @@ void Usr_WriteRowTchAllData (struct UsrData *UsrDat)
} }
/****** Write the user's ID ******/ /****** Write the user's ID ******/
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"%s LEFT_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">",
UsrDat->Accepted ? "DAT_SMALL_N" : UsrDat->Accepted ? "DAT_SMALL_N" :
"DAT_SMALL", "DAT_SMALL",
BgColor); Gbl.RowEvenOdd);
ID_WriteUsrIDs (UsrDat,ID_ICanSeeTeacherID (UsrDat)); ID_WriteUsrIDs (UsrDat,ID_ICanSeeTeacherID (UsrDat));
fprintf (Gbl.F.Out,"&nbsp;</td>"); fprintf (Gbl.F.Out,"&nbsp;</td>");
/***** Write rest of main teacher's data *****/ /***** Write rest of main teacher's data *****/
Ins.InsCod = UsrDat->InsCod; Ins.InsCod = UsrDat->InsCod;
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA); Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA);
Usr_WriteMainUsrDataExceptUsrID (UsrDat,BgColor,ShowData,NULL,Ins.ShortName,NULL); Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd],ShowData,NULL,Ins.ShortName,NULL);
/***** Write the rest of teacher's data *****/ /***** Write the rest of teacher's data *****/
if (ShowData && UsrDat->Tch.CtrCod > 0) if (ShowData && UsrDat->Tch.CtrCod > 0)
@ -3156,7 +3138,7 @@ void Usr_WriteRowTchAllData (struct UsrData *UsrDat)
Ctr.CtrCod = UsrDat->Tch.CtrCod; Ctr.CtrCod = UsrDat->Tch.CtrCod;
Ctr_GetDataOfCentreByCod (&Ctr); Ctr_GetDataOfCentreByCod (&Ctr);
} }
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
(ShowData && UsrDat->Tch.CtrCod > 0) ? Ctr.FullName : (ShowData && UsrDat->Tch.CtrCod > 0) ? Ctr.FullName :
"&nbsp;", "&nbsp;",
NULL,true,UsrDat->Accepted); NULL,true,UsrDat->Accepted);
@ -3165,15 +3147,15 @@ void Usr_WriteRowTchAllData (struct UsrData *UsrDat)
Dpt.DptCod = UsrDat->Tch.DptCod; Dpt.DptCod = UsrDat->Tch.DptCod;
Dpt_GetDataOfDepartmentByCod (&Dpt); Dpt_GetDataOfDepartmentByCod (&Dpt);
} }
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
(ShowData && UsrDat->Tch.DptCod > 0) ? Dpt.FullName : (ShowData && UsrDat->Tch.DptCod > 0) ? Dpt.FullName :
"&nbsp;", "&nbsp;",
NULL,true,UsrDat->Accepted); NULL,true,UsrDat->Accepted);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
(ShowData && UsrDat->Tch.Office[0]) ? UsrDat->Tch.Office : (ShowData && UsrDat->Tch.Office[0]) ? UsrDat->Tch.Office :
"&nbsp;", "&nbsp;",
NULL,true,UsrDat->Accepted); NULL,true,UsrDat->Accepted);
Usr_WriteUsrData (BgColor, Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
(ShowData && UsrDat->Tch.OfficePhone[0]) ? UsrDat->Tch.OfficePhone : (ShowData && UsrDat->Tch.OfficePhone[0]) ? UsrDat->Tch.OfficePhone :
"&nbsp;", "&nbsp;",
NULL,true,UsrDat->Accepted); NULL,true,UsrDat->Accepted);
@ -3189,29 +3171,25 @@ void Usr_WriteRowTchAllData (struct UsrData *UsrDat)
void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat) void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat)
{ {
const char *BgColor;
char PhotoURL[PATH_MAX+1]; char PhotoURL[PATH_MAX+1];
bool ShowPhoto; bool ShowPhoto;
char MailLink[7+Usr_MAX_BYTES_USR_EMAIL+1]; // mailto:mail_address char MailLink[7+Usr_MAX_BYTES_USR_EMAIL+1]; // mailto:mail_address
struct Institution Ins; struct Institution Ins;
/***** Start row *****/ /***** Start row *****/
BgColor = Gbl.ColorRows[Gbl.RowEvenOdd]; // Two colors are used alternatively to better distinguish the rows
fprintf (Gbl.F.Out,"<tr>"); fprintf (Gbl.F.Out,"<tr>");
/***** Write number of user *****/ /***** Write number of user *****/
fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL_N RIGHT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"DAT_SMALL_N RIGHT_MIDDLE COLOR%u\">"
" style=\"background-color:%s;\">"
"&nbsp;%u&nbsp;" "&nbsp;%u&nbsp;"
"</td>", "</td>",
BgColor,NumUsr); Gbl.RowEvenOdd,NumUsr);
if (Gbl.Usrs.Listing.WithPhotos) if (Gbl.Usrs.Listing.WithPhotos)
{ {
/***** Show administrator's photo *****/ /***** Show administrator's photo *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">", Gbl.RowEvenOdd);
BgColor);
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
@ -3223,18 +3201,17 @@ void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat)
Usr_RestrictLengthMainData (true,UsrDat,MailLink); Usr_RestrictLengthMainData (true,UsrDat,MailLink);
/****** Write the user's ID ******/ /****** Write the user's ID ******/
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_MIDDLE\"" fprintf (Gbl.F.Out,"<td class=\"%s LEFT_MIDDLE COLOR%u\">",
" style=\"background-color:%s;\">",
UsrDat->Accepted ? "DAT_SMALL_N" : UsrDat->Accepted ? "DAT_SMALL_N" :
"DAT_SMALL", "DAT_SMALL",
BgColor); Gbl.RowEvenOdd);
ID_WriteUsrIDs (UsrDat,(Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM)); ID_WriteUsrIDs (UsrDat,(Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM));
fprintf (Gbl.F.Out,"&nbsp;</td>"); fprintf (Gbl.F.Out,"&nbsp;</td>");
/***** Write rest of main administrator's data *****/ /***** Write rest of main administrator's data *****/
Ins.InsCod = UsrDat->InsCod; Ins.InsCod = UsrDat->InsCod;
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA); Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA);
Usr_WriteMainUsrDataExceptUsrID (UsrDat,BgColor,true, Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd],true,
UsrDat->Email[0] ? MailLink : UsrDat->Email[0] ? MailLink :
NULL, NULL,
Ins.ShortName, Ins.ShortName,