Version 14.115.1

This commit is contained in:
Antonio Cañas Vargas 2015-06-23 19:33:13 +02:00
parent dc82f3e120
commit 9ea98ca9ef
2 changed files with 35 additions and 9 deletions

View File

@ -103,11 +103,12 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 14.115 (2015/06/16)" #define Log_PLATFORM_VERSION "SWAD 14.115.1 (2015/06/23)"
// Number of lines (includes comments but not blank lines) has been got with the following command: // Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/* /*
Version 14.115.1: Jun 23, 2015 Fixed bugs in web service function getTrivialQuestion. (184768 lines)
Version 14.115: Jun 16, 2015 New function getTrivialQuestion in web service. (184747 lines) Version 14.115: Jun 16, 2015 New function getTrivialQuestion in web service. (184747 lines)
Version 14.114: Jun 15, 2015 Fixed bug in tests query (some questions were repeated in exams). (184550 lines) Version 14.114: Jun 15, 2015 Fixed bug in tests query (some questions were repeated in exams). (184550 lines)
Version 14.113.5: Jun 01, 2015 Changes in sign up form. (184541 lines) Version 14.113.5: Jun 01, 2015 Changes in sign up form. (184541 lines)

View File

@ -792,7 +792,6 @@ int swad__loginByUserPasswordKey (struct soap *soap,
/***** Generate a key used in subsequents calls to other web services *****/ /***** Generate a key used in subsequents calls to other web services *****/
if ((ReturnCode = Svc_GenerateNewWSKey ((long) loginByUserPasswordKeyOut->userCode,loginByUserPasswordKeyOut->wsKey)) != SOAP_OK) if ((ReturnCode = Svc_GenerateNewWSKey ((long) loginByUserPasswordKeyOut->userCode,loginByUserPasswordKeyOut->wsKey)) != SOAP_OK)
return ReturnCode; return ReturnCode;
return SOAP_OK; return SOAP_OK;
} }
else else
@ -3548,9 +3547,11 @@ int swad__getTrivialQuestion (struct soap *soap,
{ {
extern const char *Tst_StrAnswerTypesXML[Tst_NUM_ANS_TYPES]; extern const char *Tst_StrAnswerTypesXML[Tst_NUM_ANS_TYPES];
int ReturnCode; int ReturnCode;
char DegreesStr[1024];
const char *Ptr; const char *Ptr;
char LongStr[1+10+1]; char LongStr[1+10+1];
char DegreesStr[1024];
char DegStr[ 1+1+1+ 10 +1+ 1];
// DegStr=", ' - number ' \0"
long DegCod; long DegCod;
bool FirstDegree = true; bool FirstDegree = true;
char Query[4096]; char Query[4096];
@ -3582,6 +3583,15 @@ int swad__getTrivialQuestion (struct soap *soap,
/***** Loop over recipients' nicknames building query *****/ /***** Loop over recipients' nicknames building query *****/
DegreesStr[0] = '\0'; DegreesStr[0] = '\0';
Ptr = degrees; Ptr = degrees;
if (Gbl.Usrs.Me.UsrDat.UsrCod == 19543)
{
char QueryDebug[512*1024];
sprintf (QueryDebug,"INSERT INTO debug (DebugTime,Txt) VALUES (NOW(),'degrees = %s')",degrees);
DB_QueryINSERT (QueryDebug,"Error inserting in debug table");
}
while (*Ptr) while (*Ptr)
{ {
/* Find next string in text until comma (leading and trailing spaces are removed) */ /* Find next string in text until comma (leading and trailing spaces are removed) */
@ -3591,18 +3601,17 @@ int swad__getTrivialQuestion (struct soap *soap,
if (sscanf (LongStr,"%ld",&DegCod) == 1) // Degree code if (sscanf (LongStr,"%ld",&DegCod) == 1) // Degree code
if (DegCod > 0) if (DegCod > 0)
{ {
sprintf (LongStr,"%ld",DegCod);
/* Add this degree to query */ /* Add this degree to query */
if (FirstDegree) if (FirstDegree)
{ {
strcat (Query,"'"); sprintf (DegreesStr,"'%ld'",DegCod);
FirstDegree = false; FirstDegree = false;
} }
else else
strcat (Query,",'"); {
strcat (Query,LongStr); sprintf (DegStr,",'%ld'",DegCod);
strcat (Query,"'"); strcat (DegreesStr,DegStr);
}
} }
} }
@ -3647,6 +3656,14 @@ int swad__getTrivialQuestion (struct soap *soap,
if (NumRows == 1) // Question found if (NumRows == 1) // Question found
{ {
if (Gbl.Usrs.Me.UsrDat.UsrCod == 19543)
{
char QueryDebug[512*1024];
sprintf (QueryDebug,"INSERT INTO debug (DebugTime,Txt) VALUES (NOW(),'Una pregunta devuelta')");
DB_QueryINSERT (QueryDebug,"Error inserting in debug table");
}
/* Get next question */ /* Get next question */
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -3676,6 +3693,14 @@ int swad__getTrivialQuestion (struct soap *soap,
} }
else // Empty question else // Empty question
{ {
if (Gbl.Usrs.Me.UsrDat.UsrCod == 19543)
{
char QueryDebug[512*1024];
sprintf (QueryDebug,"INSERT INTO debug (DebugTime,Txt) VALUES (NOW(),'Ninguna pregunta devuelta')");
DB_QueryINSERT (QueryDebug,"Error inserting in debug table");
}
/* Question code (row[0]) */ /* Question code (row[0]) */
QstCod = -1L; QstCod = -1L;
getTrivialQuestionOut->question.questionCode = -1; getTrivialQuestionOut->question.questionCode = -1;