mirror of https://github.com/acanas/swad-core.git
Version19.93
This commit is contained in:
parent
9ad0384944
commit
22dea9e2af
|
@ -1052,7 +1052,7 @@ void Ctr_GetListCentres (long InsCod)
|
||||||
static const char *OrderBySubQuery[Ctr_NUM_ORDERS] =
|
static const char *OrderBySubQuery[Ctr_NUM_ORDERS] =
|
||||||
{
|
{
|
||||||
[Ctr_ORDER_BY_CENTRE ] = "FullName",
|
[Ctr_ORDER_BY_CENTRE ] = "FullName",
|
||||||
[Ctr_ORDER_BY_NUM_TCHS] = "NumUsrs DESC,FullName",
|
[Ctr_ORDER_BY_NUM_USRS] = "NumUsrs DESC,FullName",
|
||||||
};
|
};
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
@ -2576,8 +2576,8 @@ static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable)
|
||||||
|
|
||||||
HTM_TH_Empty (1);
|
HTM_TH_Empty (1);
|
||||||
|
|
||||||
for (Order = Ctr_ORDER_BY_CENTRE;
|
for (Order = (Ctr_Order_t) 0;
|
||||||
Order <= Ctr_ORDER_BY_NUM_TCHS;
|
Order <= (Ctr_Order_t) (Ctr_NUM_ORDERS - 1);
|
||||||
Order++)
|
Order++)
|
||||||
{
|
{
|
||||||
HTM_TH_Begin (1,1,Order == Ctr_ORDER_BY_CENTRE ? "LM" :
|
HTM_TH_Begin (1,1,Order == Ctr_ORDER_BY_CENTRE ? "LM" :
|
||||||
|
|
|
@ -79,7 +79,7 @@ struct Centre
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
Ctr_ORDER_BY_CENTRE = 0,
|
Ctr_ORDER_BY_CENTRE = 0,
|
||||||
Ctr_ORDER_BY_NUM_TCHS = 1,
|
Ctr_ORDER_BY_NUM_USRS = 1,
|
||||||
} Ctr_Order_t;
|
} Ctr_Order_t;
|
||||||
#define Ctr_ORDER_DEFAULT Ctr_ORDER_BY_CENTRE
|
#define Ctr_ORDER_DEFAULT Ctr_ORDER_BY_CENTRE
|
||||||
|
|
||||||
|
|
|
@ -490,13 +490,14 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
||||||
En OpenSWAD:
|
En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 19.92.1 (2019-12-15)"
|
#define Log_PLATFORM_VERSION "SWAD 19.93 (2019-12-15)"
|
||||||
#define CSS_FILE "swad19.90.1.css"
|
#define CSS_FILE "swad19.90.1.css"
|
||||||
#define JS_FILE "swad19.91.1.js"
|
#define JS_FILE "swad19.91.1.js"
|
||||||
/*
|
/*
|
||||||
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
|
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
|
||||||
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
||||||
|
|
||||||
|
Version 19.93: Dec 15, 2019 Code refactoring. (248907 lines)
|
||||||
Version 19.92.1: Dec 15, 2019 Code refactoring. (248629 lines)
|
Version 19.92.1: Dec 15, 2019 Code refactoring. (248629 lines)
|
||||||
Version 19.92: Dec 14, 2019 New module for log database tables. (248625 lines)
|
Version 19.92: Dec 14, 2019 New module for log database tables. (248625 lines)
|
||||||
Version 19.91.2: Dec 14, 2019 Code refactoring related to doubles. (248538 lines)
|
Version 19.91.2: Dec 14, 2019 Code refactoring related to doubles. (248538 lines)
|
||||||
|
|
|
@ -2771,8 +2771,8 @@ static void Fig_GetAndShowOERsStats (void)
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
for (License = 0;
|
for (License = (Brw_License_t) 0;
|
||||||
License < Brw_NUM_LICENSES;
|
License <= (Brw_License_t) (Brw_NUM_LICENSES - 1);
|
||||||
License++)
|
License++)
|
||||||
{
|
{
|
||||||
Fig_GetNumberOfOERsFromDB (Gbl.Scope.Current,License,NumFiles);
|
Fig_GetNumberOfOERsFromDB (Gbl.Scope.Current,License,NumFiles);
|
||||||
|
@ -3088,8 +3088,8 @@ static void Fig_GetAndShowTestsStats (void)
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
for (AnsType = (Tst_AnswerType_t) 0;
|
for (AnsType = (Tst_AnswerType_t) 0;
|
||||||
AnsType < Tst_NUM_ANS_TYPES;
|
AnsType <= (Tst_AnswerType_t) (Tst_NUM_ANS_TYPES - 1);
|
||||||
AnsType++)
|
AnsType++)
|
||||||
{
|
{
|
||||||
/***** Get the stats about test questions from this location *****/
|
/***** Get the stats about test questions from this location *****/
|
||||||
|
@ -3293,8 +3293,8 @@ static void Fig_GetAndShowTimelineActivityStats (void)
|
||||||
1 << Rol_TCH);
|
1 << Rol_TCH);
|
||||||
|
|
||||||
/***** Get total number of following/followers from database *****/
|
/***** Get total number of following/followers from database *****/
|
||||||
for (NoteType = (TL_NoteType_t) 0;
|
for (NoteType = (TL_NoteType_t) 0;
|
||||||
NoteType < TL_NUM_NOTE_TYPES;
|
NoteType <= (TL_NoteType_t) (TL_NUM_NOTE_TYPES - 1);
|
||||||
NoteType++)
|
NoteType++)
|
||||||
{
|
{
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
|
@ -4232,8 +4232,8 @@ static void Fig_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
Fig_GetNumUsrsWhoChoseAnOption ("usr_data.EmailNtfEvents<>0");
|
Fig_GetNumUsrsWhoChoseAnOption ("usr_data.EmailNtfEvents<>0");
|
||||||
|
|
||||||
/***** For each notify event... *****/
|
/***** For each notify event... *****/
|
||||||
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
||||||
NotifyEvent < Ntf_NUM_NOTIFY_EVENTS;
|
NotifyEvent <= (Ntf_NotifyEvent_t) (Ntf_NUM_NOTIFY_EVENTS - 1);
|
||||||
NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN
|
NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN
|
||||||
{
|
{
|
||||||
/* Get the number of users who want to be notified by email on this event, from database */
|
/* Get the number of users who want to be notified by email on this event, from database */
|
||||||
|
@ -4339,8 +4339,8 @@ static void Fig_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Write number of users who want to be notified by email on each event *****/
|
/***** Write number of users who want to be notified by email on each event *****/
|
||||||
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
||||||
NotifyEvent < Ntf_NUM_NOTIFY_EVENTS;
|
NotifyEvent <= (Ntf_NotifyEvent_t) (Ntf_NUM_NOTIFY_EVENTS - 1);
|
||||||
NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN
|
NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN
|
||||||
{
|
{
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -4422,8 +4422,8 @@ static void Fig_GetAndShowNoticesStats (void)
|
||||||
unsigned NumTotalNotifications = 0;
|
unsigned NumTotalNotifications = 0;
|
||||||
|
|
||||||
/***** Get the number of notices active and obsolete *****/
|
/***** Get the number of notices active and obsolete *****/
|
||||||
for (NoticeStatus = (Not_Status_t) 0;
|
for (NoticeStatus = (Not_Status_t) 0;
|
||||||
NoticeStatus < Not_NUM_STATUS;
|
NoticeStatus <= (Not_Status_t) (Not_NUM_STATUS - 1);
|
||||||
NoticeStatus++)
|
NoticeStatus++)
|
||||||
{
|
{
|
||||||
NumNotices[NoticeStatus] = Not_GetNumNotices (Gbl.Scope.Current,NoticeStatus,&NumNotif);
|
NumNotices[NoticeStatus] = Not_GetNumNotices (Gbl.Scope.Current,NoticeStatus,&NumNotif);
|
||||||
|
@ -4705,8 +4705,8 @@ static void Fig_GetAndShowNumUsrsPerPrivacyForAnObject (const char *TxtObject,
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** For each privacy option... *****/
|
/***** For each privacy option... *****/
|
||||||
for (Visibility = (Pri_Visibility_t) 0;
|
for (Visibility = (Pri_Visibility_t) 0;
|
||||||
Visibility < Pri_NUM_OPTIONS_PRIVACY;
|
Visibility <= (Pri_Visibility_t) (Pri_NUM_OPTIONS_PRIVACY - 1);
|
||||||
Visibility++)
|
Visibility++)
|
||||||
if (MaskAllowedVisibility & (1 << Visibility))
|
if (MaskAllowedVisibility & (1 << Visibility))
|
||||||
{
|
{
|
||||||
|
@ -4722,8 +4722,8 @@ static void Fig_GetAndShowNumUsrsPerPrivacyForAnObject (const char *TxtObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Write number of users who have chosen each privacy option *****/
|
/***** Write number of users who have chosen each privacy option *****/
|
||||||
for (Visibility = (Pri_Visibility_t) 0;
|
for (Visibility = (Pri_Visibility_t) 0;
|
||||||
Visibility < Pri_NUM_OPTIONS_PRIVACY;
|
Visibility <= (Pri_Visibility_t) (Pri_NUM_OPTIONS_PRIVACY - 1);
|
||||||
Visibility++)
|
Visibility++)
|
||||||
if (MaskAllowedVisibility & (1 << Visibility))
|
if (MaskAllowedVisibility & (1 << Visibility))
|
||||||
{
|
{
|
||||||
|
@ -4761,18 +4761,18 @@ static void Fig_GetAndShowNumUsrsPerCookies (void)
|
||||||
unsigned i;
|
unsigned i;
|
||||||
static const char AcceptedInDB[2] =
|
static const char AcceptedInDB[2] =
|
||||||
{
|
{
|
||||||
'N', // false
|
[false] = 'N',
|
||||||
'Y' // true
|
[true ] = 'Y'
|
||||||
};
|
};
|
||||||
static const char *AcceptedClass[2] =
|
static const char *AcceptedClass[2] =
|
||||||
{
|
{
|
||||||
"DAT_RED", // false
|
[false] = "DAT_RED",
|
||||||
"DAT_GREEN" // true
|
[true ] = "DAT_GREEN"
|
||||||
};
|
};
|
||||||
static const char *AcceptedSymbol[2] =
|
static const char *AcceptedSymbol[2] =
|
||||||
{
|
{
|
||||||
"✗", // false
|
[false] = "✗",
|
||||||
"✓" // true
|
[true ] = "✓"
|
||||||
};
|
};
|
||||||
|
|
||||||
char *SubQuery;
|
char *SubQuery;
|
||||||
|
@ -4868,8 +4868,8 @@ static void Fig_GetAndShowNumUsrsPerLanguage (void)
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** For each language... *****/
|
/***** For each language... *****/
|
||||||
for (Lan = (Lan_Language_t) 1;
|
for (Lan = (Lan_Language_t) 1;
|
||||||
Lan <= Lan_NUM_LANGUAGES;
|
Lan <= (Lan_Language_t) Lan_NUM_LANGUAGES;
|
||||||
Lan++)
|
Lan++)
|
||||||
{
|
{
|
||||||
/* Get the number of users who have chosen this language from database */
|
/* Get the number of users who have chosen this language from database */
|
||||||
|
@ -4884,8 +4884,8 @@ static void Fig_GetAndShowNumUsrsPerLanguage (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Write number of users who have chosen each language *****/
|
/***** Write number of users who have chosen each language *****/
|
||||||
for (Lan = (Lan_Language_t) 1;
|
for (Lan = (Lan_Language_t) 1;
|
||||||
Lan <= Lan_NUM_LANGUAGES;
|
Lan <= (Lan_Language_t) Lan_NUM_LANGUAGES;
|
||||||
Lan++)
|
Lan++)
|
||||||
{
|
{
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -5029,7 +5029,7 @@ static void Fig_GetAndShowNumUsrsPerDateFormat (void)
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** For each format... *****/
|
/***** For each format... *****/
|
||||||
for (Format = (Dat_Format_t) 0;
|
for (Format = (Dat_Format_t) 0;
|
||||||
Format <= (Dat_Format_t) (Dat_NUM_OPTIONS_FORMAT - 1);
|
Format <= (Dat_Format_t) (Dat_NUM_OPTIONS_FORMAT - 1);
|
||||||
Format++)
|
Format++)
|
||||||
{
|
{
|
||||||
|
@ -5045,7 +5045,7 @@ static void Fig_GetAndShowNumUsrsPerDateFormat (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Write number of users who have chosen each date format *****/
|
/***** Write number of users who have chosen each date format *****/
|
||||||
for (Format = (Dat_Format_t) 0;
|
for (Format = (Dat_Format_t) 0;
|
||||||
Format <= (Dat_Format_t) (Dat_NUM_OPTIONS_FORMAT - 1);
|
Format <= (Dat_Format_t) (Dat_NUM_OPTIONS_FORMAT - 1);
|
||||||
Format++)
|
Format++)
|
||||||
{
|
{
|
||||||
|
@ -5106,8 +5106,8 @@ static void Fig_GetAndShowNumUsrsPerIconSet (void)
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** For each icon set... *****/
|
/***** For each icon set... *****/
|
||||||
for (IconSet = (Ico_IconSet_t) 0;
|
for (IconSet = (Ico_IconSet_t) 0;
|
||||||
IconSet < Ico_NUM_ICON_SETS;
|
IconSet <= (Ico_IconSet_t) (Ico_NUM_ICON_SETS - 1);
|
||||||
IconSet++)
|
IconSet++)
|
||||||
{
|
{
|
||||||
/* Get the number of users who have chosen this icon set from database */
|
/* Get the number of users who have chosen this icon set from database */
|
||||||
|
@ -5122,8 +5122,8 @@ static void Fig_GetAndShowNumUsrsPerIconSet (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Write number of users who have chosen each icon set *****/
|
/***** Write number of users who have chosen each icon set *****/
|
||||||
for (IconSet = (Ico_IconSet_t) 0;
|
for (IconSet = (Ico_IconSet_t) 0;
|
||||||
IconSet < Ico_NUM_ICON_SETS;
|
IconSet <= (Ico_IconSet_t) (Ico_NUM_ICON_SETS - 1);
|
||||||
IconSet++)
|
IconSet++)
|
||||||
{
|
{
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -5186,8 +5186,8 @@ static void Fig_GetAndShowNumUsrsPerMenu (void)
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** For each menu... *****/
|
/***** For each menu... *****/
|
||||||
for (Menu = (Mnu_Menu_t) 0;
|
for (Menu = (Mnu_Menu_t) 0;
|
||||||
Menu < Mnu_NUM_MENUS;
|
Menu <= (Mnu_Menu_t) (Mnu_NUM_MENUS - 1);
|
||||||
Menu++)
|
Menu++)
|
||||||
{
|
{
|
||||||
/* Get number of users who have chosen this menu from database */
|
/* Get number of users who have chosen this menu from database */
|
||||||
|
@ -5202,8 +5202,8 @@ static void Fig_GetAndShowNumUsrsPerMenu (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Write number of users who have chosen each menu *****/
|
/***** Write number of users who have chosen each menu *****/
|
||||||
for (Menu = (Mnu_Menu_t) 0;
|
for (Menu = (Mnu_Menu_t) 0;
|
||||||
Menu < Mnu_NUM_MENUS;
|
Menu <= (Mnu_Menu_t) (Mnu_NUM_MENUS - 1);
|
||||||
Menu++)
|
Menu++)
|
||||||
{
|
{
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -5262,8 +5262,8 @@ static void Fig_GetAndShowNumUsrsPerTheme (void)
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** For each theme... *****/
|
/***** For each theme... *****/
|
||||||
for (Theme = (The_Theme_t) 0;
|
for (Theme = (The_Theme_t) 0;
|
||||||
Theme < The_NUM_THEMES;
|
Theme <= (The_Theme_t) (The_NUM_THEMES - 1);
|
||||||
Theme++)
|
Theme++)
|
||||||
{
|
{
|
||||||
/* Get number of users who have chosen this theme from database */
|
/* Get number of users who have chosen this theme from database */
|
||||||
|
@ -5278,8 +5278,8 @@ static void Fig_GetAndShowNumUsrsPerTheme (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Write number of users who have chosen each theme *****/
|
/***** Write number of users who have chosen each theme *****/
|
||||||
for (Theme = (The_Theme_t) 0;
|
for (Theme = (The_Theme_t) 0;
|
||||||
Theme < The_NUM_THEMES;
|
Theme <= (The_Theme_t) (The_NUM_THEMES - 1);
|
||||||
Theme++)
|
Theme++)
|
||||||
{
|
{
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
|
@ -2373,8 +2373,8 @@ static void Brw_GetParamsPathInTreeAndFileName (void)
|
||||||
|
|
||||||
/***** Get the name of the file, folder or link *****/
|
/***** Get the name of the file, folder or link *****/
|
||||||
Gbl.FileBrowser.FilFolLnk.Type = Brw_IS_UNKNOWN;
|
Gbl.FileBrowser.FilFolLnk.Type = Brw_IS_UNKNOWN;
|
||||||
for (FileType = (Brw_FileType_t) 0;
|
for (FileType = (Brw_FileType_t) 0;
|
||||||
FileType < Brw_NUM_FILE_TYPES;
|
FileType <= (Brw_FileType_t) (Brw_NUM_FILE_TYPES - 1);
|
||||||
FileType++)
|
FileType++)
|
||||||
// File names with heading and trailing spaces are allowed
|
// File names with heading and trailing spaces are allowed
|
||||||
if (Par_GetParAndChangeFormat (Brw_FileTypeParamName[FileType],
|
if (Par_GetParAndChangeFormat (Brw_FileTypeParamName[FileType],
|
||||||
|
@ -3540,7 +3540,6 @@ static void Brw_ShowFileBrowser (void)
|
||||||
extern const char *Txt_Temporary_private_storage_area;
|
extern const char *Txt_Temporary_private_storage_area;
|
||||||
extern const char *Txt_Project_documents;
|
extern const char *Txt_Project_documents;
|
||||||
extern const char *Txt_Project_assessment;
|
extern const char *Txt_Project_assessment;
|
||||||
|
|
||||||
const char *Brw_TitleOfFileBrowser[Brw_NUM_TYPES_FILE_BROWSER];
|
const char *Brw_TitleOfFileBrowser[Brw_NUM_TYPES_FILE_BROWSER];
|
||||||
const char *Brw_HelpOfFileBrowser[Brw_NUM_TYPES_FILE_BROWSER];
|
const char *Brw_HelpOfFileBrowser[Brw_NUM_TYPES_FILE_BROWSER];
|
||||||
struct Brw_NumObjects Removed;
|
struct Brw_NumObjects Removed;
|
||||||
|
@ -9649,8 +9648,8 @@ void Brw_ShowFileMetadata (void)
|
||||||
{
|
{
|
||||||
HTM_SELECT_Begin (false,
|
HTM_SELECT_Begin (false,
|
||||||
"id=\"License\" name=\"License\" class=\"LICENSE\"");
|
"id=\"License\" name=\"License\" class=\"LICENSE\"");
|
||||||
for (License = 0;
|
for (License = (Brw_License_t) 0;
|
||||||
License < Brw_NUM_LICENSES;
|
License <= (Brw_License_t) (Brw_NUM_LICENSES - 1);
|
||||||
License++)
|
License++)
|
||||||
{
|
{
|
||||||
LicenseUnsigned = (unsigned) License;
|
LicenseUnsigned = (unsigned) License;
|
||||||
|
@ -10460,18 +10459,18 @@ void Brw_GetFileMetadataByPath (struct FileMetadata *FileMetadata)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FileMetadata->FilCod = -1L;
|
FileMetadata->FilCod = -1L;
|
||||||
FileMetadata->FileBrowser = Brw_UNKNOWN;
|
FileMetadata->FileBrowser = Brw_UNKNOWN;
|
||||||
FileMetadata->Cod = -1L;
|
FileMetadata->Cod = -1L;
|
||||||
FileMetadata->ZoneUsrCod = -1L;
|
FileMetadata->ZoneUsrCod = -1L;
|
||||||
FileMetadata->PublisherUsrCod = -1L;
|
FileMetadata->PublisherUsrCod = -1L;
|
||||||
FileMetadata->FilFolLnk.Type = Brw_IS_UNKNOWN;
|
FileMetadata->FilFolLnk.Type = Brw_IS_UNKNOWN;
|
||||||
FileMetadata->FilFolLnk.Full[0] = '\0';
|
FileMetadata->FilFolLnk.Full[0] = '\0';
|
||||||
FileMetadata->FilFolLnk.Path[0] = '\0';
|
FileMetadata->FilFolLnk.Path[0] = '\0';
|
||||||
FileMetadata->FilFolLnk.Name[0] = '\0';
|
FileMetadata->FilFolLnk.Name[0] = '\0';
|
||||||
FileMetadata->IsHidden = false;
|
FileMetadata->IsHidden = false;
|
||||||
FileMetadata->IsPublic = false;
|
FileMetadata->IsPublic = false;
|
||||||
FileMetadata->License = Brw_LICENSE_DEFAULT;
|
FileMetadata->License = Brw_LICENSE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
|
|
|
@ -1749,8 +1749,8 @@ static void For_PutFormWhichForums (void)
|
||||||
HTM_DIV_Begin ("class=\"SEL_BELOW_TITLE\"");
|
HTM_DIV_Begin ("class=\"SEL_BELOW_TITLE\"");
|
||||||
HTM_UL_Begin (NULL);
|
HTM_UL_Begin (NULL);
|
||||||
|
|
||||||
for (ForumSet = (For_ForumSet_t) 0;
|
for (ForumSet = (For_ForumSet_t) 0;
|
||||||
ForumSet < For_NUM_FORUM_SETS;
|
ForumSet <= (For_ForumSet_t) (For_NUM_FORUM_SETS - 1);
|
||||||
ForumSet++)
|
ForumSet++)
|
||||||
{
|
{
|
||||||
HTM_LI_Begin (NULL);
|
HTM_LI_Begin (NULL);
|
||||||
|
|
|
@ -194,8 +194,8 @@ void Gbl_InitializeGlobals (void)
|
||||||
Gbl.Usrs.Selected.Filled = false; // Lists of encrypted codes of users selected from form are not filled
|
Gbl.Usrs.Selected.Filled = false; // Lists of encrypted codes of users selected from form are not filled
|
||||||
Gbl.Usrs.Selected.ParamSuffix = NULL;// Don't add suffix to param names
|
Gbl.Usrs.Selected.ParamSuffix = NULL;// Don't add suffix to param names
|
||||||
Gbl.Usrs.Selected.Option = Usr_OPTION_UNKNOWN;
|
Gbl.Usrs.Selected.Option = Usr_OPTION_UNKNOWN;
|
||||||
for (Role = (Rol_Role_t) 0;
|
for (Role = (Rol_Role_t) 0;
|
||||||
Role < Rol_NUM_ROLES;
|
Role <= (Rol_Role_t) (Rol_NUM_ROLES - 1);
|
||||||
Role++)
|
Role++)
|
||||||
{
|
{
|
||||||
Gbl.Usrs.LstUsrs[Role].Lst = NULL;
|
Gbl.Usrs.LstUsrs[Role].Lst = NULL;
|
||||||
|
@ -461,8 +461,8 @@ void Gbl_Cleanup (void)
|
||||||
Lnk_FreeListLinks ();
|
Lnk_FreeListLinks ();
|
||||||
Plg_FreeListPlugins ();
|
Plg_FreeListPlugins ();
|
||||||
|
|
||||||
for (Role = (Rol_Role_t) 0;
|
for (Role = (Rol_Role_t) 0;
|
||||||
Role < Rol_NUM_ROLES;
|
Role <= (Rol_Role_t) (Rol_NUM_ROLES - 1);
|
||||||
Role++)
|
Role++)
|
||||||
Usr_FreeUsrsList (Role);
|
Usr_FreeUsrsList (Role);
|
||||||
|
|
||||||
|
|
|
@ -605,8 +605,8 @@ static void Hld_ListHolidaysForEdition (void)
|
||||||
Hld_PutParamHldCod (Hld->HldCod);
|
Hld_PutParamHldCod (Hld->HldCod);
|
||||||
HTM_SELECT_Begin (true,
|
HTM_SELECT_Begin (true,
|
||||||
"name=\"HldTyp\" style=\"width:62px;\"");
|
"name=\"HldTyp\" style=\"width:62px;\"");
|
||||||
for (HolidayType = (Hld_HolidayType_t) 0;
|
for (HolidayType = (Hld_HolidayType_t) 0;
|
||||||
HolidayType < Hld_NUM_TYPES_HOLIDAY;
|
HolidayType <= (Hld_HolidayType_t) (Hld_NUM_TYPES_HOLIDAY - 1);
|
||||||
HolidayType++)
|
HolidayType++)
|
||||||
{
|
{
|
||||||
HolidayTypeUnsigned = (unsigned) HolidayType;
|
HolidayTypeUnsigned = (unsigned) HolidayType;
|
||||||
|
@ -785,7 +785,7 @@ void Hld_ChangeHolidayType (void)
|
||||||
|
|
||||||
void Hld_ChangeStartDate (void)
|
void Hld_ChangeStartDate (void)
|
||||||
{
|
{
|
||||||
Hld_ChangeDate (HLD_START_DATE);
|
Hld_ChangeDate (Hld_START_DATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -794,7 +794,7 @@ void Hld_ChangeStartDate (void)
|
||||||
|
|
||||||
void Hld_ChangeEndDate (void)
|
void Hld_ChangeEndDate (void)
|
||||||
{
|
{
|
||||||
Hld_ChangeDate (HLD_END_DATE);
|
Hld_ChangeDate (Hld_END_DATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -822,7 +822,7 @@ static void Hld_ChangeDate (Hld_StartOrEndDate_t StartOrEndDate)
|
||||||
/***** Get the new date for the holiday *****/
|
/***** Get the new date for the holiday *****/
|
||||||
switch (StartOrEndDate)
|
switch (StartOrEndDate)
|
||||||
{
|
{
|
||||||
case HLD_START_DATE:
|
case Hld_START_DATE:
|
||||||
StrStartOrEndDate = "StartDate";
|
StrStartOrEndDate = "StartDate";
|
||||||
PtrDate = &Hld_EditingHld->StartDate;
|
PtrDate = &Hld_EditingHld->StartDate;
|
||||||
Dat_GetDateFromForm ("StartDay","StartMonth","StartYear",
|
Dat_GetDateFromForm ("StartDay","StartMonth","StartYear",
|
||||||
|
@ -832,7 +832,7 @@ static void Hld_ChangeDate (Hld_StartOrEndDate_t StartOrEndDate)
|
||||||
NewDate.Year == 0)
|
NewDate.Year == 0)
|
||||||
Dat_AssignDate (&NewDate,&Gbl.Now.Date);
|
Dat_AssignDate (&NewDate,&Gbl.Now.Date);
|
||||||
break;
|
break;
|
||||||
case HLD_END_DATE:
|
case Hld_END_DATE:
|
||||||
StrStartOrEndDate = "EndDate";
|
StrStartOrEndDate = "EndDate";
|
||||||
PtrDate = &Hld_EditingHld->EndDate;
|
PtrDate = &Hld_EditingHld->EndDate;
|
||||||
switch (Hld_EditingHld->HldTyp)
|
switch (Hld_EditingHld->HldTyp)
|
||||||
|
@ -999,8 +999,8 @@ static void Hld_PutFormToCreateHoliday (void)
|
||||||
HTM_TD_Begin ("class=\"CM\"");
|
HTM_TD_Begin ("class=\"CM\"");
|
||||||
HTM_SELECT_Begin (false,
|
HTM_SELECT_Begin (false,
|
||||||
"name=\"HldTyp\" style=\"width:62px;\"");
|
"name=\"HldTyp\" style=\"width:62px;\"");
|
||||||
for (HolidayType = (Hld_HolidayType_t) 0;
|
for (HolidayType = (Hld_HolidayType_t) 0;
|
||||||
HolidayType < Hld_NUM_TYPES_HOLIDAY;
|
HolidayType <= (Hld_HolidayType_t) (Hld_NUM_TYPES_HOLIDAY - 1);
|
||||||
HolidayType++)
|
HolidayType++)
|
||||||
{
|
{
|
||||||
HolidayTypeUnsigned = (unsigned) HolidayType;
|
HolidayTypeUnsigned = (unsigned) HolidayType;
|
||||||
|
|
|
@ -47,8 +47,8 @@ typedef enum
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
HLD_START_DATE,
|
Hld_START_DATE,
|
||||||
HLD_END_DATE
|
Hld_END_DATE
|
||||||
} Hld_StartOrEndDate_t;
|
} Hld_StartOrEndDate_t;
|
||||||
|
|
||||||
struct Holiday
|
struct Holiday
|
||||||
|
|
12
swad_icon.c
12
swad_icon.c
|
@ -120,8 +120,8 @@ void Ico_PutIconsToSelectIconSet (void)
|
||||||
Hlp_PROFILE_Settings_icons,Box_NOT_CLOSABLE);
|
Hlp_PROFILE_Settings_icons,Box_NOT_CLOSABLE);
|
||||||
Set_StartSettingsHead ();
|
Set_StartSettingsHead ();
|
||||||
Set_StartOneSettingSelector ();
|
Set_StartOneSettingSelector ();
|
||||||
for (IconSet = (Ico_IconSet_t) 0;
|
for (IconSet = (Ico_IconSet_t) 0;
|
||||||
IconSet < Ico_NUM_ICON_SETS;
|
IconSet <= (Ico_IconSet_t) (Ico_NUM_ICON_SETS - 1);
|
||||||
IconSet++)
|
IconSet++)
|
||||||
{
|
{
|
||||||
HTM_DIV_Begin ("class=\"%s\"",
|
HTM_DIV_Begin ("class=\"%s\"",
|
||||||
|
@ -187,8 +187,8 @@ Ico_IconSet_t Ico_GetParamIconSet (void)
|
||||||
Ico_IconSet_t IconSet;
|
Ico_IconSet_t IconSet;
|
||||||
|
|
||||||
Par_GetParToText ("IconSet",IconSetId,Ico_MAX_BYTES_ICON_SET_ID);
|
Par_GetParToText ("IconSet",IconSetId,Ico_MAX_BYTES_ICON_SET_ID);
|
||||||
for (IconSet = (Ico_IconSet_t) 0;
|
for (IconSet = (Ico_IconSet_t) 0;
|
||||||
IconSet < Ico_NUM_ICON_SETS;
|
IconSet <= (Ico_IconSet_t) (Ico_NUM_ICON_SETS - 1);
|
||||||
IconSet++)
|
IconSet++)
|
||||||
if (!strcmp (IconSetId,Ico_IconSetId[IconSet]))
|
if (!strcmp (IconSetId,Ico_IconSetId[IconSet]))
|
||||||
return IconSet;
|
return IconSet;
|
||||||
|
@ -204,8 +204,8 @@ Ico_IconSet_t Ico_GetIconSetFromStr (const char *Str)
|
||||||
{
|
{
|
||||||
Ico_IconSet_t IconSet;
|
Ico_IconSet_t IconSet;
|
||||||
|
|
||||||
for (IconSet = (Ico_IconSet_t) 0;
|
for (IconSet = (Ico_IconSet_t) 0;
|
||||||
IconSet < Ico_NUM_ICON_SETS;
|
IconSet <= (Ico_IconSet_t) (Ico_NUM_ICON_SETS - 1);
|
||||||
IconSet++)
|
IconSet++)
|
||||||
if (!strcasecmp (Str,Ico_IconSetId[IconSet]))
|
if (!strcasecmp (Str,Ico_IconSetId[IconSet]))
|
||||||
return IconSet;
|
return IconSet;
|
||||||
|
|
72
swad_info.c
72
swad_info.c
|
@ -515,8 +515,8 @@ bool Inf_GetIfIMustReadAnyCrsInfoInThisCrs (void)
|
||||||
Inf_InfoType_t InfoType;
|
Inf_InfoType_t InfoType;
|
||||||
|
|
||||||
/***** Reset must-be-read to false for all info types *****/
|
/***** Reset must-be-read to false for all info types *****/
|
||||||
for (InfoType = (Inf_InfoType_t) 0;
|
for (InfoType = (Inf_InfoType_t) 0;
|
||||||
InfoType < Inf_NUM_INFO_TYPES;
|
InfoType <= (Inf_InfoType_t) (Inf_NUM_INFO_TYPES - 1);
|
||||||
InfoType++)
|
InfoType++)
|
||||||
Gbl.Crs.Info.MustBeRead[InfoType] = false;
|
Gbl.Crs.Info.MustBeRead[InfoType] = false;
|
||||||
|
|
||||||
|
@ -572,8 +572,8 @@ void Inf_WriteMsgYouMustReadInfo (void)
|
||||||
/***** Write every information I must read *****/
|
/***** Write every information I must read *****/
|
||||||
HTM_DIV_Begin ("class=\"CM\"");
|
HTM_DIV_Begin ("class=\"CM\"");
|
||||||
HTM_UL_Begin ("class=\"LIST_I_MUST_READ\"");
|
HTM_UL_Begin ("class=\"LIST_I_MUST_READ\"");
|
||||||
for (InfoType = (Inf_InfoType_t) 0;
|
for (InfoType = (Inf_InfoType_t) 0;
|
||||||
InfoType < Inf_NUM_INFO_TYPES;
|
InfoType <= (Inf_InfoType_t) (Inf_NUM_INFO_TYPES - 1);
|
||||||
InfoType++)
|
InfoType++)
|
||||||
if (Gbl.Crs.Info.MustBeRead[InfoType])
|
if (Gbl.Crs.Info.MustBeRead[InfoType])
|
||||||
{
|
{
|
||||||
|
@ -1060,14 +1060,14 @@ void Inf_FormsToSelSendInfo (void)
|
||||||
bool MustBeRead;
|
bool MustBeRead;
|
||||||
const char *HelpEdit[Inf_NUM_INFO_TYPES] =
|
const char *HelpEdit[Inf_NUM_INFO_TYPES] =
|
||||||
{
|
{
|
||||||
Hlp_COURSE_Information_edit, // Inf_INTRODUCTION
|
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_edit,
|
||||||
Hlp_COURSE_Guide_edit, // Inf_TEACHING_GUIDE
|
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide_edit,
|
||||||
Hlp_COURSE_Syllabus_edit, // Inf_LECTURES
|
[Inf_LECTURES ] = Hlp_COURSE_Syllabus_edit,
|
||||||
Hlp_COURSE_Syllabus_edit, // Inf_PRACTICALS
|
[Inf_PRACTICALS ] = Hlp_COURSE_Syllabus_edit,
|
||||||
Hlp_COURSE_Bibliography_edit, // Inf_BIBLIOGRAPHY
|
[Inf_BIBLIOGRAPHY ] = Hlp_COURSE_Bibliography_edit,
|
||||||
Hlp_COURSE_FAQ_edit, // Inf_FAQ
|
[Inf_FAQ ] = Hlp_COURSE_FAQ_edit,
|
||||||
Hlp_COURSE_Links_edit, // Inf_LINKS
|
[Inf_LINKS ] = Hlp_COURSE_Links_edit,
|
||||||
Hlp_ASSESSMENT_System_edit, // Inf_ASSESSMENT
|
[Inf_ASSESSMENT ] = Hlp_ASSESSMENT_System_edit,
|
||||||
};
|
};
|
||||||
|
|
||||||
/***** Set info type *****/
|
/***** Set info type *****/
|
||||||
|
@ -1079,8 +1079,8 @@ void Inf_FormsToSelSendInfo (void)
|
||||||
&InfoSrcSelected,&MustBeRead);
|
&InfoSrcSelected,&MustBeRead);
|
||||||
|
|
||||||
/***** Check if info available *****/
|
/***** Check if info available *****/
|
||||||
for (InfoSrc = (Inf_InfoSrc_t) 0;
|
for (InfoSrc = (Inf_InfoSrc_t) 0;
|
||||||
InfoSrc < Inf_NUM_INFO_SOURCES;
|
InfoSrc <= (Inf_InfoSrc_t) (Inf_NUM_INFO_SOURCES - 1);
|
||||||
InfoSrc++)
|
InfoSrc++)
|
||||||
InfoAvailable[InfoSrc] = Inf_CheckIfInfoAvailable (InfoSrc);
|
InfoAvailable[InfoSrc] = Inf_CheckIfInfoAvailable (InfoSrc);
|
||||||
|
|
||||||
|
@ -1099,8 +1099,8 @@ void Inf_FormsToSelSendInfo (void)
|
||||||
HelpEdit[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE,4);
|
HelpEdit[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE,4);
|
||||||
|
|
||||||
/* Options */
|
/* Options */
|
||||||
for (InfoSrc = (Inf_InfoSrc_t) 0;
|
for (InfoSrc = (Inf_InfoSrc_t) 0;
|
||||||
InfoSrc < Inf_NUM_INFO_SOURCES;
|
InfoSrc <= (Inf_InfoSrc_t) (Inf_NUM_INFO_SOURCES - 1);
|
||||||
InfoSrc++)
|
InfoSrc++)
|
||||||
{
|
{
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -1616,8 +1616,8 @@ Inf_InfoType_t Inf_ConvertFromStrDBToInfoType (const char *StrInfoTypeDB)
|
||||||
{
|
{
|
||||||
Inf_InfoType_t InfoType;
|
Inf_InfoType_t InfoType;
|
||||||
|
|
||||||
for (InfoType = (Inf_InfoType_t) 0;
|
for (InfoType = (Inf_InfoType_t) 0;
|
||||||
InfoType < Inf_NUM_INFO_TYPES;
|
InfoType <= (Inf_InfoType_t) (Inf_NUM_INFO_TYPES - 1);
|
||||||
InfoType++)
|
InfoType++)
|
||||||
if (!strcmp (StrInfoTypeDB,Inf_NamesInDBForInfoType[InfoType]))
|
if (!strcmp (StrInfoTypeDB,Inf_NamesInDBForInfoType[InfoType]))
|
||||||
return InfoType;
|
return InfoType;
|
||||||
|
@ -1633,8 +1633,8 @@ Inf_InfoSrc_t Inf_ConvertFromStrDBToInfoSrc (const char *StrInfoSrcDB)
|
||||||
{
|
{
|
||||||
Inf_InfoSrc_t InfoSrc;
|
Inf_InfoSrc_t InfoSrc;
|
||||||
|
|
||||||
for (InfoSrc = (Inf_InfoSrc_t) 0;
|
for (InfoSrc = (Inf_InfoSrc_t) 0;
|
||||||
InfoSrc < Inf_NUM_INFO_SOURCES;
|
InfoSrc <= (Inf_InfoSrc_t) (Inf_NUM_INFO_SOURCES - 1);
|
||||||
InfoSrc++)
|
InfoSrc++)
|
||||||
if (!strcmp (StrInfoSrcDB,Inf_NamesInDBForInfoSrc[InfoSrc]))
|
if (!strcmp (StrInfoSrcDB,Inf_NamesInDBForInfoSrc[InfoSrc]))
|
||||||
return InfoSrc;
|
return InfoSrc;
|
||||||
|
@ -2016,14 +2016,14 @@ void Inf_EditPlainTxtInfo (void)
|
||||||
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
|
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
|
||||||
const char *HelpEdit[Inf_NUM_INFO_TYPES] =
|
const char *HelpEdit[Inf_NUM_INFO_TYPES] =
|
||||||
{
|
{
|
||||||
Hlp_COURSE_Information_edit, // Inf_INTRODUCTION
|
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_edit,
|
||||||
Hlp_COURSE_Guide_edit, // Inf_TEACHING_GUIDE
|
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide_edit,
|
||||||
Hlp_COURSE_Syllabus_edit, // Inf_LECTURES
|
[Inf_LECTURES ] = Hlp_COURSE_Syllabus_edit,
|
||||||
Hlp_COURSE_Syllabus_edit, // Inf_PRACTICALS
|
[Inf_PRACTICALS ] = Hlp_COURSE_Syllabus_edit,
|
||||||
Hlp_COURSE_Bibliography_edit, // Inf_BIBLIOGRAPHY
|
[Inf_BIBLIOGRAPHY ] = Hlp_COURSE_Bibliography_edit,
|
||||||
Hlp_COURSE_FAQ_edit, // Inf_FAQ
|
[Inf_FAQ ] = Hlp_COURSE_FAQ_edit,
|
||||||
Hlp_COURSE_Links_edit, // Inf_LINKS
|
[Inf_LINKS ] = Hlp_COURSE_Links_edit,
|
||||||
Hlp_ASSESSMENT_System_edit, // Inf_ASSESSMENT
|
[Inf_ASSESSMENT ] = Hlp_ASSESSMENT_System_edit,
|
||||||
};
|
};
|
||||||
|
|
||||||
/***** Set info type *****/
|
/***** Set info type *****/
|
||||||
|
@ -2066,14 +2066,14 @@ void Inf_EditRichTxtInfo (void)
|
||||||
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
|
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
|
||||||
const char *HelpEdit[Inf_NUM_INFO_TYPES] =
|
const char *HelpEdit[Inf_NUM_INFO_TYPES] =
|
||||||
{
|
{
|
||||||
Hlp_COURSE_Information_edit, // Inf_INTRODUCTION
|
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_edit,
|
||||||
Hlp_COURSE_Guide_edit, // Inf_TEACHING_GUIDE
|
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide_edit,
|
||||||
Hlp_COURSE_Syllabus_edit, // Inf_LECTURES
|
[Inf_LECTURES ] = Hlp_COURSE_Syllabus_edit,
|
||||||
Hlp_COURSE_Syllabus_edit, // Inf_PRACTICALS
|
[Inf_PRACTICALS ] = Hlp_COURSE_Syllabus_edit,
|
||||||
Hlp_COURSE_Bibliography_edit, // Inf_BIBLIOGRAPHY
|
[Inf_BIBLIOGRAPHY ] = Hlp_COURSE_Bibliography_edit,
|
||||||
Hlp_COURSE_FAQ_edit, // Inf_FAQ
|
[Inf_FAQ ] = Hlp_COURSE_FAQ_edit,
|
||||||
Hlp_COURSE_Links_edit, // Inf_LINKS
|
[Inf_LINKS ] = Hlp_COURSE_Links_edit,
|
||||||
Hlp_ASSESSMENT_System_edit, // Inf_ASSESSMENT
|
[Inf_ASSESSMENT ] = Hlp_ASSESSMENT_System_edit,
|
||||||
};
|
};
|
||||||
|
|
||||||
/***** Set info type *****/
|
/***** Set info type *****/
|
||||||
|
|
|
@ -849,8 +849,8 @@ static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable)
|
||||||
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
HTM_TH_Empty (1);
|
HTM_TH_Empty (1);
|
||||||
for (Order = Ins_ORDER_BY_INSTITUTION;
|
for (Order = (Ins_Order_t) 0;
|
||||||
Order <= Ins_ORDER_BY_NUM_USRS;
|
Order <= (Ins_Order_t) (Ins_NUM_ORDERS - 1);
|
||||||
Order++)
|
Order++)
|
||||||
{
|
{
|
||||||
HTM_TH_Begin (1,1,Order == Ins_ORDER_BY_INSTITUTION ? "LM" :
|
HTM_TH_Begin (1,1,Order == Ins_ORDER_BY_INSTITUTION ? "LM" :
|
||||||
|
|
|
@ -119,8 +119,8 @@ void Lan_PutSelectorToSelectLanguage (void)
|
||||||
Frm_StartForm (ActReqChgLan);
|
Frm_StartForm (ActReqChgLan);
|
||||||
HTM_SELECT_Begin (true,
|
HTM_SELECT_Begin (true,
|
||||||
"name=\"Lan\" style=\"width:112px; margin:0;\"");
|
"name=\"Lan\" style=\"width:112px; margin:0;\"");
|
||||||
for (Lan = (Lan_Language_t) 1;
|
for (Lan = (Lan_Language_t) 1;
|
||||||
Lan <= Lan_NUM_LANGUAGES;
|
Lan <= (Lan_Language_t) Lan_NUM_LANGUAGES;
|
||||||
Lan++)
|
Lan++)
|
||||||
{
|
{
|
||||||
LanUnsigned = (unsigned) Lan;
|
LanUnsigned = (unsigned) Lan;
|
||||||
|
|
|
@ -363,7 +363,7 @@ void Mch_GetDataOfMatchByCod (struct Match *Match)
|
||||||
Match->MchCod = -1L;
|
Match->MchCod = -1L;
|
||||||
Match->GamCod = -1L;
|
Match->GamCod = -1L;
|
||||||
Match->UsrCod = -1L;
|
Match->UsrCod = -1L;
|
||||||
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
||||||
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||||
StartEndTime++)
|
StartEndTime++)
|
||||||
Match->TimeUTC[StartEndTime] = (time_t) 0;
|
Match->TimeUTC[StartEndTime] = (time_t) 0;
|
||||||
|
@ -583,7 +583,7 @@ static void Mch_ListOneOrMoreMatchesTimes (const struct Match *Match,unsigned Un
|
||||||
Dat_StartEndTime_t StartEndTime;
|
Dat_StartEndTime_t StartEndTime;
|
||||||
char *Id;
|
char *Id;
|
||||||
|
|
||||||
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
||||||
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||||
StartEndTime++)
|
StartEndTime++)
|
||||||
{
|
{
|
||||||
|
@ -887,7 +887,7 @@ static void Mch_GetMatchDataFromRow (MYSQL_RES *mysql_res,
|
||||||
Match->UsrCod = Str_ConvertStrCodToLongCod (row[2]);
|
Match->UsrCod = Str_ConvertStrCodToLongCod (row[2]);
|
||||||
|
|
||||||
/* Get start/end times (row[3], row[4] hold start/end UTC times) */
|
/* Get start/end times (row[3], row[4] hold start/end UTC times) */
|
||||||
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
||||||
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||||
StartEndTime++)
|
StartEndTime++)
|
||||||
Match->TimeUTC[StartEndTime] = Dat_GetUNIXTimeFromStr (row[3 + StartEndTime]);
|
Match->TimeUTC[StartEndTime] = Dat_GetUNIXTimeFromStr (row[3 + StartEndTime]);
|
||||||
|
|
|
@ -783,7 +783,7 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther,
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/* Write start/end times (row[1], row[2] hold UTC start/end times) */
|
/* Write start/end times (row[1], row[2] hold UTC start/end times) */
|
||||||
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
||||||
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||||
StartEndTime++)
|
StartEndTime++)
|
||||||
{
|
{
|
||||||
|
@ -1143,7 +1143,7 @@ void McR_ShowOneMchResult (void)
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/* Start/end time (for user in this match) */
|
/* Start/end time (for user in this match) */
|
||||||
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
for (StartEndTime = (Dat_StartEndTime_t) 0;
|
||||||
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||||
StartEndTime++)
|
StartEndTime++)
|
||||||
{
|
{
|
||||||
|
|
41
swad_media.c
41
swad_media.c
|
@ -350,33 +350,32 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
|
||||||
struct ParamUploadMedia ParamUploadMedia;
|
struct ParamUploadMedia ParamUploadMedia;
|
||||||
char Id[Frm_MAX_BYTES_ID + 1];
|
char Id[Frm_MAX_BYTES_ID + 1];
|
||||||
size_t NumUploader;
|
size_t NumUploader;
|
||||||
|
|
||||||
#define Med_NUM_MEDIA_UPLOADERS 3
|
#define Med_NUM_MEDIA_UPLOADERS 3
|
||||||
struct MediaUploader MediaUploader[Med_NUM_MEDIA_UPLOADERS] =
|
struct MediaUploader MediaUploader[Med_NUM_MEDIA_UPLOADERS] =
|
||||||
{
|
{
|
||||||
{/* Upload */
|
{/* Upload */
|
||||||
Med_FORM_FILE,
|
.FormType = Med_FORM_FILE,
|
||||||
"ico_upl", // <id>_ico_upl
|
.IconSuffix = "ico_upl", // <id>_ico_upl
|
||||||
"par_upl", // <id>_par_upl
|
.ParamSuffix = "par_upl", // <id>_par_upl
|
||||||
"mediaClickOnActivateUpload",
|
.FunctionName = "mediaClickOnActivateUpload",
|
||||||
"photo-video.svg",
|
.Icon = "photo-video.svg",
|
||||||
Txt_Image_video
|
.Title = Txt_Image_video
|
||||||
},
|
},
|
||||||
{/* YouTube */
|
{/* YouTube */
|
||||||
Med_FORM_YOUTUBE,
|
.FormType = Med_FORM_YOUTUBE,
|
||||||
"ico_you", // <id>_ico_you
|
.IconSuffix = "ico_you", // <id>_ico_you
|
||||||
"par_you", // <id>_par_you
|
.ParamSuffix = "par_you", // <id>_par_you
|
||||||
"mediaClickOnActivateYoutube",
|
.FunctionName = "mediaClickOnActivateYoutube",
|
||||||
"youtube-brands.svg",
|
.Icon = "youtube-brands.svg",
|
||||||
"YouTube"
|
.Title = "YouTube"
|
||||||
},
|
},
|
||||||
{/* Embed */
|
{/* Embed */
|
||||||
Med_FORM_EMBED,
|
.FormType = Med_FORM_EMBED,
|
||||||
"ico_emb", // <id>_ico_emb
|
.IconSuffix = "ico_emb", // <id>_ico_emb
|
||||||
"par_emb", // <id>_par_emb
|
.ParamSuffix = "par_emb", // <id>_par_emb
|
||||||
"mediaClickOnActivateEmbed",
|
.FunctionName = "mediaClickOnActivateEmbed",
|
||||||
"code.svg",
|
.Icon = "code.svg",
|
||||||
"Embed"
|
.Title = "Embed"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1918,8 +1917,8 @@ static Med_Type_t Med_GetTypeFromStrInDB (const char *Str)
|
||||||
{
|
{
|
||||||
Med_Type_t Type;
|
Med_Type_t Type;
|
||||||
|
|
||||||
for (Type = (Med_Type_t) 0;
|
for (Type = (Med_Type_t) 0;
|
||||||
Type < Med_NUM_TYPES;
|
Type <= (Med_Type_t) (Med_NUM_TYPES - 1);
|
||||||
Type++)
|
Type++)
|
||||||
if (!strcasecmp (Str,Med_StringsTypeDB[Type]))
|
if (!strcasecmp (Str,Med_StringsTypeDB[Type]))
|
||||||
return Type;
|
return Type;
|
||||||
|
|
|
@ -279,8 +279,8 @@ void Mnu_PutIconsToSelectMenu (void)
|
||||||
Hlp_PROFILE_Settings_menu,Box_NOT_CLOSABLE);
|
Hlp_PROFILE_Settings_menu,Box_NOT_CLOSABLE);
|
||||||
Set_StartSettingsHead ();
|
Set_StartSettingsHead ();
|
||||||
Set_StartOneSettingSelector ();
|
Set_StartOneSettingSelector ();
|
||||||
for (Menu = (Mnu_Menu_t) 0;
|
for (Menu = (Mnu_Menu_t) 0;
|
||||||
Menu < Mnu_NUM_MENUS;
|
Menu <= (Mnu_Menu_t) (Mnu_NUM_MENUS - 1);
|
||||||
Menu++)
|
Menu++)
|
||||||
{
|
{
|
||||||
HTM_DIV_Begin ("class=\"%s\"",Menu == Gbl.Prefs.Menu ? "PREF_ON" :
|
HTM_DIV_Begin ("class=\"%s\"",Menu == Gbl.Prefs.Menu ? "PREF_ON" :
|
||||||
|
|
|
@ -2605,8 +2605,8 @@ void Msg_ShowFormSelectCourseSentOrRecMsgs (void)
|
||||||
unsigned NumOriginCrs;
|
unsigned NumOriginCrs;
|
||||||
const char *TxtSelector[Msg_NUM_TYPES_OF_MSGS] =
|
const char *TxtSelector[Msg_NUM_TYPES_OF_MSGS] =
|
||||||
{
|
{
|
||||||
Txt_Messages_received_from_A_COURSE,
|
[Msg_MESSAGES_RECEIVED] = Txt_Messages_received_from_A_COURSE,
|
||||||
Txt_Messages_sent_from_A_COURSE
|
[Msg_MESSAGES_SENT ] = Txt_Messages_sent_from_A_COURSE
|
||||||
};
|
};
|
||||||
|
|
||||||
/***** Course selection *****/
|
/***** Course selection *****/
|
||||||
|
@ -2641,8 +2641,8 @@ void Msg_ShowFormToFilterMsgs (void)
|
||||||
extern const char *Txt_MSG_Content;
|
extern const char *Txt_MSG_Content;
|
||||||
const char *TxtFromTo[Msg_NUM_TYPES_OF_MSGS] =
|
const char *TxtFromTo[Msg_NUM_TYPES_OF_MSGS] =
|
||||||
{
|
{
|
||||||
Txt_MSG_From,
|
[Msg_MESSAGES_RECEIVED] = Txt_MSG_From,
|
||||||
Txt_MSG_To
|
[Msg_MESSAGES_SENT ] = Txt_MSG_To
|
||||||
};
|
};
|
||||||
|
|
||||||
/***** Begin table *****/
|
/***** Begin table *****/
|
||||||
|
|
|
@ -214,8 +214,8 @@ void Net_ShowWebsAndSocialNets (const struct UsrData *UsrDat)
|
||||||
"swad64x64.png",Cfg_PLATFORM_SHORT_NAME);
|
"swad64x64.png",Cfg_PLATFORM_SHORT_NAME);
|
||||||
|
|
||||||
/***** Show the rest of webs / social networks *****/
|
/***** Show the rest of webs / social networks *****/
|
||||||
for (NumURL = (Net_WebsAndSocialNetworks_t) 0;
|
for (NumURL = (Net_WebsAndSocialNetworks_t) 0;
|
||||||
NumURL < Net_NUM_WEBS_AND_SOCIAL_NETWORKS;
|
NumURL <= (Net_WebsAndSocialNetworks_t) (Net_NUM_WEBS_AND_SOCIAL_NETWORKS - 1);
|
||||||
NumURL++)
|
NumURL++)
|
||||||
{
|
{
|
||||||
/***** Check if exists the web / social network for this user *****/
|
/***** Check if exists the web / social network for this user *****/
|
||||||
|
@ -293,8 +293,8 @@ void Net_ShowFormMyWebsAndSocialNets (void)
|
||||||
Frm_StartFormAnchor (ActChgMyNet,Net_MY_WEBS_ID);
|
Frm_StartFormAnchor (ActChgMyNet,Net_MY_WEBS_ID);
|
||||||
|
|
||||||
/***** List webs and social networks *****/
|
/***** List webs and social networks *****/
|
||||||
for (NumURL = (Net_WebsAndSocialNetworks_t) 0;
|
for (NumURL = (Net_WebsAndSocialNetworks_t) 0;
|
||||||
NumURL < Net_NUM_WEBS_AND_SOCIAL_NETWORKS;
|
NumURL <= (Net_WebsAndSocialNetworks_t) (Net_NUM_WEBS_AND_SOCIAL_NETWORKS - 1);
|
||||||
NumURL++)
|
NumURL++)
|
||||||
{
|
{
|
||||||
/***** Get user's web / social network from database *****/
|
/***** Get user's web / social network from database *****/
|
||||||
|
@ -391,8 +391,8 @@ static void Net_GetMyWebsAndSocialNetsFromForm (void)
|
||||||
char URL[Cns_MAX_BYTES_WWW + 1];
|
char URL[Cns_MAX_BYTES_WWW + 1];
|
||||||
|
|
||||||
/***** Get URLs *****/
|
/***** Get URLs *****/
|
||||||
for (NumURL = (Net_WebsAndSocialNetworks_t) 0;
|
for (NumURL = (Net_WebsAndSocialNetworks_t) 0;
|
||||||
NumURL < Net_NUM_WEBS_AND_SOCIAL_NETWORKS;
|
NumURL <= (Net_WebsAndSocialNetworks_t) (Net_NUM_WEBS_AND_SOCIAL_NETWORKS - 1);
|
||||||
NumURL++)
|
NumURL++)
|
||||||
{
|
{
|
||||||
/***** Get URL from the form *****/
|
/***** Get URL from the form *****/
|
||||||
|
@ -563,8 +563,8 @@ void Net_ShowWebAndSocialNetworksStats (void)
|
||||||
/* Get web / social network (row[0]) */
|
/* Get web / social network (row[0]) */
|
||||||
Str_Copy (NetName,row[0],
|
Str_Copy (NetName,row[0],
|
||||||
Net_MAX_BYTES_NETWORK_NAME);
|
Net_MAX_BYTES_NETWORK_NAME);
|
||||||
for (Web = (Net_WebsAndSocialNetworks_t) 0;
|
for (Web = (Net_WebsAndSocialNetworks_t) 0;
|
||||||
Web < Net_NUM_WEBS_AND_SOCIAL_NETWORKS;
|
Web <= (Net_WebsAndSocialNetworks_t) (Net_NUM_WEBS_AND_SOCIAL_NETWORKS - 1);
|
||||||
Web++)
|
Web++)
|
||||||
if (!strcmp (Net_WebsAndSocialNetworksDB[Web],NetName))
|
if (!strcmp (Net_WebsAndSocialNetworksDB[Web],NetName))
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1926,8 +1926,8 @@ void Ntf_PutFormChangeNotifSentByEMail (void)
|
||||||
|
|
||||||
/***** Checkbox to activate internal notifications and email notifications
|
/***** Checkbox to activate internal notifications and email notifications
|
||||||
about events *****/
|
about events *****/
|
||||||
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
||||||
NotifyEvent < Ntf_NUM_NOTIFY_EVENTS;
|
NotifyEvent <= (Ntf_NotifyEvent_t) (Ntf_NUM_NOTIFY_EVENTS - 1);
|
||||||
NotifyEvent++) // O is reserved for Ntf_EVENT_UNKNOWN
|
NotifyEvent++) // O is reserved for Ntf_EVENT_UNKNOWN
|
||||||
{
|
{
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -1979,8 +1979,8 @@ static void Ntf_GetParamsNotifyEvents (void)
|
||||||
|
|
||||||
Gbl.Usrs.Me.UsrDat.NtfEvents.CreateNotif = 0;
|
Gbl.Usrs.Me.UsrDat.NtfEvents.CreateNotif = 0;
|
||||||
Gbl.Usrs.Me.UsrDat.NtfEvents.SendEmail = 0;
|
Gbl.Usrs.Me.UsrDat.NtfEvents.SendEmail = 0;
|
||||||
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
for (NotifyEvent = (Ntf_NotifyEvent_t) 1;
|
||||||
NotifyEvent < Ntf_NUM_NOTIFY_EVENTS;
|
NotifyEvent <= (Ntf_NotifyEvent_t) (Ntf_NUM_NOTIFY_EVENTS - 1);
|
||||||
NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN
|
NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN
|
||||||
{
|
{
|
||||||
if ((CreateNotifForThisEvent = Par_GetParToBool (Ntf_ParamNotifMeAboutNotifyEvents[NotifyEvent])))
|
if ((CreateNotifForThisEvent = Par_GetParToBool (Ntf_ParamNotifMeAboutNotifyEvents[NotifyEvent])))
|
||||||
|
|
32
swad_photo.c
32
swad_photo.c
|
@ -1372,13 +1372,13 @@ void Pho_CalcPhotoDegree (void)
|
||||||
/***** Get list of students in this degree *****/
|
/***** Get list of students in this degree *****/
|
||||||
Usr_GetUnorderedStdsCodesInDeg (DegCod);
|
Usr_GetUnorderedStdsCodesInDeg (DegCod);
|
||||||
|
|
||||||
for (Sex = (Usr_Sex_t) 0;
|
for (Sex = (Usr_Sex_t) 0;
|
||||||
Sex < Usr_NUM_SEXS;
|
Sex <= (Usr_Sex_t) (Usr_NUM_SEXS - 1);
|
||||||
Sex++)
|
Sex++)
|
||||||
{
|
{
|
||||||
TotalTimeToComputeAvgPhotoInMicroseconds = 0;
|
TotalTimeToComputeAvgPhotoInMicroseconds = 0;
|
||||||
for (TypeOfAverage = (Pho_AvgPhotoTypeOfAverage_t) 0;
|
for (TypeOfAverage = (Pho_AvgPhotoTypeOfAverage_t) 0;
|
||||||
TypeOfAverage < Pho_NUM_AVERAGE_PHOTO_TYPES;
|
TypeOfAverage <= (Pho_AvgPhotoTypeOfAverage_t) (Pho_NUM_AVERAGE_PHOTO_TYPES - 1);
|
||||||
TypeOfAverage++)
|
TypeOfAverage++)
|
||||||
{
|
{
|
||||||
/***** Compute average photos of students belonging this degree *****/
|
/***** Compute average photos of students belonging this degree *****/
|
||||||
|
@ -1545,8 +1545,8 @@ static long Pho_GetTimeToComputeAvgPhoto (long DegCod)
|
||||||
if (NumRows == Usr_NUM_SEXS)
|
if (NumRows == Usr_NUM_SEXS)
|
||||||
{
|
{
|
||||||
TotalTimeToComputeAvgPhoto = 0;
|
TotalTimeToComputeAvgPhoto = 0;
|
||||||
for (Sex = (Usr_Sex_t) 0;
|
for (Sex = (Usr_Sex_t) 0;
|
||||||
Sex < Usr_NUM_SEXS;
|
Sex <= (Usr_Sex_t) (Usr_NUM_SEXS - 1);
|
||||||
Sex++)
|
Sex++)
|
||||||
{
|
{
|
||||||
/***** Get row *****/
|
/***** Get row *****/
|
||||||
|
@ -1805,8 +1805,8 @@ static void Pho_PutSelectorForTypeOfAvg (void)
|
||||||
Usr_PutParamsPrefsAboutUsrList ();
|
Usr_PutParamsPrefsAboutUsrList ();
|
||||||
HTM_SELECT_Begin (true,
|
HTM_SELECT_Begin (true,
|
||||||
"id=\"AvgType\" name=\"AvgType\"");
|
"id=\"AvgType\" name=\"AvgType\"");
|
||||||
for (TypeOfAvg = (Pho_AvgPhotoTypeOfAverage_t) 0;
|
for (TypeOfAvg = (Pho_AvgPhotoTypeOfAverage_t) 0;
|
||||||
TypeOfAvg < Pho_NUM_AVERAGE_PHOTO_TYPES;
|
TypeOfAvg <= (Pho_AvgPhotoTypeOfAverage_t) (Pho_NUM_AVERAGE_PHOTO_TYPES - 1);
|
||||||
TypeOfAvg++)
|
TypeOfAvg++)
|
||||||
{
|
{
|
||||||
TypeOfAvgUnsigned = (unsigned) TypeOfAvg;
|
TypeOfAvgUnsigned = (unsigned) TypeOfAvg;
|
||||||
|
@ -1870,8 +1870,8 @@ static void Pho_PutSelectorForHowComputePhotoSize (void)
|
||||||
Usr_PutParamsPrefsAboutUsrList ();
|
Usr_PutParamsPrefsAboutUsrList ();
|
||||||
HTM_SELECT_Begin (true,
|
HTM_SELECT_Begin (true,
|
||||||
"id=\"PhotoSize\" name=\"PhotoSize\"");
|
"id=\"PhotoSize\" name=\"PhotoSize\"");
|
||||||
for (PhoSi = (Pho_HowComputePhotoSize_t) 0;
|
for (PhoSi = (Pho_HowComputePhotoSize_t) 0;
|
||||||
PhoSi < Pho_NUM_HOW_COMPUTE_PHOTO_SIZES;
|
PhoSi <= (Pho_HowComputePhotoSize_t) (Pho_NUM_HOW_COMPUTE_PHOTO_SIZES - 1);
|
||||||
PhoSi++)
|
PhoSi++)
|
||||||
{
|
{
|
||||||
PhoSiUnsigned = (unsigned) PhoSi;
|
PhoSiUnsigned = (unsigned) PhoSi;
|
||||||
|
@ -1935,8 +1935,8 @@ static void Pho_PutSelectorForHowOrderDegrees (void)
|
||||||
Usr_PutParamsPrefsAboutUsrList ();
|
Usr_PutParamsPrefsAboutUsrList ();
|
||||||
HTM_SELECT_Begin (true,
|
HTM_SELECT_Begin (true,
|
||||||
"id=\"Order\" name=\"Order\"");
|
"id=\"Order\" name=\"Order\"");
|
||||||
for (Order = (Pho_HowOrderDegrees_t) 0;
|
for (Order = (Pho_HowOrderDegrees_t) 0;
|
||||||
Order < Pho_NUM_HOW_ORDER_DEGREES;
|
Order <= (Pho_HowOrderDegrees_t) (Pho_NUM_HOW_ORDER_DEGREES - 1);
|
||||||
Order++)
|
Order++)
|
||||||
{
|
{
|
||||||
OrderUnsigned = (unsigned) Order;
|
OrderUnsigned = (unsigned) Order;
|
||||||
|
@ -2230,8 +2230,8 @@ static void Pho_ShowOrPrintListDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint)
|
||||||
|
|
||||||
HTM_TH (1,1,"RT",Txt_No_INDEX);
|
HTM_TH (1,1,"RT",Txt_No_INDEX);
|
||||||
HTM_TH (1,1,"CT",Txt_Degree);
|
HTM_TH (1,1,"CT",Txt_Degree);
|
||||||
for (Sex = (Usr_Sex_t) 0;
|
for (Sex = (Usr_Sex_t) 0;
|
||||||
Sex < Usr_NUM_SEXS;
|
Sex <= (Usr_Sex_t) (Usr_NUM_SEXS - 1);
|
||||||
Sex++)
|
Sex++)
|
||||||
HTM_TH (1,1,"CT",Txt_SEX_PLURAL_Abc[Sex]);
|
HTM_TH (1,1,"CT",Txt_SEX_PLURAL_Abc[Sex]);
|
||||||
|
|
||||||
|
@ -2271,8 +2271,8 @@ static void Pho_ShowOrPrintListDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint)
|
||||||
}
|
}
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
for (Sex = (Usr_Sex_t) 0;
|
for (Sex = (Usr_Sex_t) 0;
|
||||||
Sex < Usr_NUM_SEXS;
|
Sex <= (Usr_Sex_t) (Usr_NUM_SEXS - 1);
|
||||||
Sex++)
|
Sex++)
|
||||||
{
|
{
|
||||||
/***** Show average photo of students belonging to this degree *****/
|
/***** Show average photo of students belonging to this degree *****/
|
||||||
|
|
|
@ -115,8 +115,8 @@ void Plc_SeePlaces (void)
|
||||||
Hlp_INSTITUTION_Places,Box_NOT_CLOSABLE);
|
Hlp_INSTITUTION_Places,Box_NOT_CLOSABLE);
|
||||||
HTM_TABLE_BeginWideMarginPadding (2);
|
HTM_TABLE_BeginWideMarginPadding (2);
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
for (Order = Plc_ORDER_BY_PLACE;
|
for (Order = (Plc_Order_t) 0;
|
||||||
Order <= Plc_ORDER_BY_NUM_CTRS;
|
Order <= (Plc_Order_t) (Plc_NUM_ORDERS - 1);
|
||||||
Order++)
|
Order++)
|
||||||
{
|
{
|
||||||
HTM_TH_Begin (1,1,"LM");
|
HTM_TH_Begin (1,1,"LM");
|
||||||
|
|
|
@ -202,8 +202,8 @@ Pri_Visibility_t Pri_GetVisibilityFromStr (const char *Str)
|
||||||
{
|
{
|
||||||
Pri_Visibility_t Visibility;
|
Pri_Visibility_t Visibility;
|
||||||
|
|
||||||
for (Visibility = (Pri_Visibility_t) 0;
|
for (Visibility = (Pri_Visibility_t) 0;
|
||||||
Visibility < Pri_NUM_OPTIONS_PRIVACY;
|
Visibility <= (Pri_Visibility_t) (Pri_NUM_OPTIONS_PRIVACY - 1);
|
||||||
Visibility++)
|
Visibility++)
|
||||||
if (!strcasecmp (Str,Pri_VisibilityDB[Visibility]))
|
if (!strcasecmp (Str,Pri_VisibilityDB[Visibility]))
|
||||||
return Visibility;
|
return Visibility;
|
||||||
|
|
|
@ -538,7 +538,7 @@ static void Prj_ShowFormToFilterByAssign (void)
|
||||||
Prj_AssignedNonassig_t Assign;
|
Prj_AssignedNonassig_t Assign;
|
||||||
|
|
||||||
Set_StartOneSettingSelector ();
|
Set_StartOneSettingSelector ();
|
||||||
for (Assign = (Prj_AssignedNonassig_t) 0;
|
for (Assign = (Prj_AssignedNonassig_t) 0;
|
||||||
Assign <= (Prj_AssignedNonassig_t) (Prj_NUM_ASSIGNED_NONASSIG - 1);
|
Assign <= (Prj_AssignedNonassig_t) (Prj_NUM_ASSIGNED_NONASSIG - 1);
|
||||||
Assign++)
|
Assign++)
|
||||||
{
|
{
|
||||||
|
@ -579,7 +579,7 @@ static void Prj_ShowFormToFilterByHidden (void)
|
||||||
};
|
};
|
||||||
|
|
||||||
Set_StartOneSettingSelector ();
|
Set_StartOneSettingSelector ();
|
||||||
for (HidVis = (Prj_HiddenVisibl_t) 0;
|
for (HidVis = (Prj_HiddenVisibl_t) 0;
|
||||||
HidVis <= (Prj_HiddenVisibl_t) (Prj_NUM_HIDDEN_VISIBL - 1);
|
HidVis <= (Prj_HiddenVisibl_t) (Prj_NUM_HIDDEN_VISIBL - 1);
|
||||||
HidVis++)
|
HidVis++)
|
||||||
{
|
{
|
||||||
|
@ -620,7 +620,7 @@ static void Prj_ShowFormToFilterByWarning (void)
|
||||||
};
|
};
|
||||||
|
|
||||||
Set_StartOneSettingSelector ();
|
Set_StartOneSettingSelector ();
|
||||||
for (Faultiness = (Prj_Faultiness_t) 0;
|
for (Faultiness = (Prj_Faultiness_t) 0;
|
||||||
Faultiness <= (Prj_Faultiness_t) (Prj_NUM_FAULTINESS - 1);
|
Faultiness <= (Prj_Faultiness_t) (Prj_NUM_FAULTINESS - 1);
|
||||||
Faultiness++)
|
Faultiness++)
|
||||||
{
|
{
|
||||||
|
@ -888,7 +888,7 @@ static void Prj_ShowProjectsHead (Prj_ProjectView_t ProjectView)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Rest of columns *****/
|
/***** Rest of columns *****/
|
||||||
for (Order = (Prj_Order_t) 0;
|
for (Order = (Prj_Order_t) 0;
|
||||||
Order <= (Prj_Order_t) (Prj_NUM_ORDERS - 1);
|
Order <= (Prj_Order_t) (Prj_NUM_ORDERS - 1);
|
||||||
Order++)
|
Order++)
|
||||||
{
|
{
|
||||||
|
@ -937,7 +937,7 @@ static void Prj_ShowTableAllProjectsHead (void)
|
||||||
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
for (Order = (Prj_Order_t) 0;
|
for (Order = (Prj_Order_t) 0;
|
||||||
Order <= (Prj_Order_t) (Prj_NUM_ORDERS - 1);
|
Order <= (Prj_Order_t) (Prj_NUM_ORDERS - 1);
|
||||||
Order++)
|
Order++)
|
||||||
HTM_TH (1,1,"LT DAT_N",Txt_PROJECT_ORDER[Order]);
|
HTM_TH (1,1,"LT DAT_N",Txt_PROJECT_ORDER[Order]);
|
||||||
|
@ -2271,10 +2271,10 @@ static void Prj_ReqAddUsrs (Prj_RoleInProject_t RoleInProject)
|
||||||
extern const char *Txt_PROJECT_ROLES_PLURAL_abc[Prj_NUM_ROLES_IN_PROJECT];
|
extern const char *Txt_PROJECT_ROLES_PLURAL_abc[Prj_NUM_ROLES_IN_PROJECT];
|
||||||
static Act_Action_t ActionAddUsr[Prj_NUM_ROLES_IN_PROJECT] =
|
static Act_Action_t ActionAddUsr[Prj_NUM_ROLES_IN_PROJECT] =
|
||||||
{
|
{
|
||||||
ActUnk, // Prj_ROLE_UNK, Unknown
|
[Prj_ROLE_UNK] = ActUnk, // Unknown
|
||||||
ActAddStdPrj, // Prj_ROLE_STD, Student
|
[Prj_ROLE_STD] = ActAddStdPrj, // Student
|
||||||
ActAddTutPrj, // Prj_ROLE_TUT, Tutor
|
[Prj_ROLE_TUT] = ActAddTutPrj, // Tutor
|
||||||
ActAddEvlPrj, // Prj_ROLE_EVL, Evaluator
|
[Prj_ROLE_EVL] = ActAddEvlPrj, // Evaluator
|
||||||
};
|
};
|
||||||
char TxtButton[Lay_MAX_BYTES_TITLE + 1];
|
char TxtButton[Lay_MAX_BYTES_TITLE + 1];
|
||||||
|
|
||||||
|
@ -2421,10 +2421,10 @@ static void Prj_ReqRemUsrFromPrj (Prj_RoleInProject_t RoleInProject)
|
||||||
extern const char *Txt_Remove_USER_from_this_project;
|
extern const char *Txt_Remove_USER_from_this_project;
|
||||||
static Act_Action_t ActionRemUsr[Prj_NUM_ROLES_IN_PROJECT] =
|
static Act_Action_t ActionRemUsr[Prj_NUM_ROLES_IN_PROJECT] =
|
||||||
{
|
{
|
||||||
ActUnk, // Prj_ROLE_UNK, Unknown
|
[Prj_ROLE_UNK] = ActUnk, // Unknown
|
||||||
ActRemStdPrj, // Prj_ROLE_STD, Student
|
[Prj_ROLE_STD] = ActRemStdPrj, // Student
|
||||||
ActRemTutPrj, // Prj_ROLE_TUT, Tutor
|
[Prj_ROLE_TUT] = ActRemTutPrj, // Tutor
|
||||||
ActRemEvlPrj, // Prj_ROLE_EVL, Evaluator
|
[Prj_ROLE_EVL] = ActRemEvlPrj, // Evaluator
|
||||||
};
|
};
|
||||||
struct Project Prj;
|
struct Project Prj;
|
||||||
bool ItsMe;
|
bool ItsMe;
|
||||||
|
|
|
@ -335,8 +335,8 @@ void Rec_ListFieldsRecordsForEdition (void)
|
||||||
Par_PutHiddenParamLong (NULL,"FieldCod",Gbl.Crs.Records.LstFields.Lst[NumField].FieldCod);
|
Par_PutHiddenParamLong (NULL,"FieldCod",Gbl.Crs.Records.LstFields.Lst[NumField].FieldCod);
|
||||||
HTM_SELECT_Begin (true,
|
HTM_SELECT_Begin (true,
|
||||||
"name=\"Visibility\"");
|
"name=\"Visibility\"");
|
||||||
for (Vis = (Rec_VisibilityRecordFields_t) 0;
|
for (Vis = (Rec_VisibilityRecordFields_t) 0;
|
||||||
Vis < (Rec_VisibilityRecordFields_t) Rec_NUM_TYPES_VISIBILITY;
|
Vis <= (Rec_VisibilityRecordFields_t) (Rec_NUM_TYPES_VISIBILITY - 1);
|
||||||
Vis++)
|
Vis++)
|
||||||
{
|
{
|
||||||
VisUnsigned = (unsigned) Vis;
|
VisUnsigned = (unsigned) Vis;
|
||||||
|
@ -400,8 +400,8 @@ void Rec_ShowFormCreateRecordField (void)
|
||||||
HTM_TD_Begin ("class=\"CM\"");
|
HTM_TD_Begin ("class=\"CM\"");
|
||||||
HTM_SELECT_Begin (false,
|
HTM_SELECT_Begin (false,
|
||||||
"name=\"Visibility\"");
|
"name=\"Visibility\"");
|
||||||
for (Vis = (Rec_VisibilityRecordFields_t) 0;
|
for (Vis = (Rec_VisibilityRecordFields_t) 0;
|
||||||
Vis < (Rec_VisibilityRecordFields_t) Rec_NUM_TYPES_VISIBILITY;
|
Vis <= (Rec_VisibilityRecordFields_t) (Rec_NUM_TYPES_VISIBILITY - 1);
|
||||||
Vis++)
|
Vis++)
|
||||||
{
|
{
|
||||||
VisUnsigned = (unsigned) Vis;
|
VisUnsigned = (unsigned) Vis;
|
||||||
|
|
14
swad_role.c
14
swad_role.c
|
@ -211,7 +211,7 @@ void Rol_SetMyRoles (void)
|
||||||
if (!(Gbl.Usrs.Me.Role.Available &
|
if (!(Gbl.Usrs.Me.Role.Available &
|
||||||
(1 << Gbl.Usrs.Me.Role.Logged))) // Current type I am logged is not available for me
|
(1 << Gbl.Usrs.Me.Role.Logged))) // Current type I am logged is not available for me
|
||||||
/* Set the lowest role available for me */
|
/* Set the lowest role available for me */
|
||||||
for (Gbl.Usrs.Me.Role.Logged = Rol_UNK;
|
for (Gbl.Usrs.Me.Role.Logged = (Rol_Role_t) 0;
|
||||||
Gbl.Usrs.Me.Role.Logged <= (Rol_Role_t) (Rol_NUM_ROLES - 1);
|
Gbl.Usrs.Me.Role.Logged <= (Rol_Role_t) (Rol_NUM_ROLES - 1);
|
||||||
Gbl.Usrs.Me.Role.Logged++)
|
Gbl.Usrs.Me.Role.Logged++)
|
||||||
if (Gbl.Usrs.Me.Role.Available & (1 << Gbl.Usrs.Me.Role.Logged))
|
if (Gbl.Usrs.Me.Role.Available & (1 << Gbl.Usrs.Me.Role.Logged))
|
||||||
|
@ -227,8 +227,8 @@ unsigned Rol_GetNumAvailableRoles (void)
|
||||||
Rol_Role_t Role;
|
Rol_Role_t Role;
|
||||||
unsigned NumAvailableRoles = 0;
|
unsigned NumAvailableRoles = 0;
|
||||||
|
|
||||||
for (Role = Rol_GST;
|
for (Role = (Rol_Role_t) 1;
|
||||||
Role < Rol_NUM_ROLES;
|
Role <= (Rol_Role_t) Rol_NUM_ROLES - 1;
|
||||||
Role++)
|
Role++)
|
||||||
if (Gbl.Usrs.Me.Role.Available & (1 << Role))
|
if (Gbl.Usrs.Me.Role.Available & (1 << Role))
|
||||||
NumAvailableRoles++;
|
NumAvailableRoles++;
|
||||||
|
@ -485,8 +485,8 @@ void Rol_PutFormToChangeMyRole (const char *ClassSelect)
|
||||||
else
|
else
|
||||||
HTM_SELECT_Begin (true,
|
HTM_SELECT_Begin (true,
|
||||||
"name=\"MyRole\"");
|
"name=\"MyRole\"");
|
||||||
for (Role = Rol_GST;
|
for (Role = (Rol_Role_t) 1;
|
||||||
Role < Rol_NUM_ROLES;
|
Role <= (Rol_Role_t) (Rol_NUM_ROLES - 1);
|
||||||
Role++)
|
Role++)
|
||||||
if (Gbl.Usrs.Me.Role.Available & (1 << Role))
|
if (Gbl.Usrs.Me.Role.Available & (1 << Role))
|
||||||
{
|
{
|
||||||
|
@ -578,7 +578,7 @@ void Rol_PutHiddenParamRoles (unsigned Roles)
|
||||||
|
|
||||||
unsigned Rol_GetSelectedRoles (void)
|
unsigned Rol_GetSelectedRoles (void)
|
||||||
{
|
{
|
||||||
char StrRoles[Rol_NUM_ROLES * (10 + 1)];
|
char StrRoles[Rol_NUM_ROLES * (Cns_MAX_DECIMAL_DIGITS_UINT + 1)];
|
||||||
const char *Ptr;
|
const char *Ptr;
|
||||||
char UnsignedStr[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
|
char UnsignedStr[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
|
||||||
Rol_Role_t Role;
|
Rol_Role_t Role;
|
||||||
|
@ -592,7 +592,7 @@ unsigned Rol_GetSelectedRoles (void)
|
||||||
0); // 000...000
|
0); // 000...000
|
||||||
|
|
||||||
/***** Try to get multiple param "Role" *****/
|
/***** Try to get multiple param "Role" *****/
|
||||||
Par_GetParMultiToText ("Role",StrRoles,Rol_NUM_ROLES * (10 + 1));
|
Par_GetParMultiToText ("Role",StrRoles,Rol_NUM_ROLES * (Cns_MAX_DECIMAL_DIGITS_UINT + 1));
|
||||||
for (Ptr = StrRoles;
|
for (Ptr = StrRoles;
|
||||||
*Ptr;)
|
*Ptr;)
|
||||||
{
|
{
|
||||||
|
|
|
@ -78,8 +78,8 @@ void Sco_PutSelectorScope (const char *ParamName,bool SendOnChange)
|
||||||
HTM_SELECT_Begin (SendOnChange,
|
HTM_SELECT_Begin (SendOnChange,
|
||||||
"id=\"%s\" name=\"%s\"",ParamName,ParamName);
|
"id=\"%s\" name=\"%s\"",ParamName,ParamName);
|
||||||
|
|
||||||
for (Scope = (Hie_Level_t) 0;
|
for (Scope = (Hie_Level_t) 0;
|
||||||
Scope < Hie_NUM_LEVELS;
|
Scope <= (Hie_Level_t) (Hie_NUM_LEVELS - 1);
|
||||||
Scope++)
|
Scope++)
|
||||||
if ((Gbl.Scope.Allowed & (1 << Scope)))
|
if ((Gbl.Scope.Allowed & (1 << Scope)))
|
||||||
{
|
{
|
||||||
|
@ -333,8 +333,8 @@ Hie_Level_t Sco_GetScopeFromDBStr (const char *ScopeDBStr)
|
||||||
{
|
{
|
||||||
Hie_Level_t Scope;
|
Hie_Level_t Scope;
|
||||||
|
|
||||||
for (Scope = Hie_UNK;
|
for (Scope = (Hie_Level_t) 0;
|
||||||
Scope < Hie_NUM_LEVELS;
|
Scope <= (Hie_Level_t) (Hie_NUM_LEVELS - 1);
|
||||||
Scope++)
|
Scope++)
|
||||||
if (!strcmp (Sco_GetDBStrFromScope (Scope),ScopeDBStr))
|
if (!strcmp (Sco_GetDBStrFromScope (Scope),ScopeDBStr))
|
||||||
return Scope;
|
return Scope;
|
||||||
|
|
|
@ -167,8 +167,8 @@ static void Sch_PutFormToSearchWithWhatToSearchAndScope (Act_Action_t Action,Hie
|
||||||
HTM_TxtF (" %s ",Txt_SEARCH_X_in_Y);
|
HTM_TxtF (" %s ",Txt_SEARCH_X_in_Y);
|
||||||
HTM_SELECT_Begin (false,
|
HTM_SELECT_Begin (false,
|
||||||
"name=\"WhatToSearch\" class=\"WHAT_TO_SEARCH\"");
|
"name=\"WhatToSearch\" class=\"WHAT_TO_SEARCH\"");
|
||||||
for (WhatToSearch = (Sch_WhatToSearch_t) 0;
|
for (WhatToSearch = (Sch_WhatToSearch_t) 0;
|
||||||
WhatToSearch < Sch_NUM_WHAT_TO_SEARCH;
|
WhatToSearch <= (Sch_WhatToSearch_t) (Sch_NUM_WHAT_TO_SEARCH - 1);
|
||||||
WhatToSearch++)
|
WhatToSearch++)
|
||||||
if (Sch_CheckIfIHavePermissionToSearch (WhatToSearch))
|
if (Sch_CheckIfIHavePermissionToSearch (WhatToSearch))
|
||||||
{
|
{
|
||||||
|
|
|
@ -436,8 +436,8 @@ void Sta_AskShowGblHits (void)
|
||||||
HTM_TD_Begin ("class=\"LM\"");
|
HTM_TD_Begin ("class=\"LM\"");
|
||||||
HTM_SELECT_Begin (false,
|
HTM_SELECT_Begin (false,
|
||||||
"id=\"Role\" name=\"Role\" class=\"STAT_SEL\"");
|
"id=\"Role\" name=\"Role\" class=\"STAT_SEL\"");
|
||||||
for (RoleStat = (Sta_Role_t) 0;
|
for (RoleStat = (Sta_Role_t) 0;
|
||||||
RoleStat < Sta_NUM_ROLES_STAT;
|
RoleStat <= (Sta_Role_t) (Sta_NUM_ROLES_STAT - 1);
|
||||||
RoleStat++)
|
RoleStat++)
|
||||||
{
|
{
|
||||||
RoleStatUnsigned = (unsigned) RoleStat;
|
RoleStatUnsigned = (unsigned) RoleStat;
|
||||||
|
@ -575,8 +575,8 @@ static void Sta_WriteSelectorCountType (void)
|
||||||
/**** Count type *****/
|
/**** Count type *****/
|
||||||
HTM_SELECT_Begin (false,
|
HTM_SELECT_Begin (false,
|
||||||
"id=\"CountType\" name=\"CountType\"");
|
"id=\"CountType\" name=\"CountType\"");
|
||||||
for (StatCountType = (Sta_CountType_t) 0;
|
for (StatCountType = (Sta_CountType_t) 0;
|
||||||
StatCountType < Sta_NUM_COUNT_TYPES;
|
StatCountType <= (Sta_CountType_t) (Sta_NUM_COUNT_TYPES - 1);
|
||||||
StatCountType++)
|
StatCountType++)
|
||||||
{
|
{
|
||||||
StatCountTypeUnsigned = (unsigned) StatCountType;
|
StatCountTypeUnsigned = (unsigned) StatCountType;
|
||||||
|
@ -615,8 +615,8 @@ static void Sta_WriteSelectorAction (void)
|
||||||
"id=\"StatAct\" name=\"StatAct\" class=\"STAT_SEL\"");
|
"id=\"StatAct\" name=\"StatAct\" class=\"STAT_SEL\"");
|
||||||
HTM_OPTION (HTM_Type_STRING,"0",Gbl.Stat.NumAction == 0,false,
|
HTM_OPTION (HTM_Type_STRING,"0",Gbl.Stat.NumAction == 0,false,
|
||||||
"%s",Txt_Any_action);
|
"%s",Txt_Any_action);
|
||||||
for (Action = (Act_Action_t) 1;
|
for (Action = (Act_Action_t) 1;
|
||||||
Action < Act_NUM_ACTIONS;
|
Action <= (Act_Action_t) (Act_NUM_ACTIONS - 1);
|
||||||
Action++)
|
Action++)
|
||||||
{
|
{
|
||||||
Tab = Act_GetTab (Act_GetSuperAction (Action));
|
Tab = Act_GetTab (Act_GetSuperAction (Action));
|
||||||
|
@ -1974,8 +1974,8 @@ static void Sta_ShowDistrAccessesPerDayAndHour (unsigned long NumRows,MYSQL_RES
|
||||||
HTM_TxtF ("%s: ",Txt_Color_of_the_graphic);
|
HTM_TxtF ("%s: ",Txt_Color_of_the_graphic);
|
||||||
HTM_SELECT_Begin (true,
|
HTM_SELECT_Begin (true,
|
||||||
"name=\"ColorType\"");
|
"name=\"ColorType\"");
|
||||||
for (ColorType = (Sta_ColorType_t) 0;
|
for (ColorType = (Sta_ColorType_t) 0;
|
||||||
ColorType < Sta_NUM_COLOR_TYPES;
|
ColorType <= (Sta_ColorType_t) (Sta_NUM_COLOR_TYPES - 1);
|
||||||
ColorType++)
|
ColorType++)
|
||||||
{
|
{
|
||||||
ColorTypeUnsigned = (unsigned) ColorType;
|
ColorTypeUnsigned = (unsigned) ColorType;
|
||||||
|
|
|
@ -62,8 +62,8 @@ extern struct Globals Gbl;
|
||||||
|
|
||||||
const char *Svy_StrAnswerTypesDB[Svy_NUM_ANS_TYPES] =
|
const char *Svy_StrAnswerTypesDB[Svy_NUM_ANS_TYPES] =
|
||||||
{
|
{
|
||||||
"unique_choice",
|
[Svy_ANS_UNIQUE_CHOICE ] = "unique_choice",
|
||||||
"multiple_choice",
|
[Svy_ANS_MULTIPLE_CHOICE] = "multiple_choice",
|
||||||
};
|
};
|
||||||
|
|
||||||
#define Svy_MAX_ANSWERS_PER_QUESTION 10
|
#define Svy_MAX_ANSWERS_PER_QUESTION 10
|
||||||
|
@ -2714,8 +2714,8 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"%s LT\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
|
HTM_TD_Begin ("class=\"%s LT\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
|
||||||
for (AnsType = (Svy_AnswerType_t) 0;
|
for (AnsType = (Svy_AnswerType_t) 0;
|
||||||
AnsType < Svy_NUM_ANS_TYPES;
|
AnsType <= (Svy_AnswerType_t) (Svy_NUM_ANS_TYPES - 1);
|
||||||
AnsType++)
|
AnsType++)
|
||||||
{
|
{
|
||||||
HTM_LABEL_Begin (NULL);
|
HTM_LABEL_Begin (NULL);
|
||||||
|
@ -2844,8 +2844,8 @@ static Svy_AnswerType_t Svy_ConvertFromStrAnsTypDBToAnsTyp (const char *StrAnsTy
|
||||||
{
|
{
|
||||||
Svy_AnswerType_t AnsType;
|
Svy_AnswerType_t AnsType;
|
||||||
|
|
||||||
for (AnsType = (Svy_AnswerType_t) 0;
|
for (AnsType = (Svy_AnswerType_t) 0;
|
||||||
AnsType < Svy_NUM_ANS_TYPES;
|
AnsType <= (Svy_AnswerType_t) (Svy_NUM_ANS_TYPES - 1);
|
||||||
AnsType++)
|
AnsType++)
|
||||||
if (!strcmp (StrAnsTypeBD,Svy_StrAnswerTypesDB[AnsType]))
|
if (!strcmp (StrAnsTypeBD,Svy_StrAnswerTypesDB[AnsType]))
|
||||||
return AnsType;
|
return AnsType;
|
||||||
|
|
|
@ -65,17 +65,17 @@ extern struct Globals Gbl;
|
||||||
|
|
||||||
static const char *StyleSyllabus[1 + Syl_MAX_LEVELS_SYLLABUS] =
|
static const char *StyleSyllabus[1 + Syl_MAX_LEVELS_SYLLABUS] =
|
||||||
{
|
{
|
||||||
"",
|
[ 0] = "",
|
||||||
"T1",
|
[ 1] = "T1",
|
||||||
"T2",
|
[ 2] = "T2",
|
||||||
"T3",
|
[ 3] = "T3",
|
||||||
"T3",
|
[ 4] = "T3",
|
||||||
"T3",
|
[ 5] = "T3",
|
||||||
"T3",
|
[ 6] = "T3",
|
||||||
"T3",
|
[ 7] = "T3",
|
||||||
"T3",
|
[ 8] = "T3",
|
||||||
"T3",
|
[ 9] = "T3",
|
||||||
"T3",
|
[10] = "T3",
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -144,8 +144,8 @@ void Syl_PutFormWhichSyllabus (void)
|
||||||
HTM_DIV_Begin ("class=\"CM\"");
|
HTM_DIV_Begin ("class=\"CM\"");
|
||||||
HTM_UL_Begin ("class=\"LIST_LEFT\"");
|
HTM_UL_Begin ("class=\"LIST_LEFT\"");
|
||||||
|
|
||||||
for (WhichSyllabus = (Syl_WhichSyllabus_t) 0;
|
for (WhichSyllabus = (Syl_WhichSyllabus_t) 0;
|
||||||
WhichSyllabus < For_NUM_FORUM_SETS;
|
WhichSyllabus <= (Syl_WhichSyllabus_t) (For_NUM_FORUM_SETS - 1);
|
||||||
WhichSyllabus++)
|
WhichSyllabus++)
|
||||||
{
|
{
|
||||||
HTM_LI_Begin ("class=\"DAT LM\"");
|
HTM_LI_Begin ("class=\"DAT LM\"");
|
||||||
|
|
|
@ -86,8 +86,8 @@ void Tab_DrawTabs (void)
|
||||||
HTM_UL_Begin ("class=\"TAB_LIST\"");
|
HTM_UL_Begin ("class=\"TAB_LIST\"");
|
||||||
|
|
||||||
/***** Draw the tabs *****/
|
/***** Draw the tabs *****/
|
||||||
for (NumTab = (Tab_Tab_t) 1;
|
for (NumTab = (Tab_Tab_t) 1;
|
||||||
NumTab <= (Tab_Tab_t) Tab_NUM_TABS - 1;
|
NumTab <= (Tab_Tab_t) (Tab_NUM_TABS - 1);
|
||||||
NumTab++)
|
NumTab++)
|
||||||
{
|
{
|
||||||
ICanViewTab = Tab_CheckIfICanViewTab (NumTab);
|
ICanViewTab = Tab_CheckIfICanViewTab (NumTab);
|
||||||
|
@ -201,7 +201,8 @@ static const char *Tab_GetIcon (Tab_Tab_t NumTab)
|
||||||
[TabPrf] = "user",
|
[TabPrf] = "user",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (NumTab < (Tab_Tab_t) 1 || NumTab >= Tab_NUM_TABS)
|
if (NumTab < (Tab_Tab_t) 1 ||
|
||||||
|
NumTab > (Tab_Tab_t) (Tab_NUM_TABS - 1))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return Ico_GetIcon (Tab_TabIcons[NumTab]);
|
return Ico_GetIcon (Tab_TabIcons[NumTab]);
|
||||||
|
|
163
swad_test.c
163
swad_test.c
|
@ -86,31 +86,31 @@ const char *Tst_StrAnswerTypesXML[Tst_NUM_ANS_TYPES] =
|
||||||
#define Tst_MAX_BYTES_TAGS_LIST (16 * 1024)
|
#define Tst_MAX_BYTES_TAGS_LIST (16 * 1024)
|
||||||
#define Tst_MAX_BYTES_FLOAT_ANSWER 30 // Maximum length of the strings that store an floating point answer
|
#define Tst_MAX_BYTES_FLOAT_ANSWER 30 // Maximum length of the strings that store an floating point answer
|
||||||
|
|
||||||
const char *Tst_PluggableDB[Tst_NUM_OPTIONS_PLUGGABLE] =
|
static const char *Tst_PluggableDB[Tst_NUM_OPTIONS_PLUGGABLE] =
|
||||||
{
|
{
|
||||||
"unknown",
|
[Tst_PLUGGABLE_UNKNOWN] = "unknown",
|
||||||
"N",
|
[Tst_PLUGGABLE_NO ] = "N",
|
||||||
"Y",
|
[Tst_PLUGGABLE_YES ] = "Y",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Feedback to students in tests
|
// Feedback to students in tests
|
||||||
const char *Tst_FeedbackDB[Tst_NUM_TYPES_FEEDBACK] =
|
static const char *Tst_FeedbackDB[Tst_NUM_TYPES_FEEDBACK] =
|
||||||
{
|
{
|
||||||
"nothing", // No feedback
|
[Tst_FEEDBACK_NOTHING ] = "nothing", // No feedback
|
||||||
"total_result", // Little
|
[Tst_FEEDBACK_TOTAL_RESULT ] = "total_result", // Little
|
||||||
"each_result", // Medium
|
[Tst_FEEDBACK_EACH_RESULT ] = "each_result", // Medium
|
||||||
"each_good_bad", // High
|
[Tst_FEEDBACK_EACH_GOOD_BAD] = "each_good_bad", // High
|
||||||
"full_feedback", // Maximum
|
[Tst_FEEDBACK_FULL_FEEDBACK] = "full_feedback", // Maximum
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *Tst_StrAnswerTypesDB[Tst_NUM_ANS_TYPES] =
|
static const char *Tst_StrAnswerTypesDB[Tst_NUM_ANS_TYPES] =
|
||||||
{
|
{
|
||||||
"int",
|
[Tst_ANS_INT ] = "int",
|
||||||
"float",
|
[Tst_ANS_FLOAT ] = "float",
|
||||||
"true_false",
|
[Tst_ANS_TRUE_FALSE ] = "true_false",
|
||||||
"unique_choice",
|
[Tst_ANS_UNIQUE_CHOICE ] = "unique_choice",
|
||||||
"multiple_choice",
|
[Tst_ANS_MULTIPLE_CHOICE] = "multiple_choice",
|
||||||
"text",
|
[Tst_ANS_TEXT ] = "text",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Test images will be saved with:
|
// Test images will be saved with:
|
||||||
|
@ -1979,8 +1979,8 @@ static void Tst_ShowFormConfigTst (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LB\"");
|
HTM_TD_Begin ("class=\"LB\"");
|
||||||
for (Feedback = (Tst_Feedback_t) 0;
|
for (Feedback = (Tst_Feedback_t) 0;
|
||||||
Feedback < Tst_NUM_TYPES_FEEDBACK;
|
Feedback <= (Tst_Feedback_t) (Tst_NUM_TYPES_FEEDBACK - 1);
|
||||||
Feedback++)
|
Feedback++)
|
||||||
{
|
{
|
||||||
HTM_LABEL_Begin ("class=\"DAT\"");
|
HTM_LABEL_Begin ("class=\"DAT\"");
|
||||||
|
@ -2126,8 +2126,8 @@ void Tst_GetConfigFromRow (MYSQL_ROW row)
|
||||||
(unsigned long) LongNum;
|
(unsigned long) LongNum;
|
||||||
|
|
||||||
/***** Get feedback type (row[5]) *****/
|
/***** Get feedback type (row[5]) *****/
|
||||||
for (Feedback = (Tst_Feedback_t) 0;
|
for (Feedback = (Tst_Feedback_t) 0;
|
||||||
Feedback < Tst_NUM_TYPES_FEEDBACK;
|
Feedback <= (Tst_Feedback_t) (Tst_NUM_TYPES_FEEDBACK - 1);
|
||||||
Feedback++)
|
Feedback++)
|
||||||
if (!strcmp (row[5],Tst_FeedbackDB[Feedback]))
|
if (!strcmp (row[5],Tst_FeedbackDB[Feedback]))
|
||||||
{
|
{
|
||||||
|
@ -2343,8 +2343,8 @@ static void Tst_ShowFormAnswerTypes (void)
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** Type of answer *****/
|
/***** Type of answer *****/
|
||||||
for (AnsType = (Tst_AnswerType_t) 0;
|
for (AnsType = (Tst_AnswerType_t) 0;
|
||||||
AnsType < Tst_NUM_ANS_TYPES;
|
AnsType <= (Tst_AnswerType_t) (Tst_NUM_ANS_TYPES - 1);
|
||||||
AnsType++)
|
AnsType++)
|
||||||
{
|
{
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -2824,8 +2824,8 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows,
|
||||||
/* Stem and answers of question */
|
/* Stem and answers of question */
|
||||||
/* Number of times that the question has been answered */
|
/* Number of times that the question has been answered */
|
||||||
/* Average score */
|
/* Average score */
|
||||||
for (Order = (Tst_QuestionsOrder_t) 0;
|
for (Order = (Tst_QuestionsOrder_t) 0;
|
||||||
Order < (Tst_QuestionsOrder_t) Tst_NUM_TYPES_ORDER_QST;
|
Order <= (Tst_QuestionsOrder_t) (Tst_NUM_TYPES_ORDER_QST - 1);
|
||||||
Order++)
|
Order++)
|
||||||
{
|
{
|
||||||
HTM_TH_Begin (1,1,"LT");
|
HTM_TH_Begin (1,1,"LT");
|
||||||
|
@ -5242,8 +5242,8 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1],
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"%s LT\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
|
HTM_TD_Begin ("class=\"%s LT\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
|
||||||
for (AnsType = (Tst_AnswerType_t) 0;
|
for (AnsType = (Tst_AnswerType_t) 0;
|
||||||
AnsType < Tst_NUM_ANS_TYPES;
|
AnsType <= (Tst_AnswerType_t) (Tst_NUM_ANS_TYPES - 1);
|
||||||
AnsType++)
|
AnsType++)
|
||||||
{
|
{
|
||||||
HTM_LABEL_Begin (NULL);
|
HTM_LABEL_Begin (NULL);
|
||||||
|
@ -5837,8 +5837,8 @@ Tst_AnswerType_t Tst_ConvertFromStrAnsTypDBToAnsTyp (const char *StrAnsTypeBD)
|
||||||
Tst_AnswerType_t AnsType;
|
Tst_AnswerType_t AnsType;
|
||||||
|
|
||||||
if (StrAnsTypeBD != NULL)
|
if (StrAnsTypeBD != NULL)
|
||||||
for (AnsType = (Tst_AnswerType_t) 0;
|
for (AnsType = (Tst_AnswerType_t) 0;
|
||||||
AnsType < Tst_NUM_ANS_TYPES;
|
AnsType <= (Tst_AnswerType_t) (Tst_NUM_ANS_TYPES - 1);
|
||||||
AnsType++)
|
AnsType++)
|
||||||
if (!strcmp (StrAnsTypeBD,Tst_StrAnswerTypesDB[AnsType]))
|
if (!strcmp (StrAnsTypeBD,Tst_StrAnswerTypesDB[AnsType]))
|
||||||
return AnsType;
|
return AnsType;
|
||||||
|
@ -6285,6 +6285,111 @@ bool Tst_CheckIfQstFormatIsCorrectAndCountNumOptions (void)
|
||||||
return true; // Question format without errors
|
return true; // Question format without errors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********** Check if a test question already exists in database *************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
bool Tst_CheckIfQuestionExistsInDB (void)
|
||||||
|
{
|
||||||
|
extern const char *Tst_StrAnswerTypesDB[Tst_NUM_ANS_TYPES];
|
||||||
|
MYSQL_RES *mysql_res_qst;
|
||||||
|
MYSQL_RES *mysql_res_ans;
|
||||||
|
MYSQL_ROW row;
|
||||||
|
bool IdenticalQuestionFound = false;
|
||||||
|
bool IdenticalAnswers;
|
||||||
|
unsigned NumQst;
|
||||||
|
unsigned NumQstsWithThisStem;
|
||||||
|
unsigned NumOpt;
|
||||||
|
unsigned NumOptsExistingQstInDB;
|
||||||
|
long QstCod;
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
|
/***** Check if stem exists *****/
|
||||||
|
NumQstsWithThisStem =
|
||||||
|
(unsigned) DB_QuerySELECT (&mysql_res_qst,"can not check"
|
||||||
|
" if a question exists",
|
||||||
|
"SELECT QstCod FROM tst_questions"
|
||||||
|
" WHERE CrsCod=%ld AND AnsType='%s' AND Stem='%s'",
|
||||||
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
|
Tst_StrAnswerTypesDB[Gbl.Test.AnswerType],
|
||||||
|
Gbl.Test.Stem.Text);
|
||||||
|
|
||||||
|
if (NumQstsWithThisStem) // There are questions in database with the same stem that the one of this question
|
||||||
|
{
|
||||||
|
/***** Check if the answer exists in any of the questions with the same stem *****/
|
||||||
|
/* For each question with the same stem */
|
||||||
|
for (NumQst = 0;
|
||||||
|
!IdenticalQuestionFound && NumQst < NumQstsWithThisStem;
|
||||||
|
NumQst++)
|
||||||
|
{
|
||||||
|
row = mysql_fetch_row (mysql_res_qst);
|
||||||
|
if ((QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
||||||
|
Lay_ShowErrorAndExit ("Wrong code of question.");
|
||||||
|
|
||||||
|
/* Get answers from this question */
|
||||||
|
NumOptsExistingQstInDB =
|
||||||
|
(unsigned) DB_QuerySELECT (&mysql_res_ans,"can not get the answer"
|
||||||
|
" of a question",
|
||||||
|
"SELECT Answer FROM tst_answers"
|
||||||
|
" WHERE QstCod=%ld ORDER BY AnsInd",
|
||||||
|
QstCod);
|
||||||
|
|
||||||
|
switch (Gbl.Test.AnswerType)
|
||||||
|
{
|
||||||
|
case Tst_ANS_INT:
|
||||||
|
row = mysql_fetch_row (mysql_res_ans);
|
||||||
|
IdenticalQuestionFound = (Tst_GetIntAnsFromStr (row[0]) == Gbl.Test.Answer.Integer);
|
||||||
|
break;
|
||||||
|
case Tst_ANS_FLOAT:
|
||||||
|
for (IdenticalAnswers = true, i = 0;
|
||||||
|
IdenticalAnswers && i < 2;
|
||||||
|
i++)
|
||||||
|
{
|
||||||
|
row = mysql_fetch_row (mysql_res_ans);
|
||||||
|
IdenticalAnswers = (Str_GetDoubleFromStr (row[0]) == Gbl.Test.Answer.FloatingPoint[i]);
|
||||||
|
}
|
||||||
|
IdenticalQuestionFound = IdenticalAnswers;
|
||||||
|
break;
|
||||||
|
case Tst_ANS_TRUE_FALSE:
|
||||||
|
row = mysql_fetch_row (mysql_res_ans);
|
||||||
|
IdenticalQuestionFound = (Str_ConvertToUpperLetter (row[0][0]) == Gbl.Test.Answer.TF);
|
||||||
|
break;
|
||||||
|
case Tst_ANS_UNIQUE_CHOICE:
|
||||||
|
case Tst_ANS_MULTIPLE_CHOICE:
|
||||||
|
case Tst_ANS_TEXT:
|
||||||
|
if (NumOptsExistingQstInDB == Gbl.Test.Answer.NumOptions)
|
||||||
|
{
|
||||||
|
for (IdenticalAnswers = true, NumOpt = 0;
|
||||||
|
IdenticalAnswers && NumOpt < NumOptsExistingQstInDB;
|
||||||
|
NumOpt++)
|
||||||
|
{
|
||||||
|
row = mysql_fetch_row (mysql_res_ans);
|
||||||
|
|
||||||
|
if (strcasecmp (row[0],Gbl.Test.Answer.Options[NumOpt].Text))
|
||||||
|
IdenticalAnswers = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Different number of answers (options)
|
||||||
|
IdenticalAnswers = false;
|
||||||
|
IdenticalQuestionFound = IdenticalAnswers;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Free structure that stores the query result for answers */
|
||||||
|
DB_FreeMySQLResult (&mysql_res_ans);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Stem does not exist
|
||||||
|
IdenticalQuestionFound = false;
|
||||||
|
|
||||||
|
/* Free structure that stores the query result for questions */
|
||||||
|
DB_FreeMySQLResult (&mysql_res_qst);
|
||||||
|
|
||||||
|
return IdenticalQuestionFound;
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Move images associates to a test question to their definitive directories */
|
/* Move images associates to a test question to their definitive directories */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -197,6 +197,9 @@ int Tst_AllocateTextChoiceAnswer (unsigned NumOpt);
|
||||||
Tst_AnswerType_t Tst_ConvertFromStrAnsTypDBToAnsTyp (const char *StrAnsTypeBD);
|
Tst_AnswerType_t Tst_ConvertFromStrAnsTypDBToAnsTyp (const char *StrAnsTypeBD);
|
||||||
void Tst_ReceiveQst (void);
|
void Tst_ReceiveQst (void);
|
||||||
bool Tst_CheckIfQstFormatIsCorrectAndCountNumOptions (void);
|
bool Tst_CheckIfQstFormatIsCorrectAndCountNumOptions (void);
|
||||||
|
|
||||||
|
bool Tst_CheckIfQuestionExistsInDB (void);
|
||||||
|
|
||||||
long Tst_GetIntAnsFromStr (char *Str);
|
long Tst_GetIntAnsFromStr (char *Str);
|
||||||
void Tst_RequestRemoveQst (void);
|
void Tst_RequestRemoveQst (void);
|
||||||
void Tst_RemoveQst (void);
|
void Tst_RemoveQst (void);
|
||||||
|
|
|
@ -72,7 +72,6 @@ static void TsI_WriteAnswersOfAQstXML (long QstCod);
|
||||||
static void TsI_ReadQuestionsFromXMLFileAndStoreInDB (const char *FileNameXML);
|
static void TsI_ReadQuestionsFromXMLFileAndStoreInDB (const char *FileNameXML);
|
||||||
static void TsI_ImportQuestionsFromXMLBuffer (const char *XMLBuffer);
|
static void TsI_ImportQuestionsFromXMLBuffer (const char *XMLBuffer);
|
||||||
static Tst_AnswerType_t TsI_ConvertFromStrAnsTypXMLToAnsTyp (const char *StrAnsTypeXML);
|
static Tst_AnswerType_t TsI_ConvertFromStrAnsTypXMLToAnsTyp (const char *StrAnsTypeXML);
|
||||||
static bool TsI_CheckIfQuestionExistsInDB (void);
|
|
||||||
static void TsI_GetAnswerFromXML (struct XMLElement *AnswerElem);
|
static void TsI_GetAnswerFromXML (struct XMLElement *AnswerElem);
|
||||||
static void TsI_WriteHeadingListImportedQst (void);
|
static void TsI_WriteHeadingListImportedQst (void);
|
||||||
static void TsI_WriteRowImportedQst (struct XMLElement *StemElem,
|
static void TsI_WriteRowImportedQst (struct XMLElement *StemElem,
|
||||||
|
@ -641,7 +640,7 @@ static void TsI_ImportQuestionsFromXMLBuffer (const char *XMLBuffer)
|
||||||
if (Tst_CheckIfQstFormatIsCorrectAndCountNumOptions ())
|
if (Tst_CheckIfQstFormatIsCorrectAndCountNumOptions ())
|
||||||
{
|
{
|
||||||
/* Check if question already exists in database */
|
/* Check if question already exists in database */
|
||||||
QuestionExists = TsI_CheckIfQuestionExistsInDB ();
|
QuestionExists = Tst_CheckIfQuestionExistsInDB ();
|
||||||
|
|
||||||
/* Write row with this imported question */
|
/* Write row with this imported question */
|
||||||
TsI_WriteRowImportedQst (StemElem,FeedbackElem,QuestionExists);
|
TsI_WriteRowImportedQst (StemElem,FeedbackElem,QuestionExists);
|
||||||
|
@ -681,8 +680,8 @@ static Tst_AnswerType_t TsI_ConvertFromStrAnsTypXMLToAnsTyp (const char *StrAnsT
|
||||||
Tst_AnswerType_t AnsType;
|
Tst_AnswerType_t AnsType;
|
||||||
|
|
||||||
if (StrAnsTypeXML != NULL)
|
if (StrAnsTypeXML != NULL)
|
||||||
for (AnsType = (Tst_AnswerType_t) 0;
|
for (AnsType = (Tst_AnswerType_t) 0;
|
||||||
AnsType < Tst_NUM_ANS_TYPES;
|
AnsType <= (Tst_AnswerType_t) (Tst_NUM_ANS_TYPES - 1);
|
||||||
AnsType++)
|
AnsType++)
|
||||||
// comparison must be case insensitive, because users can edit XML
|
// comparison must be case insensitive, because users can edit XML
|
||||||
if (!strcasecmp (StrAnsTypeXML,Tst_StrAnswerTypesXML[AnsType]))
|
if (!strcasecmp (StrAnsTypeXML,Tst_StrAnswerTypesXML[AnsType]))
|
||||||
|
@ -692,111 +691,6 @@ static Tst_AnswerType_t TsI_ConvertFromStrAnsTypXMLToAnsTyp (const char *StrAnsT
|
||||||
return (Tst_AnswerType_t) 0; // Not reached
|
return (Tst_AnswerType_t) 0; // Not reached
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/**************** Get answer inside an XML question elements *****************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static bool TsI_CheckIfQuestionExistsInDB (void)
|
|
||||||
{
|
|
||||||
extern const char *Tst_StrAnswerTypesDB[Tst_NUM_ANS_TYPES];
|
|
||||||
MYSQL_RES *mysql_res_qst;
|
|
||||||
MYSQL_RES *mysql_res_ans;
|
|
||||||
MYSQL_ROW row;
|
|
||||||
bool IdenticalQuestionFound = false;
|
|
||||||
bool IdenticalAnswers;
|
|
||||||
unsigned NumQst;
|
|
||||||
unsigned NumQstsWithThisStem;
|
|
||||||
unsigned NumOpt;
|
|
||||||
unsigned NumOptsExistingQstInDB;
|
|
||||||
long QstCod;
|
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
/***** Check if stem exists *****/
|
|
||||||
NumQstsWithThisStem =
|
|
||||||
(unsigned) DB_QuerySELECT (&mysql_res_qst,"can not check"
|
|
||||||
" if a question exists",
|
|
||||||
"SELECT QstCod FROM tst_questions"
|
|
||||||
" WHERE CrsCod=%ld AND AnsType='%s' AND Stem='%s'",
|
|
||||||
Gbl.Hierarchy.Crs.CrsCod,
|
|
||||||
Tst_StrAnswerTypesDB[Gbl.Test.AnswerType],
|
|
||||||
Gbl.Test.Stem.Text);
|
|
||||||
|
|
||||||
if (NumQstsWithThisStem) // There are questions in database with the same stem that the one of this question
|
|
||||||
{
|
|
||||||
/***** Check if the answer exists in any of the questions with the same stem *****/
|
|
||||||
/* For each question with the same stem */
|
|
||||||
for (NumQst = 0;
|
|
||||||
!IdenticalQuestionFound && NumQst < NumQstsWithThisStem;
|
|
||||||
NumQst++)
|
|
||||||
{
|
|
||||||
row = mysql_fetch_row (mysql_res_qst);
|
|
||||||
if ((QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
|
||||||
Lay_ShowErrorAndExit ("Wrong code of question.");
|
|
||||||
|
|
||||||
/* Get answers from this question */
|
|
||||||
NumOptsExistingQstInDB =
|
|
||||||
(unsigned) DB_QuerySELECT (&mysql_res_ans,"can not get the answer"
|
|
||||||
" of a question",
|
|
||||||
"SELECT Answer FROM tst_answers"
|
|
||||||
" WHERE QstCod=%ld ORDER BY AnsInd",
|
|
||||||
QstCod);
|
|
||||||
|
|
||||||
switch (Gbl.Test.AnswerType)
|
|
||||||
{
|
|
||||||
case Tst_ANS_INT:
|
|
||||||
row = mysql_fetch_row (mysql_res_ans);
|
|
||||||
IdenticalQuestionFound = (Tst_GetIntAnsFromStr (row[0]) == Gbl.Test.Answer.Integer);
|
|
||||||
break;
|
|
||||||
case Tst_ANS_FLOAT:
|
|
||||||
for (IdenticalAnswers = true, i = 0;
|
|
||||||
IdenticalAnswers && i < 2;
|
|
||||||
i++)
|
|
||||||
{
|
|
||||||
row = mysql_fetch_row (mysql_res_ans);
|
|
||||||
IdenticalAnswers = (Str_GetDoubleFromStr (row[0]) == Gbl.Test.Answer.FloatingPoint[i]);
|
|
||||||
}
|
|
||||||
IdenticalQuestionFound = IdenticalAnswers;
|
|
||||||
break;
|
|
||||||
case Tst_ANS_TRUE_FALSE:
|
|
||||||
row = mysql_fetch_row (mysql_res_ans);
|
|
||||||
IdenticalQuestionFound = (Str_ConvertToUpperLetter (row[0][0]) == Gbl.Test.Answer.TF);
|
|
||||||
break;
|
|
||||||
case Tst_ANS_UNIQUE_CHOICE:
|
|
||||||
case Tst_ANS_MULTIPLE_CHOICE:
|
|
||||||
case Tst_ANS_TEXT:
|
|
||||||
if (NumOptsExistingQstInDB == Gbl.Test.Answer.NumOptions)
|
|
||||||
{
|
|
||||||
for (IdenticalAnswers = true, NumOpt = 0;
|
|
||||||
IdenticalAnswers && NumOpt < NumOptsExistingQstInDB;
|
|
||||||
NumOpt++)
|
|
||||||
{
|
|
||||||
row = mysql_fetch_row (mysql_res_ans);
|
|
||||||
|
|
||||||
if (strcasecmp (row[0],Gbl.Test.Answer.Options[NumOpt].Text))
|
|
||||||
IdenticalAnswers = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else // Different number of answers (options)
|
|
||||||
IdenticalAnswers = false;
|
|
||||||
IdenticalQuestionFound = IdenticalAnswers;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Free structure that stores the query result for answers */
|
|
||||||
DB_FreeMySQLResult (&mysql_res_ans);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else // Stem does not exist
|
|
||||||
IdenticalQuestionFound = false;
|
|
||||||
|
|
||||||
/* Free structure that stores the query result for questions */
|
|
||||||
DB_FreeMySQLResult (&mysql_res_qst);
|
|
||||||
|
|
||||||
return IdenticalQuestionFound;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**************** Get answer inside an XML question elements *****************/
|
/**************** Get answer inside an XML question elements *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
9074
swad_text.c
9074
swad_text.c
File diff suppressed because it is too large
Load Diff
12
swad_theme.c
12
swad_theme.c
|
@ -322,8 +322,8 @@ void The_PutIconsToSelectTheme (void)
|
||||||
Hlp_PROFILE_Settings_theme,Box_NOT_CLOSABLE);
|
Hlp_PROFILE_Settings_theme,Box_NOT_CLOSABLE);
|
||||||
Set_StartSettingsHead ();
|
Set_StartSettingsHead ();
|
||||||
Set_StartOneSettingSelector ();
|
Set_StartOneSettingSelector ();
|
||||||
for (Theme = (The_Theme_t) 0;
|
for (Theme = (The_Theme_t) 0;
|
||||||
Theme < The_NUM_THEMES;
|
Theme <= (The_Theme_t) (The_NUM_THEMES - 1);
|
||||||
Theme++)
|
Theme++)
|
||||||
{
|
{
|
||||||
HTM_DIV_Begin ("class=\"%s\"",Theme == Gbl.Prefs.Theme ? "PREF_ON" :
|
HTM_DIV_Begin ("class=\"%s\"",Theme == Gbl.Prefs.Theme ? "PREF_ON" :
|
||||||
|
@ -395,8 +395,8 @@ The_Theme_t The_GetParamTheme (void)
|
||||||
The_Theme_t Theme;
|
The_Theme_t Theme;
|
||||||
|
|
||||||
Par_GetParToText ("Theme",ThemeId,The_MAX_BYTES_THEME_ID);
|
Par_GetParToText ("Theme",ThemeId,The_MAX_BYTES_THEME_ID);
|
||||||
for (Theme = (The_Theme_t) 0;
|
for (Theme = (The_Theme_t) 0;
|
||||||
Theme < The_NUM_THEMES;
|
Theme <= (The_Theme_t) (The_NUM_THEMES - 1);
|
||||||
Theme++)
|
Theme++)
|
||||||
if (!strcmp (ThemeId,The_ThemeId[Theme]))
|
if (!strcmp (ThemeId,The_ThemeId[Theme]))
|
||||||
return Theme;
|
return Theme;
|
||||||
|
@ -412,8 +412,8 @@ The_Theme_t The_GetThemeFromStr (const char *Str)
|
||||||
{
|
{
|
||||||
The_Theme_t Theme;
|
The_Theme_t Theme;
|
||||||
|
|
||||||
for (Theme = (The_Theme_t) 0;
|
for (Theme = (The_Theme_t) 0;
|
||||||
Theme < The_NUM_THEMES;
|
Theme <= (The_Theme_t) (The_NUM_THEMES - 1);
|
||||||
Theme++)
|
Theme++)
|
||||||
if (!strcasecmp (Str,The_ThemeId[Theme]))
|
if (!strcasecmp (Str,The_ThemeId[Theme]))
|
||||||
return Theme;
|
return Theme;
|
||||||
|
|
|
@ -279,12 +279,12 @@ static void TT_GetParamsTimeTable (void)
|
||||||
|
|
||||||
/***** Get class type *****/
|
/***** Get class type *****/
|
||||||
Par_GetParToText ("TTTyp",StrClassType,TT_MAX_BYTES_STR_CLASS_TYPE);
|
Par_GetParToText ("TTTyp",StrClassType,TT_MAX_BYTES_STR_CLASS_TYPE);
|
||||||
for (Gbl.TimeTable.ClassType = (TT_ClassType_t) 0;
|
for (Gbl.TimeTable.ClassType = (TT_ClassType_t) 0;
|
||||||
Gbl.TimeTable.ClassType < (TT_ClassType_t) TT_NUM_CLASS_TYPES;
|
Gbl.TimeTable.ClassType <= (TT_ClassType_t) (TT_NUM_CLASS_TYPES - 1);
|
||||||
Gbl.TimeTable.ClassType++)
|
Gbl.TimeTable.ClassType++)
|
||||||
if (!strcmp (StrClassType,TT_ClassTypeDB[Gbl.TimeTable.ClassType]))
|
if (!strcmp (StrClassType,TT_ClassTypeDB[Gbl.TimeTable.ClassType]))
|
||||||
break;
|
break;
|
||||||
if (Gbl.TimeTable.ClassType == (TT_ClassType_t) TT_NUM_CLASS_TYPES)
|
if (Gbl.TimeTable.ClassType > (TT_ClassType_t) (TT_NUM_CLASS_TYPES - 1))
|
||||||
Lay_ShowErrorAndExit ("Type of timetable cell is missing.");
|
Lay_ShowErrorAndExit ("Type of timetable cell is missing.");
|
||||||
|
|
||||||
/***** Get class duration *****/
|
/***** Get class duration *****/
|
||||||
|
@ -420,9 +420,9 @@ static void TT_PutFormToSelectWhichGroupsToShow (void)
|
||||||
{
|
{
|
||||||
static const Act_Action_t ActSeeTT[TT_NUM_TIMETABLE_TYPES] =
|
static const Act_Action_t ActSeeTT[TT_NUM_TIMETABLE_TYPES] =
|
||||||
{
|
{
|
||||||
ActSeeCrsTT, // TT_COURSE_TIMETABLE
|
[TT_COURSE_TIMETABLE ] = ActSeeCrsTT,
|
||||||
ActSeeMyTT, // TT_MY_TIMETABLE
|
[TT_MY_TIMETABLE ] = ActSeeMyTT,
|
||||||
ActUnk, // TT_TUTORING_TIMETABLE
|
[TT_TUTORING_TIMETABLE] = ActUnk,
|
||||||
};
|
};
|
||||||
|
|
||||||
Grp_ShowFormToSelWhichGrps (ActSeeTT[Gbl.TimeTable.Type],NULL);
|
Grp_ShowFormToSelWhichGrps (ActSeeTT[Gbl.TimeTable.Type],NULL);
|
||||||
|
@ -1606,8 +1606,8 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
/***** Class type *****/
|
/***** Class type *****/
|
||||||
HTM_SELECT_Begin (true,
|
HTM_SELECT_Begin (true,
|
||||||
"name=\"TTTyp\" class=\"TT_TYP\"");
|
"name=\"TTTyp\" class=\"TT_TYP\"");
|
||||||
for (CT = (TT_ClassType_t) 0;
|
for (CT = (TT_ClassType_t) 0;
|
||||||
CT < (TT_ClassType_t) TT_NUM_CLASS_TYPES;
|
CT <= (TT_ClassType_t) (TT_NUM_CLASS_TYPES - 1);
|
||||||
CT++)
|
CT++)
|
||||||
if ((CT == TT_FREE) ||
|
if ((CT == TT_FREE) ||
|
||||||
((Gbl.TimeTable.View == TT_CRS_EDIT) && (CT == TT_LECTURE || CT == TT_PRACTICAL)) ||
|
((Gbl.TimeTable.View == TT_CRS_EDIT) && (CT == TT_LECTURE || CT == TT_PRACTICAL)) ||
|
||||||
|
|
24
swad_user.c
24
swad_user.c
|
@ -690,8 +690,8 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,Usr_GetPrefs_t GetPrefs)
|
||||||
{
|
{
|
||||||
/* Get language (row[26]) */
|
/* Get language (row[26]) */
|
||||||
UsrDat->Prefs.Language = Lan_LANGUAGE_UNKNOWN; // Language unknown
|
UsrDat->Prefs.Language = Lan_LANGUAGE_UNKNOWN; // Language unknown
|
||||||
for (Lan = (Lan_Language_t) 1;
|
for (Lan = (Lan_Language_t) 1;
|
||||||
Lan <= Lan_NUM_LANGUAGES;
|
Lan <= (Lan_Language_t) Lan_NUM_LANGUAGES;
|
||||||
Lan++)
|
Lan++)
|
||||||
if (!strcasecmp (row[26],Lan_STR_LANG_ID[Lan]))
|
if (!strcasecmp (row[26],Lan_STR_LANG_ID[Lan]))
|
||||||
{
|
{
|
||||||
|
@ -707,8 +707,8 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,Usr_GetPrefs_t GetPrefs)
|
||||||
|
|
||||||
/* Get theme (row[29]) */
|
/* Get theme (row[29]) */
|
||||||
UsrDat->Prefs.Theme = The_THEME_DEFAULT;
|
UsrDat->Prefs.Theme = The_THEME_DEFAULT;
|
||||||
for (Theme = (The_Theme_t) 0;
|
for (Theme = (The_Theme_t) 0;
|
||||||
Theme < The_NUM_THEMES;
|
Theme <= (The_Theme_t) (The_NUM_THEMES - 1);
|
||||||
Theme++)
|
Theme++)
|
||||||
if (!strcasecmp (row[29],The_ThemeId[Theme]))
|
if (!strcasecmp (row[29],The_ThemeId[Theme]))
|
||||||
{
|
{
|
||||||
|
@ -718,8 +718,8 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,Usr_GetPrefs_t GetPrefs)
|
||||||
|
|
||||||
/* Get icon set (row[30]) */
|
/* Get icon set (row[30]) */
|
||||||
UsrDat->Prefs.IconSet = Ico_ICON_SET_DEFAULT;
|
UsrDat->Prefs.IconSet = Ico_ICON_SET_DEFAULT;
|
||||||
for (IconSet = (Ico_IconSet_t) 0;
|
for (IconSet = (Ico_IconSet_t) 0;
|
||||||
IconSet < Ico_NUM_ICON_SETS;
|
IconSet <= (Ico_IconSet_t) (Ico_NUM_ICON_SETS - 1);
|
||||||
IconSet++)
|
IconSet++)
|
||||||
if (!strcasecmp (row[30],Ico_IconSetId[IconSet]))
|
if (!strcasecmp (row[30],Ico_IconSetId[IconSet]))
|
||||||
{
|
{
|
||||||
|
@ -865,8 +865,8 @@ static Usr_Sex_t Usr_GetSexFromStr (const char *Str)
|
||||||
{
|
{
|
||||||
Usr_Sex_t Sex;
|
Usr_Sex_t Sex;
|
||||||
|
|
||||||
for (Sex = (Usr_Sex_t) 0;
|
for (Sex = (Usr_Sex_t) 0;
|
||||||
Sex < Usr_NUM_SEXS;
|
Sex <= (Usr_Sex_t) (Usr_NUM_SEXS - 1);
|
||||||
Sex++)
|
Sex++)
|
||||||
if (!strcasecmp (Str,Usr_StringsSexDB[Sex]))
|
if (!strcasecmp (Str,Usr_StringsSexDB[Sex]))
|
||||||
return Sex;
|
return Sex;
|
||||||
|
@ -6109,8 +6109,8 @@ void Usr_FreeListsSelectedEncryptedUsrsCods (struct SelectedUsrs *SelectedUsrs)
|
||||||
if (SelectedUsrs->Filled) // Only if lists are filled
|
if (SelectedUsrs->Filled) // Only if lists are filled
|
||||||
{
|
{
|
||||||
/***** Free lists *****/
|
/***** Free lists *****/
|
||||||
for (Role = (Rol_Role_t) 0;
|
for (Role = (Rol_Role_t) 0;
|
||||||
Role < Rol_NUM_ROLES;
|
Role <= (Rol_Role_t) (Rol_NUM_ROLES - 1);
|
||||||
Role++)
|
Role++)
|
||||||
if (SelectedUsrs->List[Role])
|
if (SelectedUsrs->List[Role])
|
||||||
{
|
{
|
||||||
|
@ -7695,8 +7695,8 @@ static void Usr_GetMyUsrListTypeFromDB (void)
|
||||||
Gbl.Usrs.Me.ListType = Usr_SHOW_USRS_TYPE_DEFAULT;
|
Gbl.Usrs.Me.ListType = Usr_SHOW_USRS_TYPE_DEFAULT;
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
if (row[0])
|
if (row[0])
|
||||||
for (ListType = (Usr_ShowUsrsType_t) 0;
|
for (ListType = (Usr_ShowUsrsType_t) 0;
|
||||||
ListType < Usr_NUM_USR_LIST_TYPES;
|
ListType <= (Usr_ShowUsrsType_t) (Usr_NUM_USR_LIST_TYPES - 1);
|
||||||
ListType++)
|
ListType++)
|
||||||
if (!strcasecmp (row[0],Usr_StringsUsrListTypeInDB[ListType]))
|
if (!strcasecmp (row[0],Usr_StringsUsrListTypeInDB[ListType]))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue