From 7a9c697bcb8b4b183491f7dc095ac3120d49463c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 21 Mar 2016 12:53:02 +0100 Subject: [PATCH] Version 15.158.2 --- swad_changelog.h | 3 ++- swad_test.c | 35 +++++++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index cc1feb260..ab0eb22f9 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -134,13 +134,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.158.1 (2016-03-21)" +#define Log_PLATFORM_VERSION "SWAD 15.158.2 (2016-03-21)" #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.158.2: Mar 21, 2016 Icon to add new test question integrated in frame. (196283 lines) 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.157.3: Mar 20, 2016 Changes in layout of tests. (196247 lines) diff --git a/swad_test.c b/swad_test.c index 1b6bb8439..ff8b71671 100644 --- a/swad_test.c +++ b/swad_test.c @@ -148,7 +148,7 @@ static void Tst_WriteQstAndAnsExam (unsigned NumQst,long QstCod,MYSQL_ROW row, static void Tst_UpdateScoreQst (long QstCod,float ScoreThisQst,bool AnswerIsNotBlank); static void Tst_UpdateMyNumAccessTst (unsigned NumAccessesTst); static void Tst_UpdateLastAccTst (void); -static void Tst_PutFormToCreateNewTstQst (void); +static void Tst_PutIconToCreateNewTstQst (void); static void Tst_PutButtonToAddQuestion (void); static long Tst_GetParamTagCode (void); static bool Tst_CheckIfCurrentCrsHasTestTags (void); @@ -1116,15 +1116,14 @@ void Tst_ShowFormAskEditTsts (void) MYSQL_RES *mysql_res; unsigned long NumRows; - /***** Buttons for edition *****/ + /***** Contextual menu *****/ fprintf (Gbl.F.Out,"
"); - Tst_PutFormToCreateNewTstQst (); // Put link (form) to create a new test question TsI_PutFormToImportQuestions (); // Put link (form) to import questions from XML file Tst_PutFormToConfigure (); // Put form to go to test configuration fprintf (Gbl.F.Out,"
"); /***** Start frame *****/ - Lay_StartRoundFrame (NULL,Txt_Questions,NULL); + Lay_StartRoundFrame (NULL,Txt_Questions,Tst_PutIconToCreateNewTstQst); /***** Get tags already present in the table of questions *****/ if ((NumRows = Tst_GetAllTagsFromCurrentCrs (&mysql_res))) @@ -1165,16 +1164,16 @@ void Tst_ShowFormAskEditTsts (void) } /*****************************************************************************/ -/************ Put a link (form) to create a new test question ****************/ +/***************** Put icon to create a new test question ********************/ /*****************************************************************************/ -static void Tst_PutFormToCreateNewTstQst (void) +static void Tst_PutIconToCreateNewTstQst (void) { extern const char *Txt_New_question; /***** Put form to create a new test question *****/ Lay_PutContextualLink (ActEdiOneTstQst,NULL,"plus64x64.png", - Txt_New_question,Txt_New_question); + Txt_New_question,NULL); } /*****************************************************************************/ @@ -2113,7 +2112,6 @@ void Tst_ListQuestionsToEdit (void) { /***** Buttons for edition *****/ fprintf (Gbl.F.Out,"
"); - Tst_PutFormToCreateNewTstQst (); // Put link (form) to create a new test question if (Gbl.Test.XML.CreateXML) TsI_CreateXML (NumRows,mysql_res); // Create XML file for exporting questions and put a link to download it else @@ -2390,15 +2388,8 @@ static void Tst_ListOneQstToEdit (void) /***** Query database *****/ if (Tst_GetOneQuestionByCod (Gbl.Test.QstCod,&mysql_res)) - { - /***** Button to create a new question *****/ - fprintf (Gbl.F.Out,"
"); - Tst_PutFormToCreateNewTstQst (); // Put link (form) to create a new test question - fprintf (Gbl.F.Out,"
"); - /***** Show the question ready to edit it *****/ Tst_ListOneOrMoreQuestionsToEdit (1,mysql_res); - } else Lay_ShowErrorAndExit ("Can not get question."); @@ -2465,10 +2456,12 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m double TotalScoreThisQst; /***** Table start *****/ - Lay_StartRoundFrameTable (NULL,2,Txt_Questions); + Lay_StartRoundFrame (NULL,Txt_Questions,Tst_PutIconToCreateNewTstQst); /***** Write the heading *****/ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out,"" + "" "" "
" "%s" @@ -2685,7 +2678,13 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m } /***** End table *****/ - Lay_EndRoundFrameTable (); + fprintf (Gbl.F.Out,"
"); + + /***** Button to add a new question *****/ + Tst_PutButtonToAddQuestion (); + + /***** End frame *****/ + Lay_EndRoundFrame (); } /*****************************************************************************/