From 16ad544a858edcb6cb7d8d1a112af058b74982ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sun, 20 Mar 2016 23:38:22 +0100 Subject: [PATCH] Version 15.157.3 --- swad_changelog.h | 3 ++- swad_survey.c | 2 +- swad_test.c | 25 ++++++++++++++++--------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 950d2b56..11c1df0f 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -134,13 +134,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.157.2 (2016-03-20)" +#define Log_PLATFORM_VERSION "SWAD 15.157.3 (2016-03-20)" #define CSS_FILE "swad15.157.css" #define JS_FILE "swad15.131.3.js" // 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 /* + 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.1: Mar 20, 2016 Changed names of functions related to degree types. (196237 lines) Version 15.157: Mar 20, 2016 Changes in tagline and title. (196227 lines) diff --git a/swad_survey.c b/swad_survey.c index d37226c6..93f1a9ec 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -2952,7 +2952,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ /***** Put button to add a new question in this survey *****/ Svy_PutButtonToCreateNewQuestion (); - /***** End table *****/ + /***** End frame *****/ Lay_EndRoundFrame (); } diff --git a/swad_test.c b/swad_test.c index 7d818b1e..175088e4 100644 --- a/swad_test.c +++ b/swad_test.c @@ -132,7 +132,7 @@ extern struct Globals Gbl; /*****************************************************************************/ static void Tst_PutFormToSeeResultsOfUsersTests (void); -static void Tst_PutFormToEdit (void); +static void Tst_PutIconToEdit (void); static void Tst_PutFormToConfigure (void); static void Tst_GetQuestionsAndAnswersFromForm (void); @@ -243,27 +243,32 @@ static void Tst_GetExamQuestionsFromDB (long TstCod); void Tst_ShowFormAskTst (void) { extern const char *The_ClassForm[The_NUM_THEMES]; + extern const char *Txt_Test; extern const char *Txt_No_of_questions; extern const char *Txt_Generate_exam; extern const char *Txt_No_test_questions_in_X; MYSQL_RES *mysql_res; unsigned long NumRows; + bool ICanEdit = (Gbl.Usrs.Me.LoggedRole == Rol_STUDENT || + Gbl.Usrs.Me.LoggedRole == Rol_TEACHER || + Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM); /***** Read test configuration from database *****/ Tst_GetConfigTstFromDB (); /***** Put form to go to test edition and configuration *****/ - if (Gbl.Usrs.Me.LoggedRole == Rol_STUDENT || - Gbl.Usrs.Me.LoggedRole == Rol_TEACHER || - Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) + if (ICanEdit) { fprintf (Gbl.F.Out,"
"); Tst_PutFormToSeeResultsOfUsersTests (); - Tst_PutFormToEdit (); Tst_PutFormToConfigure (); fprintf (Gbl.F.Out,"
"); } + /***** Start frame *****/ + Lay_StartRoundFrame (NULL,Txt_Test,ICanEdit ? Tst_PutIconToEdit : + NULL); + /***** Get tags *****/ if ((NumRows = Tst_GetEnabledTagsFromThisCrs (&mysql_res)) != 0) { @@ -306,6 +311,9 @@ void Tst_ShowFormAskTst (void) Lay_ShowAlert (Lay_INFO,Gbl.Message); } + /***** End frame *****/ + Lay_EndRoundFrame (); + /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); } @@ -325,15 +333,14 @@ static void Tst_PutFormToSeeResultsOfUsersTests (void) } /*****************************************************************************/ -/************** Write a form to go to edition of test questions **************/ +/*************** Write icon to go to edition of test questions ***************/ /*****************************************************************************/ -static void Tst_PutFormToEdit (void) +static void Tst_PutIconToEdit (void) { extern const char *Txt_Edit; - Lay_PutContextualLink (ActEdiTstQst,NULL,"edit64x64.png", - Txt_Edit,Txt_Edit); + Lay_PutContextualLink (ActEdiTstQst,NULL,"edit64x64.png",Txt_Edit,NULL); } /*****************************************************************************/