mirror of https://github.com/acanas/swad-core.git
Version19.102
This commit is contained in:
parent
e1109f599f
commit
a3b2e75a92
4
Makefile
4
Makefile
|
@ -30,8 +30,8 @@ OBJS = swad_account.o swad_action.o swad_agenda.o swad_alert.o \
|
|||
swad_announcement.o swad_API.o swad_assignment.o swad_attendance.o \
|
||||
swad_banner.o swad_box.o swad_button.o \
|
||||
swad_calendar.o swad_centre.o swad_chat.o swad_classroom.o \
|
||||
swad_config.o swad_connected.o swad_cookie.o swad_country.o \
|
||||
swad_course.o swad_cryptography.o \
|
||||
swad_config.o swad_config_course.o swad_connected.o swad_cookie.o \
|
||||
swad_country.o swad_course.o swad_cryptography.o \
|
||||
swad_database.o swad_date.o swad_degree.o swad_degree_type.o \
|
||||
swad_department.o swad_duplicate.o \
|
||||
swad_enrolment.o swad_exam.o \
|
||||
|
|
|
@ -93,10 +93,10 @@ cp -f /home/acanas/swad/swad/swad /var/www/cgi-bin/
|
|||
|
||||
#include <dirent.h> // For scandir, etc.
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <sys/stat.h> // For lstat
|
||||
#include <stddef.h> // For NULL
|
||||
#include <string.h>
|
||||
#include <stdsoap2.h>
|
||||
#include <sys/stat.h> // For lstat
|
||||
|
||||
#include "soap/soapH.h" // gSOAP header
|
||||
#include "soap/swad.nsmap" // Namespaces map used
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <string.h>
|
||||
|
||||
#include "swad_changelog.h"
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/*********************************** Headers *********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For fprintf
|
||||
#include <string.h> // For string functions
|
||||
|
||||
|
@ -1909,12 +1909,12 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
[ActSeeCrsTT ] = { 25, 6,TabCrs,ActSeeCrsTT ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TT_ShowClassTimeTable ,"clock" },
|
||||
|
||||
// Actions not in menu:
|
||||
[ActPrnCrsInf ] = {1028,-1,TabUnk,ActSeeCrsInf ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,Crs_PrintConfiguration ,NULL},
|
||||
[ActChgCrsDegCfg ] = {1587,-1,TabUnk,ActSeeCrsInf ,0x380,0x380, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeCrsDegInConfig ,Crs_ContEditAfterChgCrsInConfig,NULL},
|
||||
[ActRenCrsShoCfg ] = {1601,-1,TabUnk,ActSeeCrsInf ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RenameCourseShortInConfig ,Crs_ContEditAfterChgCrsInConfig,NULL},
|
||||
[ActRenCrsFulCfg ] = {1600,-1,TabUnk,ActSeeCrsInf ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RenameCourseFullInConfig ,Crs_ContEditAfterChgCrsInConfig,NULL},
|
||||
[ActChgInsCrsCodCfg ] = {1024,-1,TabUnk,ActSeeCrsInf ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeInsCrsCodInConfig ,Crs_ContEditAfterChgCrsInConfig,NULL},
|
||||
[ActChgCrsYeaCfg ] = {1573,-1,TabUnk,ActSeeCrsInf ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeCrsYearInConfig ,Crs_ContEditAfterChgCrsInConfig,NULL},
|
||||
[ActPrnCrsInf ] = {1028,-1,TabUnk,ActSeeCrsInf ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,CfgCrs_PrintConfiguration ,NULL},
|
||||
[ActChgCrsDegCfg ] = {1587,-1,TabUnk,ActSeeCrsInf ,0x380,0x380, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeCrsDegInConfig ,CfgCrs_ContEditAfterChgCrsInConfig,NULL},
|
||||
[ActRenCrsShoCfg ] = {1601,-1,TabUnk,ActSeeCrsInf ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RenameCourseShortInConfig ,CfgCrs_ContEditAfterChgCrsInConfig,NULL},
|
||||
[ActRenCrsFulCfg ] = {1600,-1,TabUnk,ActSeeCrsInf ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RenameCourseFullInConfig ,CfgCrs_ContEditAfterChgCrsInConfig,NULL},
|
||||
[ActChgInsCrsCodCfg ] = {1024,-1,TabUnk,ActSeeCrsInf ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeInsCrsCodInConfig ,CfgCrs_ContEditAfterChgCrsInConfig,NULL},
|
||||
[ActChgCrsYeaCfg ] = {1573,-1,TabUnk,ActSeeCrsInf ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeCrsYearInConfig ,CfgCrs_ContEditAfterChgCrsInConfig,NULL},
|
||||
[ActEdiCrsInf ] = { 848,-1,TabUnk,ActSeeCrsInf ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_FormsToSelSendInfo ,NULL},
|
||||
|
||||
[ActEdiTchGui ] = { 785,-1,TabUnk,ActSeeTchGui ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_FormsToSelSendInfo ,NULL},
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For vasprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stdarg.h> // For va_start, va_end
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For FILE, fprintf, vasprintf
|
||||
#include <stdlib.h> // For free
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <mysql/mysql.h> // To access MySQL databases
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stdbool.h> // For boolean type
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -492,7 +492,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
|||
En OpenSWAD:
|
||||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.101.5 (2019-12-28)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.102 (2019-12-28)"
|
||||
#define CSS_FILE "swad19.101.5.css"
|
||||
#define JS_FILE "swad19.91.1.js"
|
||||
/*
|
||||
|
@ -500,8 +500,9 @@ ps2pdf source.ps destination.pdf
|
|||
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
||||
// TODO: No se puede entrar con DNI '1' suponiendo que no tenga password ¿por qué?
|
||||
|
||||
Version 19.103: Dec 28, 2019 Map in country information. (? lines)
|
||||
Version 19.102: Dec 28, 2019 Map in institution information. (? lines)
|
||||
Version 19.10x: Dec 28, 2019 Map in country information. (? lines)
|
||||
Version 19.10x: Dec 28, 2019 Map in institution information. (? lines)
|
||||
Version 19.102: Dec 29, 2019 New module swad_config_course for course configuration. (249397 lines)
|
||||
Version 19.101.5: Dec 28, 2019 Country information is splitted into two columns. (249330 lines)
|
||||
Version 19.101.4: Dec 28, 2019 Institution information is splitted into two columns. (249324 lines)
|
||||
Version 19.101.3: Dec 28, 2019 Course information is splitted into two columns. (249308 lines)
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdbool.h> // For boolean type
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
/********************************** Headers **********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <malloc.h> // For calloc, free
|
||||
#include <stddef.h> // For NULL
|
||||
#include <string.h> // For string functions
|
||||
|
||||
#include "swad_box.h"
|
||||
|
|
|
@ -0,0 +1,468 @@
|
|||
// swad_config_course.c: configuration of current course
|
||||
|
||||
/*
|
||||
SWAD (Shared Workspace At a Distance),
|
||||
is a web platform developed at the University of Granada (Spain),
|
||||
and used to support university teaching.
|
||||
|
||||
This file is part of SWAD core.
|
||||
Copyright (C) 1999-2019 Antonio Cañas Vargas
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <stdbool.h> // For boolean type
|
||||
#include <stddef.h> // For NULL
|
||||
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_logo.h"
|
||||
#include "swad_role.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** External global variables from others modules ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
extern struct Globals Gbl;
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************************** Public constants ********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************************** Private types *********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************************** Private variables ******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************************** Private prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_PutIconToPrint (void);
|
||||
static void CfgCrs_Title (bool PutLink);
|
||||
static void CfgCrs_Degree (bool PrintView,bool PutForm);
|
||||
static void CfgCrs_FullName (bool PutForm);
|
||||
static void CfgCrs_ShrtName (bool PutForm);
|
||||
static void CfgCrs_Year (bool PutForm);
|
||||
static void CfgCrs_InstitutionalCode (bool PutForm);
|
||||
static void CfgCrs_InternalCode (void);
|
||||
static void CfgCrs_Shortcut (bool PrintView);
|
||||
static void CfgCrs_QR (void);
|
||||
static void CfgCrs_NumUsrsInCrs (Rol_Role_t Role);
|
||||
static void CfgCrs_Indicators (void);
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Configuration of the current course ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void CfgCrs_Configuration (bool PrintView)
|
||||
{
|
||||
extern const char *Hlp_COURSE_Information;
|
||||
bool PutLink;
|
||||
bool PutFormDeg;
|
||||
bool PutFormName;
|
||||
bool PutFormYear;
|
||||
bool PutFormInsCod;
|
||||
|
||||
/***** Trivial check *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected
|
||||
return;
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = !PrintView && Gbl.Hierarchy.Deg.WWW[0];
|
||||
PutFormDeg = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
|
||||
PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM;
|
||||
PutFormYear =
|
||||
PutFormInsCod = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_TCH;
|
||||
|
||||
/***** Contextual menu *****/
|
||||
if (!PrintView)
|
||||
if (Gbl.Usrs.Me.Role.Logged == Rol_GST ||
|
||||
Gbl.Usrs.Me.Role.Logged == Rol_USR)
|
||||
{
|
||||
Mnu_ContextMenuBegin ();
|
||||
Enr_PutLinkToRequestSignUp (); // Request enrolment in the current course
|
||||
Mnu_ContextMenuEnd ();
|
||||
}
|
||||
|
||||
/***** Begin box *****/
|
||||
if (PrintView)
|
||||
Box_BoxBegin (NULL,NULL,NULL,
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
else
|
||||
Box_BoxBegin (NULL,NULL,CfgCrs_PutIconToPrint,
|
||||
Hlp_COURSE_Information,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Title *****/
|
||||
CfgCrs_Title (PutLink);
|
||||
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT\"");
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
|
||||
/***** Degree *****/
|
||||
CfgCrs_Degree (PrintView,PutFormDeg);
|
||||
|
||||
/***** Course name *****/
|
||||
CfgCrs_FullName (PutFormName);
|
||||
CfgCrs_ShrtName (PutFormName);
|
||||
|
||||
/***** Course year *****/
|
||||
CfgCrs_Year (PutFormYear);
|
||||
|
||||
if (!PrintView)
|
||||
{
|
||||
/***** Institutional code of the course *****/
|
||||
CfgCrs_InstitutionalCode (PutFormInsCod);
|
||||
|
||||
/***** Internal code of the course *****/
|
||||
CfgCrs_InternalCode ();
|
||||
}
|
||||
|
||||
/***** Shortcut to the couse *****/
|
||||
CfgCrs_Shortcut (PrintView);
|
||||
|
||||
if (PrintView)
|
||||
/***** QR code with link to the course *****/
|
||||
CfgCrs_QR ();
|
||||
else
|
||||
{
|
||||
/***** Number of users *****/
|
||||
CfgCrs_NumUsrsInCrs (Rol_TCH);
|
||||
CfgCrs_NumUsrsInCrs (Rol_NET);
|
||||
CfgCrs_NumUsrsInCrs (Rol_STD);
|
||||
|
||||
/***** Indicators *****/
|
||||
CfgCrs_Indicators ();
|
||||
}
|
||||
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/***** End of left part *****/
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** End box *****/
|
||||
Box_BoxEnd ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************* Put icon to print the configuration of a course ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_PutIconToPrint (void)
|
||||
{
|
||||
Ico_PutContextualIconToPrint (ActPrnCrsInf,NULL);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Print configuration of the current course *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void CfgCrs_PrintConfiguration (void)
|
||||
{
|
||||
CfgCrs_Configuration (true);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Show title in course configuration *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_Title (bool PutLink)
|
||||
{
|
||||
Hie_ConfigTitle (PutLink,
|
||||
Hie_DEG, // Logo scope
|
||||
Gbl.Hierarchy.Deg.DegCod, // Logo code
|
||||
Gbl.Hierarchy.Deg.ShrtName, // Logo short name
|
||||
Gbl.Hierarchy.Deg.FullName, // Logo full name
|
||||
Gbl.Hierarchy.Deg.WWW, // Logo www
|
||||
Gbl.Hierarchy.Crs.FullName); // Text full name
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Show degree in course configuration ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_Degree (bool PrintView,bool PutForm)
|
||||
{
|
||||
extern const char *Txt_Degree;
|
||||
extern const char *Txt_Go_to_X;
|
||||
unsigned NumDeg;
|
||||
|
||||
/***** Degree *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",PutForm ? "OthDegCod" :
|
||||
NULL,
|
||||
Txt_Degree);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"DAT LB\"");
|
||||
if (PutForm)
|
||||
{
|
||||
/* Get list of degrees of the current centre */
|
||||
Deg_GetListDegsOfCurrentCtr ();
|
||||
|
||||
/* Put form to select degree */
|
||||
Frm_StartForm (ActChgCrsDegCfg);
|
||||
HTM_SELECT_Begin (true,
|
||||
"id=\"OthDegCod\" name=\"OthDegCod\""
|
||||
" class=\"INPUT_SHORT_NAME\"");
|
||||
for (NumDeg = 0;
|
||||
NumDeg < Gbl.Hierarchy.Ctr.Degs.Num;
|
||||
NumDeg++)
|
||||
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].DegCod,
|
||||
Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].DegCod == Gbl.Hierarchy.Deg.DegCod,false,
|
||||
"%s",Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].ShrtName);
|
||||
HTM_SELECT_End ();
|
||||
Frm_EndForm ();
|
||||
|
||||
/* Free list of degrees of the current centre */
|
||||
Deg_FreeListDegs (&Gbl.Hierarchy.Ctr.Degs);
|
||||
}
|
||||
else // I can not move course to another degree
|
||||
{
|
||||
if (!PrintView)
|
||||
{
|
||||
Frm_StartFormGoTo (ActSeeDegInf);
|
||||
Deg_PutParamDegCod (Gbl.Hierarchy.Deg.DegCod);
|
||||
snprintf (Gbl.Title,sizeof (Gbl.Title),
|
||||
Txt_Go_to_X,
|
||||
Gbl.Hierarchy.Deg.ShrtName);
|
||||
HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK LT DAT",NULL);
|
||||
}
|
||||
Lgo_DrawLogo (Hie_DEG,Gbl.Hierarchy.Deg.DegCod,Gbl.Hierarchy.Deg.ShrtName,
|
||||
20,"LM",true);
|
||||
HTM_NBSP ();
|
||||
HTM_Txt (Gbl.Hierarchy.Deg.FullName);
|
||||
if (!PrintView)
|
||||
{
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
}
|
||||
}
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Show course full name in course configuration ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_FullName (bool PutForm)
|
||||
{
|
||||
extern const char *Txt_Course;
|
||||
|
||||
Hie_ConfigFullName (PutForm,Txt_Course,ActRenCrsFulCfg,
|
||||
Gbl.Hierarchy.Crs.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Show course short name in course configuration ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_ShrtName (bool PutForm)
|
||||
{
|
||||
Hie_ConfigShrtName (PutForm,ActRenCrsShoCfg,Gbl.Hierarchy.Crs.ShrtName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Show course year in course configuration ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_Year (bool PutForm)
|
||||
{
|
||||
extern const char *Txt_Year_OF_A_DEGREE;
|
||||
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
|
||||
extern const char *Txt_Not_applicable;
|
||||
unsigned Year;
|
||||
|
||||
/***** Academic year *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",PutForm ? "OthCrsYear" :
|
||||
NULL,
|
||||
Txt_Year_OF_A_DEGREE);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"DAT LB\"");
|
||||
if (PutForm)
|
||||
{
|
||||
Frm_StartForm (ActChgCrsYeaCfg);
|
||||
HTM_SELECT_Begin (true,
|
||||
"id=\"OthCrsYear\" name=\"OthCrsYear\"");
|
||||
for (Year = 0;
|
||||
Year <= Deg_MAX_YEARS_PER_DEGREE;
|
||||
Year++)
|
||||
HTM_OPTION (HTM_Type_UNSIGNED,&Year,
|
||||
Year == Gbl.Hierarchy.Crs.Year,false,
|
||||
"%s",Txt_YEAR_OF_DEGREE[Year]);
|
||||
HTM_SELECT_End ();
|
||||
Frm_EndForm ();
|
||||
}
|
||||
else
|
||||
HTM_Txt (Gbl.Hierarchy.Crs.Year ? Txt_YEAR_OF_DEGREE[Gbl.Hierarchy.Crs.Year] :
|
||||
Txt_Not_applicable);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************* Show institutional code in course configuration ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_InstitutionalCode (bool PutForm)
|
||||
{
|
||||
extern const char *Txt_Institutional_code;
|
||||
|
||||
/***** Institutional course code *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",PutForm ? "InsCrsCod" :
|
||||
NULL,
|
||||
Txt_Institutional_code);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"DAT LB\"");
|
||||
if (PutForm)
|
||||
{
|
||||
Frm_StartForm (ActChgInsCrsCodCfg);
|
||||
HTM_INPUT_TEXT ("InsCrsCod",Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD,
|
||||
Gbl.Hierarchy.Crs.InstitutionalCrsCod,true,
|
||||
"id=\"InsCrsCod\" size=\"%u\" class=\"INPUT_INS_CODE\"",
|
||||
Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
else
|
||||
HTM_Txt (Gbl.Hierarchy.Crs.InstitutionalCrsCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************** Show internal code in course configuration *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_InternalCode (void)
|
||||
{
|
||||
extern const char *Txt_Internal_code;
|
||||
|
||||
/***** Internal course code *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",NULL,Txt_Internal_code);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"DAT LB\"");
|
||||
HTM_Long (Gbl.Hierarchy.Crs.CrsCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************** Show course shortcut in course configuration ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_Shortcut (bool PrintView)
|
||||
{
|
||||
Hie_ConfigShortcut (PrintView,"crs",Gbl.Hierarchy.Crs.CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** Show course QR in course configuration *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_QR (void)
|
||||
{
|
||||
Hie_ConfigQR ("crs",Gbl.Hierarchy.Crs.CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********************** Number of users in this course **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_NumUsrsInCrs (Rol_Role_t Role)
|
||||
{
|
||||
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||
|
||||
/***** Number of users in course *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",NULL,Txt_ROLES_PLURAL_Abc[Role][Usr_SEX_UNKNOWN]);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"DAT LB\"");
|
||||
HTM_Unsigned (Gbl.Hierarchy.Crs.NumUsrs[Role]);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** Show indicators in course configuration ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CfgCrs_Indicators (void)
|
||||
{
|
||||
extern const char *Txt_Indicators;
|
||||
extern const char *Txt_of_PART_OF_A_TOTAL;
|
||||
struct Ind_IndicatorsCrs Indicators;
|
||||
int NumIndicatorsFromDB = Ind_GetNumIndicatorsCrsFromDB (Gbl.Hierarchy.Crs.CrsCod);
|
||||
|
||||
/***** Compute indicators ******/
|
||||
Ind_ComputeAndStoreIndicatorsCrs (Gbl.Hierarchy.Crs.CrsCod,
|
||||
NumIndicatorsFromDB,&Indicators);
|
||||
|
||||
/***** Number of indicators *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",NULL,Txt_Indicators);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LB\"");
|
||||
Frm_StartForm (ActReqStaCrs);
|
||||
snprintf (Gbl.Title,sizeof (Gbl.Title),
|
||||
"%u %s %u",
|
||||
Indicators.NumIndicators,
|
||||
Txt_of_PART_OF_A_TOTAL,Ind_NUM_INDICATORS);
|
||||
HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK DAT",NULL);
|
||||
HTM_TxtF ("%s ",Gbl.Title);
|
||||
Ico_PutIcon ((Indicators.NumIndicators == Ind_NUM_INDICATORS) ? "check-circle.svg" :
|
||||
"exclamation-triangle.svg",
|
||||
Gbl.Title,"ICO16x16");
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
// swad_config_course.h: configuration of current course
|
||||
|
||||
#ifndef _SWAD_CFGCRS
|
||||
#define _SWAD_CFGCRS
|
||||
/*
|
||||
SWAD (Shared Workspace At a Distance in Spanish),
|
||||
is a web platform developed at the University of Granada (Spain),
|
||||
and used to support university teaching.
|
||||
|
||||
This file is part of SWAD core.
|
||||
Copyright (C) 1999-2019 Antonio Cañas Vargas
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <stdbool.h> // For boolean type
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************************** Public constants ******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************* Public types ********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************************** Public prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void CfgCrs_Configuration (bool PrintView);
|
||||
void CfgCrs_PrintConfiguration (void);
|
||||
void CfgCrs_ContEditAfterChgCrsInConfig (void);
|
||||
|
||||
#endif
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <limits.h> // For maximum values
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For fprintf
|
||||
#include <string.h> // For string functions
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <math.h> // For log10, ceil, pow...
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
|
436
swad_course.c
436
swad_course.c
|
@ -26,33 +26,19 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <limits.h> // For maximum values
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For getenv, etc.
|
||||
#include <string.h> // For string functions
|
||||
|
||||
#include "swad_box.h"
|
||||
#include "swad_config_course.h"
|
||||
#include "swad_course.h"
|
||||
#include "swad_constant.h"
|
||||
#include "swad_database.h"
|
||||
#include "swad_degree.h"
|
||||
#include "swad_enrolment.h"
|
||||
#include "swad_exam.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_help.h"
|
||||
#include "swad_hierarchy.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_indicator.h"
|
||||
#include "swad_info.h"
|
||||
#include "swad_logo.h"
|
||||
#include "swad_notification.h"
|
||||
#include "swad_parameter.h"
|
||||
#include "swad_role.h"
|
||||
#include "swad_RSS.h"
|
||||
#include "swad_tab.h"
|
||||
#include "swad_theme.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** External global variables from others modules ****************/
|
||||
|
@ -78,20 +64,6 @@ static struct Course *Crs_EditingCrs = NULL; // Static variable to keep the cour
|
|||
/**************************** Private prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_Configuration (bool PrintView);
|
||||
static void Crs_PutIconToPrint (void);
|
||||
static void Crs_ConfigTitle (bool PutLink);
|
||||
static void Crs_ConfigDegree (bool PrintView,bool PutForm);
|
||||
static void Crs_ConfigFullName (bool PutForm);
|
||||
static void Crs_ConfigShrtName (bool PutForm);
|
||||
static void Crs_ConfigYear (bool PutForm);
|
||||
static void Crs_ConfigInstitutionalCode (bool PutForm);
|
||||
static void Crs_ConfigInternalCode (void);
|
||||
static void Crs_ConfigShortcut (bool PrintView);
|
||||
static void Crs_ConfigQR (void);
|
||||
static void Crs_ShowNumUsrsInCrs (Rol_Role_t Role);
|
||||
static void Crs_ConfigIndicators (void);
|
||||
|
||||
static void Crs_WriteListMyCoursesToSelectOne (void);
|
||||
|
||||
static void Crs_GetListCoursesInCurrentDegree (Crs_WhatCourses_t WhatCourses);
|
||||
|
@ -155,7 +127,7 @@ void Crs_ShowIntroduction (void)
|
|||
{
|
||||
/***** Course configuration *****/
|
||||
HTM_DIV_Begin ("class=\"CM\"");
|
||||
Crs_Configuration (false);
|
||||
CfgCrs_Configuration (false);
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** Course introduction *****/
|
||||
|
@ -165,404 +137,6 @@ void Crs_ShowIntroduction (void)
|
|||
Hlp_ShowHelpWhatWouldYouLikeToDo ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Print configuration of the current course *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Crs_PrintConfiguration (void)
|
||||
{
|
||||
Crs_Configuration (true);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Configuration of the current course ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_Configuration (bool PrintView)
|
||||
{
|
||||
extern const char *Hlp_COURSE_Information;
|
||||
bool PutLink;
|
||||
bool PutFormDeg;
|
||||
bool PutFormName;
|
||||
bool PutFormYear;
|
||||
bool PutFormInsCod;
|
||||
|
||||
/***** Trivial check *****/
|
||||
if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected
|
||||
return;
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = !PrintView && Gbl.Hierarchy.Deg.WWW[0];
|
||||
PutFormDeg = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
|
||||
PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM;
|
||||
PutFormYear =
|
||||
PutFormInsCod = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_TCH;
|
||||
|
||||
/***** Contextual menu *****/
|
||||
if (!PrintView)
|
||||
if (Gbl.Usrs.Me.Role.Logged == Rol_GST ||
|
||||
Gbl.Usrs.Me.Role.Logged == Rol_USR)
|
||||
{
|
||||
Mnu_ContextMenuBegin ();
|
||||
Enr_PutLinkToRequestSignUp (); // Request enrolment in the current course
|
||||
Mnu_ContextMenuEnd ();
|
||||
}
|
||||
|
||||
/***** Begin box *****/
|
||||
if (PrintView)
|
||||
Box_BoxBegin (NULL,NULL,NULL,
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
else
|
||||
Box_BoxBegin (NULL,NULL,Crs_PutIconToPrint,
|
||||
Hlp_COURSE_Information,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Title *****/
|
||||
Crs_ConfigTitle (PutLink);
|
||||
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT\"");
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
|
||||
/***** Degree *****/
|
||||
Crs_ConfigDegree (PrintView,PutFormDeg);
|
||||
|
||||
/***** Course name *****/
|
||||
Crs_ConfigFullName (PutFormName);
|
||||
Crs_ConfigShrtName (PutFormName);
|
||||
|
||||
/***** Course year *****/
|
||||
Crs_ConfigYear (PutFormYear);
|
||||
|
||||
if (!PrintView)
|
||||
{
|
||||
/***** Institutional code of the course *****/
|
||||
Crs_ConfigInstitutionalCode (PutFormInsCod);
|
||||
|
||||
/***** Internal code of the course *****/
|
||||
Crs_ConfigInternalCode ();
|
||||
}
|
||||
|
||||
/***** Shortcut to the couse *****/
|
||||
Crs_ConfigShortcut (PrintView);
|
||||
|
||||
if (PrintView)
|
||||
/***** QR code with link to the course *****/
|
||||
Crs_ConfigQR ();
|
||||
else
|
||||
{
|
||||
/***** Number of users *****/
|
||||
Crs_ShowNumUsrsInCrs (Rol_TCH);
|
||||
Crs_ShowNumUsrsInCrs (Rol_NET);
|
||||
Crs_ShowNumUsrsInCrs (Rol_STD);
|
||||
|
||||
/***** Indicators *****/
|
||||
Crs_ConfigIndicators ();
|
||||
}
|
||||
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/***** End of left part *****/
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** End box *****/
|
||||
Box_BoxEnd ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************* Put icon to print the configuration of a course ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_PutIconToPrint (void)
|
||||
{
|
||||
Ico_PutContextualIconToPrint (ActPrnCrsInf,NULL);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Show title in course configuration *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_ConfigTitle (bool PutLink)
|
||||
{
|
||||
Hie_ConfigTitle (PutLink,
|
||||
Hie_DEG, // Logo scope
|
||||
Gbl.Hierarchy.Deg.DegCod, // Logo code
|
||||
Gbl.Hierarchy.Deg.ShrtName, // Logo short name
|
||||
Gbl.Hierarchy.Deg.FullName, // Logo full name
|
||||
Gbl.Hierarchy.Deg.WWW, // Logo www
|
||||
Gbl.Hierarchy.Crs.FullName); // Text full name
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Show degree in course configuration ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_ConfigDegree (bool PrintView,bool PutForm)
|
||||
{
|
||||
extern const char *Txt_Degree;
|
||||
extern const char *Txt_Go_to_X;
|
||||
unsigned NumDeg;
|
||||
|
||||
/***** Degree *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",PutForm ? "OthDegCod" :
|
||||
NULL,
|
||||
Txt_Degree);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"DAT LB\"");
|
||||
if (PutForm)
|
||||
{
|
||||
/* Get list of degrees of the current centre */
|
||||
Deg_GetListDegsOfCurrentCtr ();
|
||||
|
||||
/* Put form to select degree */
|
||||
Frm_StartForm (ActChgCrsDegCfg);
|
||||
HTM_SELECT_Begin (true,
|
||||
"id=\"OthDegCod\" name=\"OthDegCod\""
|
||||
" class=\"INPUT_SHORT_NAME\"");
|
||||
for (NumDeg = 0;
|
||||
NumDeg < Gbl.Hierarchy.Ctr.Degs.Num;
|
||||
NumDeg++)
|
||||
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].DegCod,
|
||||
Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].DegCod == Gbl.Hierarchy.Deg.DegCod,false,
|
||||
"%s",Gbl.Hierarchy.Ctr.Degs.Lst[NumDeg].ShrtName);
|
||||
HTM_SELECT_End ();
|
||||
Frm_EndForm ();
|
||||
|
||||
/* Free list of degrees of the current centre */
|
||||
Deg_FreeListDegs (&Gbl.Hierarchy.Ctr.Degs);
|
||||
}
|
||||
else // I can not move course to another degree
|
||||
{
|
||||
if (!PrintView)
|
||||
{
|
||||
Frm_StartFormGoTo (ActSeeDegInf);
|
||||
Deg_PutParamDegCod (Gbl.Hierarchy.Deg.DegCod);
|
||||
snprintf (Gbl.Title,sizeof (Gbl.Title),
|
||||
Txt_Go_to_X,
|
||||
Gbl.Hierarchy.Deg.ShrtName);
|
||||
HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK LT DAT",NULL);
|
||||
}
|
||||
Lgo_DrawLogo (Hie_DEG,Gbl.Hierarchy.Deg.DegCod,Gbl.Hierarchy.Deg.ShrtName,
|
||||
20,"LM",true);
|
||||
HTM_NBSP ();
|
||||
HTM_Txt (Gbl.Hierarchy.Deg.FullName);
|
||||
if (!PrintView)
|
||||
{
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
}
|
||||
}
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Show course full name in course configuration ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_ConfigFullName (bool PutForm)
|
||||
{
|
||||
extern const char *Txt_Course;
|
||||
|
||||
Hie_ConfigFullName (PutForm,Txt_Course,ActRenCrsFulCfg,
|
||||
Gbl.Hierarchy.Crs.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Show course short name in course configuration ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_ConfigShrtName (bool PutForm)
|
||||
{
|
||||
Hie_ConfigShrtName (PutForm,ActRenCrsShoCfg,Gbl.Hierarchy.Crs.ShrtName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Show course year in course configuration ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_ConfigYear (bool PutForm)
|
||||
{
|
||||
extern const char *Txt_Year_OF_A_DEGREE;
|
||||
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
|
||||
extern const char *Txt_Not_applicable;
|
||||
unsigned Year;
|
||||
|
||||
/***** Academic year *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",PutForm ? "OthCrsYear" :
|
||||
NULL,
|
||||
Txt_Year_OF_A_DEGREE);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"DAT LB\"");
|
||||
if (PutForm)
|
||||
{
|
||||
Frm_StartForm (ActChgCrsYeaCfg);
|
||||
HTM_SELECT_Begin (true,
|
||||
"id=\"OthCrsYear\" name=\"OthCrsYear\"");
|
||||
for (Year = 0;
|
||||
Year <= Deg_MAX_YEARS_PER_DEGREE;
|
||||
Year++)
|
||||
HTM_OPTION (HTM_Type_UNSIGNED,&Year,
|
||||
Year == Gbl.Hierarchy.Crs.Year,false,
|
||||
"%s",Txt_YEAR_OF_DEGREE[Year]);
|
||||
HTM_SELECT_End ();
|
||||
Frm_EndForm ();
|
||||
}
|
||||
else
|
||||
HTM_Txt (Gbl.Hierarchy.Crs.Year ? Txt_YEAR_OF_DEGREE[Gbl.Hierarchy.Crs.Year] :
|
||||
Txt_Not_applicable);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************* Show institutional code in course configuration ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_ConfigInstitutionalCode (bool PutForm)
|
||||
{
|
||||
extern const char *Txt_Institutional_code;
|
||||
|
||||
/***** Institutional course code *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",PutForm ? "InsCrsCod" :
|
||||
NULL,
|
||||
Txt_Institutional_code);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"DAT LB\"");
|
||||
if (PutForm)
|
||||
{
|
||||
Frm_StartForm (ActChgInsCrsCodCfg);
|
||||
HTM_INPUT_TEXT ("InsCrsCod",Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD,
|
||||
Gbl.Hierarchy.Crs.InstitutionalCrsCod,true,
|
||||
"id=\"InsCrsCod\" size=\"%u\" class=\"INPUT_INS_CODE\"",
|
||||
Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
else
|
||||
HTM_Txt (Gbl.Hierarchy.Crs.InstitutionalCrsCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************** Show internal code in course configuration *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_ConfigInternalCode (void)
|
||||
{
|
||||
extern const char *Txt_Internal_code;
|
||||
|
||||
/***** Internal course code *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",NULL,Txt_Internal_code);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"DAT LB\"");
|
||||
HTM_Long (Gbl.Hierarchy.Crs.CrsCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************** Show course shortcut in course configuration ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_ConfigShortcut (bool PrintView)
|
||||
{
|
||||
Hie_ConfigShortcut (PrintView,"crs",Gbl.Hierarchy.Crs.CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** Show course QR in course configuration *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_ConfigQR (void)
|
||||
{
|
||||
Hie_ConfigQR ("crs",Gbl.Hierarchy.Crs.CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********************** Number of users in this course **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_ShowNumUsrsInCrs (Rol_Role_t Role)
|
||||
{
|
||||
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||
|
||||
/***** Number of users in course *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",NULL,Txt_ROLES_PLURAL_Abc[Role][Usr_SEX_UNKNOWN]);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"DAT LB\"");
|
||||
HTM_Unsigned (Gbl.Hierarchy.Crs.NumUsrs[Role]);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** Show indicators in course configuration ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_ConfigIndicators (void)
|
||||
{
|
||||
extern const char *Txt_Indicators;
|
||||
extern const char *Txt_of_PART_OF_A_TOTAL;
|
||||
struct Ind_IndicatorsCrs Indicators;
|
||||
int NumIndicatorsFromDB = Ind_GetNumIndicatorsCrsFromDB (Gbl.Hierarchy.Crs.CrsCod);
|
||||
|
||||
/***** Compute indicators ******/
|
||||
Ind_ComputeAndStoreIndicatorsCrs (Gbl.Hierarchy.Crs.CrsCod,
|
||||
NumIndicatorsFromDB,&Indicators);
|
||||
|
||||
/***** Number of indicators *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",NULL,Txt_Indicators);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LB\"");
|
||||
Frm_StartForm (ActReqStaCrs);
|
||||
snprintf (Gbl.Title,sizeof (Gbl.Title),
|
||||
"%u %s %u",
|
||||
Indicators.NumIndicators,
|
||||
Txt_of_PART_OF_A_TOTAL,Ind_NUM_INDICATORS);
|
||||
HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK DAT",NULL);
|
||||
HTM_TxtF ("%s ",Gbl.Title);
|
||||
Ico_PutIcon ((Indicators.NumIndicators == Ind_NUM_INDICATORS) ? "check-circle.svg" :
|
||||
"exclamation-triangle.svg",
|
||||
Gbl.Title,"ICO16x16");
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************ Write menu with my courses *************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -2438,7 +2012,7 @@ void Crs_ChangeCrsDegInConfig (void)
|
|||
/** Show message of success after changing a course in course configuration **/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Crs_ContEditAfterChgCrsInConfig (void)
|
||||
void CfgCrs_ContEditAfterChgCrsInConfig (void)
|
||||
{
|
||||
/***** Write error/success message *****/
|
||||
Ale_ShowAlerts (NULL);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// swad_course.c: edition of courses
|
||||
// swad_course.h: edition of courses
|
||||
|
||||
#ifndef _SWAD_CRS
|
||||
#define _SWAD_CRS
|
||||
|
@ -99,8 +99,8 @@ typedef enum
|
|||
/*****************************************************************************/
|
||||
|
||||
void Crs_ShowIntroduction (void);
|
||||
void Crs_PrintConfiguration (void);
|
||||
void Crs_ContEditAfterChgCrsInConfig (void);
|
||||
void CfgCrs_PrintConfiguration (void);
|
||||
void CfgCrs_ContEditAfterChgCrsInConfig (void);
|
||||
|
||||
unsigned Crs_GetNumCrssTotal (void);
|
||||
unsigned Crs_GetNumCrssInCty (long CtyCod);
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For vasprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <mysql/mysql.h> // To access MySQL databases
|
||||
#include <stdarg.h> // For va_start, va_end
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For FILE, fprintf, vasprintf
|
||||
#include <stdlib.h> // For free
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#include <ctype.h> // For isprint, isspace, etc.
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stdbool.h> // For boolean type
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For fprintf, etc.
|
||||
#include <stdlib.h> // For exit, system, calloc, free, etc.
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#include <ctype.h> // For isprint, isspace, etc.
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stdbool.h> // For boolean type
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For fprintf, etc.
|
||||
#include <stdlib.h> // For exit, system, calloc, free, etc.
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stdbool.h> // For boolean type
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For sscanf, asprintf, etc.
|
||||
#include <stdlib.h> // For exit, system, malloc, calloc, free, etc.
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <dirent.h> // For scandir, etc.
|
||||
#include <errno.h> // For errno
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For FILE,fprintf
|
||||
#include <stdlib.h> // For exit, system, free, etc.
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
#include <dirent.h> // For scandir, etc.
|
||||
#include <errno.h> // For errno
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For exit, system, free, etc
|
||||
#include <string.h> // For string functions
|
||||
#include <time.h> // For time
|
||||
#include <sys/types.h> // For lstat, time_t
|
||||
#include <sys/stat.h> // For lstat
|
||||
#include <time.h> // For time
|
||||
#include <unistd.h> // For access, lstat, getpid, chdir, symlink
|
||||
|
||||
#include "swad_box.h"
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <malloc.h> // For malloc
|
||||
#include <mysql/mysql.h> // To access MySQL databases
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <string.h>
|
||||
#include <time.h> // For time_t
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#define _GNU_SOURCE // For asprintf
|
||||
#include <float.h> // For DBL_MAX
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <locale.h> // For setlocale
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For exit
|
||||
#include <string.h> // For string functions
|
||||
#include <sys/time.h> // For gettimeofday
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For exit, system, malloc, free, rand, etc.
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For aprintf
|
||||
#include <mysql/mysql.h> // To access MySQL databases
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <limits.h> // For maximum values
|
||||
#include <linux/limits.h> // For PATH_MAX, NAME_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For getenv, etc
|
||||
#include <stdsoap2.h> // For SOAP_OK and soap functions
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For exit
|
||||
#include <string.h> // For string functions
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
#include <sys/wait.h> // For the macro WEXITSTATUS
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/*********************************** Headers *********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For exit
|
||||
#include <string.h>
|
||||
#include <unistd.h> // For sleep
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <malloc.h> // For malloc
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <string.h> // For string functions
|
||||
#include <unistd.h> // For unlink
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For free
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For sscanf, asprintf, etc.
|
||||
#include <stdlib.h> // For exit, system, malloc, calloc, free, etc.
|
||||
#include <string.h>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For system
|
||||
#include <string.h>
|
||||
#include <sys/wait.h> // For the macro WEXITSTATUS
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For free
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#include <ctype.h> // For isprint, isspace, etc.
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <math.h> // For log10, floor, ceil, modf, sqrt...
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For system, getenv, etc.
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/********************************** Headers **********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ TODO: Check if web service is called from an authorized IP.
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stdbool.h> // For boolean type
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For fprintf, asprintf
|
||||
#include <stdlib.h> // For calloc, free
|
||||
#include <string.h>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/*********************************** Headers *********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <string.h> // For string functions
|
||||
|
||||
#include "swad_box.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h>
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
/************************************ Headers ********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <mysql/mysql.h> // To access MySQL databases
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For sprintf
|
||||
#include <stdlib.h> // For malloc and free
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
/********************************** Headers **********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stdbool.h> // For boolean type
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For fprintf, etc.
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <ctype.h> // For isprint, isspace, etc.
|
||||
#include <locale.h> // For setlocale
|
||||
#include <math.h> // For log10, floor, ceil, modf, sqrt...
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For malloc and free
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For calloc
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
|
||||
#include <unistd.h> // For SEEK_SET
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stdsoap2.h> // For SOAP_OK and soap functions
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For free ()
|
||||
#include <stdsoap2.h> // For SOAP_OK and soap functions
|
||||
#include <string.h> // For string functions
|
||||
#include <time.h> // For time ()
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
#define _GNU_SOURCE // For asprintf
|
||||
#include <limits.h> // For UINT_MAX
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <mysql/mysql.h> // To access MySQL databases
|
||||
#include <stdbool.h> // For boolean type
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For fprintf, asprintf, etc.
|
||||
#include <stdlib.h> // For exit, system, malloc, free, etc
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
/********************************* Headers ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
|
||||
#include "swad_action.h"
|
||||
#include "swad_assignment.h"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For malloc, calloc, free
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <ctype.h> // For isalnum, isdigit, etc.
|
||||
#include <limits.h> // For maximum values
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For exit, system, malloc, free, rand, etc.
|
||||
#include <string.h> // For string functions
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#include <ctype.h> // For isspace()
|
||||
#include <linux/stddef.h> // For NULL
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdlib.h> // For free ()
|
||||
#include <string.h> // For strlen (), etc.
|
||||
|
||||
|
|
Loading…
Reference in New Issue