mirror of https://github.com/acanas/swad-core.git
Version19.55
This commit is contained in:
parent
0ae606cf54
commit
b430fbc969
77
swad_HTML.c
77
swad_HTML.c
|
@ -55,18 +55,19 @@ extern struct Globals Gbl;
|
|||
/***************************** Private vatiables *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static unsigned HTM_TABLE_NestingLevel = 0;
|
||||
static unsigned HTM_TR_NestingLevel = 0;
|
||||
static unsigned HTM_TH_NestingLevel = 0;
|
||||
static unsigned HTM_TD_NestingLevel = 0;
|
||||
static unsigned HTM_DIV_NestingLevel = 0;
|
||||
static unsigned HTM_UL_NestingLevel = 0;
|
||||
static unsigned HTM_LI_NestingLevel = 0;
|
||||
static unsigned HTM_A_NestingLevel = 0;
|
||||
static unsigned HTM_SCRIPT_NestingLevel = 0;
|
||||
static unsigned HTM_LABEL_NestingLevel = 0;
|
||||
static unsigned HTM_TABLE_NestingLevel = 0;
|
||||
static unsigned HTM_TR_NestingLevel = 0;
|
||||
static unsigned HTM_TH_NestingLevel = 0;
|
||||
static unsigned HTM_TD_NestingLevel = 0;
|
||||
static unsigned HTM_DIV_NestingLevel = 0;
|
||||
static unsigned HTM_SPAN_NestingLevel = 0;
|
||||
static unsigned HTM_UL_NestingLevel = 0;
|
||||
static unsigned HTM_LI_NestingLevel = 0;
|
||||
static unsigned HTM_A_NestingLevel = 0;
|
||||
static unsigned HTM_SCRIPT_NestingLevel = 0;
|
||||
static unsigned HTM_LABEL_NestingLevel = 0;
|
||||
static unsigned HTM_TEXTAREA_NestingLevel = 0;
|
||||
static unsigned HTM_SELECT_NestingLevel = 0;
|
||||
static unsigned HTM_SELECT_NestingLevel = 0;
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************************** Private prototypes ****************************/
|
||||
|
@ -83,6 +84,8 @@ static void HTM_TD_BeginWithoutAttr (void);
|
|||
|
||||
static void HTM_DIV_BeginWithoutAttr (void);
|
||||
|
||||
static void HTM_SPAN_BeginWithoutAttr (void);
|
||||
|
||||
static void HTM_UL_BeginWithoutAttr (void);
|
||||
static void HTM_LI_BeginWithoutAttr (void);
|
||||
|
||||
|
@ -558,6 +561,58 @@ void HTM_SECTION_End (void)
|
|||
fprintf (Gbl.F.Out,"</section>");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********************************** Spans ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void HTM_SPAN_Begin (const char *fmt,...)
|
||||
{
|
||||
va_list ap;
|
||||
int NumBytesPrinted;
|
||||
char *Attr;
|
||||
|
||||
if (fmt)
|
||||
{
|
||||
if (fmt[0])
|
||||
{
|
||||
va_start (ap,fmt);
|
||||
NumBytesPrinted = vasprintf (&Attr,fmt,ap);
|
||||
va_end (ap);
|
||||
|
||||
if (NumBytesPrinted < 0) // If memory allocation wasn't possible,
|
||||
// or some other error occurs,
|
||||
// vasprintf will return -1
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
|
||||
/***** Print HTML *****/
|
||||
fprintf (Gbl.F.Out,"<span %s>",Attr);
|
||||
|
||||
free (Attr);
|
||||
}
|
||||
else
|
||||
HTM_SPAN_BeginWithoutAttr ();
|
||||
}
|
||||
else
|
||||
HTM_SPAN_BeginWithoutAttr ();
|
||||
|
||||
HTM_SPAN_NestingLevel++;
|
||||
}
|
||||
|
||||
static void HTM_SPAN_BeginWithoutAttr (void)
|
||||
{
|
||||
fprintf (Gbl.F.Out,"<span>");
|
||||
}
|
||||
|
||||
void HTM_SPAN_End (void)
|
||||
{
|
||||
if (HTM_SPAN_NestingLevel == 0) // No SPAN open
|
||||
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened SPAN.");
|
||||
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
|
||||
HTM_SPAN_NestingLevel--;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************************** Unordered lists ******************************/
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -81,6 +81,9 @@ void HTM_ARTICLE_End (void);
|
|||
void HTM_SECTION_Begin (const char *SectionId);
|
||||
void HTM_SECTION_End (void);
|
||||
|
||||
void HTM_SPAN_Begin (const char *fmt,...);
|
||||
void HTM_SPAN_End (void);
|
||||
|
||||
void HTM_UL_Begin (const char *fmt,...);
|
||||
void HTM_UL_End (void);
|
||||
|
||||
|
|
18
swad_ID.c
18
swad_ID.c
|
@ -386,14 +386,14 @@ void ID_WriteUsrIDs (struct UsrData *UsrDat,const char *Anchor)
|
|||
if (NumID)
|
||||
fprintf (Gbl.F.Out,"<br />");
|
||||
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">",
|
||||
UsrDat->IDs.List[NumID].Confirmed ? "USR_ID_C" :
|
||||
"USR_ID_NC");
|
||||
HTM_SPAN_Begin ("class=\"%s\"",
|
||||
UsrDat->IDs.List[NumID].Confirmed ? "USR_ID_C" :
|
||||
"USR_ID_NC");
|
||||
if (ICanSeeUsrID)
|
||||
fprintf (Gbl.F.Out,"%s",UsrDat->IDs.List[NumID].ID);
|
||||
else
|
||||
fprintf (Gbl.F.Out,"********");
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
HTM_SPAN_End ();
|
||||
|
||||
if (ICanConfirmUsrID &&
|
||||
!UsrDat->IDs.List[NumID].Confirmed)
|
||||
|
@ -655,13 +655,15 @@ static void ID_ShowFormChangeUsrID (const struct UsrData *UsrDat,
|
|||
UsrDat->IDs.List[NumID].Confirmed ? Txt_ID_X_confirmed :
|
||||
Txt_ID_X_not_confirmed,
|
||||
UsrDat->IDs.List[NumID].ID);
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\" title=\"%s\">%s%s</span>",
|
||||
UsrDat->IDs.List[NumID].Confirmed ? "USR_ID_C" :
|
||||
"USR_ID_NC",
|
||||
Gbl.Title,
|
||||
HTM_SPAN_Begin ("class=\"%s\" title=\"%s\"",
|
||||
UsrDat->IDs.List[NumID].Confirmed ? "USR_ID_C" :
|
||||
"USR_ID_NC",
|
||||
Gbl.Title);
|
||||
fprintf (Gbl.F.Out,"%s%s",
|
||||
UsrDat->IDs.List[NumID].ID,
|
||||
UsrDat->IDs.List[NumID].Confirmed ? "✓" :
|
||||
"");
|
||||
HTM_SPAN_End ();
|
||||
if (NumID == UsrDat->IDs.Num - 1)
|
||||
{
|
||||
HTM_TD_End ();
|
||||
|
|
|
@ -3132,7 +3132,8 @@ static void Att_ListEventsToSelect (Att_TypeOfView_t TypeOfView)
|
|||
Lay_NotEnoughMemoryExit ();
|
||||
HTM_TD_Begin ("class=\"DAT LT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
HTM_LABEL_Begin ("for=\"Att%u\"",NumAttEvent);
|
||||
fprintf (Gbl.F.Out,"<span id=\"%s\"></span>",Id);
|
||||
HTM_SPAN_Begin ("id=\"%s\"",Id);
|
||||
HTM_SPAN_End ();
|
||||
HTM_LABEL_End ();
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,Gbl.AttEvents.Lst[NumAttEvent].TimeUTC[Att_START_TIME],
|
||||
Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA,
|
||||
|
@ -3575,10 +3576,9 @@ static void Att_ListAttEventsForAStd (unsigned NumUsr,struct UsrData *UsrDat)
|
|||
if (asprintf (&Id,"att_date_start_%u_%u",NumUsr,UniqueId) < 0)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
HTM_TD_Begin ("class=\"DAT LT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
fprintf (Gbl.F.Out,"<span id=\"%s\"></span>"
|
||||
"<br />%s",
|
||||
Id,
|
||||
Gbl.AttEvents.Lst[NumAttEvent].Title);
|
||||
HTM_SPAN_Begin ("id=\"%s\"",Id);
|
||||
HTM_SPAN_End ();
|
||||
fprintf (Gbl.F.Out,"<br />%s",Gbl.AttEvents.Lst[NumAttEvent].Title);
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,Gbl.AttEvents.Lst[NumAttEvent].TimeUTC[Att_START_TIME],
|
||||
Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA,
|
||||
true,true,true,0x7);
|
||||
|
|
|
@ -490,7 +490,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
|||
En OpenSWAD:
|
||||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.54.10 (2019-11-07)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.55 (2019-11-07)"
|
||||
#define CSS_FILE "swad19.47.css"
|
||||
#define JS_FILE "swad19.39.js"
|
||||
/*
|
||||
|
@ -498,6 +498,8 @@ ps2pdf source.ps destination.pdf
|
|||
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
||||
// TODO: Importante: filtrar proyectos por usuarios (igual que en trabajos o en asistencia)
|
||||
|
||||
Version 19.55: Nov 07, 2019 Code refactoring in HTML spans.
|
||||
Fixed bug in groups. (246058 lines)
|
||||
Version 19.54.10: Nov 07, 2019 Code refactoring in HTML select options. (245888 lines)
|
||||
Version 19.54.9: Nov 07, 2019 Code refactoring in HTML select options.
|
||||
Fixed bug in dates form. (245936 lines)
|
||||
|
|
14
swad_date.c
14
swad_date.c
|
@ -159,8 +159,8 @@ static void Dat_PutIconsDateFormat (void)
|
|||
|
||||
void Dat_PutSpanDateFormat (Dat_Format_t Format)
|
||||
{
|
||||
fprintf (Gbl.F.Out,"<span id=\"date_format_%u\"></span>",
|
||||
(unsigned) Format);
|
||||
HTM_SPAN_Begin ("id=\"date_format_%u\"",(unsigned) Format);
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
|
||||
void Dat_PutScriptDateFormat (Dat_Format_t Format)
|
||||
|
@ -318,8 +318,9 @@ void Dat_ShowClientLocalTime (void)
|
|||
HTM_DIV_Begin ("id=\"current_month\"");
|
||||
Frm_StartForm (ActSeeCal);
|
||||
Frm_LinkFormSubmit (Txt_Show_calendar,"CURRENT_MONTH",NULL);
|
||||
fprintf (Gbl.F.Out,"<span id=\"current_month_txt\">" // JavaScript will write HTML here
|
||||
"</span>");
|
||||
HTM_SPAN_Begin ("id=\"current_month_txt\"");
|
||||
// JavaScript will write HTML here
|
||||
HTM_SPAN_End ();
|
||||
Frm_LinkFormEnd ();
|
||||
Frm_EndForm ();
|
||||
HTM_DIV_End ();
|
||||
|
@ -331,8 +332,9 @@ void Dat_ShowClientLocalTime (void)
|
|||
Frm_StartForm (ActSeeMyAgd);
|
||||
Frm_LinkFormSubmit (Txt_Show_agenda,"CURRENT_DAY",NULL);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"<span id=\"current_day_txt\">" // JavaScript will write HTML here
|
||||
"</span>");
|
||||
HTM_SPAN_Begin ("id=\"current_day_txt\"");
|
||||
// JavaScript will write HTML here
|
||||
HTM_SPAN_End ();
|
||||
if (Gbl.Usrs.Me.Logged)
|
||||
{
|
||||
Frm_LinkFormEnd ();
|
||||
|
|
|
@ -1047,7 +1047,7 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
|
|||
HTM_TR_Begin (NULL);
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"CM\"");
|
||||
if (TypeViewExamAnnouncement == Exa_PRINT_VIEW)
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">",StyleTitle);
|
||||
HTM_SPAN_Begin ("class=\"%s\"",StyleTitle);
|
||||
else
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"%s\"",
|
||||
Ins.WWW,StyleTitle);
|
||||
|
@ -1055,7 +1055,7 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
|
|||
fprintf (Gbl.F.Out,"<br />%s",
|
||||
Ins.FullName);
|
||||
if (TypeViewExamAnnouncement == Exa_PRINT_VIEW)
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
HTM_SPAN_End ();
|
||||
else
|
||||
HTM_A_End ();
|
||||
HTM_TD_End ();
|
||||
|
|
|
@ -6271,13 +6271,12 @@ static void Brw_WriteFileName (unsigned Level,bool IsPublic)
|
|||
if ((Level == 1) &&
|
||||
(Gbl.FileBrowser.Type == Brw_ADMI_ASG_USR ||
|
||||
Gbl.FileBrowser.Type == Brw_ADMI_ASG_CRS))
|
||||
fprintf (Gbl.F.Out,"<span title=\"%s\">",
|
||||
Gbl.FileBrowser.Asg.Title);
|
||||
HTM_SPAN_Begin ("title=\"%s\"",Gbl.FileBrowser.Asg.Title);
|
||||
fprintf (Gbl.F.Out,"<strong>%s</strong> ",FileNameToShow);
|
||||
if ((Level == 1) &&
|
||||
(Gbl.FileBrowser.Type == Brw_ADMI_ASG_USR ||
|
||||
Gbl.FileBrowser.Type == Brw_ADMI_ASG_CRS))
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
|
||||
/***** End cell *****/
|
||||
|
@ -6392,11 +6391,11 @@ static void Brw_WriteDatesAssignment (void)
|
|||
/***** Write start date *****/
|
||||
if (asprintf (&Id,"asg_start_date_%u",UniqueId) < 0)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
fprintf (Gbl.F.Out,"<span id=\"%s\">",Id);
|
||||
HTM_SPAN_Begin ("id=\"%s\"",Id);
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,Gbl.FileBrowser.Asg.TimeUTC[Dat_START_TIME],
|
||||
Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA,
|
||||
true,true,false,0x7);
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
HTM_SPAN_End ();
|
||||
free (Id);
|
||||
|
||||
/***** Arrow *****/
|
||||
|
@ -6405,11 +6404,11 @@ static void Brw_WriteDatesAssignment (void)
|
|||
/***** Write end date *****/
|
||||
if (asprintf (&Id,"asg_end_date_%u",UniqueId) < 0)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
fprintf (Gbl.F.Out,"<span id=\"%s\">",Id);
|
||||
HTM_SPAN_Begin ("id=\"%s\"",Id);
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,Gbl.FileBrowser.Asg.TimeUTC[Dat_END_TIME],
|
||||
Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA,
|
||||
true,false,false,0x7);
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
HTM_SPAN_End ();
|
||||
free (Id);
|
||||
}
|
||||
else
|
||||
|
@ -6447,7 +6446,8 @@ static void Brw_WriteFileSizeAndDate (struct FileMetadata *FileMetadata)
|
|||
UniqueId++;
|
||||
if (asprintf (&Id,"filedate%u",UniqueId) < 0)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
fprintf (Gbl.F.Out,"<span id=\"%s\"></span>",Id);
|
||||
HTM_SPAN_Begin ("id=\"%s\"",Id);
|
||||
HTM_SPAN_End ();
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,FileMetadata->Time,
|
||||
Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA,
|
||||
true,true,false,0x6);
|
||||
|
@ -8386,9 +8386,11 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow)
|
|||
Brw_PutImplicitParamsFileBrowser ();
|
||||
|
||||
HTM_DIV_Begin ("class=\"dz-message\"");
|
||||
fprintf (Gbl.F.Out,"<span class=\"DAT_LIGHT\">%s</span>",
|
||||
Txt_Select_one_or_more_files_from_your_computer_or_drag_and_drop_here);
|
||||
HTM_SPAN_Begin ("class=\"DAT_LIGHT\"");
|
||||
fprintf (Gbl.F.Out,"%s",Txt_Select_one_or_more_files_from_your_computer_or_drag_and_drop_here);
|
||||
HTM_SPAN_End ();
|
||||
HTM_DIV_End ();
|
||||
|
||||
fprintf (Gbl.F.Out,"</form>");
|
||||
|
||||
/***** Put button to refresh file browser after upload *****/
|
||||
|
|
|
@ -610,9 +610,8 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat,
|
|||
"FOLLOW_NUM",NULL);
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">",
|
||||
(Gbl.Action.Act == Action) ? "FOLLOW_NUM_B" :
|
||||
"FOLLOW_NUM");
|
||||
HTM_SPAN_Begin ("class=\"%s\"",(Gbl.Action.Act == Action) ? "FOLLOW_NUM_B" :
|
||||
"FOLLOW_NUM");
|
||||
fprintf (Gbl.F.Out,"%u",NumUsrs);
|
||||
if (NumUsrs)
|
||||
{
|
||||
|
@ -620,7 +619,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat,
|
|||
Frm_EndForm ();
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
HTM_SPAN_End ();
|
||||
|
||||
/***** Text *****/
|
||||
HTM_DIV_Begin ("class=\"%s\"",
|
||||
|
|
|
@ -1240,11 +1240,11 @@ static void For_ShowAForumPost (unsigned PstNum,long PstCod,
|
|||
Enabled ? Txt_FORUM_Post_X_allowed :
|
||||
Txt_FORUM_Post_X_banned,
|
||||
PstNum);
|
||||
fprintf (Gbl.F.Out,"<span title=\"%s\">",Gbl.Title); // TODO: Remove?
|
||||
HTM_SPAN_Begin ("title=\"%s\"",Gbl.Title); // TODO: Remove?
|
||||
Ico_PutIcon (Enabled ? "eye.svg" :
|
||||
"eye-slash.svg",
|
||||
Gbl.Title,"ICO_HIDDEN ICO16x16");
|
||||
fprintf (Gbl.F.Out,"</span>"); // TODO: Remove?
|
||||
HTM_SPAN_End (); // TODO: Remove?
|
||||
}
|
||||
|
||||
/***** Form to remove post *****/
|
||||
|
|
12
swad_group.c
12
swad_group.c
|
@ -2270,8 +2270,9 @@ static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp,
|
|||
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
HTM_INPUT_CHECKBOX ("GrpCods",false,
|
||||
"id=\"Grp%ld\" value=\"%ld\"%s%s onclick=\"checkParent(this,'AllGroups')\"",
|
||||
-(GrpTyp->GrpTypCod),-(GrpTyp->GrpTypCod),
|
||||
"id=\"Grp%ld\" value=\"%ld\"%s"
|
||||
" onclick=\"checkParent(this,'AllGroups')\"",
|
||||
-GrpTyp->GrpTypCod,-GrpTyp->GrpTypCod,
|
||||
ICanSelUnselGroup ? (Checked ? " checked=\"checked\"" : "") :
|
||||
" disabled=\"disabled\"");
|
||||
HTM_TD_End ();
|
||||
|
@ -2332,10 +2333,9 @@ static void Grp_WriteGrpHead (struct GroupType *GrpTyp)
|
|||
UniqueId++;
|
||||
if (asprintf (&Id,"open_time_%u",UniqueId) < 0)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
fprintf (Gbl.F.Out,"<br />%s: "
|
||||
"<span id=\"%s\"></span>",
|
||||
Txt_Opening_of_groups,
|
||||
Id);
|
||||
fprintf (Gbl.F.Out,"<br />%s: ",Txt_Opening_of_groups);
|
||||
HTM_SPAN_Begin ("id=\"%s\"",Id);
|
||||
HTM_SPAN_End ();
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,GrpTyp->OpenTimeUTC,
|
||||
Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA,
|
||||
true,true,true,0x7);
|
||||
|
|
|
@ -1166,8 +1166,11 @@ void Inf_FormsToSelSendInfo (void)
|
|||
fprintf (Gbl.F.Out,"%s",Txt_INFO_SRC_FULL_TEXT[InfoSrc]);
|
||||
HTM_LABEL_End ();
|
||||
if (Txt_INFO_SRC_HELP[InfoSrc])
|
||||
fprintf (Gbl.F.Out,"<span class=\"DAT\"><br />(%s)</span>",
|
||||
Txt_INFO_SRC_HELP[InfoSrc]);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"DAT\"");
|
||||
fprintf (Gbl.F.Out,"<br />(%s)",Txt_INFO_SRC_HELP[InfoSrc]);
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
if (Inf_FormsForEditionTypes[InfoSrc])
|
||||
Inf_FormsForEditionTypes[InfoSrc] (InfoSrc);
|
||||
HTM_TD_End ();
|
||||
|
|
|
@ -573,7 +573,9 @@ static void Mch_ListOneOrMoreMatchesTitleGrps (const struct Match *Match)
|
|||
HTM_TD_Begin ("class=\"LT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
|
||||
/***** Title *****/
|
||||
fprintf (Gbl.F.Out,"<span class=\"ASG_TITLE\">%s</span>",Match->Title);
|
||||
HTM_SPAN_Begin ("class=\"ASG_TITLE\"");
|
||||
fprintf (Gbl.F.Out,"%s",Match->Title);
|
||||
HTM_SPAN_End ();
|
||||
|
||||
/***** Groups whose students can answer this match *****/
|
||||
if (Gbl.Crs.Grps.NumGrps)
|
||||
|
|
|
@ -1631,9 +1631,9 @@ static void Med_ShowGIF (struct Media *Media,
|
|||
"class=\"%s\" lazyload=\"on\"",ClassMedia); // Lazy load of the media
|
||||
|
||||
/* Overlay with GIF label */
|
||||
fprintf (Gbl.F.Out,"<span class=\"MED_PLAY_ICO\">"
|
||||
"GIF"
|
||||
"</span>");
|
||||
HTM_SPAN_Begin ("class=\"MED_PLAY_ICO\"");
|
||||
fprintf (Gbl.F.Out,"GIF");
|
||||
HTM_SPAN_End ();
|
||||
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
|
|
@ -693,7 +693,8 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
|
|||
}
|
||||
if (asprintf (&Id,"not_date_%u",UniqueId) < 0)
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
fprintf (Gbl.F.Out,"<span id=\"%s\"></span>",Id);
|
||||
HTM_SPAN_Begin ("id=\"%s\"",Id);
|
||||
HTM_SPAN_End ();
|
||||
if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES)
|
||||
{
|
||||
Frm_LinkFormEnd ();
|
||||
|
|
|
@ -500,8 +500,11 @@ void Ntf_ShowMyNotifications (void)
|
|||
Frm_EndForm ();
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">%s</span>",
|
||||
ClassAnchor,Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"%s\"",ClassAnchor);
|
||||
fprintf (Gbl.F.Out,"%s",Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]);
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Write user (from) */
|
||||
|
@ -520,7 +523,7 @@ void Ntf_ShowMyNotifications (void)
|
|||
if (PutLink)
|
||||
Frm_LinkFormSubmit (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent],ClassAnchor,NULL);
|
||||
else
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">",ClassAnchor);
|
||||
HTM_SPAN_Begin ("class=\"%s\"",ClassAnchor);
|
||||
fprintf (Gbl.F.Out,"%s: %s",Txt_Forum,ForumName);
|
||||
if (PutLink)
|
||||
{
|
||||
|
@ -528,7 +531,7 @@ void Ntf_ShowMyNotifications (void)
|
|||
Frm_EndForm ();
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -538,7 +541,7 @@ void Ntf_ShowMyNotifications (void)
|
|||
if (PutLink)
|
||||
Frm_LinkFormSubmit (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent],ClassAnchor,NULL);
|
||||
else
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">",ClassAnchor);
|
||||
HTM_SPAN_Begin ("class=\"%s\"",ClassAnchor);
|
||||
|
||||
if (Crs.CrsCod > 0)
|
||||
fprintf (Gbl.F.Out,"%s: %s",Txt_Course,Crs.ShrtName);
|
||||
|
@ -557,7 +560,7 @@ void Ntf_ShowMyNotifications (void)
|
|||
Frm_EndForm ();
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -2049,20 +2052,24 @@ void Ntf_WriteNumberOfNewNtfs (void)
|
|||
The_ClassNotif[Gbl.Prefs.Theme],"form_ntf",NULL);
|
||||
|
||||
/***** Number of unseen notifications *****/
|
||||
fprintf (Gbl.F.Out,"<span id=\"notif_all\">%u %s<br /></span>",
|
||||
HTM_SPAN_Begin ("id=\"notif_all\"");
|
||||
fprintf (Gbl.F.Out,"%u %s<br />",
|
||||
NumUnseenNtfs,
|
||||
NumUnseenNtfs == 1 ? Txt_notification :
|
||||
Txt_notifications);
|
||||
HTM_SPAN_End ();
|
||||
|
||||
/***** Icon and number of new notifications *****/
|
||||
if (NumNewNtfs)
|
||||
{
|
||||
HTM_IMG (Gbl.Prefs.URLTheme,"bell.svg",Txt_Notifications,
|
||||
"class=\"ICO16x16\"");
|
||||
fprintf (Gbl.F.Out," %u<span id=\"notif_new\"> %s</span>",
|
||||
NumNewNtfs,
|
||||
fprintf (Gbl.F.Out," %u",NumNewNtfs);
|
||||
HTM_SPAN_Begin ("id=\"notif_new\"");
|
||||
fprintf (Gbl.F.Out," %s",
|
||||
NumNewNtfs == 1 ? Txt_NOTIF_new_SINGULAR :
|
||||
Txt_NOTIF_new_PLURAL);
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
|
||||
/***** End form *****/
|
||||
|
|
|
@ -242,7 +242,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
Frm_LinkFormSubmit (Gbl.Title,Font,NULL);
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">",Font);
|
||||
HTM_SPAN_Begin ("class=\"%s\"",Font);
|
||||
if (FirstMsgEnabled)
|
||||
fprintf (Gbl.F.Out,"%s",Subject);
|
||||
else
|
||||
|
@ -253,7 +253,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
Frm_EndForm ();
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
HTM_SPAN_End ();
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
|
@ -355,7 +355,11 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
Frm_LinkFormEnd ();
|
||||
Frm_EndForm ();
|
||||
if (Pagination->LeftPage > 2)
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">…</span>",Font);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"%s\"",Font);
|
||||
fprintf (Gbl.F.Out,"…");
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
}
|
||||
|
||||
/***** Posible link to page left *****/
|
||||
|
@ -451,7 +455,11 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
Frm_LinkFormEnd ();
|
||||
Frm_EndForm ();
|
||||
if (Pagination->LeftPage < Pagination->StartPage - 1)
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">…</span>",Font);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"%s\"",Font);
|
||||
fprintf (Gbl.F.Out,"…");
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
}
|
||||
|
||||
/***** Loop to put links to the pages around the current one *****/
|
||||
|
@ -463,10 +471,11 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
Txt_Page_X_of_Y,
|
||||
NumPage,Pagination->NumPags);
|
||||
if (!LinkToPagCurrent && NumPage == Pagination->CurrentPage)
|
||||
fprintf (Gbl.F.Out,"<span title=\"%s\" class=\"PAG_CUR %s\">"
|
||||
"%u"
|
||||
"</span>",
|
||||
Gbl.Title,Font,NumPage);
|
||||
{
|
||||
HTM_SPAN_Begin ("title=\"%s\" class=\"PAG_CUR %s\"",Gbl.Title,Font);
|
||||
fprintf (Gbl.F.Out,"%u",NumPage);
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (WhatPaginate)
|
||||
|
@ -561,7 +570,11 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
Pagination->RightPage < Pagination->NumPags)
|
||||
{
|
||||
if (Pagination->RightPage > Pagination->EndPage + 1)
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">…</span>",Font);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"%s\"",Font);
|
||||
fprintf (Gbl.F.Out,"…");
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
switch (WhatPaginate)
|
||||
{
|
||||
case Pag_ASSIGNMENTS:
|
||||
|
@ -655,7 +668,11 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
if (Pagination->EndPage < Pagination->NumPags)
|
||||
{
|
||||
if (Pagination->NumPags > Pagination->RightPage + 1)
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">…</span>",Font);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"%s\"",Font);
|
||||
fprintf (Gbl.F.Out,"…");
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
switch (WhatPaginate)
|
||||
{
|
||||
case Pag_ASSIGNMENTS:
|
||||
|
|
34
swad_photo.c
34
swad_photo.c
|
@ -1252,12 +1252,23 @@ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
|
|||
{
|
||||
Fol_GetNumFollow (UsrDat->UsrCod,&NumFollowing,&NumFollowers);
|
||||
HTM_DIV_Begin ("class=\"ZOOM_TXT_LINE\"");
|
||||
fprintf (Gbl.F.Out,"<span class=\"DAT_N_BOLD\">%u</span>"
|
||||
"<span class=\"DAT_SMALL\"> %s </span>"
|
||||
"<span class=\"DAT_N_BOLD\">%u</span>"
|
||||
"<span class=\"DAT_SMALL\"> %s</span>",
|
||||
NumFollowing,Txt_Following,
|
||||
NumFollowers,Txt_Followers);
|
||||
|
||||
HTM_SPAN_Begin ("class=\"DAT_N_BOLD\"");
|
||||
fprintf (Gbl.F.Out,"%u",NumFollowing);
|
||||
HTM_SPAN_End ();
|
||||
|
||||
HTM_SPAN_Begin ("class=\"DAT_SMALL\"");
|
||||
fprintf (Gbl.F.Out," %s ",Txt_Following);
|
||||
HTM_SPAN_End ();
|
||||
|
||||
HTM_SPAN_Begin ("class=\"DAT_N_BOLD\"");
|
||||
fprintf (Gbl.F.Out,"%u",NumFollowers);
|
||||
HTM_SPAN_End ();
|
||||
|
||||
HTM_SPAN_Begin ("class=\"DAT_SMALL\"");
|
||||
fprintf (Gbl.F.Out," %s",Txt_Followers);
|
||||
HTM_SPAN_End ();
|
||||
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
|
@ -2411,11 +2422,16 @@ static void Pho_ShowDegreeStat (int NumStds,int NumStdsWithPhoto)
|
|||
{
|
||||
extern const char *Txt_photos;
|
||||
|
||||
fprintf (Gbl.F.Out,"<span class=\"DAT\">%d </span>"
|
||||
"<span class=\"DAT_SMALL\">(%d %s, %d%%)</span>",
|
||||
NumStds,NumStdsWithPhoto,Txt_photos,
|
||||
HTM_SPAN_Begin ("class=\"DAT\"");
|
||||
fprintf (Gbl.F.Out,"%d ",NumStds);
|
||||
HTM_SPAN_End ();
|
||||
|
||||
HTM_SPAN_Begin ("class=\"DAT_SMALL\"");
|
||||
fprintf (Gbl.F.Out,"(%d %s, %d%%)",
|
||||
NumStdsWithPhoto,Txt_photos,
|
||||
NumStds > 0 ? (int) (((NumStdsWithPhoto * 100.0) / NumStds) + 0.5) :
|
||||
0);
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -475,7 +475,8 @@ static void Prf_ShowTimeSinceFirstClick (const struct UsrData *UsrDat,
|
|||
/* Create unique id */
|
||||
Frm_SetUniqueId (IdFirstClickTime);
|
||||
|
||||
fprintf (Gbl.F.Out,"<span id=\"%s\"></span>",IdFirstClickTime);
|
||||
HTM_SPAN_Begin ("id=\"%s\"",IdFirstClickTime);
|
||||
HTM_SPAN_End ();
|
||||
if (UsrFigures->NumDays > 0)
|
||||
{
|
||||
fprintf (Gbl.F.Out," (");
|
||||
|
|
|
@ -1803,8 +1803,12 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView,
|
|||
fprintf (Gbl.F.Out,"%s:",Gbl.Crs.Records.LstFields.Lst[NumField].Name);
|
||||
if (TypeOfView == Rec_CRS_LIST_ONE_RECORD ||
|
||||
TypeOfView == Rec_CRS_LIST_SEVERAL_RECORDS)
|
||||
fprintf (Gbl.F.Out,"<span class=\"DAT_SMALL\"> (%s)</span>",
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"DAT_SMALL\"");
|
||||
fprintf (Gbl.F.Out," (%s)",
|
||||
Txt_RECORD_FIELD_VISIBILITY_RECORD[Gbl.Crs.Records.LstFields.Lst[NumField].Visibility]);
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Get the text of the field */
|
||||
|
|
|
@ -305,17 +305,21 @@ static void Rep_TitleReport (struct Rep_CurrentTimeUTC *CurrentTimeUTC)
|
|||
HTM_DIV_Begin ("class=\"TITLE_REPORT DAT\"");
|
||||
|
||||
/***** User *****/
|
||||
fprintf (Gbl.F.Out,"%s: <span class=\"DAT_N_BOLD\">%s</span>",
|
||||
Txt_User[Gbl.Usrs.Me.UsrDat.Sex],
|
||||
Gbl.Usrs.Me.UsrDat.FullName);
|
||||
fprintf (Gbl.F.Out,"%s: ",Txt_User[Gbl.Usrs.Me.UsrDat.Sex]);
|
||||
HTM_SPAN_Begin ("class=\"DAT_N_BOLD\"");
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.Usrs.Me.UsrDat.FullName);
|
||||
HTM_SPAN_End ();
|
||||
|
||||
/***** Report date *****/
|
||||
if (CurrentTimeUTC)
|
||||
{
|
||||
fprintf (Gbl.F.Out,"<br />"
|
||||
"%s: <span class=\"DAT_N\">%s %s UTC</span>",
|
||||
Txt_Date,
|
||||
CurrentTimeUTC->StrDate,
|
||||
CurrentTimeUTC->StrTime);
|
||||
"%s: ",Txt_Date);
|
||||
HTM_SPAN_Begin ("class=\"DAT_N\"");
|
||||
fprintf (Gbl.F.Out,"%s %s UTC",CurrentTimeUTC->StrDate,
|
||||
CurrentTimeUTC->StrTime);
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
|
122
swad_test.c
122
swad_test.c
|
@ -635,12 +635,15 @@ void Tst_ShowTstTotalMark (unsigned NumQsts,double TotalScore)
|
|||
|
||||
/***** Write total mark ****/
|
||||
HTM_DIV_Begin ("class=\"DAT CM\"");
|
||||
fprintf (Gbl.F.Out,"%s: <span class=\"%s\">%.2lf (%.2lf %s %u)</span>",
|
||||
Txt_Score,
|
||||
(TotalScoreOverSCORE_MAX >= (double) TotalScoreOverSCORE_MAX / 2.0) ? "ANS_OK" :
|
||||
"ANS_BAD",
|
||||
fprintf (Gbl.F.Out,"%s: ",Txt_Score);
|
||||
HTM_SPAN_Begin ("class=\"%s\"",
|
||||
(TotalScoreOverSCORE_MAX >=
|
||||
(double) TotalScoreOverSCORE_MAX / 2.0) ? "ANS_OK" :
|
||||
"ANS_BAD");
|
||||
fprintf (Gbl.F.Out,"%.2lf (%.2lf %s %u)",
|
||||
TotalScore,
|
||||
TotalScoreOverSCORE_MAX,Txt_out_of_PART_OF_A_SCORE,Tst_SCORE_MAX);
|
||||
HTM_SPAN_End ();
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
|
@ -3301,8 +3304,9 @@ void Tst_WriteAnswersEdit (long QstCod)
|
|||
case Tst_ANS_INT:
|
||||
Tst_CheckIfNumberOfAnswersIsOne ();
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
fprintf (Gbl.F.Out,"<span class=\"TEST_EDI\">(%ld)</span>",
|
||||
Tst_GetIntAnsFromStr (row[1]));
|
||||
HTM_SPAN_Begin ("class=\"TEST_EDI\"");
|
||||
fprintf (Gbl.F.Out,"(%ld)",Tst_GetIntAnsFromStr (row[1]));
|
||||
HTM_SPAN_End ();
|
||||
break;
|
||||
case Tst_ANS_FLOAT:
|
||||
if (Gbl.Test.Answer.NumOptions != 2)
|
||||
|
@ -3315,15 +3319,18 @@ void Tst_WriteAnswersEdit (long QstCod)
|
|||
row = mysql_fetch_row (mysql_res);
|
||||
FloatNum[i] = Tst_GetFloatAnsFromStr (row[1]);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"<span class=\"TEST_EDI\">([%lg; %lg])</span>",
|
||||
FloatNum[0],FloatNum[1]);
|
||||
HTM_SPAN_Begin ("class=\"TEST_EDI\"");
|
||||
fprintf (Gbl.F.Out,"([%lg; %lg])",FloatNum[0],FloatNum[1]);
|
||||
HTM_SPAN_End ();
|
||||
break;
|
||||
case Tst_ANS_TRUE_FALSE:
|
||||
Tst_CheckIfNumberOfAnswersIsOne ();
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
fprintf (Gbl.F.Out,"<span class=\"TEST_EDI\">(");
|
||||
HTM_SPAN_Begin ("class=\"TEST_EDI\"");
|
||||
fprintf (Gbl.F.Out,"(");
|
||||
Tst_WriteAnsTF (row[1][0]);
|
||||
fprintf (Gbl.F.Out,")</span>");
|
||||
fprintf (Gbl.F.Out,")");
|
||||
HTM_SPAN_End ();
|
||||
break;
|
||||
case Tst_ANS_UNIQUE_CHOICE:
|
||||
case Tst_ANS_MULTIPLE_CHOICE:
|
||||
|
@ -3620,11 +3627,21 @@ static void Tst_WriteTFAnsAssessTest (struct UsrData *UsrDat,
|
|||
{
|
||||
Tst_WriteScoreStart (2);
|
||||
if (AnsTF == '\0') // If user has omitted the answer
|
||||
fprintf (Gbl.F.Out,"ANS_0\">%.2lf",0.0);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",0.0);
|
||||
}
|
||||
else if (AnsTF == row[1][0]) // If correct
|
||||
fprintf (Gbl.F.Out,"ANS_OK\">%.2lf",1.0);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",1.0);
|
||||
}
|
||||
else // If wrong
|
||||
fprintf (Gbl.F.Out,"ANS_BAD\">%.2lf",-1.0);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",-1.0);
|
||||
}
|
||||
HTM_SPAN_End ();
|
||||
Tst_WriteScoreEnd ();
|
||||
}
|
||||
|
||||
|
@ -3879,12 +3896,13 @@ static void Tst_WriteChoiceAnsAssessTest (struct UsrData *UsrDat,
|
|||
{
|
||||
Tst_WriteScoreStart (4);
|
||||
if (*ScoreThisQst == 0.0)
|
||||
fprintf (Gbl.F.Out,"ANS_0");
|
||||
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
||||
else if (*ScoreThisQst > 0.0)
|
||||
fprintf (Gbl.F.Out,"ANS_OK");
|
||||
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
||||
else
|
||||
fprintf (Gbl.F.Out,"ANS_BAD");
|
||||
fprintf (Gbl.F.Out,"\">%.2lf",*ScoreThisQst);
|
||||
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",*ScoreThisQst);
|
||||
HTM_SPAN_End ();
|
||||
Tst_WriteScoreEnd ();
|
||||
}
|
||||
|
||||
|
@ -4397,11 +4415,21 @@ static void Tst_WriteTextAnsAssessTest (struct UsrData *UsrDat,
|
|||
{
|
||||
Tst_WriteScoreStart (4);
|
||||
if (!Gbl.Test.StrAnswersOneQst[NumQst][0]) // If user has omitted the answer
|
||||
fprintf (Gbl.F.Out,"ANS_0\">%.2lf",0.0);
|
||||
else if (Correct) // If correct
|
||||
fprintf (Gbl.F.Out,"ANS_OK\">%.2lf",1.0);
|
||||
else // If wrong
|
||||
fprintf (Gbl.F.Out,"ANS_BAD\">%.2lf",0.0);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",0.0);
|
||||
}
|
||||
else if (Correct) // If correct
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",1.0);
|
||||
}
|
||||
else // If wrong
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",0.0);
|
||||
}
|
||||
HTM_SPAN_End ();
|
||||
Tst_WriteScoreEnd ();
|
||||
}
|
||||
|
||||
|
@ -4516,11 +4544,21 @@ static void Tst_WriteIntAnsAssessTest (struct UsrData *UsrDat,
|
|||
{
|
||||
Tst_WriteScoreStart (2);
|
||||
if (!Gbl.Test.StrAnswersOneQst[NumQst][0]) // If user has omitted the answer
|
||||
fprintf (Gbl.F.Out,"ANS_0\">%.2lf",0.0);
|
||||
else if (IntAnswerUsr == IntAnswerCorr) // If correct
|
||||
fprintf (Gbl.F.Out,"ANS_OK\">%.2lf",1.0);
|
||||
else // If wrong
|
||||
fprintf (Gbl.F.Out,"ANS_BAD\">%.2lf",0.0);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",0.0);
|
||||
}
|
||||
else if (IntAnswerUsr == IntAnswerCorr) // If correct
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",1.0);
|
||||
}
|
||||
else // If wrong
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",0.0);
|
||||
}
|
||||
HTM_SPAN_End ();
|
||||
Tst_WriteScoreEnd ();
|
||||
}
|
||||
|
||||
|
@ -4649,12 +4687,22 @@ static void Tst_WriteFloatAnsAssessTest (struct UsrData *UsrDat,
|
|||
{
|
||||
Tst_WriteScoreStart (2);
|
||||
if (!Gbl.Test.StrAnswersOneQst[NumQst][0]) // If user has omitted the answer
|
||||
fprintf (Gbl.F.Out,"ANS_0\">%.2lf",0.0);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",0.0);
|
||||
}
|
||||
else if (FloatAnsUsr >= FloatAnsCorr[0] &&
|
||||
FloatAnsUsr <= FloatAnsCorr[1]) // If correct (inside the interval)
|
||||
fprintf (Gbl.F.Out,"ANS_OK\">%.2lf",1.0);
|
||||
else // If wrong (outside the interval)
|
||||
fprintf (Gbl.F.Out,"ANS_BAD\">%.2lf",0.0);
|
||||
FloatAnsUsr <= FloatAnsCorr[1]) // If correct (inside the interval)
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",1.0);
|
||||
}
|
||||
else // If wrong (outside the interval)
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
||||
fprintf (Gbl.F.Out,"%.2lf",0.0);
|
||||
}
|
||||
HTM_SPAN_End ();
|
||||
Tst_WriteScoreEnd ();
|
||||
}
|
||||
|
||||
|
@ -4690,12 +4738,11 @@ static void Tst_WriteScoreStart (unsigned ColSpan)
|
|||
|
||||
HTM_TR_Begin (NULL);
|
||||
HTM_TD_Begin ("colspan=\"%u\" class=\"DAT_SMALL LM\"",ColSpan);
|
||||
fprintf (Gbl.F.Out,"%s: <span class=\"",Txt_Score);
|
||||
fprintf (Gbl.F.Out,"%s: ",Txt_Score);
|
||||
}
|
||||
|
||||
static void Tst_WriteScoreEnd (void)
|
||||
{
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
HTM_TD_End ();
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
@ -4767,8 +4814,11 @@ void Tst_GetAndWriteTagsQst (long QstCod)
|
|||
HTM_UL_End ();
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Out,"<span class=\"DAT_SMALL\">(%s)</span>",
|
||||
Txt_no_tags);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"DAT_SMALL\"");
|
||||
fprintf (Gbl.F.Out,"(%s)",Txt_no_tags);
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
|
||||
/***** Free structure that stores the query result *****/
|
||||
DB_FreeMySQLResult (&mysql_res);
|
||||
|
|
|
@ -1039,8 +1039,11 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem,
|
|||
HTM_TABLE_End ();
|
||||
}
|
||||
else // no tags for this question
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\"> (%s) </span>",
|
||||
ClassData,Txt_no_tags);
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"%s\"",ClassData);
|
||||
fprintf (Gbl.F.Out," (%s) ",Txt_no_tags);
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -1067,17 +1070,23 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem,
|
|||
switch (Gbl.Test.AnswerType)
|
||||
{
|
||||
case Tst_ANS_INT:
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">(%ld)</span>",
|
||||
ClassStem,Gbl.Test.Answer.Integer);
|
||||
HTM_SPAN_Begin ("class=\"%s\"",ClassStem);
|
||||
fprintf (Gbl.F.Out,"(%ld)",Gbl.Test.Answer.Integer);
|
||||
HTM_SPAN_End ();
|
||||
break;
|
||||
case Tst_ANS_FLOAT:
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">([%lg; %lg])</span>",
|
||||
ClassStem,Gbl.Test.Answer.FloatingPoint[0],Gbl.Test.Answer.FloatingPoint[1]);
|
||||
HTM_SPAN_Begin ("class=\"%s\"",ClassStem);
|
||||
fprintf (Gbl.F.Out,"([%lg; %lg])",
|
||||
Gbl.Test.Answer.FloatingPoint[0],
|
||||
Gbl.Test.Answer.FloatingPoint[1]);
|
||||
HTM_SPAN_End ();
|
||||
break;
|
||||
case Tst_ANS_TRUE_FALSE:
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">(",ClassStem);
|
||||
HTM_SPAN_Begin ("class=\"%s\"",ClassStem);
|
||||
fprintf (Gbl.F.Out,"(");
|
||||
Tst_WriteAnsTF (Gbl.Test.Answer.TF);
|
||||
fprintf (Gbl.F.Out,")</span>");
|
||||
fprintf (Gbl.F.Out,")");
|
||||
HTM_SPAN_End ();
|
||||
break;
|
||||
case Tst_ANS_UNIQUE_CHOICE:
|
||||
case Tst_ANS_MULTIPLE_CHOICE:
|
||||
|
|
|
@ -1401,8 +1401,11 @@ static void TL_PutLinkToViewNewPublications (void)
|
|||
HTM_A_Begin ("href=\"\" class=\"%s\""
|
||||
" onclick=\"moveNewTimelineToTimeline();return false;\"",
|
||||
The_ClassFormInBoxBold[Gbl.Prefs.Theme]);
|
||||
fprintf (Gbl.F.Out,"%s (<span id=\"view_new_posts_count\">0</span>)",
|
||||
Txt_See_new_activity);
|
||||
fprintf (Gbl.F.Out,"%s (",Txt_See_new_activity);
|
||||
HTM_SPAN_Begin ("id=\"view_new_posts_count\"");
|
||||
fprintf (Gbl.F.Out,"0");
|
||||
HTM_SPAN_End ();
|
||||
fprintf (Gbl.F.Out,")");
|
||||
HTM_A_End ();
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
@ -2322,9 +2325,15 @@ static void TL_PutFormToWriteNewPost (void)
|
|||
|
||||
/* Write author's full name and nickname */
|
||||
HTM_DIV_Begin ("class=\"TL_RIGHT_AUTHOR TL_RIGHT_AUTHOR_WIDTH\"");
|
||||
fprintf (Gbl.F.Out,"<span class=\"DAT_N_BOLD\">%s</span>"
|
||||
"<span class=\"DAT_LIGHT\"> @%s</span>",
|
||||
Gbl.Usrs.Me.UsrDat.FullName,Gbl.Usrs.Me.UsrDat.Nickname);
|
||||
|
||||
HTM_SPAN_Begin ("class=\"DAT_N_BOLD\"");
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.Usrs.Me.UsrDat.FullName);
|
||||
HTM_SPAN_End ();
|
||||
|
||||
HTM_SPAN_Begin ("class=\"DAT_LIGHT\"");
|
||||
fprintf (Gbl.F.Out," @%s",Gbl.Usrs.Me.UsrDat.Nickname);
|
||||
HTM_SPAN_End ();
|
||||
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** Form to write the post *****/
|
||||
|
|
12
swad_user.c
12
swad_user.c
|
@ -3495,10 +3495,16 @@ void Usr_ShowFormsLogoutAndRole (void)
|
|||
|
||||
/***** Put a form to change my role *****/
|
||||
if (Rol_GetNumAvailableRoles () == 1)
|
||||
fprintf (Gbl.F.Out,"<span class=\"DAT\">%s: </span>"
|
||||
"<span class=\"DAT_N_BOLD\">%s</span>",
|
||||
Txt_Role,
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"DAT\"");
|
||||
fprintf (Gbl.F.Out,"%s: ",Txt_Role);
|
||||
HTM_SPAN_End ();
|
||||
|
||||
HTM_SPAN_Begin ("class=\"DAT_N_BOLD\"");
|
||||
fprintf (Gbl.F.Out,"%s",
|
||||
Txt_ROLES_SINGUL_Abc[Gbl.Usrs.Me.Role.Logged][Gbl.Usrs.Me.UsrDat.Sex]);
|
||||
HTM_SPAN_End ();
|
||||
}
|
||||
else
|
||||
{
|
||||
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
|
||||
|
|
Loading…
Reference in New Issue