Version 16.9

This commit is contained in:
Antonio Cañas Vargas 2016-10-03 14:12:01 +02:00
parent 778f119c61
commit 6fa4500d7e
11 changed files with 169 additions and 111 deletions

View File

@ -143,13 +143,14 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.8.1 (2016-10-03)" #define Log_PLATFORM_VERSION "SWAD 16.9 (2016-10-03)"
#define CSS_FILE "swad15.229.css" #define CSS_FILE "swad15.229.css"
#define JS_FILE "swad15.238.1.js" #define JS_FILE "swad15.238.1.js"
// 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 16.9: Oct 03, 2016 User's usage report is written into a temporary file. (205795 lines)
Version 16.8.1: Oct 03, 2016 Do not show courses with a few clicks in user's usage report. (205747 lines) Version 16.8.1: Oct 03, 2016 Do not show courses with a few clicks in user's usage report. (205747 lines)
Version 16.8: Oct 03, 2016 New option to view user's usage report. (205720 lines) Version 16.8: Oct 03, 2016 New option to view user's usage report. (205720 lines)
1 change necessary in database: 1 change necessary in database:

View File

@ -398,6 +398,9 @@
/* Folder for temporary XML files received to import test questions, inside private swad directory */ /* Folder for temporary XML files received to import test questions, inside private swad directory */
#define Cfg_FOLDER_TEST "test" // Created automatically the first time it is accessed #define Cfg_FOLDER_TEST "test" // Created automatically the first time it is accessed
/* Folder for reports, inside private swad directory */
#define Cfg_FOLDER_REP "rep" // Created automatically the first time it is accessed
/* Folder for compression of assignments and works into a zip files, inside private swad directory */ /* Folder for compression of assignments and works into a zip files, inside private swad directory */
#define Cfg_FOLDER_ZIP "zip" // Created automatically the first time it is accessed #define Cfg_FOLDER_ZIP "zip" // Created automatically the first time it is accessed

View File

@ -522,6 +522,19 @@ void Fil_CloseXMLFile (void)
} }
} }
/*****************************************************************************/
/***************************** Close report file *****************************/
/*****************************************************************************/
void Fil_CloseReportFile (void)
{
if (Gbl.F.Rep)
{
fclose (Gbl.F.Rep);
Gbl.F.Rep = NULL; // To indicate that it is not open
}
}
/*****************************************************************************/ /*****************************************************************************/
/********** Write a quantity of bytes as bytes, KiB, MiB, GiB or TiB *********/ /********** Write a quantity of bytes as bytes, KiB, MiB, GiB or TiB *********/
/*****************************************************************************/ /*****************************************************************************/

View File

@ -50,6 +50,7 @@ struct Files
FILE *Out; // File with the HTML output of this CGI FILE *Out; // File with the HTML output of this CGI
FILE *Tmp; // Temporary file to save stdin FILE *Tmp; // Temporary file to save stdin
FILE *XML; // XML file for syllabus, for directory tree FILE *XML; // XML file for syllabus, for directory tree
FILE *Rep; // Temporary file to save report
}; };
#define Fil_MAX_BYTES_FILE_SIZE_STRING 32 #define Fil_MAX_BYTES_FILE_SIZE_STRING 32
@ -73,7 +74,9 @@ void Fil_CreateDirIfNotExists (const char *Path);
void Fil_RemoveOldTmpFiles (const char *Path,time_t TimeToRemove,bool RemoveDirectory); void Fil_RemoveOldTmpFiles (const char *Path,time_t TimeToRemove,bool RemoveDirectory);
void Fil_FastCopyOfFiles (const char *PathSrc,const char *PathTgt); void Fil_FastCopyOfFiles (const char *PathSrc,const char *PathTgt);
void Fil_FastCopyOfOpenFiles (FILE *FileSrc,FILE *FileTgt); void Fil_FastCopyOfOpenFiles (FILE *FileSrc,FILE *FileTgt);
void Fil_CloseXMLFile (void); void Fil_CloseXMLFile (void);
void Fil_CloseReportFile (void);
void Fil_WriteFileSizeBrief (double SizeInBytes, void Fil_WriteFileSizeBrief (double SizeInBytes,
char FileSizeStr[Fil_MAX_BYTES_FILE_SIZE_STRING]); char FileSizeStr[Fil_MAX_BYTES_FILE_SIZE_STRING]);

View File

@ -116,6 +116,7 @@ void Gbl_InitializeGlobals (void)
Gbl.F.Out = stdout; Gbl.F.Out = stdout;
Gbl.F.Tmp = NULL; Gbl.F.Tmp = NULL;
Gbl.F.XML = NULL; Gbl.F.XML = NULL;
Gbl.F.Rep = NULL; // Report
Gbl.Form.Num = -1; // Number of form. It's increased by 1 at the begin of each form Gbl.Form.Num = -1; // Number of form. It's increased by 1 at the begin of each form
Gbl.Form.Inside = false; // Set to true inside a form to avoid nested forms Gbl.Form.Inside = false; // Set to true inside a form to avoid nested forms
@ -473,5 +474,6 @@ void Gbl_Cleanup (void)
if (Gbl.F.Tmp) if (Gbl.F.Tmp)
fclose (Gbl.F.Tmp); fclose (Gbl.F.Tmp);
Fil_CloseXMLFile (); Fil_CloseXMLFile ();
Fil_CloseReportFile ();
Par_FreeParams (); Par_FreeParams ();
} }

View File

