mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-06 16:55:22 +02:00
Version 21.46.2: Oct 26, 2021 Queries moved to module swad_test_database.
This commit is contained in:
parent
d38b53b196
commit
5ad59021f1
|
@ -602,14 +602,15 @@ TODO: FIX BUG, URGENT! En las fechas como par
|
||||||
|
|
||||||
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
|
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 21.46.1 (2021-10-26)"
|
#define Log_PLATFORM_VERSION "SWAD 21.46.2 (2021-10-26)"
|
||||||
#define CSS_FILE "swad20.45.css"
|
#define CSS_FILE "swad20.45.css"
|
||||||
#define JS_FILE "swad20.69.1.js"
|
#define JS_FILE "swad20.69.1.js"
|
||||||
/*
|
/*
|
||||||
TODO: Rename CENTRE to CENTER in help wiki.
|
TODO: Rename CENTRE to CENTER in help wiki.
|
||||||
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
||||||
|
|
||||||
Version 21.46.1: Oct 26, 2021 Queries moved to module swad_test_database. (? lines)
|
Version 21.46.2: Oct 26, 2021 Queries moved to module swad_test_database. (321062 lines)
|
||||||
|
Version 21.46.1: Oct 26, 2021 Queries moved to module swad_test_database. (321058 lines)
|
||||||
Version 21.46: Oct 26, 2021 New module swad_test_database for database queries related to self-assessment tests. (321036 lines)
|
Version 21.46: Oct 26, 2021 New module swad_test_database for database queries related to self-assessment tests. (321036 lines)
|
||||||
Version 21.45.1: Oct 25, 2021 Code refactoring in test questions. (320932 lines)
|
Version 21.45.1: Oct 25, 2021 Code refactoring in test questions. (320932 lines)
|
||||||
Version 21.45: Oct 25, 2021 Functions moved to module swad_question. (320930 lines)
|
Version 21.45: Oct 25, 2021 Functions moved to module swad_question. (320930 lines)
|
||||||
|
|
|
@ -1354,7 +1354,7 @@ static void ExaSet_CopyQstFromBankToExamSet (const struct ExaSet_Set *Set,long Q
|
||||||
QstCodInSet = Exa_DB_AddQuestionToSet (Set->SetCod,&Question,CloneMedCod);
|
QstCodInSet = Exa_DB_AddQuestionToSet (Set->SetCod,&Question,CloneMedCod);
|
||||||
|
|
||||||
/***** Get the answers from the database *****/
|
/***** Get the answers from the database *****/
|
||||||
Qst_GetAnswersQst (&Question,&mysql_res,
|
Question.Answer.NumOptions = Qst_DB_GetAnswersQst (&mysql_res,&Question,
|
||||||
false); // Don't shuffle
|
false); // Don't shuffle
|
||||||
/*
|
/*
|
||||||
row[0] AnsInd
|
row[0] AnsInd
|
||||||
|
|
|
@ -1402,11 +1402,14 @@ unsigned Qst_DB_GetNumAnswersQst (long QstCod)
|
||||||
/***************** Get answers of a question from database *******************/
|
/***************** Get answers of a question from database *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Qst_GetAnswersQst (struct Qst_Question *Question,MYSQL_RES **mysql_res,
|
unsigned Qst_DB_GetAnswersQst (MYSQL_RES **mysql_res,
|
||||||
|
const struct Qst_Question *Question,
|
||||||
bool Shuffle)
|
bool Shuffle)
|
||||||
{
|
{
|
||||||
|
unsigned NumOptions;
|
||||||
|
|
||||||
/***** Get answers of a question from database *****/
|
/***** Get answers of a question from database *****/
|
||||||
Question->Answer.NumOptions = (unsigned)
|
if (!(NumOptions = (unsigned)
|
||||||
DB_QuerySELECT (mysql_res,"can not get answers of a question",
|
DB_QuerySELECT (mysql_res,"can not get answers of a question",
|
||||||
"SELECT AnsInd," // row[0]
|
"SELECT AnsInd," // row[0]
|
||||||
"Answer," // row[1]
|
"Answer," // row[1]
|
||||||
|
@ -1418,9 +1421,10 @@ void Qst_GetAnswersQst (struct Qst_Question *Question,MYSQL_RES **mysql_res,
|
||||||
" ORDER BY %s",
|
" ORDER BY %s",
|
||||||
Question->QstCod,
|
Question->QstCod,
|
||||||
Shuffle ? "RAND()" :
|
Shuffle ? "RAND()" :
|
||||||
"AnsInd");
|
"AnsInd")))
|
||||||
if (!Question->Answer.NumOptions)
|
|
||||||
Err_WrongAnswerExit ();
|
Err_WrongAnswerExit ();
|
||||||
|
|
||||||
|
return NumOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2606,7 +2610,7 @@ bool Qst_GetQstDataFromDB (struct Qst_Question *Question)
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
/***** Get the answers from the database *****/
|
/***** Get the answers from the database *****/
|
||||||
Qst_GetAnswersQst (Question,&mysql_res,
|
Question->Answer.NumOptions = Qst_DB_GetAnswersQst (&mysql_res,Question,
|
||||||
false); // Don't shuffle
|
false); // Don't shuffle
|
||||||
/*
|
/*
|
||||||
row[0] AnsInd
|
row[0] AnsInd
|
||||||
|
|
|
@ -178,7 +178,8 @@ void Qst_WriteQuestionRowForSelection (unsigned QstInd,
|
||||||
void Qst_PutParamsEditQst (void *Questions);
|
void Qst_PutParamsEditQst (void *Questions);
|
||||||
|
|
||||||
unsigned Qst_DB_GetNumAnswersQst (long QstCod);
|
unsigned Qst_DB_GetNumAnswersQst (long QstCod);
|
||||||
void Qst_GetAnswersQst (struct Qst_Question *Question,MYSQL_RES **mysql_res,
|
unsigned Qst_DB_GetAnswersQst (MYSQL_RES **mysql_res,
|
||||||
|
const struct Qst_Question *Question,
|
||||||
bool Shuffle);
|
bool Shuffle);
|
||||||
|
|
||||||
void Qst_WriteAnswersBank (struct Qst_Question *Question,
|
void Qst_WriteAnswersBank (struct Qst_Question *Question,
|
||||||
|
|
|
@ -193,11 +193,11 @@ static void Tst_ShowFormRequestTest (struct Qst_Questions *Questions)
|
||||||
Qst_PutButtonToAddQuestion ();
|
Qst_PutButtonToAddQuestion ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** End box *****/
|
|
||||||
Box_BoxEnd ();
|
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
|
/***** End box *****/
|
||||||
|
Box_BoxEnd ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -582,7 +582,7 @@ static void Tst_GenerateChoiceIndexes (struct TstPrn_PrintedQuestion *PrintedQue
|
||||||
Question.QstCod = PrintedQuestion->QstCod;
|
Question.QstCod = PrintedQuestion->QstCod;
|
||||||
|
|
||||||
/***** Get answers of question from database *****/
|
/***** Get answers of question from database *****/
|
||||||
Qst_GetAnswersQst (&Question,&mysql_res,Shuffle);
|
Question.Answer.NumOptions = Qst_DB_GetAnswersQst (&mysql_res,&Question,Shuffle);
|
||||||
/*
|
/*
|
||||||
row[0] AnsInd
|
row[0] AnsInd
|
||||||
row[1] Answer
|
row[1] Answer
|
||||||
|
|
Loading…
Reference in New Issue
Block a user