Version 20.51.39: Mar 24, 2021 Calls for exams database table renamed.

This commit is contained in:
acanas 2021-03-24 10:35:42 +01:00
parent 7dc56a7c22
commit 5cd0023fdb
6 changed files with 32 additions and 27 deletions

View File

@ -216,9 +216,9 @@ CREATE TABLE IF NOT EXISTS brw_views (
NumViews INT NOT NULL DEFAULT 0,
UNIQUE INDEX(FilCod,UsrCod),INDEX(UsrCod));
--
-- Table cfe_calls_for_exams: stores the calls for examination
-- Table cfe_exams: stores the calls for exams
--
CREATE TABLE IF NOT EXISTS cfe_calls_for_exams (
CREATE TABLE IF NOT EXISTS cfe_exams (
ExaCod INT NOT NULL AUTO_INCREMENT,
CrsCod INT NOT NULL DEFAULT -1,
Status TINYINT NOT NULL DEFAULT 0,

View File

@ -51,7 +51,7 @@ extern struct Globals Gbl;
/*****************************************************************************/
static void RSS_WriteNotices (FILE *FileRSS,struct Crs_Course *Crs);
static void RSS_WriteExamAnnouncements (FILE *FileRSS,struct Crs_Course *Crs);
static void RSS_WriteCallsForExams (FILE *FileRSS,struct Crs_Course *Crs);
/*****************************************************************************/
/******* Update RSS archive with active notices in the current course ********/
@ -129,7 +129,7 @@ void RSS_UpdateRSSFileForACrs (struct Crs_Course *Crs)
RSS_WriteNotices (FileRSS,Crs);
/***** Write exam announcements as RSS items *****/
RSS_WriteExamAnnouncements (FileRSS,Crs);
RSS_WriteCallsForExams (FileRSS,Crs);
/***** Write channel footer *****/
fprintf (FileRSS,"</channel>\n");
@ -241,10 +241,10 @@ static void RSS_WriteNotices (FILE *FileRSS,struct Crs_Course *Crs)
}
/*****************************************************************************/
/******** Write exam announcements of a course as items of RSS file **********/
/********** Write calls for exams of a course as items of RSS file ***********/
/*****************************************************************************/
static void RSS_WriteExamAnnouncements (FILE *FileRSS,struct Crs_Course *Crs)
static void RSS_WriteCallsForExams (FILE *FileRSS,struct Crs_Course *Crs)
{
extern const char *Txt_Exam;
MYSQL_RES *mysql_res;
@ -253,17 +253,18 @@ static void RSS_WriteExamAnnouncements (FILE *FileRSS,struct Crs_Course *Crs)
struct tm *tm;
time_t CallTimeUTC;
long ExaCod;
unsigned long NumExa,NumExamAnnouncements;
unsigned long NumExa;
unsigned long NumExams;
if (Gbl.DB.DatabaseIsOpen)
{
/***** Get exam announcements (only future exams) in current course from database *****/
NumExamAnnouncements =
DB_QuerySELECT (&mysql_res,"can not get exam announcements",
NumExams =
DB_QuerySELECT (&mysql_res,"can not get calls for exams",
"SELECT ExaCod," // row[0]
"UNIX_TIMESTAMP(CallDate) AS T," // row[1]
"DATE_FORMAT(ExamDate,'%%d/%%m/%%Y %%H:%%i')" // row[2]
" FROM cfe_calls_for_exams"
" FROM cfe_exams"
" WHERE CrsCod=%ld"
" AND Status=%u"
" AND ExamDate>=NOW()"
@ -272,12 +273,12 @@ static void RSS_WriteExamAnnouncements (FILE *FileRSS,struct Crs_Course *Crs)
(unsigned) Cfe_VISIBLE_CALL_FOR_EXAM);
/***** Write items with notices *****/
if (NumExamAnnouncements)
if (NumExams)
{
Usr_UsrDataConstructor (&UsrDat);
for (NumExa = 0;
NumExa < NumExamAnnouncements;
NumExa < NumExams;
NumExa++)
{
/***** Get data of the exam announcement *****/

View File

@ -400,7 +400,7 @@ static void Cfe_UpdateNumUsrsNotifiedByEMailAboutCallForExam (long ExaCod,
/***** Update number of users notified *****/
DB_QueryUPDATE ("can not update the number of notifications"
" of a call for exam",
"UPDATE cfe_calls_for_exams"
"UPDATE cfe_exams"
" SET NumNotif=NumNotif+%u"
" WHERE ExaCod=%ld",
NumUsrsToBeNotifiedByEMail,ExaCod);
@ -492,7 +492,7 @@ void Cfe_RemoveCallForExam1 (void)
/***** Mark the call for exam as deleted in the database *****/
DB_QueryUPDATE ("can not remove call for exam",
"UPDATE cfe_calls_for_exams"
"UPDATE cfe_exams"
" SET Status=%u"
" WHERE ExaCod=%ld"
" AND CrsCod=%ld",
@ -540,7 +540,7 @@ void Cfe_HideCallForExam (void)
/***** Mark the call for exam as hidden in the database *****/
DB_QueryUPDATE ("can not hide call for exam",
"UPDATE cfe_calls_for_exams"
"UPDATE cfe_exams"
" SET Status=%u"
" WHERE ExaCod=%ld"
" AND CrsCod=%ld",
@ -571,7 +571,7 @@ void Cfe_UnhideCallForExam (void)
/***** Mark the call for exam as visible in the database *****/
DB_QueryUPDATE ("can not unhide call for exam",
"UPDATE cfe_calls_for_exams"
"UPDATE cfe_exams"
" SET Status=%u"
" WHERE ExaCod=%ld"
" AND CrsCod=%ld",
@ -704,7 +704,7 @@ static void Cfe_ListCallsForExams (struct Cfe_CallsForExams *CallsForExams,
NumExaAnns = DB_QuerySELECT (&mysql_res,"can not get calls for exams"
" in this course for listing",
"SELECT ExaCod" // row[0]
" FROM cfe_calls_for_exams"
" FROM cfe_exams"
" WHERE CrsCod=%ld"
" AND %s"
" ORDER BY ExamDate DESC",
@ -808,7 +808,7 @@ static long Cfe_AddCallForExamToDB (const struct Cfe_CallsForExams *CallsForExam
/***** Add call for exam *****/
ExaCod =
DB_QueryINSERTandReturnCode ("can not create a new call for exam",
"INSERT INTO cfe_calls_for_exams "
"INSERT INTO cfe_exams "
"(CrsCod,Status,NumNotif,CrsFullName,Year,ExamSession,"
"CallDate,ExamDate,Duration,"
"Place,ExamMode,Structure,DocRequired,MatRequired,MatAllowed,OtherInfo)"
@ -848,7 +848,7 @@ static void Cfe_ModifyCallForExamInDB (const struct Cfe_CallsForExams *CallsForE
{
/***** Modify call for exam *****/
DB_QueryUPDATE ("can not update a call for exam",
"UPDATE cfe_calls_for_exams"
"UPDATE cfe_exams"
" SET CrsFullName='%s',"
"Year=%u,"
"ExamSession='%s',"
@ -902,7 +902,7 @@ void Cfe_CreateListCallsForExams (struct Cfe_CallsForExams *CallsForExams)
" in this course",
"SELECT ExaCod," // row[0]
"DATE(ExamDate)" // row[1]
" FROM cfe_calls_for_exams"
" FROM cfe_exams"
" WHERE CrsCod=%ld AND Status=%u"
" ORDER BY ExamDate DESC",
Gbl.Hierarchy.Crs.CrsCod,
@ -992,7 +992,7 @@ static void Cfe_GetDataCallForExamFromDB (struct Cfe_CallsForExams *CallsForExam
"MatRequired," // row[12]
"MatAllowed," // row[13]
"OtherInfo" // row[14]
" FROM cfe_calls_for_exams"
" FROM cfe_exams"
" WHERE ExaCod=%ld",
ExaCod);

View File

@ -600,14 +600,18 @@ TODO: Salvador Romero Cort
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
*/
#define Log_PLATFORM_VERSION "SWAD 20.51.38 (2021-03-24)"
#define Log_PLATFORM_VERSION "SWAD 20.51.39 (2021-03-24)"
#define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.6.2.js"
/*
TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
Version 20.51.38: Mar 24, 2021 API keys database table renamed. (? lines)
Version 20.51.39: Mar 24, 2021 Calls for exams database table renamed. (308655 lines)
1 change necessary in database:
RENAME TABLE cfe_calls_for_exams TO cfe_exams;
Version 20.51.38: Mar 24, 2021 API keys database table renamed. (308651 lines)
1 change necessary in database:
RENAME TABLE API_keys TO api_keys;

View File

@ -1951,7 +1951,7 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
/***** Remove exam announcements in the course *****/
/* Mark all exam announcements in the course as deleted */
DB_QueryUPDATE ("can not remove exam announcements of a course",
"UPDATE cfe_calls_for_exams"
"UPDATE cfe_exams"
" SET Status=%u"
" WHERE CrsCod=%ld",
(unsigned) Cfe_DELETED_CALL_FOR_EXAM,CrsCod);

View File

@ -545,9 +545,9 @@ mysql> DESCRIBE brw_views;
"UNIQUE INDEX(FilCod,UsrCod),"
"INDEX(UsrCod))");
/***** Table cfe_calls_for_exams *****/
/***** Table cfe_exams *****/
/*
mysql> DESCRIBE cfe_calls_for_exams;
mysql> DESCRIBE cfe_exams;
+-------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+---------------+------+-----+---------+----------------+
@ -571,7 +571,7 @@ mysql> DESCRIBE cfe_calls_for_exams;
+-------------+---------------+------+-----+---------+----------------+
17 rows in set (0,00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS cfe_calls_for_exams ("
DB_CreateTable ("CREATE TABLE IF NOT EXISTS cfe_exams ("
"ExaCod INT NOT NULL AUTO_INCREMENT,"
"CrsCod INT NOT NULL DEFAULT -1,"
"Status TINYINT NOT NULL DEFAULT 0,"