@ -481,7 +481,8 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
if (UsrFigures.NumDays > 0) if (UsrFigures.NumDays > 0)
{ {
fprintf (Gbl.F.Out," ("); fprintf (Gbl.F.Out," (");
Str_WriteFloatNum ((float) UsrFigures.NumClicks / Str_WriteFloatNum (Gbl.F.Out,
(float) UsrFigures.NumClicks /
(float) UsrFigures.NumDays); (float) UsrFigures.NumDays);
fprintf (Gbl.F.Out,"/%s ",Txt_day); fprintf (Gbl.F.Out,"/%s ",Txt_day);
Prf_ShowRanking (Prf_GetRankingNumClicksPerDay (UsrDat->UsrCod), Prf_ShowRanking (Prf_GetRankingNumClicksPerDay (UsrDat->UsrCod),
@ -510,7 +511,8 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
if (UsrFigures.NumDays > 0) if (UsrFigures.NumDays > 0)
{ {
fprintf (Gbl.F.Out," ("); fprintf (Gbl.F.Out," (");
Str_WriteFloatNum ((float) UsrFigures.NumFileViews / Str_WriteFloatNum (Gbl.F.Out,
(float) UsrFigures.NumFileViews /
(float) UsrFigures.NumDays); (float) UsrFigures.NumDays);
fprintf (Gbl.F.Out,"/%s)",Txt_day); fprintf (Gbl.F.Out,"/%s)",Txt_day);
} }
@ -536,7 +538,8 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
if (UsrFigures.NumDays > 0) if (UsrFigures.NumDays > 0)
{ {
fprintf (Gbl.F.Out," ("); fprintf (Gbl.F.Out," (");
Str_WriteFloatNum ((float) UsrFigures.NumForPst / Str_WriteFloatNum (Gbl.F.Out,
(float) UsrFigures.NumForPst /
(float) UsrFigures.NumDays); (float) UsrFigures.NumDays);
fprintf (Gbl.F.Out,"/%s)",Txt_day); fprintf (Gbl.F.Out,"/%s)",Txt_day);
} }
@ -563,7 +566,8 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
if (UsrFigures.NumDays > 0) if (UsrFigures.NumDays > 0)
{ {
fprintf (Gbl.F.Out," ("); fprintf (Gbl.F.Out," (");
Str_WriteFloatNum ((float) UsrFigures.NumMsgSnt / Str_WriteFloatNum (Gbl.F.Out,
(float) UsrFigures.NumMsgSnt /
(float) UsrFigures.NumDays); (float) UsrFigures.NumDays);
fprintf (Gbl.F.Out,"/%s)",Txt_day); fprintf (Gbl.F.Out,"/%s)",Txt_day);
} }
@ -1460,7 +1464,7 @@ void Prf_GetAndShowRankingClicksPerDay (void)
fprintf (Gbl.F.Out,"<td class=\"RIGHT_MIDDLE COLOR%u\"" fprintf (Gbl.F.Out,"<td class=\"RIGHT_MIDDLE COLOR%u\""
" style=\"height:50px;\">", " style=\"height:50px;\">",
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
Str_WriteFloatNum (NumClicksPerDay); Str_WriteFloatNum (Gbl.F.Out,NumClicksPerDay);
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"</tr>"); "</tr>");
} }

View File

@ -28,6 +28,7 @@
// #include <stdbool.h> // For boolean type // #include <stdbool.h> // For boolean type
// #include <stdio.h> // For sprintf // #include <stdio.h> // For sprintf
// #include <string.h> // For string functions // #include <string.h> // For string functions
#include <unistd.h> // For unlink
#include "swad_database.h" #include "swad_database.h"
#include "swad_global.h" #include "swad_global.h"
@ -79,7 +80,7 @@ extern struct Globals Gbl;
static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint); static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint);
static void Rep_PutIconToPrintMyUsageReport (void); static void Rep_PutIconToPrintMyUsageReport (void);
static void Rep_WriteHeader (const char *StrCurrentDateUTC); static void Rep_WriteHeader (FILE *FileDst,const char *StrCurrentDateUTC);
static void Rep_WriteSectionPlatform (void); static void Rep_WriteSectionPlatform (void);
static void Rep_WriteSectionUsrInfo (void); static void Rep_WriteSectionUsrInfo (void);
static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures, static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures,
@ -140,7 +141,7 @@ void Rep_ReqMyUsageReport (void)
Lay_StartRoundFrame (NULL,Txt_Report,NULL); Lay_StartRoundFrame (NULL,Txt_Report,NULL);
/***** Header *****/ /***** Header *****/
Rep_WriteHeader (StrCurrentDateUTC); Rep_WriteHeader (Gbl.F.Out,StrCurrentDateUTC);
/***** Send button and end frame *****/ /***** Send button and end frame *****/
Lay_EndRoundFrameWithButton (Lay_CONFIRM_BUTTON,Txt_Generate_report); Lay_EndRoundFrameWithButton (Lay_CONFIRM_BUTTON,Txt_Generate_report);
@ -163,7 +164,8 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
{ {
extern const char *Txt_Report; extern const char *Txt_Report;
struct UsrFigures UsrFigures; struct UsrFigures UsrFigures;
char PathReports[PATH_MAX+1];
char PathFileReport[PATH_MAX+1];
struct tm tm_FirstClickTime; struct tm tm_FirstClickTime;
char StrCurrentDateUTC[10+1]; // Example: 2016-10-02 char StrCurrentDateUTC[10+1]; // Example: 2016-10-02
// 1234567890 // 1234567890
@ -178,10 +180,23 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
if (SeeOrPrint == Rep_SEE) if (SeeOrPrint == Rep_SEE)
Lay_StartRoundFrame (NULL,Txt_Report, Lay_StartRoundFrame (NULL,Txt_Report,
Rep_PutIconToPrintMyUsageReport); Rep_PutIconToPrintMyUsageReport);
fprintf (Gbl.F.Out,"<div style=\"margin:2em; text-align:left;\">\n");
/***** Path for reports *****/
sprintf (PathReports,"%s/%s",Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_REP);
Fil_CreateDirIfNotExists (PathReports);
/***** Create a new empty syllabus *****/
/* Path of the private directory for the file with the report */
sprintf (PathFileReport,"%s/%s.html",
PathReports,Gbl.UniqueNameEncrypted);
if ((Gbl.F.Rep = fopen (PathFileReport,"wb")) == NULL)
Lay_ShowErrorAndExit ("Can not create report file.");
/***** Start file *****/
fprintf (Gbl.F.Rep,"<div style=\"margin:2em; text-align:left;\">\n");
/***** Header *****/ /***** Header *****/
Rep_WriteHeader (StrCurrentDateUTC); Rep_WriteHeader (Gbl.F.Rep,StrCurrentDateUTC);
/***** Platform *****/ /***** Platform *****/
Rep_WriteSectionPlatform (); Rep_WriteSectionPlatform ();
@ -208,8 +223,21 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
Rep_WriteSectionHistoricCourses (&UsrFigures,&tm_FirstClickTime, Rep_WriteSectionHistoricCourses (&UsrFigures,&tm_FirstClickTime,
MaxHitsPerYear); MaxHitsPerYear);
/***** End file *****/
fprintf (Gbl.F.Rep,"</div>\n");
/***** Open report file for reading *****/
if ((Gbl.F.Rep = fopen (PathFileReport,"rb")) == NULL)
Lay_ShowErrorAndExit ("Can not open report file.");
/***** Copy from report file to output file *****/
Fil_FastCopyOfOpenFiles (Gbl.F.Rep,Gbl.F.Out);
/***** Close and remove report file *****/
Fil_CloseReportFile ();
unlink (PathFileReport);
/***** End frame *****/ /***** End frame *****/
fprintf (Gbl.F.Out,"</div>\n");
if (SeeOrPrint == Rep_SEE) if (SeeOrPrint == Rep_SEE)
Lay_EndRoundFrame (); Lay_EndRoundFrame ();
} }
@ -232,25 +260,25 @@ static void Rep_PutIconToPrintMyUsageReport (void)
/******************** Write header of user's usage report ********************/ /******************** Write header of user's usage report ********************/
/*****************************************************************************/ /*****************************************************************************/
static void Rep_WriteHeader (const char *StrCurrentDateUTC) static void Rep_WriteHeader (FILE *FileDst,const char *StrCurrentDateUTC)
{ {
extern const char *Txt_Report_of_use_of_PLATFORM; extern const char *Txt_Report_of_use_of_PLATFORM;
/***** Start of header *****/ /***** Start of header *****/
fprintf (Gbl.F.Out,"<header style=\"margin:2em; text-align:center;\">"); fprintf (FileDst,"<header style=\"margin:2em; text-align:center;\">");
/***** Main title *****/ /***** Main title *****/
sprintf (Gbl.Title,Txt_Report_of_use_of_PLATFORM,Cfg_PLATFORM_SHORT_NAME); sprintf (Gbl.Title,Txt_Report_of_use_of_PLATFORM,Cfg_PLATFORM_SHORT_NAME);
fprintf (Gbl.F.Out,"<h1>%s</h1>",Gbl.Title); fprintf (FileDst,"<h1>%s</h1>",Gbl.Title);
/***** Subtitle *****/ /***** Subtitle *****/
fprintf (Gbl.F.Out,"<h2>%s",Gbl.Usrs.Me.UsrDat.FullName); fprintf (FileDst,"<h2>%s",Gbl.Usrs.Me.UsrDat.FullName);
if (StrCurrentDateUTC[0]) if (StrCurrentDateUTC[0])
fprintf (Gbl.F.Out,", %s",StrCurrentDateUTC); fprintf (FileDst,", %s",StrCurrentDateUTC);
fprintf (Gbl.F.Out,"</h2>"); fprintf (FileDst,"</h2>");
/***** End of header *****/ /***** End of header *****/
fprintf (Gbl.F.Out,"</header>\n"); fprintf (FileDst,"</header>\n");
} }
/*****************************************************************************/ /*****************************************************************************/
@ -265,22 +293,22 @@ static void Rep_WriteSectionPlatform (void)
extern const char *Txt_URL; extern const char *Txt_URL;
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Out,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s</h3>" "<h3>%s</h3>"
"<ul>", "<ul>",
Txt_Teaching_platform); Txt_Teaching_platform);
/***** Platform name *****/ /***** Platform name *****/
fprintf (Gbl.F.Out,"<li>%s: %s, %s</li>", fprintf (Gbl.F.Rep,"<li>%s: %s, %s</li>",
Txt_Name, Txt_Name,
Cfg_PLATFORM_FULL_NAME,Txt_TAGLINE); Cfg_PLATFORM_FULL_NAME,Txt_TAGLINE);
/***** Server URL *****/ /***** Server URL *****/
fprintf (Gbl.F.Out,"<li>%s: <a href=\"%s\">%s</a></li>", fprintf (Gbl.F.Rep,"<li>%s: <a href=\"%s\">%s</a></li>",
Txt_URL,Cfg_URL_SWAD_SERVER,Cfg_URL_SWAD_SERVER); Txt_URL,Cfg_URL_SWAD_SERVER,Cfg_URL_SWAD_SERVER);
/***** End of section *****/ /***** End of section *****/
fprintf (Gbl.F.Out,"</ul>" fprintf (Gbl.F.Rep,"</ul>"
"</section>\n"); "</section>\n");
} }
@ -299,36 +327,36 @@ static void Rep_WriteSectionUsrInfo (void)
struct Institution Ins; struct Institution Ins;
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Out,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s</h3>" "<h3>%s</h3>"
"<ul>", "<ul>",
Txt_Personal_information); Txt_Personal_information);
/***** User's name *****/ /***** User's name *****/
fprintf (Gbl.F.Out,"<li>%s: <strong>%s</strong></li>", fprintf (Gbl.F.Rep,"<li>%s: <strong>%s</strong></li>",
Txt_Name, Txt_Name,
Gbl.Usrs.Me.UsrDat.FullName); Gbl.Usrs.Me.UsrDat.FullName);
/***** User's e-mail *****/ /***** User's e-mail *****/
fprintf (Gbl.F.Out,"<li>%s: %s</li>", fprintf (Gbl.F.Rep,"<li>%s: %s</li>",
Txt_Email, Txt_Email,
Gbl.Usrs.Me.UsrDat.Email); Gbl.Usrs.Me.UsrDat.Email);
/***** User's country *****/ /***** User's country *****/
Cty_GetCountryName (Gbl.Usrs.Me.UsrDat.CtyCod,CtyName); Cty_GetCountryName (Gbl.Usrs.Me.UsrDat.CtyCod,CtyName);
fprintf (Gbl.F.Out,"<li>%s: %s</li>", fprintf (Gbl.F.Rep,"<li>%s: %s</li>",
Txt_Country, Txt_Country,
CtyName); CtyName);
/***** User's institution *****/ /***** User's institution *****/
Ins.InsCod = Gbl.Usrs.Me.UsrDat.InsCod; Ins.InsCod = Gbl.Usrs.Me.UsrDat.InsCod;
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA); Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA);
fprintf (Gbl.F.Out,"<li>%s: %s</li>", fprintf (Gbl.F.Rep,"<li>%s: %s</li>",
Txt_Institution, Txt_Institution,
Ins.FullName); Ins.FullName);
/***** End of section *****/ /***** End of section *****/
fprintf (Gbl.F.Out,"</ul>" fprintf (Gbl.F.Rep,"</ul>"
"</section>\n"); "</section>\n");
} }
@ -364,18 +392,18 @@ static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures,
unsigned NumPublicFiles; unsigned NumPublicFiles;
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Out,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s</h3>" "<h3>%s</h3>"
"<ul>", "<ul>",
Txt_Figures); Txt_Figures);
/***** Time since first click until now *****/ /***** Time since first click until now *****/
fprintf (Gbl.F.Out,"<li>%s ",Txt_TIME_Since); fprintf (Gbl.F.Rep,"<li>%s ",Txt_TIME_Since);
if (UsrFigures->FirstClickTimeUTC) if (UsrFigures->FirstClickTimeUTC)
{ {
if (tm_FirstClickTime != NULL) if (tm_FirstClickTime != NULL)
{ {
fprintf (Gbl.F.Out,"%04d-%02d-%02d %02d:%02d:%02d UTC", fprintf (Gbl.F.Rep,"%04d-%02d-%02d %02d:%02d:%02d UTC",
1900 + tm_FirstClickTime->tm_year, // year 1900 + tm_FirstClickTime->tm_year, // year
1 + tm_FirstClickTime->tm_mon, // month 1 + tm_FirstClickTime->tm_mon, // month
tm_FirstClickTime->tm_mday, // day of the month tm_FirstClickTime->tm_mday, // day of the month
@ -383,10 +411,10 @@ static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures,
tm_FirstClickTime->tm_min, // minutes tm_FirstClickTime->tm_min, // minutes
tm_FirstClickTime->tm_sec); // seconds tm_FirstClickTime->tm_sec); // seconds
if (StrCurrentDateUTC[0]) if (StrCurrentDateUTC[0])
fprintf (Gbl.F.Out," %s %s %s UTC", fprintf (Gbl.F.Rep," %s %s %s UTC",
Txt_TIME_until,StrCurrentDateUTC,StrCurrentTimeUTC); Txt_TIME_until,StrCurrentDateUTC,StrCurrentTimeUTC);
if (UsrFigures->NumDays > 0) if (UsrFigures->NumDays > 0)
fprintf (Gbl.F.Out," (%d %s)", fprintf (Gbl.F.Rep," (%d %s)",
UsrFigures->NumDays, UsrFigures->NumDays,
(UsrFigures->NumDays == 1) ? Txt_day : (UsrFigures->NumDays == 1) ? Txt_day :
Txt_days); Txt_days);
@ -394,35 +422,36 @@ static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures,
} }
else // Time of first click is unknown else // Time of first click is unknown
{ {
fprintf (Gbl.F.Out,"?"); fprintf (Gbl.F.Rep,"?");
if (StrCurrentDateUTC[0]) if (StrCurrentDateUTC[0])
fprintf (Gbl.F.Out," - %s %s UTC",StrCurrentDateUTC,StrCurrentTimeUTC); fprintf (Gbl.F.Rep," - %s %s UTC",StrCurrentDateUTC,StrCurrentTimeUTC);
} }
fprintf (Gbl.F.Out,"</li>"); fprintf (Gbl.F.Rep,"</li>");
/***** Number of clicks *****/ /***** Number of clicks *****/
fprintf (Gbl.F.Out,"<li>%s: ",Txt_Clicks); fprintf (Gbl.F.Rep,"<li>%s: ",Txt_Clicks);
if (UsrFigures->NumClicks >= 0) if (UsrFigures->NumClicks >= 0)
{ {
fprintf (Gbl.F.Out,"%ld",UsrFigures->NumClicks); fprintf (Gbl.F.Rep,"%ld",UsrFigures->NumClicks);
if (UsrFigures->NumDays > 0) if (UsrFigures->NumDays > 0)
{ {
fprintf (Gbl.F.Out," ("); fprintf (Gbl.F.Rep," (");
Str_WriteFloatNum ((float) UsrFigures->NumClicks / Str_WriteFloatNum (Gbl.F.Rep,
(float) UsrFigures->NumClicks /
(float) UsrFigures->NumDays); (float) UsrFigures->NumDays);
fprintf (Gbl.F.Out," / %s)",Txt_day); fprintf (Gbl.F.Rep," / %s)",Txt_day);
} }
} }
else // Number of clicks is unknown else // Number of clicks is unknown
fprintf (Gbl.F.Out,"?"); fprintf (Gbl.F.Rep,"?");
fprintf (Gbl.F.Out,"</li>"); fprintf (Gbl.F.Rep,"</li>");
/***** Number of files currently published *****/ /***** Number of files currently published *****/
if ((NumFiles = Brw_GetNumFilesUsr (Gbl.Usrs.Me.UsrDat.UsrCod))) if ((NumFiles = Brw_GetNumFilesUsr (Gbl.Usrs.Me.UsrDat.UsrCod)))
NumPublicFiles = Brw_GetNumPublicFilesUsr (Gbl.Usrs.Me.UsrDat.UsrCod); NumPublicFiles = Brw_GetNumPublicFilesUsr (Gbl.Usrs.Me.UsrDat.UsrCod);
else else
NumPublicFiles = 0; NumPublicFiles = 0;
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Rep,"<li>"
"%s: %u %s (%u %s)" "%s: %u %s (%u %s)"
"</li>", "</li>",
Txt_Files_uploaded, Txt_Files_uploaded,
@ -432,67 +461,70 @@ static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures,
NumPublicFiles,Txt_public_FILES); NumPublicFiles,Txt_public_FILES);
/***** Number of file views *****/ /***** Number of file views *****/
fprintf (Gbl.F.Out,"<li>%s: ",Txt_Downloads); fprintf (Gbl.F.Rep,"<li>%s: ",Txt_Downloads);
if (UsrFigures->NumFileViews >= 0) if (UsrFigures->NumFileViews >= 0)
{ {
fprintf (Gbl.F.Out,"%ld %s", fprintf (Gbl.F.Rep,"%ld %s",
UsrFigures->NumFileViews, UsrFigures->NumFileViews,
(UsrFigures->NumFileViews == 1) ? Txt_download : (UsrFigures->NumFileViews == 1) ? Txt_download :
Txt_downloads); Txt_downloads);
if (UsrFigures->NumDays > 0) if (UsrFigures->NumDays > 0)
{ {
fprintf (Gbl.F.Out," ("); fprintf (Gbl.F.Rep," (");
Str_WriteFloatNum ((float) UsrFigures->NumFileViews / Str_WriteFloatNum (Gbl.F.Rep,
(float) UsrFigures->NumFileViews /
(float) UsrFigures->NumDays); (float) UsrFigures->NumDays);
fprintf (Gbl.F.Out," / %s)",Txt_day); fprintf (Gbl.F.Rep," / %s)",Txt_day);
} }
} }
else // Number of file views is unknown else // Number of file views is unknown
fprintf (Gbl.F.Out,"?"); fprintf (Gbl.F.Rep,"?");
fprintf (Gbl.F.Out,"</li>"); fprintf (Gbl.F.Rep,"</li>");
/***** Number of posts in forums *****/ /***** Number of posts in forums *****/
fprintf (Gbl.F.Out,"<li>%s: ",Txt_Forum_posts); fprintf (Gbl.F.Rep,"<li>%s: ",Txt_Forum_posts);
if (UsrFigures->NumForPst >= 0) if (UsrFigures->NumForPst >= 0)
{ {
fprintf (Gbl.F.Out,"%ld %s", fprintf (Gbl.F.Rep,"%ld %s",
UsrFigures->NumForPst, UsrFigures->NumForPst,
(UsrFigures->NumForPst == 1) ? Txt_post : (UsrFigures->NumForPst == 1) ? Txt_post :
Txt_posts); Txt_posts);
if (UsrFigures->NumDays > 0) if (UsrFigures->NumDays > 0)
{ {
fprintf (Gbl.F.Out," ("); fprintf (Gbl.F.Rep," (");
Str_WriteFloatNum ((float) UsrFigures->NumForPst / Str_WriteFloatNum (Gbl.F.Rep,
(float) UsrFigures->NumForPst /
(float) UsrFigures->NumDays); (float) UsrFigures->NumDays);
fprintf (Gbl.F.Out," / %s)",Txt_day); fprintf (Gbl.F.Rep," / %s)",Txt_day);
} }
} }
else // Number of forum posts is unknown else // Number of forum posts is unknown
fprintf (Gbl.F.Out,"?"); fprintf (Gbl.F.Rep,"?");
fprintf (Gbl.F.Out,"</li>"); fprintf (Gbl.F.Rep,"</li>");
/***** Number of messages sent *****/ /***** Number of messages sent *****/
fprintf (Gbl.F.Out,"<li>%s: ",Txt_Messages_sent); fprintf (Gbl.F.Rep,"<li>%s: ",Txt_Messages_sent);
if (UsrFigures->NumMsgSnt >= 0) if (UsrFigures->NumMsgSnt >= 0)
{ {
fprintf (Gbl.F.Out,"%ld %s", fprintf (Gbl.F.Rep,"%ld %s",
UsrFigures->NumMsgSnt, UsrFigures->NumMsgSnt,
(UsrFigures->NumMsgSnt == 1) ? Txt_message : (UsrFigures->NumMsgSnt == 1) ? Txt_message :
Txt_messages); Txt_messages);
if (UsrFigures->NumDays > 0) if (UsrFigures->NumDays > 0)
{ {
fprintf (Gbl.F.Out," ("); fprintf (Gbl.F.Rep," (");
Str_WriteFloatNum ((float) UsrFigures->NumMsgSnt / Str_WriteFloatNum (Gbl.F.Rep,
(float) UsrFigures->NumMsgSnt /
(float) UsrFigures->NumDays); (float) UsrFigures->NumDays);
fprintf (Gbl.F.Out," / %s)",Txt_day); fprintf (Gbl.F.Rep," / %s)",Txt_day);
} }
} }
else // Number of messages sent is unknown else // Number of messages sent is unknown
fprintf (Gbl.F.Out,"?"); fprintf (Gbl.F.Rep,"?");
fprintf (Gbl.F.Out,"</li>"); fprintf (Gbl.F.Rep,"</li>");
/***** End of section *****/ /***** End of section *****/
fprintf (Gbl.F.Out,"</ul>" fprintf (Gbl.F.Rep,"</ul>"
"</section>\n"); "</section>\n");
} }
@ -506,7 +538,7 @@ static void Rep_WriteSectionGlobalHits (struct UsrFigures *UsrFigures,
extern const char *Txt_Hits; extern const char *Txt_Hits;
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Out,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s</h3>", "<h3>%s</h3>",
Txt_Hits); Txt_Hits);
@ -518,7 +550,7 @@ static void Rep_WriteSectionGlobalHits (struct UsrFigures *UsrFigures,
0); // MaxHitsPerYear not passed as an argument but computed inside the function 0); // MaxHitsPerYear not passed as an argument but computed inside the function
/***** End of section *****/ /***** End of section *****/
fprintf (Gbl.F.Out,"</section>\n"); fprintf (Gbl.F.Rep,"</section>\n");
} }
/*****************************************************************************/ /*****************************************************************************/
@ -534,12 +566,12 @@ static void Rep_WriteSectionCurrentCourses (struct UsrFigures *UsrFigures,
Rol_Role_t Role; Rol_Role_t Role;
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Out,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s", "<h3>%s",
Txt_Courses); Txt_Courses);
if (StrCurrentDateUTC[0]) if (StrCurrentDateUTC[0])
fprintf (Gbl.F.Out," (%s)",StrCurrentDateUTC); fprintf (Gbl.F.Rep," (%s)",StrCurrentDateUTC);
fprintf (Gbl.F.Out,"</h3>" fprintf (Gbl.F.Rep,"</h3>"
"<ul>"); "<ul>");
/***** Number of courses in which the user is student/teacher *****/ /***** Number of courses in which the user is student/teacher *****/
@ -552,7 +584,7 @@ static void Rep_WriteSectionCurrentCourses (struct UsrFigures *UsrFigures,
MaxHitsPerYear); MaxHitsPerYear);
/***** End of section *****/ /***** End of section *****/
fprintf (Gbl.F.Out,"</ul>" fprintf (Gbl.F.Rep,"</ul>"
"</section>\n"); "</section>\n");
} }
@ -570,12 +602,12 @@ static void Rep_WriteSectionHistoricCourses (struct UsrFigures *UsrFigures,
Rol_Role_t Role; Rol_Role_t Role;
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Out,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s (%s)</h3>", "<h3>%s (%s)</h3>",
Txt_Courses,Txt_historical_log); Txt_Courses,Txt_historical_log);
fprintf (Gbl.F.Out,Txt_Only_courses_with_more_than_X_clicks_are_shown, fprintf (Gbl.F.Rep,Txt_Only_courses_with_more_than_X_clicks_are_shown,
Rep_MIN_CLICKS_CRS); Rep_MIN_CLICKS_CRS);
fprintf (Gbl.F.Out,"<ul>"); fprintf (Gbl.F.Rep,"<ul>");
/***** Number of courses in which the user clicked as student/teacher *****/ /***** Number of courses in which the user clicked as student/teacher *****/
for (Role = Rol_STUDENT; for (Role = Rol_STUDENT;
@ -587,7 +619,7 @@ static void Rep_WriteSectionHistoricCourses (struct UsrFigures *UsrFigures,
MaxHitsPerYear); MaxHitsPerYear);
/***** End of section *****/ /***** End of section *****/
fprintf (Gbl.F.Out,"</ul>" fprintf (Gbl.F.Rep,"</ul>"
"</section>\n"); "</section>\n");
} }
@ -652,14 +684,14 @@ static void Rep_GetAndWriteCurrentCrssOfAUsr (const struct UsrData *UsrDat,Rol_R
NumCrss = Usr_GetNumCrssOfUsrWithARole (UsrDat->UsrCod,Role); NumCrss = Usr_GetNumCrssOfUsrWithARole (UsrDat->UsrCod,Role);
sprintf (Gbl.Title,Txt_USER_in_COURSE,Txt_ROLES_SINGUL_Abc[Role][Gbl.Usrs.Me.UsrDat.Sex]); sprintf (Gbl.Title,Txt_USER_in_COURSE,Txt_ROLES_SINGUL_Abc[Role][Gbl.Usrs.Me.UsrDat.Sex]);
fprintf (Gbl.F.Out,"<li>%s %u %s", fprintf (Gbl.F.Rep,"<li>%s %u %s",
Gbl.Title, Gbl.Title,
NumCrss, NumCrss,
NumCrss == 1 ? Txt_course : NumCrss == 1 ? Txt_course :
Txt_courses); Txt_courses);
if (NumCrss) if (NumCrss)
{ {
fprintf (Gbl.F.Out," (%u %s / %u %s)", fprintf (Gbl.F.Rep," (%u %s / %u %s)",
Usr_GetNumUsrsInCrssOfAUsr (Gbl.Usrs.Me.UsrDat.UsrCod,Role,Rol_TEACHER), Usr_GetNumUsrsInCrssOfAUsr (Gbl.Usrs.Me.UsrDat.UsrCod,Role,Rol_TEACHER),
Txt_teachers_ABBREVIATION, Txt_teachers_ABBREVIATION,
Usr_GetNumUsrsInCrssOfAUsr (Gbl.Usrs.Me.UsrDat.UsrCod,Role,Rol_STUDENT), Usr_GetNumUsrsInCrssOfAUsr (Gbl.Usrs.Me.UsrDat.UsrCod,Role,Rol_STUDENT),
@ -679,7 +711,7 @@ static void Rep_GetAndWriteCurrentCrssOfAUsr (const struct UsrData *UsrDat,Rol_R
if ((NumCrss = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get courses of a user"))) if ((NumCrss = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get courses of a user")))
{ {
/* Heading row */ /* Heading row */
fprintf (Gbl.F.Out,"<ol>"); fprintf (Gbl.F.Rep,"<ol>");
/* Write courses */ /* Write courses */
for (NumCrs = 1; for (NumCrs = 1;
@ -699,14 +731,14 @@ static void Rep_GetAndWriteCurrentCrssOfAUsr (const struct UsrData *UsrDat,Rol_R
} }
/* End table */ /* End table */
fprintf (Gbl.F.Out,"</ol>"); fprintf (Gbl.F.Rep,"</ol>");
} }
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
} }
fprintf (Gbl.F.Out,"</li>"); fprintf (Gbl.F.Rep,"</li>");
} }
/*****************************************************************************/ /*****************************************************************************/
@ -743,7 +775,7 @@ static void Rep_GetAndWriteHistoricCrssOfAUsr (const struct UsrData *UsrDat,Rol_
/* Heading row */ /* Heading row */
sprintf (Gbl.Title,Txt_Hits_as_a_USER, sprintf (Gbl.Title,Txt_Hits_as_a_USER,
Txt_ROLES_SINGUL_abc[Role][Gbl.Usrs.Me.UsrDat.Sex]); Txt_ROLES_SINGUL_abc[Role][Gbl.Usrs.Me.UsrDat.Sex]);
fprintf (Gbl.F.Out,"<li>%s:" fprintf (Gbl.F.Rep,"<li>%s:"
"<ol>", "<ol>",
Gbl.Title); Gbl.Title);
@ -765,7 +797,7 @@ static void Rep_GetAndWriteHistoricCrssOfAUsr (const struct UsrData *UsrDat,Rol_
} }
/* End of list */ /* End of list */
fprintf (Gbl.F.Out,"</ol>" fprintf (Gbl.F.Rep,"</ol>"
"</li>"); "</li>");
} }
@ -799,40 +831,40 @@ static void Rep_WriteRowCrsData (long CrsCod,Rol_Role_t Role,
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDataOfDegreeByCod (&Deg);
/***** Start row *****/ /***** Start row *****/
fprintf (Gbl.F.Out,"<li>"); fprintf (Gbl.F.Rep,"<li>");
if (CrsCod > 0) // CrsCod > 0 in log ==> course selected if (CrsCod > 0) // CrsCod > 0 in log ==> course selected
{ {
if (Crs.CrsCod > 0) // Course exists if (Crs.CrsCod > 0) // Course exists
{ {
/***** Write course full name *****/ /***** Write course full name *****/
fprintf (Gbl.F.Out,"<strong>%s</strong> -",Crs.FullName); fprintf (Gbl.F.Rep,"<strong>%s</strong> -",Crs.FullName);
/***** Write year *****/ /***** Write year *****/
if (Crs.Year) if (Crs.Year)
fprintf (Gbl.F.Out," %s",Txt_YEAR_OF_DEGREE[Crs.Year]); fprintf (Gbl.F.Rep," %s",Txt_YEAR_OF_DEGREE[Crs.Year]);
/***** Write degree full name *****/ /***** Write degree full name *****/
fprintf (Gbl.F.Out," %s",Deg.FullName); fprintf (Gbl.F.Rep," %s",Deg.FullName);
/***** Write number of teachers / students in course *****/ /***** Write number of teachers / students in course *****/
fprintf (Gbl.F.Out," (%u %s / %u %s)", fprintf (Gbl.F.Rep," (%u %s / %u %s)",
Usr_GetNumUsrsInCrs (Rol_TEACHER,Crs.CrsCod),Txt_teachers_ABBREVIATION, Usr_GetNumUsrsInCrs (Rol_TEACHER,Crs.CrsCod),Txt_teachers_ABBREVIATION,
Usr_GetNumUsrsInCrs (Rol_STUDENT,Crs.CrsCod),Txt_students_ABBREVIATION); Usr_GetNumUsrsInCrs (Rol_STUDENT,Crs.CrsCod),Txt_students_ABBREVIATION);
} }
else else
fprintf (Gbl.F.Out,"(%s)",Txt_unknown_removed_course); fprintf (Gbl.F.Rep,"(%s)",Txt_unknown_removed_course);
} }
else // CrsCod <= 0 in log ==> no course selected else // CrsCod <= 0 in log ==> no course selected
fprintf (Gbl.F.Out,"(%s)",Txt_no_course_selected); fprintf (Gbl.F.Rep,"(%s)",Txt_no_course_selected);
/***** Write hits per year for this course *****/ /***** Write hits per year for this course *****/
fprintf (Gbl.F.Out,"<br />"); fprintf (Gbl.F.Rep,"<br />");
Rep_ShowMyHitsPerYear (false,CrsCod,Role, Rep_ShowMyHitsPerYear (false,CrsCod,Role,
FirstClickTimeUTC,tm_FirstClickTime, FirstClickTimeUTC,tm_FirstClickTime,
MaxHitsPerYear); MaxHitsPerYear);
fprintf (Gbl.F.Out,"</li>"); fprintf (Gbl.F.Rep,"</li>");
} }
/*****************************************************************************/ /*****************************************************************************/
@ -915,7 +947,7 @@ static void Rep_ShowMyHitsPerYear (bool AnyCourse,long CrsCod,Rol_Role_t Role,
Year--) Year--)
{ {
/* Write the year */ /* Write the year */
fprintf (Gbl.F.Out,"%04u ",Year); fprintf (Gbl.F.Rep,"%04u ",Year);
/* Draw bar proportional to number of hits */ /* Draw bar proportional to number of hits */
Rep_DrawBarNumHits (Year == LastYear ? Hits.Num : Rep_DrawBarNumHits (Year == LastYear ? Hits.Num :
@ -931,7 +963,7 @@ static void Rep_ShowMyHitsPerYear (bool AnyCourse,long CrsCod,Rol_Role_t Role,
Year--) Year--)
{ {
/* Write the year */ /* Write the year */
fprintf (Gbl.F.Out,"%04u ",Year); fprintf (Gbl.F.Rep,"%04u ",Year);
/* Draw bar proportional to number of hits */ /* Draw bar proportional to number of hits */
Rep_DrawBarNumHits (0.0,Hits.Max,Rep_MAX_BAR_WIDTH); Rep_DrawBarNumHits (0.0,Hits.Max,Rep_MAX_BAR_WIDTH);
@ -955,15 +987,15 @@ static void Rep_DrawBarNumHits (float HitsNum,float HitsMax,
for (i = 0; for (i = 0;
i < BarWidth; i < BarWidth;
i++) i++)
fprintf (Gbl.F.Out,Rep_BLOCK); fprintf (Gbl.F.Rep,Rep_BLOCK);
/***** Write the number of hits *****/ /***** Write the number of hits *****/
fprintf (Gbl.F.Out," "); fprintf (Gbl.F.Rep," ");
Str_WriteFloatNum (HitsNum); Str_WriteFloatNum (Gbl.F.Rep,HitsNum);
} }
else else
/***** Write the number of clicks *****/ /***** Write the number of clicks *****/
fprintf (Gbl.F.Out,"0"); fprintf (Gbl.F.Rep,"0");
fprintf (Gbl.F.Out,"<br />"); fprintf (Gbl.F.Rep,"<br />");
} }

View File

@ -1856,7 +1856,7 @@ static void Sta_ShowNumHitsPerUsr (unsigned long NumRows,
UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? 'c' : UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? 'c' :
'v', 'v',
BarWidth); BarWidth);
Str_WriteFloatNum (Hits.Num); Str_WriteFloatNum (Gbl.F.Out,Hits.Num);
fprintf (Gbl.F.Out,"&nbsp;</td>" fprintf (Gbl.F.Out,"&nbsp;</td>"
"</tr>"); "</tr>");
} }
@ -2319,14 +2319,14 @@ static void Sta_DrawBarColors (Sta_ColorType_t ColorType,float HitsMax)
" style=\"width:%upx;\">", " style=\"width:%upx;\">",
GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5, GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5,
GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5); GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5);
Str_WriteFloatNum ((float) Interval * HitsMax / 5.0); Str_WriteFloatNum (Gbl.F.Out,(float) Interval * HitsMax / 5.0);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
} }
fprintf (Gbl.F.Out,"<td colspan=\"%u\" class=\"LOG RIGHT_BOTTOM\"" fprintf (Gbl.F.Out,"<td colspan=\"%u\" class=\"LOG RIGHT_BOTTOM\""
" style=\"width:%upx;\">", " style=\"width:%upx;\">",
(GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5)/2, (GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5)/2,
(GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5)/2); (GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5)/2);
Str_WriteFloatNum (HitsMax); Str_WriteFloatNum (Gbl.F.Out,HitsMax);
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"</tr>" "</tr>"
"<tr>"); "<tr>");
@ -2365,7 +2365,7 @@ static void Sta_DrawAccessesPerHourForADay (Sta_ColorType_t ColorType,float Hits
{ {
Sta_SetColor (ColorType,HitsNum[Hour],HitsMax,&R,&G,&B); Sta_SetColor (ColorType,HitsNum[Hour],HitsMax,&R,&G,&B);
fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_MIDDLE\" title=\""); fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_MIDDLE\" title=\"");
Str_WriteFloatNum (HitsNum[Hour]); Str_WriteFloatNum (Gbl.F.Out,HitsNum[Hour]);
fprintf (Gbl.F.Out,"\" style=\"width:%upx;" fprintf (Gbl.F.Out,"\" style=\"width:%upx;"
" background-color:#%02X%02X%02X;\">" " background-color:#%02X%02X%02X;\">"
"</td>", "</td>",
@ -2727,7 +2727,7 @@ static void Sta_WriteAccessHour (unsigned Hour,struct Sta_Hits *Hits,unsigned Co
fprintf (Gbl.F.Out,"%u%%<br />", fprintf (Gbl.F.Out,"%u%%<br />",
(unsigned) (((Hits->Num * 100.0) / (unsigned) (((Hits->Num * 100.0) /
Hits->Total) + 0.5)); Hits->Total) + 0.5));
Str_WriteFloatNum (Hits->Num); Str_WriteFloatNum (Gbl.F.Out,Hits->Num);
fprintf (Gbl.F.Out,"<br />"); fprintf (Gbl.F.Out,"<br />");
BarHeight = (unsigned) (((Hits->Num * 500.0) / Hits->Max) + 0.5); BarHeight = (unsigned) (((Hits->Num * 500.0) / Hits->Max) + 0.5);
if (BarHeight == 0) if (BarHeight == 0)
@ -3740,7 +3740,7 @@ static void Sta_DrawBarNumHits (char Color,float HitsNum,float HitsMax,float Hit
Gbl.Prefs.IconsURL,Color,BarWidth); Gbl.Prefs.IconsURL,Color,BarWidth);
/***** Write the number of hits *****/ /***** Write the number of hits *****/
Str_WriteFloatNum (HitsNum); Str_WriteFloatNum (Gbl.F.Out,HitsNum);
fprintf (Gbl.F.Out,"&nbsp;(%u", fprintf (Gbl.F.Out,"&nbsp;(%u",
(unsigned) (((HitsNum * 100.0) / (unsigned) (((HitsNum * 100.0) /
HitsTotal) + 0.5)); HitsTotal) + 0.5));

View File

@ -813,7 +813,7 @@ char Str_ConvertToLowerLetter (char Ch)
/******** Write a number in floating point with the correct accuracy *********/ /******** Write a number in floating point with the correct accuracy *********/
/*****************************************************************************/ /*****************************************************************************/
void Str_WriteFloatNum (float Number) void Str_WriteFloatNum (FILE *FileDst,float Number)
{ {
double IntegerPart; double IntegerPart;
double FractionaryPart; double FractionaryPart;
@ -822,7 +822,7 @@ void Str_WriteFloatNum (float Number)
FractionaryPart = modf ((double) Number,&IntegerPart); FractionaryPart = modf ((double) Number,&IntegerPart);
if (FractionaryPart == 0.0) if (FractionaryPart == 0.0)
fprintf (Gbl.F.Out,"%.0f",IntegerPart); fprintf (FileDst,"%.0f",IntegerPart);
else else
{ {
if (IntegerPart != 0.0 || FractionaryPart >= 0.1) if (IntegerPart != 0.0 || FractionaryPart >= 0.1)
@ -839,7 +839,7 @@ void Str_WriteFloatNum (float Number)
Format = "%.7f"; Format = "%.7f";
else else
Format = "%e"; Format = "%e";
fprintf (Gbl.F.Out,Format,Number); fprintf (FileDst,Format,Number);
} }
} }

View File

@ -76,7 +76,7 @@ char *Str_ConvertToLowerText (char *Str);
char Str_ConvertToUpperLetter (char Ch); char Str_ConvertToUpperLetter (char Ch);
char Str_ConvertToLowerLetter (char Ch); char Str_ConvertToLowerLetter (char Ch);
void Str_WriteFloatNum (float Number); void Str_WriteFloatNum (FILE *FileDst,float Number);
void Str_ConvertStrFloatCommaToStrFloatPoint (char *Str); void Str_ConvertStrFloatCommaToStrFloatPoint (char *Str);
float Str_GetFloatNumFromStr (const char *Str); float Str_GetFloatNumFromStr (const char *Str);
void Str_SetDecimalPointToUS (void); void Str_SetDecimalPointToUS (void);

View File

@ -27046,7 +27046,7 @@ const char *Txt_Online_tutoring =
"Tutoria on-line"; "Tutoria on-line";
#endif #endif
const char *Txt_Only_courses_with_more_than_X_clicks_are_shown = const char *Txt_Only_courses_with_more_than_X_clicks_are_shown = // Warning: it is very important to include %u in the following sentences
#if L==1 #if L==1
"Nom&eacute;s es mostren les assignatures amb m&eacute;s de %u clics."; "Nom&eacute;s es mostren les assignatures amb m&eacute;s de %u clics.";
#elif L==2 #elif L==2