mirror of https://github.com/acanas/swad-core.git
Version19.183.2
This commit is contained in:
parent
ce307b0d6b
commit
23c7e8baf5
|
@ -13303,4 +13303,23 @@ Si se quieren eliminar todos los datos de una partici
|
||||||
ALTER TABLE log TRUNCATE PARTITION p2014;
|
ALTER TABLE log TRUNCATE PARTITION p2014;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Cambios realizados el 14 de abril de 2020
|
||||||
|
// Ahora la pareja ExaCod,QstCod deben ser única en la tabla tst_exam_questions.
|
||||||
|
// Detecté los siguientes exámenes que tenían preguntas repetidas, y los eliminé de la tabla tst_exam_questions pero no de tst_exams;
|
||||||
|
|
||||||
|
SELECT DISTINCT (ExaCod) FROM (SELECT ExaCod,COUNT(*) AS N FROM tst_exam_questions GROUP BY ExaCod,QstCod HAVING N>1) AS E;
|
||||||
|
|
||||||
|
SELECT * FROM tst_exam_questions WHERE ExaCod IN (138946,149939,153732,155072,158845,160028,163616,163617,165036,176633,177040,177140,177221,180469,182532,189061,189169,189179,189207,189245,189273,200335,200336,200337,203975,205562,206021,207224,215085,218272,218294,218300,218317,218665,218851,218869,218880,218955,219045,219074,219082,219086,219089,219092,219095,219097,219104,219107,219189,252548,252549,252550,259574,259825);
|
||||||
|
|
||||||
|
DELETE FROM tst_exam_questions WHERE ExaCod IN (138946,149939,153732,155072,158845,160028,163616,163617,165036,176633,177040,177140,177221,180469,182532,189061,189169,189179,189207,189245,189273,200335,200336,200337,203975,205562,206021,207224,215085,218272,218294,218300,218317,218665,218851,218869,218880,218955,219045,219074,219082,219086,219089,219092,219095,219097,219104,219107,219189,252548,252549,252550,259574,259825);
|
||||||
|
|
||||||
|
SELECT ExaCod,CrsCod FROM tst_exams WHERE ExaCod IN (138946,149939,153732,155072,158845,160028,163616,163617,165036,176633,177040,177140,177221,180469,182532,189061,189169,189179,189207,189245,189273,200335,200336,200337,203975,205562,206021,207224,215085,218272,218294,218300,218317,218665,218851,218869,218880,218955,219045,219074,219082,219086,219089,219092,219095,219097,219104,219107,219189,252548,252549,252550,259574,259825);
|
||||||
|
|
||||||
|
SELECT * FROM tst_exams WHERE ExaCod IN (138946,149939,153732,155072,158845,160028,163616,163617,165036,176633,177040,177140,177221,180469,182532,189061,189169,189179,189207,189245,189273,200335,200336,200337,203975,205562,206021,207224,215085,218272,218294,218300,218317,218665,218851,218869,218880,218955,219045,219074,219082,219086,219089,219092,219095,219097,219104,219107,219189,252548,252549,252550,259574,259825);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -497,7 +497,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
||||||
En OpenSWAD:
|
En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 19.183.1 (2020-04-14)"
|
#define Log_PLATFORM_VERSION "SWAD 19.183.2 (2020-04-14)"
|
||||||
#define CSS_FILE "swad19.146.css"
|
#define CSS_FILE "swad19.146.css"
|
||||||
#define JS_FILE "swad19.172.1.js"
|
#define JS_FILE "swad19.172.1.js"
|
||||||
/*
|
/*
|
||||||
|
@ -548,6 +548,7 @@ Funci
|
||||||
// TODO: Oresti Baños: cambiar ojos por candados en descriptores para prohibir/permitir y dejar los ojos para poder elegir descriptores
|
// TODO: Oresti Baños: cambiar ojos por candados en descriptores para prohibir/permitir y dejar los ojos para poder elegir descriptores
|
||||||
// TODO: Integrar pull requests con traducciones del alemán del usuario eruedin en GitHub
|
// TODO: Integrar pull requests con traducciones del alemán del usuario eruedin en GitHub
|
||||||
|
|
||||||
|
Version 19.183.2: Apr 14, 2020 Fixed bug in test exams. (285684 lines)
|
||||||
Version 19.183.1: Apr 14, 2020 Fixed bug in forums, reported by Javier Fernández Baldomero. (285677 lines)
|
Version 19.183.1: Apr 14, 2020 Fixed bug in forums, reported by Javier Fernández Baldomero. (285677 lines)
|
||||||
Version 19.183: Apr 13, 2020 Code refactoring in holidays. (285689 lines)
|
Version 19.183: Apr 13, 2020 Code refactoring in holidays. (285689 lines)
|
||||||
Version 19.182: Apr 13, 2020 Code refactoring in places. (285685 lines)
|
Version 19.182: Apr 13, 2020 Code refactoring in places. (285685 lines)
|
||||||
|
@ -672,7 +673,7 @@ ALTER TABLE tst_exams CHANGE COLUMN EndTime EndTime DATETIME NOT NULL;
|
||||||
Version 19.148: Mar 17, 2020 Code refactoring in tests.
|
Version 19.148: Mar 17, 2020 Code refactoring in tests.
|
||||||
New actions to remove several test questions. (282868 lines)
|
New actions to remove several test questions. (282868 lines)
|
||||||
Version 19.147: Mar 14, 2020 Change MathJax to version 3.0.1. (282550 lines)
|
Version 19.147: Mar 14, 2020 Change MathJax to version 3.0.1. (282550 lines)
|
||||||
Install MathJax 3.0.1
|
Install MathJax 3.0.1 or later
|
||||||
Copy the following JavaScript file to public directory:
|
Copy the following JavaScript file to public directory:
|
||||||
sudo cp js/mathjax-config.js /var/www/html/swad/
|
sudo cp js/mathjax-config.js /var/www/html/swad/
|
||||||
|
|
||||||
|
|
|
@ -4546,7 +4546,7 @@ bool Tst_GetQstDataFromDB (struct Tst_Question *Question)
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get edition time (row[0] holds the start UTC time) */
|
/* Get edition time (row[0] holds the start UTC time) */
|
||||||
Question->EditTime = Dat_GetUNIXTimeFromStr (row[3]);
|
Question->EditTime = Dat_GetUNIXTimeFromStr (row[0]);
|
||||||
|
|
||||||
/* Get the type of answer (row[1]) */
|
/* Get the type of answer (row[1]) */
|
||||||
Question->Answer.Type = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[1]);
|
Question->Answer.Type = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[1]);
|
||||||
|
|
|
@ -1811,7 +1811,7 @@ static void TstExa_ShowExams (struct UsrData *UsrDat)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HTM_TD_ColouredEmpty (7);
|
HTM_TD_ColouredEmpty (8);
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2296,10 +2296,11 @@ void TstExa_GetExamQuestionsFromDB (struct TstExa_Exam *Exam)
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
unsigned NumQsts;
|
||||||
unsigned NumQst;
|
unsigned NumQst;
|
||||||
|
|
||||||
/***** Get questions of a test exam from database *****/
|
/***** Get questions of a test exam from database *****/
|
||||||
Exam->NumQsts =
|
NumQsts =
|
||||||
(unsigned) DB_QuerySELECT (&mysql_res,"can not get questions"
|
(unsigned) DB_QuerySELECT (&mysql_res,"can not get questions"
|
||||||
" of a test exam",
|
" of a test exam",
|
||||||
"SELECT QstCod," // row[0]
|
"SELECT QstCod," // row[0]
|
||||||
|
@ -2310,33 +2311,39 @@ void TstExa_GetExamQuestionsFromDB (struct TstExa_Exam *Exam)
|
||||||
" ORDER BY QstInd",
|
" ORDER BY QstInd",
|
||||||
Exam->ExaCod);
|
Exam->ExaCod);
|
||||||
|
|
||||||
/***** Get questions codes *****/
|
/***** List questions *****/
|
||||||
for (NumQst = 0;
|
// The number of questions in table of exam questions
|
||||||
NumQst < Exam->NumQsts;
|
// should match the number of questions got from exam
|
||||||
NumQst++)
|
if (NumQsts == Exam->NumQsts)
|
||||||
{
|
for (NumQst = 0;
|
||||||
row = mysql_fetch_row (mysql_res);
|
NumQst < NumQsts;
|
||||||
|
NumQst++)
|
||||||
|
{
|
||||||
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get question code */
|
/* Get question code */
|
||||||
if ((Exam->Questions[NumQst].QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Exam->Questions[NumQst].QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of question.");
|
Lay_ShowErrorAndExit ("Wrong code of question.");
|
||||||
|
|
||||||
/* Get indexes for this question (row[1]) */
|
/* Get indexes for this question (row[1]) */
|
||||||
Str_Copy (Exam->Questions[NumQst].StrIndexes,row[1],
|
Str_Copy (Exam->Questions[NumQst].StrIndexes,row[1],
|
||||||
TstExa_MAX_BYTES_INDEXES_ONE_QST);
|
TstExa_MAX_BYTES_INDEXES_ONE_QST);
|
||||||
|
|
||||||
/* Get answers selected by user for this question (row[2]) */
|
/* Get answers selected by user for this question (row[2]) */
|
||||||
Str_Copy (Exam->Questions[NumQst].StrAnswers,row[2],
|
Str_Copy (Exam->Questions[NumQst].StrAnswers,row[2],
|
||||||
TstExa_MAX_BYTES_ANSWERS_ONE_QST);
|
TstExa_MAX_BYTES_ANSWERS_ONE_QST);
|
||||||
|
|
||||||
/* Replace each comma by a separator of multiple parameters */
|
/* Replace each comma by a separator of multiple parameters */
|
||||||
/* In database commas are used as separators instead of special chars */
|
/* In database commas are used as separators instead of special chars */
|
||||||
Par_ReplaceCommaBySeparatorMultiple (Exam->Questions[NumQst].StrIndexes);
|
Par_ReplaceCommaBySeparatorMultiple (Exam->Questions[NumQst].StrIndexes);
|
||||||
Par_ReplaceCommaBySeparatorMultiple (Exam->Questions[NumQst].StrAnswers);
|
Par_ReplaceCommaBySeparatorMultiple (Exam->Questions[NumQst].StrAnswers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
|
if (NumQsts != Exam->NumQsts)
|
||||||
|
Lay_ShowErrorAndExit ("Wrong exam.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue