swad-core/swad_indicator.c

1575 lines
58 KiB
C
Raw Normal View History

2014-12-01 23:55:08 +01:00
// swad_indicators.c: indicators of courses
/*
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.
2021-02-09 12:43:45 +01:00
Copyright (C) 1999-2021 Antonio Ca<EFBFBD>as Vargas
2014-12-01 23:55:08 +01:00
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 ***********************************/
/*****************************************************************************/
2019-12-29 12:39:00 +01:00
#include <stddef.h> // For NULL
2014-12-01 23:55:08 +01:00
#include <mysql/mysql.h> // To access MySQL databases
#include "swad_action.h"
2017-06-10 21:38:10 +02:00
#include "swad_box.h"
2014-12-01 23:55:08 +01:00
#include "swad_database.h"
2020-04-14 17:15:17 +02:00
#include "swad_department.h"
2018-11-09 20:47:39 +01:00
#include "swad_form.h"
#include "swad_forum.h"
2014-12-01 23:55:08 +01:00
#include "swad_global.h"
2019-10-23 19:05:05 +02:00
#include "swad_HTML.h"
2014-12-01 23:55:08 +01:00
#include "swad_indicator.h"
2020-04-14 17:15:17 +02:00
#include "swad_message.h"
2014-12-01 23:55:08 +01:00
#include "swad_parameter.h"
#include "swad_theme.h"
/*****************************************************************************/
/************** External global variables from others modules ****************/
/*****************************************************************************/
extern struct Globals Gbl;
/*****************************************************************************/
2019-11-21 16:47:07 +01:00
/**************************** Private constants ******************************/
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/*****************************************************************************/
2019-11-21 16:47:07 +01:00
/******************************* Private types *******************************/
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
typedef enum
{
Ind_INDICATORS_BRIEF,
Ind_INDICATORS_FULL,
} Ind_IndicatorsLayout_t;
/*****************************************************************************/
2019-11-21 16:47:07 +01:00
/***************************** Private prototypes ****************************/
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
2020-04-12 21:47:01 +02:00
static void Ind_GetParamsIndicators (struct Ind_Indicators *Indicators);
static void Ind_GetParamNumIndicators (struct Ind_Indicators *Indicators);
static unsigned Ind_GetTableOfCourses (const struct Ind_Indicators *Indicators,
MYSQL_RES **mysql_res);
static bool Ind_GetIfShowBigList (struct Ind_Indicators *Indicators,
unsigned NumCrss);
static void Ind_PutButtonToConfirmIWantToSeeBigList (struct Ind_Indicators *Indicators,
unsigned NumCrss);
2020-04-12 21:33:02 +02:00
static void Ind_PutParamsConfirmIWantToSeeBigList (void *Indicators);
2016-06-04 19:16:21 +02:00
2017-01-28 15:58:46 +01:00
static void Ind_GetNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 + Ind_NUM_INDICATORS],
2016-06-04 19:16:21 +02:00
unsigned NumCrss,MYSQL_RES *mysql_res);
2020-04-12 21:47:01 +02:00
static void Ind_ShowNumCoursesWithIndicators (const struct Ind_Indicators *Indicators,
unsigned NumCrssWithIndicatorYes[1 + Ind_NUM_INDICATORS],
2016-06-08 13:19:17 +02:00
unsigned NumCrss,bool PutForm);
2020-04-12 21:47:01 +02:00
static void Ind_ShowTableOfCoursesWithIndicators (const struct Ind_Indicators *Indicators,
Ind_IndicatorsLayout_t IndicatorsLayout,
2016-06-04 19:16:21 +02:00
unsigned NumCrss,MYSQL_RES *mysql_res);
2016-06-10 10:22:22 +02:00
static unsigned Ind_GetAndUpdateNumIndicatorsCrs (long CrsCod);
2016-06-09 14:00:10 +02:00
static void Ind_StoreIndicatorsCrsIntoDB (long CrsCod,unsigned NumIndicators);
static unsigned Ind_GetNumFilesInDocumZonesOfCrsFromDB (long CrsCod);
static unsigned Ind_GetNumFilesInShareZonesOfCrsFromDB (long CrsCod);
static unsigned Ind_GetNumFilesInAssigZonesOfCrsFromDB (long CrsCod);
static unsigned Ind_GetNumFilesInWorksZonesOfCrsFromDB (long CrsCod);
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/******************* Request showing statistics of courses *******************/
/*****************************************************************************/
void Ind_ReqIndicatorsCourses (void)
{
2017-12-19 18:41:19 +01:00
extern const char *Hlp_ANALYTICS_Indicators;
2019-02-22 21:47:50 +01:00
extern const char *The_ClassFormInBox[The_NUM_THEMES];
2014-12-01 23:55:08 +01:00
extern const char *Txt_Scope;
extern const char *Txt_Types_of_degree;
extern const char *Txt_only_if_the_scope_is_X;
extern const char *Txt_Department;
2017-10-10 10:46:35 +02:00
extern const char *Txt_Any_department;
2020-05-07 14:15:39 +02:00
extern const char *Txt_Number_of_indicators;
2014-12-01 23:55:08 +01:00
extern const char *Txt_Indicators_of_courses;
extern const char *Txt_Show_more_details;
2020-04-12 21:47:01 +02:00
struct Ind_Indicators Indicators;
2014-12-01 23:55:08 +01:00
MYSQL_RES *mysql_res;
unsigned NumCrss;
2017-01-28 15:58:46 +01:00
unsigned NumCrssWithIndicatorYes[1 + Ind_NUM_INDICATORS];
2016-06-04 19:16:21 +02:00
unsigned NumCrssToList;
2016-06-08 14:14:31 +02:00
unsigned Ind;
2014-12-01 23:55:08 +01:00
2016-06-09 17:19:10 +02:00
/***** Get parameters *****/
2020-04-12 21:47:01 +02:00
Ind_GetParamsIndicators (&Indicators);
2016-06-09 17:56:57 +02:00
2019-10-26 02:19:42 +02:00
/***** Begin box *****/
2020-03-26 02:54:30 +01:00
Box_BoxBegin (NULL,Txt_Indicators_of_courses,
NULL,NULL,
2017-12-19 18:41:19 +01:00
Hlp_ANALYTICS_Indicators,Box_NOT_CLOSABLE);
2015-03-24 19:41:54 +01:00
2014-12-01 23:55:08 +01:00
/***** Form to update indicators *****/
2019-10-20 22:00:28 +02:00
/* Begin form and table */
Frm_BeginForm (ActReqStaCrs);
2019-10-23 19:05:05 +02:00
HTM_TABLE_BeginWidePadding (2);
2014-12-01 23:55:08 +01:00
2016-06-08 15:03:06 +02:00
/* Scope */
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-07 15:15:55 +02:00
2019-12-27 21:10:39 +01:00
/* Label */
2019-12-27 15:45:19 +01:00
Frm_LabelColumn ("RT","ScopeInd",Txt_Scope);
2019-10-07 15:15:55 +02:00
2019-12-27 21:10:39 +01:00
/* Data */
2019-12-26 22:29:04 +01:00
HTM_TD_Begin ("class=\"LT\"");
2020-04-27 03:16:55 +02:00
Sco_PutSelectorScope ("ScopeInd",HTM_SUBMIT_ON_CHANGE);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2014-12-01 23:55:08 +01:00
/* Compute stats for a type of degree */
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-07 15:15:55 +02:00
2019-12-27 21:10:39 +01:00
/* Label */
2019-12-27 15:45:19 +01:00
Frm_LabelColumn ("RT","OthDegTypCod",Txt_Types_of_degree);
2019-10-07 15:15:55 +02:00
2019-12-27 21:10:39 +01:00
/* Data */
2019-12-26 22:29:04 +01:00
HTM_TD_Begin ("class=\"DAT LT\"");
2020-04-12 21:33:02 +02:00
DT_WriteSelectorDegreeTypes (Indicators.DegTypCod);
2019-11-11 00:15:44 +01:00
HTM_Txt (" (");
HTM_TxtF (Txt_only_if_the_scope_is_X,Cfg_PLATFORM_SHORT_NAME);
2019-11-10 13:51:07 +01:00
HTM_Txt (")");
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2014-12-01 23:55:08 +01:00
/* Compute stats for courses with teachers belonging to any department or to a particular departament? */
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-07 15:15:55 +02:00
2019-12-27 21:10:39 +01:00
/* Label */
2019-12-27 15:45:19 +01:00
Frm_LabelColumn ("RT",Dpt_PARAM_DPT_COD_NAME,Txt_Department);
2019-10-07 15:15:55 +02:00
2019-12-27 21:10:39 +01:00
/* Data */
2019-12-27 15:45:19 +01:00
HTM_TD_Begin ("class=\"LT\"");
2019-04-03 20:57:04 +02:00
Dpt_WriteSelectorDepartment (Gbl.Hierarchy.Ins.InsCod, // Departments in current insitution
2020-04-12 21:33:02 +02:00
Indicators.DptCod, // Selected department
2018-10-08 14:11:21 +02:00
"INDICATORS_INPUT", // Selector class
2017-10-10 10:46:35 +02:00
-1L, // First option
Txt_Any_department, // Text when no department selected
true); // Submit on change
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2014-12-01 23:55:08 +01:00
2016-06-08 15:03:06 +02:00
/***** Get courses from database *****/
/* The result will contain courses with any number of indicators
2020-04-12 21:33:02 +02:00
If Indicators.NumIndicators < 0 ==> all courses in result will be listed
If Indicators.NumIndicators >= 0 ==> only those courses in result
with Indicators.NumIndicators set to yes
2016-06-08 15:03:06 +02:00
will be listed */
2020-04-12 21:47:01 +02:00
NumCrss = Ind_GetTableOfCourses (&Indicators,&mysql_res);
2016-06-08 15:03:06 +02:00
/***** Get vector with numbers of courses with 0, 1, 2... indicators set to yes *****/
Ind_GetNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,mysql_res);
2016-06-08 13:26:19 +02:00
/* Selection of the number of indicators */
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"RT %s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
2020-06-18 20:06:17 +02:00
HTM_TxtColon (Txt_Number_of_indicators);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"LT\"");
2020-04-12 21:47:01 +02:00
Ind_ShowNumCoursesWithIndicators (&Indicators,NumCrssWithIndicatorYes,NumCrss,true);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2014-12-01 23:55:08 +01:00
2017-05-13 00:08:22 +02:00
/* End table and form */
2019-10-23 19:05:05 +02:00
HTM_TABLE_End ();
2018-11-09 20:47:39 +01:00
Frm_EndForm ();
2014-12-01 23:55:08 +01:00
2016-06-08 13:19:17 +02:00
/***** Show the stats of courses *****/
2016-06-08 14:14:31 +02:00
for (Ind = 0, NumCrssToList = 0;
Ind <= Ind_NUM_INDICATORS;
Ind++)
2020-04-12 21:33:02 +02:00
if (Indicators.IndicatorsSelected[Ind])
2016-06-08 14:14:31 +02:00
NumCrssToList += NumCrssWithIndicatorYes[Ind];
2020-04-12 21:47:01 +02:00
if (Ind_GetIfShowBigList (&Indicators,NumCrssToList))
2014-12-01 23:55:08 +01:00
{
/* Show table */
2020-04-12 21:47:01 +02:00
Ind_ShowTableOfCoursesWithIndicators (&Indicators,Ind_INDICATORS_BRIEF,NumCrss,mysql_res);
2014-12-01 23:55:08 +01:00
/* Button to show more details */
Frm_BeginForm (ActSeeAllStaCrs);
2016-06-24 20:34:58 +02:00
Sco_PutParamScope ("ScopeInd",Gbl.Scope.Current);
2020-04-12 21:33:02 +02:00
Par_PutHiddenParamLong (NULL,"OthDegTypCod",Indicators.DegTypCod);
Par_PutHiddenParamLong (NULL,Dpt_PARAM_DPT_COD_NAME,Indicators.DptCod);
if (Indicators.StrIndicatorsSelected[0])
Par_PutHiddenParamString (NULL,"Indicators",Indicators.StrIndicatorsSelected);
2017-06-11 19:02:40 +02:00
Btn_PutConfirmButton (Txt_Show_more_details);
2018-11-09 20:47:39 +01:00
Frm_EndForm ();
2014-12-01 23:55:08 +01:00
}
2017-06-12 14:16:33 +02:00
/***** End box *****/
2019-10-25 22:48:34 +02:00
Box_BoxEnd ();
2015-03-24 19:41:54 +01:00
2014-12-01 23:55:08 +01:00
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
}
/*****************************************************************************/
2016-06-09 18:04:18 +02:00
/************* Get parameters related to indicators of courses ***************/
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
2020-04-12 21:47:01 +02:00
static void Ind_GetParamsIndicators (struct Ind_Indicators *Indicators)
2014-12-01 23:55:08 +01:00
{
2016-06-09 18:04:18 +02:00
/***** Get scope *****/
2021-02-11 22:57:09 +01:00
Gbl.Scope.Allowed = 1 << Hie_Lvl_SYS |
1 << Hie_Lvl_CTY |
1 << Hie_Lvl_INS |
1 << Hie_Lvl_CTR |
1 << Hie_Lvl_DEG |
1 << Hie_Lvl_CRS;
Gbl.Scope.Default = Hie_Lvl_CRS;
2016-06-24 20:34:58 +02:00
Sco_GetScope ("ScopeInd");
2014-12-01 23:55:08 +01:00
/***** Get degree type code *****/
2021-02-11 22:57:09 +01:00
Indicators->DegTypCod = (Gbl.Scope.Current == Hie_Lvl_SYS) ?
2020-04-12 21:47:01 +02:00
DT_GetAndCheckParamOtherDegTypCod (-1L) : // -1L (any degree type) is allowed here
-1L;
2014-12-01 23:55:08 +01:00
/***** Get department code *****/
2020-04-12 21:47:01 +02:00
Indicators->DptCod = Dpt_GetAndCheckParamDptCod (-1L); // -1L (any department) is allowed here
2014-12-01 23:55:08 +01:00
/***** Get number of indicators *****/
2020-04-12 21:47:01 +02:00
Ind_GetParamNumIndicators (Indicators);
2016-06-09 18:04:18 +02:00
}
/*****************************************************************************/
/*********************** Show statistics of courses **************************/
/*****************************************************************************/
void Ind_ShowIndicatorsCourses (void)
{
2020-04-12 21:47:01 +02:00
struct Ind_Indicators Indicators;
2016-06-09 18:04:18 +02:00
MYSQL_RES *mysql_res;
unsigned NumCrss;
2017-01-28 15:58:46 +01:00
unsigned NumCrssWithIndicatorYes[1 + Ind_NUM_INDICATORS];
2016-06-09 18:04:18 +02:00
/***** Get parameters *****/
2020-04-12 21:47:01 +02:00
Ind_GetParamsIndicators (&Indicators);
2014-12-01 23:55:08 +01:00
/***** Get courses from database *****/
2020-04-12 21:47:01 +02:00
NumCrss = Ind_GetTableOfCourses (&Indicators,&mysql_res);
2014-12-01 23:55:08 +01:00
2016-06-04 19:16:21 +02:00
/***** Get vector with numbers of courses with 0, 1, 2... indicators set to yes *****/
Ind_GetNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,mysql_res);
/***** Show table with numbers of courses with 0, 1, 2... indicators set to yes *****/
2020-04-12 21:47:01 +02:00
Ind_ShowNumCoursesWithIndicators (&Indicators,NumCrssWithIndicatorYes,NumCrss,false);
2016-06-04 19:16:21 +02:00
2014-12-01 23:55:08 +01:00
/***** Show the stats of courses *****/
2020-04-12 21:47:01 +02:00
Ind_ShowTableOfCoursesWithIndicators (&Indicators,Ind_INDICATORS_FULL,NumCrss,mysql_res);
2014-12-01 23:55:08 +01:00
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
}
/*****************************************************************************/
/*************** Get parameter with the number of indicators *****************/
/*****************************************************************************/
2020-04-12 21:47:01 +02:00
static void Ind_GetParamNumIndicators (struct Ind_Indicators *Indicators)
2014-12-01 23:55:08 +01:00
{
2016-06-08 14:14:31 +02:00
unsigned Ind;
const char *Ptr;
2019-11-08 01:10:32 +01:00
char LongStr[Cns_MAX_DECIMAL_DIGITS_LONG + 1];
2016-06-08 14:14:31 +02:00
long Indicator;
/***** Get parameter multiple with list of indicators selected *****/
2020-04-12 21:47:01 +02:00
Par_GetParMultiToText ("Indicators",Indicators->StrIndicatorsSelected,Ind_MAX_SIZE_INDICATORS_SELECTED);
2014-12-01 23:55:08 +01:00
2016-06-08 14:14:31 +02:00
/***** Set which indicators have been selected (checkboxes on) *****/
2020-04-12 21:47:01 +02:00
if (Indicators->StrIndicatorsSelected[0])
2016-06-08 14:14:31 +02:00
{
/* Reset all indicators */
for (Ind = 0;
Ind <= Ind_NUM_INDICATORS;
Ind++)
2020-04-12 21:47:01 +02:00
Indicators->IndicatorsSelected[Ind] = false;
2016-06-08 14:14:31 +02:00
/* Set indicators selected */
2020-04-12 21:47:01 +02:00
for (Ptr = Indicators->StrIndicatorsSelected;
2016-06-08 14:14:31 +02:00
*Ptr;
)
{
/* Get next indicator selected */
2019-11-08 01:10:32 +01:00
Par_GetNextStrUntilSeparParamMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
2016-06-08 14:14:31 +02:00
Indicator = Str_ConvertStrCodToLongCod (LongStr);
/* Set each indicator in list StrIndicatorsSelected as selected */
for (Ind = 0;
Ind <= Ind_NUM_INDICATORS;
Ind++)
if ((long) Ind == Indicator)
2020-04-12 21:47:01 +02:00
Indicators->IndicatorsSelected[Ind] = true;
2016-06-08 14:14:31 +02:00
}
}
else
/* Set all indicators */
for (Ind = 0;
Ind <= Ind_NUM_INDICATORS;
Ind++)
2020-04-12 21:47:01 +02:00
Indicators->IndicatorsSelected[Ind] = true;
2014-12-01 23:55:08 +01:00
}
/*****************************************************************************/
/******************* Build query to get table of courses *********************/
/*****************************************************************************/
// Return the number of courses found
2020-04-12 21:47:01 +02:00
static unsigned Ind_GetTableOfCourses (const struct Ind_Indicators *Indicators,
MYSQL_RES **mysql_res)
2014-12-01 23:55:08 +01:00
{
2018-10-31 13:00:40 +01:00
unsigned NumCrss = 0; // Initialized to avoid warning
2014-12-01 23:55:08 +01:00
switch (Gbl.Scope.Current)
{
2021-02-11 22:57:09 +01:00
case Hie_Lvl_SYS:
2020-04-12 21:47:01 +02:00
if (Indicators->DptCod >= 0) // 0 means another department
2014-12-01 23:55:08 +01:00
{
2020-04-12 21:47:01 +02:00
if (Indicators->DegTypCod > 0)
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT DISTINCTROW "
"deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM deg_degrees,"
"crs_courses,"
"crs_users,"
"usr_data"
" WHERE deg_degrees.DegTypCod=%ld"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=crs_users.CrsCod"
" AND crs_users.Role=%u"
" AND crs_users.UsrCod=usr_data.UsrCod"
" AND usr_data.DptCod=%ld"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Indicators->DegTypCod,
(unsigned) Rol_TCH,
Indicators->DptCod);
2014-12-01 23:55:08 +01:00
else
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT DISTINCTROW "
"deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM deg_degrees,"
"crs_courses,"
"crs_users,"
"usr_data"
" WHERE deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=crs_users.CrsCod"
" AND crs_users.Role=%u"
" AND crs_users.UsrCod=usr_data.UsrCod"
" AND usr_data.DptCod=%ld"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
(unsigned) Rol_TCH,
Indicators->DptCod);
2014-12-01 23:55:08 +01:00
}
else
{
2020-04-12 21:47:01 +02:00
if (Indicators->DegTypCod > 0)
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM deg_degrees,"
"crs_courses"
" WHERE deg_degrees.DegTypCod=%ld"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Indicators->DegTypCod);
2014-12-01 23:55:08 +01:00
else
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM deg_degrees,"
"crs_courses"
" WHERE deg_degrees.DegCod=crs_courses.DegCod"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName");
2014-12-01 23:55:08 +01:00
}
break;
2021-02-11 22:57:09 +01:00
case Hie_Lvl_CTY:
2020-04-12 21:47:01 +02:00
if (Indicators->DptCod >= 0) // 0 means another department
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT DISTINCTROW "
"deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM ins_instits,"
"ctr_centers,"
"deg_degrees,"
"crs_courses,"
"crs_users,"
"usr_data"
" WHERE ins_instits.CtyCod=%ld"
" AND ins_instits.InsCod=ctr_centers.InsCod"
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=crs_users.CrsCod"
" AND crs_users.Role=%u"
" AND crs_users.UsrCod=usr_data.UsrCod"
" AND usr_data.DptCod=%ld"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Gbl.Hierarchy.Cty.CtyCod,
(unsigned) Rol_TCH,
Indicators->DptCod);
2015-03-24 19:41:54 +01:00
else
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM ins_instits,"
"ctr_centers,"
"deg_degrees,"
"crs_courses"
" WHERE ins_instits.CtyCod=%ld"
" AND ins_instits.InsCod=ctr_centers.InsCod"
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Gbl.Hierarchy.Cty.CtyCod);
2015-03-24 19:41:54 +01:00
break;
2021-02-11 22:57:09 +01:00
case Hie_Lvl_INS:
2020-04-12 21:47:01 +02:00
if (Indicators->DptCod >= 0) // 0 means another department
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT DISTINCTROW "
"deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM ctr_centers,"
"deg_degrees,"
"crs_courses,"
"crs_users,"
"usr_data"
" WHERE ctr_centers.InsCod=%ld"
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=crs_users.CrsCod"
" AND crs_users.Role=%u"
" AND crs_users.UsrCod=usr_data.UsrCod"
" AND usr_data.DptCod=%ld"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Gbl.Hierarchy.Ins.InsCod,
(unsigned) Rol_TCH,
Indicators->DptCod);
2014-12-01 23:55:08 +01:00
else
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM ctr_centers,"
"deg_degrees,"
"crs_courses"
" WHERE ctr_centers.InsCod=%ld"
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Gbl.Hierarchy.Ins.InsCod);
2014-12-01 23:55:08 +01:00
break;
2021-02-11 22:57:09 +01:00
case Hie_Lvl_CTR:
2020-04-12 21:47:01 +02:00
if (Indicators->DptCod >= 0) // 0 means another department
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT DISTINCTROW "
"deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM deg_degrees,"
"crs_courses,"
"crs_users,"
"usr_data"
" WHERE deg_degrees.CtrCod=%ld"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=crs_users.CrsCod"
" AND crs_users.Role=%u"
" AND crs_users.UsrCod=usr_data.UsrCod"
" AND usr_data.DptCod=%ld"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Gbl.Hierarchy.Ctr.CtrCod,
(unsigned) Rol_TCH,
Indicators->DptCod);
2014-12-01 23:55:08 +01:00
else
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM deg_degrees,"
"crs_courses"
" WHERE deg_degrees.CtrCod=%ld"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Gbl.Hierarchy.Ctr.CtrCod);
2014-12-01 23:55:08 +01:00
break;
2021-02-11 22:57:09 +01:00
case Hie_Lvl_DEG:
2020-04-12 21:47:01 +02:00
if (Indicators->DptCod >= 0) // 0 means another department
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT DISTINCTROW "
"deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM deg_degrees,"
"crs_courses,"
"crs_users,"
"usr_data"
" WHERE deg_degrees.DegCod=%ld"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=crs_users.CrsCod"
" AND crs_users.Role=%u"
" AND crs_users.UsrCod=usr_data.UsrCod"
" AND usr_data.DptCod=%ld"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Gbl.Hierarchy.Deg.DegCod,
(unsigned) Rol_TCH,
Indicators->DptCod);
2014-12-01 23:55:08 +01:00
else
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM deg_degrees,"
"crs_courses"
" WHERE deg_degrees.DegCod=%ld"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Gbl.Hierarchy.Deg.DegCod);
2014-12-01 23:55:08 +01:00
break;
2021-02-11 22:57:09 +01:00
case Hie_Lvl_CRS:
2020-04-12 21:47:01 +02:00
if (Indicators->DptCod >= 0) // 0 means another department
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT DISTINCTROW "
"deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM deg_degrees,"
"crs_courses,"
"crs_users,"
"usr_data"
" WHERE crs_courses.CrsCod=%ld"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" AND crs_courses.CrsCod=crs_users.CrsCod"
" AND crs_users.CrsCod=%ld"
" AND crs_users.Role=%u"
" AND crs_users.UsrCod=usr_data.UsrCod"
" AND usr_data.DptCod=%ld"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Gbl.Hierarchy.Crs.CrsCod,
Gbl.Hierarchy.Crs.CrsCod,
(unsigned) Rol_TCH,
Indicators->DptCod);
2014-12-01 23:55:08 +01:00
else
NumCrss = (unsigned)
DB_QuerySELECT (mysql_res,"can not get courses",
"SELECT deg_degrees.FullName," // row[0]
"crs_courses.FullName," // row[1]
"crs_courses.CrsCod," // row[2]
"crs_courses.InsCrsCod" // row[3]
" FROM deg_degrees,"
"crs_courses"
" WHERE crs_courses.CrsCod=%ld"
" AND deg_degrees.DegCod=crs_courses.DegCod"
" ORDER BY deg_degrees.FullName,"
"crs_courses.FullName",
Gbl.Hierarchy.Crs.CrsCod);
2014-12-01 23:55:08 +01:00
break;
default:
2018-10-24 23:03:11 +02:00
Lay_WrongScopeExit ();
2014-12-01 23:55:08 +01:00
break;
}
2018-10-31 13:00:40 +01:00
return NumCrss;
2014-12-01 23:55:08 +01:00
}
/*****************************************************************************/
/******* Show form to confirm that I want to see a big list of courses *******/
/*****************************************************************************/
2020-04-12 21:47:01 +02:00
static bool Ind_GetIfShowBigList (struct Ind_Indicators *Indicators,
unsigned NumCrss)
2014-12-01 23:55:08 +01:00
{
bool ShowBigList;
/***** If list of courses is too big... *****/
if (NumCrss <= Cfg_MIN_NUM_COURSES_TO_CONFIRM_SHOW_BIG_LIST)
return true; // List is not too big ==> show it
/***** Get parameter with user's confirmation to see a big list of courses *****/
2017-01-28 20:32:50 +01:00
if (!(ShowBigList = Par_GetParToBool ("ShowBigList")))
2020-04-12 21:47:01 +02:00
Ind_PutButtonToConfirmIWantToSeeBigList (Indicators,NumCrss);
2014-12-01 23:55:08 +01:00
return ShowBigList;
}
/*****************************************************************************/
/****** Show form to confirm that I want to see a big list of courses ********/
/*****************************************************************************/
2020-04-12 21:47:01 +02:00
static void Ind_PutButtonToConfirmIWantToSeeBigList (struct Ind_Indicators *Indicators,
unsigned NumCrss)
2014-12-01 23:55:08 +01:00
{
extern const char *Txt_The_list_of_X_courses_is_too_large_to_be_displayed;
extern const char *Txt_Show_anyway;
2017-05-25 14:25:22 +02:00
/***** Show alert and button to confirm that I want to see the big list *****/
2019-02-17 01:14:55 +01:00
Ale_ShowAlertAndButton (Gbl.Action.Act,NULL,NULL,
2020-04-12 21:47:01 +02:00
Ind_PutParamsConfirmIWantToSeeBigList,Indicators,
2019-02-17 01:14:55 +01:00
Btn_CONFIRM_BUTTON,Txt_Show_anyway,
Ale_WARNING,Txt_The_list_of_X_courses_is_too_large_to_be_displayed,
NumCrss);
2017-05-25 14:25:22 +02:00
}
2014-12-01 23:55:08 +01:00
2020-04-12 21:33:02 +02:00
static void Ind_PutParamsConfirmIWantToSeeBigList (void *Indicators)
2017-05-25 14:25:22 +02:00
{
2020-04-12 21:33:02 +02:00
if (Indicators)
2020-03-26 02:54:30 +01:00
{
Sco_PutParamScope ("ScopeInd",Gbl.Scope.Current);
2020-04-12 21:33:02 +02:00
Par_PutHiddenParamLong (NULL,"OthDegTypCod",((struct Ind_Indicators *) Indicators)->DegTypCod);
Par_PutHiddenParamLong (NULL,Dpt_PARAM_DPT_COD_NAME,((struct Ind_Indicators *) Indicators)->DptCod);
if (((struct Ind_Indicators *) Indicators)->StrIndicatorsSelected[0])
Par_PutHiddenParamString (NULL,"Indicators",((struct Ind_Indicators *) Indicators)->StrIndicatorsSelected);
2020-03-26 02:54:30 +01:00
Par_PutHiddenParamChar ("ShowBigList",'Y');
}
2014-12-01 23:55:08 +01:00
}
2016-06-04 19:16:21 +02:00
/*****************************************************************************/
/** Get vector with numbers of courses with 0, 1, 2... indicators set to yes */
/*****************************************************************************/
2017-01-28 15:58:46 +01:00
static void Ind_GetNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 + Ind_NUM_INDICATORS],
2016-06-04 19:16:21 +02:00
unsigned NumCrss,MYSQL_RES *mysql_res)
{
MYSQL_ROW row;
unsigned NumCrs;
long CrsCod;
unsigned Ind;
2016-06-09 11:50:24 +02:00
unsigned NumIndicators;
2016-06-04 19:16:21 +02:00
/***** Reset counters of courses with each number of indicators *****/
for (Ind = 0;
Ind <= Ind_NUM_INDICATORS;
Ind++)
NumCrssWithIndicatorYes[Ind] = 0;
/***** List courses *****/
for (Gbl.RowEvenOdd = 1, NumCrs = 0;
NumCrs < NumCrss;
NumCrs++, Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd)
{
/* Get next course */
row = mysql_fetch_row (mysql_res);
/* Get course code (row[2]) */
if ((CrsCod = Str_ConvertStrCodToLongCod (row[2])) < 0)
Lay_WrongCourseExit ();
2016-06-04 19:16:21 +02:00
2016-06-10 10:22:22 +02:00
/* Get stored number of indicators of this course */
2016-06-09 11:50:24 +02:00
NumIndicators = Ind_GetAndUpdateNumIndicatorsCrs (CrsCod);
NumCrssWithIndicatorYes[NumIndicators]++;
2016-06-04 19:16:21 +02:00
}
}
/*****************************************************************************/
/** Show table with numbers of courses with 0, 1, 2... indicators set to yes */
/*****************************************************************************/
2020-04-12 21:47:01 +02:00
static void Ind_ShowNumCoursesWithIndicators (const struct Ind_Indicators *Indicators,
unsigned NumCrssWithIndicatorYes[1 + Ind_NUM_INDICATORS],
2016-06-08 13:19:17 +02:00
unsigned NumCrss,bool PutForm)
2016-06-04 19:16:21 +02:00
{
2016-06-08 14:14:31 +02:00
extern const char *Txt_Indicators;
2016-06-04 19:16:21 +02:00
extern const char *Txt_Courses;
2016-06-08 14:14:31 +02:00
extern const char *Txt_Total;
2016-06-04 19:16:21 +02:00
unsigned Ind;
2016-06-05 01:01:18 +02:00
const char *Class;
2019-10-15 15:23:38 +02:00
const char *ClassNormal = "DAT_LIGHT RM";
const char *ClassHighlight = "DAT RM LIGHT_BLUE";
2016-06-04 19:16:21 +02:00
/***** Write number of courses with each number of indicators valid *****/
2019-10-23 19:05:05 +02:00
HTM_TABLE_BeginPadding (2);
2017-05-01 12:36:24 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-12 00:07:52 +02:00
2016-06-08 13:19:17 +02:00
if (PutForm)
2019-10-23 19:05:05 +02:00
HTM_TH_Empty (1);
HTM_TH (1,1,"RM",Txt_Indicators);
HTM_TH (1,2,"RM",Txt_Courses);
2019-10-12 00:07:52 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2019-10-12 00:07:52 +02:00
2016-06-04 19:16:21 +02:00
for (Ind = 0;
Ind <= Ind_NUM_INDICATORS;
Ind++)
2016-06-05 01:01:18 +02:00
{
2020-04-12 21:47:01 +02:00
Class = Indicators->IndicatorsSelected[Ind] ? ClassHighlight :
ClassNormal;
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-07 15:15:55 +02:00
2016-06-08 13:19:17 +02:00
if (PutForm)
{
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s\"",Class);
2020-03-12 13:53:37 +01:00
HTM_INPUT_CHECKBOX ("Indicators",HTM_SUBMIT_ON_CHANGE,
2019-11-04 20:41:35 +01:00
"id=\"Indicators%u\" value=\"%u\"%s",
Ind,Ind,
2020-04-12 21:47:01 +02:00
Indicators->IndicatorsSelected[Ind] ? " checked=\"checked\"" :
"");
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-08 13:19:17 +02:00
}
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s\"",Class);
2019-11-02 23:40:52 +01:00
HTM_LABEL_Begin ("for=\"Indicators%u\"",Ind);
2019-11-10 13:31:47 +01:00
HTM_Unsigned (Ind);
2019-11-02 12:59:31 +01:00
HTM_LABEL_End ();
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s\"",Class);
2019-11-10 13:31:47 +01:00
HTM_Unsigned (NumCrssWithIndicatorYes[Ind]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s\"",Class);
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(%.1f%%)",
NumCrss ? (double) NumCrssWithIndicatorYes[Ind] * 100.0 /
(double) NumCrss :
0.0);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2016-06-05 01:01:18 +02:00
}
/***** Write total of courses *****/
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-07 15:15:55 +02:00
2016-06-08 13:19:17 +02:00
if (PutForm)
2019-10-23 19:05:05 +02:00
HTM_TD_Empty (1);
2019-10-07 15:15:55 +02:00
2020-06-22 19:27:23 +02:00
HTM_TD_Begin ("class=\"DAT_N LINE_TOP RM\"");
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_Total);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2020-06-22 19:27:23 +02:00
HTM_TD_Begin ("class=\"DAT_N LINE_TOP RM\"");
2019-11-10 13:31:47 +01:00
HTM_Unsigned (NumCrss);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2020-06-22 19:27:23 +02:00
HTM_TD_Begin ("class=\"DAT_N LINE_TOP RM\"");
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(%.1f%%)",100.0);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2017-05-01 12:36:24 +02:00
2019-10-23 19:05:05 +02:00
HTM_TABLE_End ();
2016-06-04 19:16:21 +02:00
}
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/****************** Get and show total number of courses *********************/
/*****************************************************************************/
2020-04-12 21:47:01 +02:00
static void Ind_ShowTableOfCoursesWithIndicators (const struct Ind_Indicators *Indicators,
Ind_IndicatorsLayout_t IndicatorsLayout,
2016-06-04 19:16:21 +02:00
unsigned NumCrss,MYSQL_RES *mysql_res)
2014-12-01 23:55:08 +01:00
{
extern const char *Txt_Degree;
extern const char *Txt_Course;
extern const char *Txt_Institutional_BR_code;
extern const char *Txt_Web_page_of_the_course;
2017-05-30 21:43:05 +02:00
extern const char *Txt_ROLES_PLURAL_BRIEF_Abc[Rol_NUM_ROLES];
2014-12-01 23:55:08 +01:00
extern const char *Txt_Indicators;
extern const char *Txt_No_INDEX;
extern const char *Txt_Syllabus_of_the_course;
extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
2020-05-07 14:15:39 +02:00
extern const char *Txt_Number_of_files_in_SHARE_zones;
extern const char *Txt_Number_of_files_in_DOCUM_zones;
2014-12-01 23:55:08 +01:00
extern const char *Txt_Guided_academic_assignments;
extern const char *Txt_Assignments;
extern const char *Txt_Files_assignments;
extern const char *Txt_Files_works;
extern const char *Txt_Online_tutoring;
extern const char *Txt_Forum_threads;
extern const char *Txt_Forum_posts;
extern const char *Txt_Messages_sent_by_teachers;
extern const char *Txt_Materials;
extern const char *Txt_Assessment_criteria;
extern const char *Txt_YES;
extern const char *Txt_NO;
extern const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_SOURCES];
2014-12-01 23:55:08 +01:00
extern const char *Txt_Courses;
MYSQL_ROW row;
unsigned NumCrs;
long CrsCod;
unsigned NumTchs;
unsigned NumStds;
2016-06-09 14:00:10 +02:00
unsigned NumIndicators;
2020-04-12 21:33:02 +02:00
struct Ind_IndicatorsCrs IndicatorsCrs;
2018-04-24 13:21:53 +02:00
long ActCod;
2014-12-01 23:55:08 +01:00
2019-10-20 22:00:28 +02:00
/***** Begin table *****/
2019-10-23 19:05:05 +02:00
HTM_TABLE_Begin ("INDICATORS");
2014-12-01 23:55:08 +01:00
/***** Write table heading *****/
switch (IndicatorsLayout)
{
case Ind_INDICATORS_BRIEF:
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-12 00:07:52 +02:00
2019-10-23 19:05:05 +02:00
HTM_TH (3,1,"LM COLOR0",Txt_Degree);
HTM_TH (3,1,"LM COLOR0",Txt_Course);
HTM_TH (3,1,"LM COLOR0",Txt_Institutional_BR_code);
HTM_TH (3,1,"LM COLOR0",Txt_Web_page_of_the_course);
2019-11-04 23:39:15 +01:00
HTM_TH (1,11,"CM COLOR0",Txt_Indicators);
2019-10-12 00:07:52 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2019-10-04 14:42:59 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-12 00:07:52 +02:00
2019-10-23 19:05:05 +02:00
HTM_TH (2,1,"CT COLOR0",Txt_No_INDEX);
HTM_TH_Begin (1,2,"CT COLOR0");
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(A) %s",Txt_Syllabus_of_the_course);
2019-10-23 19:05:05 +02:00
HTM_TH_End ();
HTM_TH_Begin (1,2,"CT COLOR0");
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(B) %s",Txt_Guided_academic_assignments);
2019-10-23 19:05:05 +02:00
HTM_TH_End ();
HTM_TH_Begin (1,2,"CT COLOR0");
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(C) %s",Txt_Online_tutoring);
2019-10-23 19:05:05 +02:00
HTM_TH_End ();
HTM_TH_Begin (1,2,"CT COLOR0");
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(D) %s",Txt_Materials);
2019-10-23 19:05:05 +02:00
HTM_TH_End ();
HTM_TH_Begin (1,2,"CT COLOR0");
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(E) %s",Txt_Assessment_criteria);
2019-10-23 19:05:05 +02:00
HTM_TH_End ();
2019-10-12 00:07:52 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2019-10-04 14:42:59 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-12 00:07:52 +02:00
2019-10-23 19:05:05 +02:00
HTM_TH (1,1,"CM COLOR0",Txt_YES);
HTM_TH (1,1,"CM COLOR0",Txt_NO);
HTM_TH (1,1,"CM COLOR0",Txt_YES);
HTM_TH (1,1,"CM COLOR0",Txt_NO);
HTM_TH (1,1,"CM COLOR0",Txt_YES);
HTM_TH (1,1,"CM COLOR0",Txt_NO);
HTM_TH (1,1,"CM COLOR0",Txt_YES);
HTM_TH (1,1,"CM COLOR0",Txt_NO);
HTM_TH (1,1,"CM COLOR0",Txt_YES);
HTM_TH (1,1,"CM COLOR0",Txt_NO);
2019-10-12 00:07:52 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2014-12-01 23:55:08 +01:00
break;
case Ind_INDICATORS_FULL:
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-12 00:07:52 +02:00
2019-10-23 19:05:05 +02:00
HTM_TH (3,1,"LM COLOR0",Txt_Degree);
HTM_TH (3,1,"LM COLOR0",Txt_Course);
HTM_TH (3,1,"LM COLOR0",Txt_Institutional_BR_code);
HTM_TH (3,1,"LM COLOR0",Txt_Web_page_of_the_course);
HTM_TH (3,1,"LM COLOR0",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_TCH]);
HTM_TH (3,1,"LM COLOR0",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_STD]);
HTM_TH (1,24,"CM COLOR0",Txt_Indicators);
2019-10-12 00:07:52 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2019-10-04 14:42:59 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-12 00:07:52 +02:00
2019-10-23 19:05:05 +02:00
HTM_TH (2,1,"CT COLOR0",Txt_No_INDEX);
HTM_TH_Begin (1,5,"CT COLOR0");
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(A) %s",Txt_Syllabus_of_the_course);
2019-10-23 19:05:05 +02:00
HTM_TH_End ();
HTM_TH_Begin (1,5,"CT COLOR0");
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(B) %s",Txt_Guided_academic_assignments);
2019-10-23 19:05:05 +02:00
HTM_TH_End ();
HTM_TH_Begin (1,5,"CT COLOR0");
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(C) %s",Txt_Online_tutoring);
2019-10-23 19:05:05 +02:00
HTM_TH_End ();
HTM_TH_Begin (1,4,"CT COLOR0");
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(D) %s",Txt_Materials);
2019-10-23 19:05:05 +02:00
HTM_TH_End ();
HTM_TH_Begin (1,4,"CT COLOR0");
2019-11-11 00:15:44 +01:00
HTM_TxtF ("(E) %s",Txt_Assessment_criteria);
2019-10-23 19:05:05 +02:00
HTM_TH_End ();
HTM_TR_End ();
HTM_TR_Begin (NULL);
HTM_TH (1,1,"CM COLOR0",Txt_YES);
HTM_TH (1,1,"CM COLOR0",Txt_NO);
HTM_TH (1,1,"LM COLOR0",Txt_INFO_TITLE[Inf_LECTURES]);
HTM_TH (1,1,"LM COLOR0",Txt_INFO_TITLE[Inf_PRACTICALS]);
HTM_TH (1,1,"LM COLOR0",Txt_INFO_TITLE[Inf_TEACHING_GUIDE]);
HTM_TH (1,1,"CM COLOR0",Txt_YES);
HTM_TH (1,1,"CM COLOR0",Txt_NO);
HTM_TH (1,1,"RM COLOR0",Txt_Assignments);
HTM_TH (1,1,"RM COLOR0",Txt_Files_assignments);
HTM_TH (1,1,"RM COLOR0",Txt_Files_works);
HTM_TH (1,1,"CM COLOR0",Txt_YES);
HTM_TH (1,1,"CM COLOR0",Txt_NO);
HTM_TH (1,1,"RM COLOR0",Txt_Forum_threads);
HTM_TH (1,1,"RM COLOR0",Txt_Forum_posts);
HTM_TH (1,1,"RM COLOR0",Txt_Messages_sent_by_teachers);
HTM_TH (1,1,"CM COLOR0",Txt_YES);
HTM_TH (1,1,"CM COLOR0",Txt_NO);
2020-05-07 14:15:39 +02:00
HTM_TH (1,1,"RM COLOR0",Txt_Number_of_files_in_DOCUM_zones);
HTM_TH (1,1,"RM COLOR0",Txt_Number_of_files_in_SHARE_zones);
2019-10-23 19:05:05 +02:00
HTM_TH (1,1,"CM COLOR0",Txt_YES);
HTM_TH (1,1,"CM COLOR0",Txt_NO);
HTM_TH (1,1,"LM COLOR0",Txt_INFO_TITLE[Inf_ASSESSMENT]);
HTM_TH (1,1,"LM COLOR0",Txt_INFO_TITLE[Inf_TEACHING_GUIDE]);
HTM_TR_End ();
2014-12-01 23:55:08 +01:00
break;
}
/***** List courses *****/
2017-04-25 14:48:47 +02:00
mysql_data_seek (mysql_res,0);
2014-12-01 23:55:08 +01:00
for (Gbl.RowEvenOdd = 1, NumCrs = 0;
NumCrs < NumCrss;
NumCrs++, Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd)
{
/* Get next course */
row = mysql_fetch_row (mysql_res);
/* Get course code (row[2]) */
if ((CrsCod = Str_ConvertStrCodToLongCod (row[2])) < 0)
Lay_WrongCourseExit ();
2014-12-01 23:55:08 +01:00
2016-06-09 14:00:10 +02:00
/* Get stored number of indicators of this course */
NumIndicators = Ind_GetAndUpdateNumIndicatorsCrs (CrsCod);
2020-04-12 21:47:01 +02:00
if (Indicators->IndicatorsSelected[NumIndicators])
2016-06-09 14:00:10 +02:00
{
/* Compute and store indicators */
2020-04-12 21:33:02 +02:00
Ind_ComputeAndStoreIndicatorsCrs (CrsCod,(int) NumIndicators,&IndicatorsCrs);
2016-06-09 14:00:10 +02:00
/* The number of indicators may have changed */
2020-04-12 21:47:01 +02:00
if (Indicators->IndicatorsSelected[IndicatorsCrs.NumIndicators])
2016-06-09 14:00:10 +02:00
{
2018-04-24 13:21:53 +02:00
ActCod = Act_GetActCod (ActReqStaCrs);
2016-06-09 14:00:10 +02:00
/* Write a row for this course */
switch (IndicatorsLayout)
{
case Ind_INDICATORS_BRIEF:
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
2020-04-12 21:33:02 +02:00
IndicatorsCrs.CourseAllOK ? "DAT_SMALL_GREEN" :
(IndicatorsCrs.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"),
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2019-11-10 12:36:37 +01:00
HTM_Txt (row[0]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
2020-04-12 21:33:02 +02:00
IndicatorsCrs.CourseAllOK ? "DAT_SMALL_GREEN" :
(IndicatorsCrs.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"),
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2019-11-10 12:36:37 +01:00
HTM_Txt (row[1]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
2020-04-12 21:33:02 +02:00
IndicatorsCrs.CourseAllOK ? "DAT_SMALL_GREEN" :
(IndicatorsCrs.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"),
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2019-11-10 12:36:37 +01:00
HTM_Txt (row[3]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-28 13:56:04 +01:00
HTM_TD_Begin ("class=\"DAT_SMALL LM COLOR%u\"",Gbl.RowEvenOdd);
2019-10-28 20:38:29 +01:00
HTM_A_Begin ("href=\"%s/?crs=%ld&amp;act=%ld\" target=\"_blank\"",
Cfg_URL_SWAD_CGI,CrsCod,ActCod);
2019-11-11 00:15:44 +01:00
HTM_TxtF ("%s/?crs=%ld&amp;act=%ld",
Cfg_URL_SWAD_CGI,CrsCod,ActCod);
2019-10-28 13:56:04 +01:00
HTM_A_End ();
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2020-04-12 21:33:02 +02:00
IndicatorsCrs.CourseAllOK ? "DAT_SMALL_GREEN" :
(IndicatorsCrs.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"),
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
HTM_Unsigned (IndicatorsCrs.NumIndicators);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_GREEN CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs.ThereIsSyllabus)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_YES);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_RED CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (!IndicatorsCrs.ThereIsSyllabus)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_NO);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_GREEN CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs.ThereAreAssignments)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_YES);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_RED CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (!IndicatorsCrs.ThereAreAssignments)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_NO);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_GREEN CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs.ThereIsOnlineTutoring)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_YES);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_RED CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (!IndicatorsCrs.ThereIsOnlineTutoring)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_NO);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_GREEN CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs.ThereAreMaterials)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_YES);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_RED CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (!IndicatorsCrs.ThereAreMaterials)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_NO);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_GREEN CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs.ThereIsAssessment)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_YES);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_RED CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (!IndicatorsCrs.ThereIsAssessment)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_NO);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2016-06-09 14:00:10 +02:00
break;
case Ind_INDICATORS_FULL:
/* Get number of users */
2021-02-11 22:57:09 +01:00
NumTchs = Usr_GetNumUsrsInCrss (Hie_Lvl_CRS,CrsCod,
2020-01-08 23:49:04 +01:00
1 << Rol_NET | // Non-editing teachers
1 << Rol_TCH); // Teachers
2021-02-11 22:57:09 +01:00
NumStds = Usr_GetNumUsrsInCrss (Hie_Lvl_CRS,CrsCod,
2020-01-08 23:49:04 +01:00
1 << Rol_STD); // Students
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_Begin (NULL);
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
2020-04-12 21:33:02 +02:00
IndicatorsCrs.CourseAllOK ? "DAT_SMALL_GREEN" :
(IndicatorsCrs.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"),
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2019-11-10 12:36:37 +01:00
HTM_Txt (row[0]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
2020-04-12 21:33:02 +02:00
IndicatorsCrs.CourseAllOK ? "DAT_SMALL_GREEN" :
(IndicatorsCrs.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"),
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2019-11-10 12:36:37 +01:00
HTM_Txt (row[1]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
2020-04-12 21:33:02 +02:00
IndicatorsCrs.CourseAllOK ? "DAT_SMALL_GREEN" :
(IndicatorsCrs.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"),
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2019-11-10 12:36:37 +01:00
HTM_Txt (row[3]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-28 13:56:04 +01:00
HTM_TD_Begin ("class=\"DAT_SMALL LM COLOR%u\"",Gbl.RowEvenOdd);
2019-10-28 20:38:29 +01:00
HTM_A_Begin ("href=\"%s/?crs=%ld&amp;act=%ld\" target=\"_blank\"",
Cfg_URL_SWAD_CGI,CrsCod,ActCod);
2019-11-11 00:15:44 +01:00
HTM_TxtF ("%s/?crs=%ld&amp;act=%ld",
Cfg_URL_SWAD_CGI,CrsCod,ActCod);
2019-10-28 13:56:04 +01:00
HTM_A_End ();
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2019-10-10 23:14:13 +02:00
NumTchs != 0 ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
Gbl.RowEvenOdd);
2019-11-10 13:31:47 +01:00
HTM_Unsigned (NumTchs);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2019-10-10 23:14:13 +02:00
NumStds != 0 ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
Gbl.RowEvenOdd);
2019-11-10 13:31:47 +01:00
HTM_Unsigned (NumStds);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2020-04-12 21:33:02 +02:00
IndicatorsCrs.CourseAllOK ? "DAT_SMALL_GREEN" :
(IndicatorsCrs.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"),
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
HTM_Unsigned (IndicatorsCrs.NumIndicators);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_GREEN CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs.ThereIsSyllabus)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_YES);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_RED CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (!IndicatorsCrs.ThereIsSyllabus)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_NO);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
(IndicatorsCrs.SyllabusLecSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusLecSrc]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
(IndicatorsCrs.SyllabusPraSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusPraSrc]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
(IndicatorsCrs.TeachingGuideSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.TeachingGuideSrc]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_GREEN CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs.ThereAreAssignments)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_YES);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_RED CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (!IndicatorsCrs.ThereAreAssignments)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_NO);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2020-04-12 21:33:02 +02:00
(IndicatorsCrs.NumAssignments != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
HTM_Unsigned (IndicatorsCrs.NumAssignments);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2020-04-12 21:33:02 +02:00
(IndicatorsCrs.NumFilesAssignments != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
HTM_Unsigned (IndicatorsCrs.NumFilesAssignments);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2020-04-12 21:33:02 +02:00
(IndicatorsCrs.NumFilesWorks != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
HTM_Unsigned (IndicatorsCrs.NumFilesWorks);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_GREEN CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs.ThereIsOnlineTutoring)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_YES);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_RED CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (!IndicatorsCrs.ThereIsOnlineTutoring)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_NO);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2020-04-12 21:33:02 +02:00
(IndicatorsCrs.NumThreads != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
HTM_Unsigned (IndicatorsCrs.NumThreads);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2020-04-12 21:33:02 +02:00
(IndicatorsCrs.NumPosts != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
HTM_Unsigned (IndicatorsCrs.NumPosts);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2020-04-12 21:33:02 +02:00
(IndicatorsCrs.NumMsgsSentByTchs != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
HTM_Unsigned (IndicatorsCrs.NumMsgsSentByTchs);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_GREEN CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs.ThereAreMaterials)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_YES);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_RED CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (!IndicatorsCrs.ThereAreMaterials)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_NO);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2020-04-12 21:33:02 +02:00
(IndicatorsCrs.NumFilesInDocumentZones != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
HTM_Unsigned (IndicatorsCrs.NumFilesInDocumentZones);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s RM COLOR%u\"",
2020-04-12 21:33:02 +02:00
(IndicatorsCrs.NumFilesInSharedZones != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
HTM_Unsigned (IndicatorsCrs.NumFilesInSharedZones);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2016-06-09 14:00:10 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_GREEN CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs.ThereIsAssessment)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_YES);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"DAT_SMALL_RED CM COLOR%u\"",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
if (!IndicatorsCrs.ThereIsAssessment)
2019-11-10 12:36:37 +01:00
HTM_Txt (Txt_NO);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
(IndicatorsCrs.AssessmentSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
2020-04-12 21:33:02 +02:00
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.AssessmentSrc]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
(IndicatorsCrs.TeachingGuideSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
2020-04-12 21:33:02 +02:00
"DAT_SMALL_RED",
2019-10-10 23:14:13 +02:00
Gbl.RowEvenOdd);
2020-04-12 21:33:02 +02:00
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.TeachingGuideSrc]);
2019-10-23 19:05:05 +02:00
HTM_TD_End ();
2019-10-07 15:15:55 +02:00
2019-10-23 19:05:05 +02:00
HTM_TR_End ();
2016-06-09 14:00:10 +02:00
break;
}
}
}
2014-12-01 23:55:08 +01:00
}
/***** End table *****/
2019-10-23 19:05:05 +02:00
HTM_TABLE_End ();
2014-12-01 23:55:08 +01:00
}
/*****************************************************************************/
2016-06-09 11:50:24 +02:00
/************ Get number of indicators of a course from database *************/
/************ If not stored ==> compute and store it *************/
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
2016-06-10 10:22:22 +02:00
static unsigned Ind_GetAndUpdateNumIndicatorsCrs (long CrsCod)
2014-12-01 23:55:08 +01:00
{
2016-06-09 11:50:24 +02:00
unsigned NumIndicators;
2020-04-12 21:33:02 +02:00
struct Ind_IndicatorsCrs IndicatorsCrs;
2016-06-09 11:50:24 +02:00
int NumIndicatorsFromDB = Ind_GetNumIndicatorsCrsFromDB (CrsCod);
/***** If number of indicators is not already computed ==> compute it! *****/
if (NumIndicatorsFromDB >= 0)
NumIndicators = (unsigned) NumIndicatorsFromDB;
else // Number of indicators is not already computed
{
/***** Compute and store number of indicators *****/
2020-04-12 21:33:02 +02:00
Ind_ComputeAndStoreIndicatorsCrs (CrsCod,NumIndicatorsFromDB,&IndicatorsCrs);
NumIndicators = IndicatorsCrs.NumIndicators;
2016-06-09 11:50:24 +02:00
}
return NumIndicators;
}
/*****************************************************************************/
/************ Get number of indicators of a course from database *************/
/*****************************************************************************/
2016-12-15 02:22:47 +01:00
// This function returns -1 if number of indicators is not yet calculated
2016-06-09 11:50:24 +02:00
2016-06-10 10:22:22 +02:00
int Ind_GetNumIndicatorsCrsFromDB (long CrsCod)
2016-06-09 11:50:24 +02:00
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
2016-12-15 02:22:47 +01:00
int NumIndicatorsFromDB = -1; // -1 means not yet calculated
2016-06-09 11:50:24 +02:00
2016-12-15 02:22:47 +01:00
/***** Get number of indicators of a course from database *****/
2018-10-31 16:16:57 +01:00
if (DB_QuerySELECT (&mysql_res,"can not get number of indicators",
"SELECT NumIndicators" // row[0]
" FROM crs_courses"
" WHERE CrsCod=%ld",
2018-10-31 16:16:57 +01:00
CrsCod))
2016-06-09 11:50:24 +02:00
{
/***** Get row *****/
row = mysql_fetch_row (mysql_res);
/***** Get number of indicators (row[0]) *****/
if (sscanf (row[0],"%d",&NumIndicatorsFromDB) != 1)
Lay_ShowErrorAndExit ("Error when getting number of indicators.");
}
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
return NumIndicatorsFromDB;
}
/*****************************************************************************/
/************ Store number of indicators of a course in database *************/
/*****************************************************************************/
2016-06-09 14:00:10 +02:00
static void Ind_StoreIndicatorsCrsIntoDB (long CrsCod,unsigned NumIndicators)
2016-06-09 11:50:24 +02:00
{
/***** Store number of indicators of a course in database *****/
2018-11-03 12:16:40 +01:00
DB_QueryUPDATE ("can not store number of indicators of a course",
"UPDATE crs_courses"
" SET NumIndicators=%u"
" WHERE CrsCod=%ld",
NumIndicators,
CrsCod);
2016-06-09 11:50:24 +02:00
}
/*****************************************************************************/
/********************* Compute indicators of a course ************************/
/*****************************************************************************/
2016-06-10 10:22:22 +02:00
/* NumIndicatorsFromDB (number of indicators stored in database)
must be retrieved before calling this function.
If NumIndicatorsFromDB is different from number of indicators just computed
==> update it into database */
2016-06-09 11:50:24 +02:00
2016-06-10 10:22:22 +02:00
void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB,
2020-04-12 21:33:02 +02:00
struct Ind_IndicatorsCrs *IndicatorsCrs)
2016-06-09 11:50:24 +02:00
{
/***** Initialize number of indicators *****/
2020-04-12 21:33:02 +02:00
IndicatorsCrs->NumIndicators = 0;
2014-12-01 23:55:08 +01:00
2016-06-09 11:50:24 +02:00
/***** Get whether download zones are empty or not *****/
2020-04-12 21:33:02 +02:00
IndicatorsCrs->NumFilesInDocumentZones = Ind_GetNumFilesInDocumZonesOfCrsFromDB (CrsCod);
IndicatorsCrs->NumFilesInSharedZones = Ind_GetNumFilesInShareZonesOfCrsFromDB (CrsCod);
2014-12-01 23:55:08 +01:00
2016-06-09 11:50:24 +02:00
/***** Indicator #1: information about syllabus *****/
2020-04-12 21:33:02 +02:00
IndicatorsCrs->SyllabusLecSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_LECTURES);
IndicatorsCrs->SyllabusPraSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_PRACTICALS);
IndicatorsCrs->TeachingGuideSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_TEACHING_GUIDE);
IndicatorsCrs->ThereIsSyllabus = (IndicatorsCrs->SyllabusLecSrc != Inf_NONE) ||
(IndicatorsCrs->SyllabusPraSrc != Inf_NONE) ||
(IndicatorsCrs->TeachingGuideSrc != Inf_NONE);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs->ThereIsSyllabus)
IndicatorsCrs->NumIndicators++;
2014-12-01 23:55:08 +01:00
2016-06-09 11:50:24 +02:00
/***** Indicator #2: information about assignments *****/
IndicatorsCrs->NumAssignments = Asg_GetNumAssignmentsInCrs (CrsCod);
2020-04-12 21:33:02 +02:00
IndicatorsCrs->NumFilesAssignments = Ind_GetNumFilesInAssigZonesOfCrsFromDB (CrsCod);
IndicatorsCrs->NumFilesWorks = Ind_GetNumFilesInWorksZonesOfCrsFromDB (CrsCod);
IndicatorsCrs->ThereAreAssignments = (IndicatorsCrs->NumAssignments != 0) ||
(IndicatorsCrs->NumFilesAssignments != 0) ||
(IndicatorsCrs->NumFilesWorks != 0);
if (IndicatorsCrs->ThereAreAssignments)
IndicatorsCrs->NumIndicators++;
2014-12-01 23:55:08 +01:00
2016-06-09 11:50:24 +02:00
/***** Indicator #3: information about online tutoring *****/
2020-04-12 21:33:02 +02:00
IndicatorsCrs->NumThreads = For_GetNumTotalThrsInForumsOfType (For_FORUM_COURSE_USRS,-1L,-1L,-1L,-1L,CrsCod);
IndicatorsCrs->NumPosts = For_GetNumTotalPstsInForumsOfType (For_FORUM_COURSE_USRS,-1L,-1L,-1L,-1L,CrsCod,&(IndicatorsCrs->NumUsrsToBeNotifiedByEMail));
IndicatorsCrs->NumMsgsSentByTchs = Msg_GetNumMsgsSentByTchsCrs (CrsCod);
IndicatorsCrs->ThereIsOnlineTutoring = (IndicatorsCrs->NumThreads != 0) ||
(IndicatorsCrs->NumPosts != 0) ||
(IndicatorsCrs->NumMsgsSentByTchs != 0);
if (IndicatorsCrs->ThereIsOnlineTutoring)
IndicatorsCrs->NumIndicators++;
2014-12-01 23:55:08 +01:00
2016-06-09 11:50:24 +02:00
/***** Indicator #4: information about materials *****/
2020-04-12 21:33:02 +02:00
IndicatorsCrs->ThereAreMaterials = (IndicatorsCrs->NumFilesInDocumentZones != 0) ||
(IndicatorsCrs->NumFilesInSharedZones != 0);
if (IndicatorsCrs->ThereAreMaterials)
IndicatorsCrs->NumIndicators++;
2014-12-01 23:55:08 +01:00
2016-06-09 11:50:24 +02:00
/***** Indicator #5: information about assessment *****/
2020-04-12 21:33:02 +02:00
IndicatorsCrs->AssessmentSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_ASSESSMENT);
IndicatorsCrs->ThereIsAssessment = (IndicatorsCrs->AssessmentSrc != Inf_NONE) ||
(IndicatorsCrs->TeachingGuideSrc != Inf_NONE);
2020-04-12 21:33:02 +02:00
if (IndicatorsCrs->ThereIsAssessment)
IndicatorsCrs->NumIndicators++;
2014-12-01 23:55:08 +01:00
2016-06-09 11:50:24 +02:00
/***** All the indicators are OK? *****/
2020-04-12 21:33:02 +02:00
IndicatorsCrs->CoursePartiallyOK = IndicatorsCrs->NumIndicators >= 1 &&
IndicatorsCrs->NumIndicators < Ind_NUM_INDICATORS;
IndicatorsCrs->CourseAllOK = IndicatorsCrs->NumIndicators == Ind_NUM_INDICATORS;
2016-06-09 11:50:24 +02:00
/***** Update number of indicators into database
if different to the stored one *****/
2020-04-12 21:33:02 +02:00
if (NumIndicatorsFromDB != (int) IndicatorsCrs->NumIndicators)
Ind_StoreIndicatorsCrsIntoDB (CrsCod,IndicatorsCrs->NumIndicators);
2014-12-01 23:55:08 +01:00
}
/*****************************************************************************/
2016-06-08 18:41:32 +02:00
/*********** Get the number of files in document zones of a course ***********/
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
static unsigned Ind_GetNumFilesInDocumZonesOfCrsFromDB (long CrsCod)
2014-12-01 23:55:08 +01:00
{
2015-01-25 23:40:07 +01:00
extern const Brw_FileBrowser_t Brw_FileBrowserForDB_files[Brw_NUM_TYPES_FILE_BROWSER];
2016-06-08 18:41:32 +02:00
/***** Get number of files in document zones of a course from database *****/
return DB_QuerySELECTUnsigned ("can not get the number of files",
"SELECT"
" (SELECT COALESCE(SUM(NumFiles),0)"
" FROM brw_sizes"
" WHERE FileBrowser=%u AND Cod=%ld) +"
" (SELECT COALESCE(SUM(brw_sizes.NumFiles),0)"
" FROM grp_types,"
"grp_groups,"
"brw_sizes"
" WHERE grp_types.CrsCod=%ld"
" AND grp_types.GrpTypCod=grp_groups.GrpTypCod"
" AND brw_sizes.FileBrowser=%u"
" AND brw_sizes.Cod=grp_groups.GrpCod)",
(unsigned) Brw_FileBrowserForDB_files[Brw_ADMI_DOC_CRS],
CrsCod,
CrsCod,
(unsigned) Brw_FileBrowserForDB_files[Brw_ADMI_DOC_GRP]);
2016-06-08 18:41:32 +02:00
}
/*****************************************************************************/
/*********** Get the number of files in shared zones of a course ***********/
/*****************************************************************************/
static unsigned Ind_GetNumFilesInShareZonesOfCrsFromDB (long CrsCod)
2016-06-08 18:41:32 +02:00
{
extern const Brw_FileBrowser_t Brw_FileBrowserForDB_files[Brw_NUM_TYPES_FILE_BROWSER];
/***** Get number of files in document zones of a course from database *****/
return DB_QuerySELECTUnsigned ("can not get the number of files",
"SELECT"
" (SELECT COALESCE(SUM(NumFiles),0)"
" FROM brw_sizes"
" WHERE FileBrowser=%u AND Cod=%ld) +"
" (SELECT COALESCE(SUM(brw_sizes.NumFiles),0)"
" FROM grp_types,"
"grp_groups,"
"brw_sizes"
" WHERE grp_types.CrsCod=%ld"
" AND grp_types.GrpTypCod=grp_groups.GrpTypCod"
" AND brw_sizes.FileBrowser=%u"
" AND brw_sizes.Cod=grp_groups.GrpCod)",
(unsigned) Brw_FileBrowserForDB_files[Brw_ADMI_SHR_CRS],
CrsCod,
CrsCod,
(unsigned) Brw_FileBrowserForDB_files[Brw_ADMI_SHR_GRP]);
2016-06-08 18:41:32 +02:00
}
/*****************************************************************************/
/********* Get the number of files in assignment zones of a course ***********/
/*****************************************************************************/
static unsigned Ind_GetNumFilesInAssigZonesOfCrsFromDB (long CrsCod)
2016-06-08 18:41:32 +02:00
{
extern const Brw_FileBrowser_t Brw_FileBrowserForDB_files[Brw_NUM_TYPES_FILE_BROWSER];
/***** Get number of files in document zones of a course from database *****/
return DB_QuerySELECTUnsigned ("can not get the number of files",
"SELECT COALESCE(SUM(NumFiles),0)"
" FROM brw_sizes"
" WHERE FileBrowser=%u"
" AND Cod=%ld",
(unsigned) Brw_FileBrowserForDB_files[Brw_ADMI_ASG_USR],
CrsCod);
2016-06-08 18:41:32 +02:00
}
/*****************************************************************************/
/************* Get the number of files in works zones of a course ************/
/*****************************************************************************/
static unsigned Ind_GetNumFilesInWorksZonesOfCrsFromDB (long CrsCod)
2016-06-08 18:41:32 +02:00
{
extern const Brw_FileBrowser_t Brw_FileBrowserForDB_files[Brw_NUM_TYPES_FILE_BROWSER];
2014-12-01 23:55:08 +01:00
2016-06-08 18:41:32 +02:00
/***** Get number of files in document zones of a course from database *****/
return DB_QuerySELECTUnsigned ("can not get the number of files",
"SELECT COALESCE(SUM(NumFiles),0)"
" FROM brw_sizes"
" WHERE FileBrowser=%u"
" AND Cod=%ld",
(unsigned) Brw_FileBrowserForDB_files[Brw_ADMI_WRK_USR],
CrsCod);
2014-12-01 23:55:08 +01:00
}