Version 15.158.1

This commit is contained in:
Antonio Cañas Vargas 2016-03-21 02:13:19 +01:00
parent b5bca7d2f8
commit 694e87c368
3 changed files with 53 additions and 38 deletions

View File

@ -134,13 +134,14 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.158 (2016-03-21)" #define Log_PLATFORM_VERSION "SWAD 15.158.1 (2016-03-21)"
#define CSS_FILE "swad15.157.css" #define CSS_FILE "swad15.157.css"
#define JS_FILE "swad15.131.3.js" #define JS_FILE "swad15.131.3.js"
// 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 15.158.1: Mar 21, 2016 Button to add new test question. (196284 lines)
Version 15.158: Mar 21, 2016 Changes in layout of tests. (196274 lines) Version 15.158: Mar 21, 2016 Changes in layout of tests. (196274 lines)
Version 15.157.3: Mar 20, 2016 Changes in layout of tests. (196247 lines) Version 15.157.3: Mar 20, 2016 Changes in layout of tests. (196247 lines)
Version 15.157.2: Mar 20, 2016 Fixed bug in surveys. (196241 lines) Version 15.157.2: Mar 20, 2016 Fixed bug in surveys. (196241 lines)

View File

@ -149,6 +149,7 @@ static void Tst_UpdateScoreQst (long QstCod,float ScoreThisQst,bool AnswerIsNotB
static void Tst_UpdateMyNumAccessTst (unsigned NumAccessesTst); static void Tst_UpdateMyNumAccessTst (unsigned NumAccessesTst);
static void Tst_UpdateLastAccTst (void); static void Tst_UpdateLastAccTst (void);
static void Tst_PutFormToCreateNewTstQst (void); static void Tst_PutFormToCreateNewTstQst (void);
static void Tst_PutButtonToAddQuestion (void);
static long Tst_GetParamTagCode (void); static long Tst_GetParamTagCode (void);
static bool Tst_CheckIfCurrentCrsHasTestTags (void); static bool Tst_CheckIfCurrentCrsHasTestTags (void);
static unsigned long Tst_GetAllTagsFromCurrentCrs (MYSQL_RES **mysql_res); static unsigned long Tst_GetAllTagsFromCurrentCrs (MYSQL_RES **mysql_res);
@ -245,7 +246,7 @@ void Tst_ShowFormAskTst (void)
extern const char *Txt_Test; extern const char *Txt_Test;
extern const char *Txt_No_of_questions; extern const char *Txt_No_of_questions;
extern const char *Txt_Generate_exam; extern const char *Txt_Generate_exam;
extern const char *Txt_No_test_questions_in_X; extern const char *Txt_No_test_questions;
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
unsigned long NumRows; unsigned long NumRows;
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole == Rol_STUDENT || bool ICanEdit = (Gbl.Usrs.Me.LoggedRole == Rol_STUDENT ||
@ -309,9 +310,11 @@ void Tst_ShowFormAskTst (void)
} }
else else
{ {
sprintf (Gbl.Message,Txt_No_test_questions_in_X, /***** Warning message *****/
Gbl.CurrentCrs.Crs.FullName); Lay_ShowAlert (Lay_INFO,Txt_No_test_questions);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
/***** Button to create a new question *****/
Tst_PutButtonToAddQuestion ();
} }
/***** End frame *****/ /***** End frame *****/
@ -1107,7 +1110,7 @@ void Tst_SetIniEndDates (void)
void Tst_ShowFormAskEditTsts (void) void Tst_ShowFormAskEditTsts (void)
{ {
extern const char *Txt_No_test_questions_in_X; extern const char *Txt_No_test_questions;
extern const char *Txt_Questions; extern const char *Txt_Questions;
extern const char *Txt_Show_questions; extern const char *Txt_Show_questions;
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
@ -1120,18 +1123,12 @@ void Tst_ShowFormAskEditTsts (void)
Tst_PutFormToConfigure (); // Put form to go to test configuration Tst_PutFormToConfigure (); // Put form to go to test configuration
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
/***** Get tags already present in the table of questions *****/ /***** Start frame *****/
if ((NumRows = Tst_GetAllTagsFromCurrentCrs (&mysql_res)) == 0) Lay_StartRoundFrame (NULL,Txt_Questions,NULL);
{
sprintf (Gbl.Message,Txt_No_test_questions_in_X,
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
}
else
{
/***** Start frame *****/
Lay_StartRoundFrame (NULL,Txt_Questions,NULL);
/***** Get tags already present in the table of questions *****/
if ((NumRows = Tst_GetAllTagsFromCurrentCrs (&mysql_res)))
{
Act_FormStart (ActLstTstQst); Act_FormStart (ActLstTstQst);
Par_PutHiddenParamUnsigned ("Order",(unsigned) Tst_ORDER_STEM); Par_PutHiddenParamUnsigned ("Order",(unsigned) Tst_ORDER_STEM);
@ -1150,10 +1147,18 @@ void Tst_ShowFormAskEditTsts (void)
/***** Send button *****/ /***** Send button *****/
Lay_PutConfirmButton (Txt_Show_questions); Lay_PutConfirmButton (Txt_Show_questions);
Act_FormEnd (); Act_FormEnd ();
/***** End frame *****/
Lay_EndRoundFrame ();
} }
else // No test questions
{
/***** Warning message *****/
Lay_ShowAlert (Lay_INFO,Txt_No_test_questions);
/***** Button to create a new question *****/
Tst_PutButtonToAddQuestion ();
}
/***** End frame *****/
Lay_EndRoundFrame ();
/* Free structure that stores the query result */ /* Free structure that stores the query result */
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
@ -1172,6 +1177,19 @@ static void Tst_PutFormToCreateNewTstQst (void)
Txt_New_question,Txt_New_question); Txt_New_question,Txt_New_question);
} }
/*****************************************************************************/
/**************** Put button to create a new test question *******************/
/*****************************************************************************/
static void Tst_PutButtonToAddQuestion (void)
{
extern const char *Txt_New_question;
Act_FormStart (ActEdiOneTstQst);
Lay_PutConfirmButton (Txt_New_question);
Act_FormEnd ();
}
/*****************************************************************************/ /*****************************************************************************/
/***************************** Form to rename tags ***************************/ /***************************** Form to rename tags ***************************/
/*****************************************************************************/ /*****************************************************************************/
@ -1490,7 +1508,7 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res,
static void Tst_ShowFormEditTags (void) static void Tst_ShowFormEditTags (void)
{ {
extern const char *Txt_No_test_questions_in_X; extern const char *Txt_No_test_questions;
extern const char *Txt_Tags; extern const char *Txt_Tags;
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -1498,13 +1516,7 @@ static void Tst_ShowFormEditTags (void)
long TagCod; long TagCod;
/***** Get current tags in current course *****/ /***** Get current tags in current course *****/
if ((NumRows = Tst_GetAllTagsFromCurrentCrs (&mysql_res)) == 0) if ((NumRows = Tst_GetAllTagsFromCurrentCrs (&mysql_res)))
{
sprintf (Gbl.Message,Txt_No_test_questions_in_X,
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
}
else
{ {
/***** Start table *****/ /***** Start table *****/
Lay_StartRoundFrameTable (NULL,2,Txt_Tags); Lay_StartRoundFrameTable (NULL,2,Txt_Tags);
@ -1542,6 +1554,8 @@ static void Tst_ShowFormEditTags (void)
/***** End table *****/ /***** End table *****/
Lay_EndRoundFrameTable (); Lay_EndRoundFrameTable ();
} }
else
Lay_ShowAlert (Lay_INFO,Txt_No_test_questions);
/* Free structure that stores the query result */ /* Free structure that stores the query result */
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);

View File

@ -24349,25 +24349,25 @@ const char *Txt_No_teachers_or_students_found =
"Nenhum professor ou estudante encontrado."; "Nenhum professor ou estudante encontrado.";
#endif #endif
const char *Txt_No_test_questions_in_X = // Warning: it is very important to include %s in the following sentences const char *Txt_No_test_questions =
#if L==1 #if L==1
"No hay preguntas de test en <strong>%s</strong>."; // Necessita traduccio "No hay preguntas de test."; // Necessita traduccio
#elif L==2 #elif L==2
"Keine Testfragen im <strong>%s</strong>."; "Keine Testfragen.";
#elif L==3 #elif L==3
"No test questions in <strong>%s</strong>."; "No test questions.";
#elif L==4 #elif L==4
"No hay preguntas de test en <strong>%s</strong>."; "No hay preguntas de test.";
#elif L==5 #elif L==5
"Il n'y a pas de questions de test dans <strong>%s</strong>."; "Il n'y a pas de questions de test.";
#elif L==6 #elif L==6
"No hay preguntas de test en <strong>%s</strong>."; // Okoteve traducción "No hay preguntas de test."; // Okoteve traducción
#elif L==7 #elif L==7
"Non ci sono domande di test in <strong>%s</strong>."; "Non ci sono domande di test.";
#elif L==8 #elif L==8
"Brak pyta&nacute; testowych <strong>%s</strong>."; "Brak pyta&nacute; testowych.";
#elif L==9 #elif L==9
"N&atilde;o existem quest&otilde;es de test em <strong>%s</strong>."; "N&atilde;o existem quest&otilde;es de test.";
#endif #endif
const char *Txt_No_user_has_been_eliminated = const char *Txt_No_user_has_been_eliminated =