From a27a6b9e07e4c7eba37447a8127fccd5e669e643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sun, 13 Dec 2015 21:30:28 +0100 Subject: [PATCH] Version 15.64.17 --- swad_changelog.h | 4 +++- swad_test.c | 4 ++-- swad_test_import.c | 39 +++++++++++++++++---------------------- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 39d8bf18..f812fa0f 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -117,12 +117,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.64.16 (2015/12/13)" +#define Log_PLATFORM_VERSION "SWAD 15.64.17 (2015/12/13)" #define CSS_FILE "swad15.64.5.css" // 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.64.17: Dec 13, 2015 Code refactoring in contextual links. + Fixed minor bug in tests. (187009 lines) Version 15.64.16: Dec 13, 2015 Code refactoring in contextual links. Fixed minor bug in surveys. (187012 lines) Version 15.64.15: Dec 13, 2015 Code refactoring in contextual links. (187025 lines) diff --git a/swad_test.c b/swad_test.c index 3246a91e..8a139f3d 100644 --- a/swad_test.c +++ b/swad_test.c @@ -1121,7 +1121,7 @@ void Tst_ShowFormAskEditTsts (void) unsigned long NumRows; /***** Buttons for edition *****/ - fprintf (Gbl.F.Out,"
"); + 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 @@ -2082,7 +2082,7 @@ void Tst_ListQuestionsToEdit (void) if ((NumRows = Tst_GetQuestionsForEdit (&mysql_res)) != 0) // Query database { /***** Buttons for edition *****/ - fprintf (Gbl.F.Out,"
"); + 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 diff --git a/swad_test_import.c b/swad_test_import.c index 00579e56..800389d9 100644 --- a/swad_test_import.c +++ b/swad_test_import.c @@ -62,6 +62,8 @@ extern struct Globals Gbl; /***************************** Internal prototypes ***************************/ /*****************************************************************************/ +static void TsI_PutParamsExportQsts (void); + static void TsI_GetAndWriteTagsXML (long QstCod); static void TsI_WriteAnswersOfAQstXML (long QstCod); static void TsI_ReadQuestionsFromXMLFileAndStoreInDB (const char *FileNameXML); @@ -81,27 +83,26 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem, void TsI_PutFormToExportQuestions (void) { - extern const char *The_ClassFormBold[The_NUM_THEMES]; extern const char *Txt_Export_questions_to_XML_file; extern const char *Txt_Export_questions; - /***** Start form *****/ - Act_FormStart (ActLstTstQst); + /***** Put a link to create a file with questions *****/ + Lay_PutContextualLink (ActLstTstQst,TsI_PutParamsExportQsts, + "export16x16.gif", + Txt_Export_questions_to_XML_file,Txt_Export_questions); + } - /***** Parameters of the form *****/ +/*****************************************************************************/ +/****************** Put params to export test questions **********************/ +/*****************************************************************************/ + +static void TsI_PutParamsExportQsts (void) + { Sta_WriteParamsDatesSeeAccesses (); Tst_WriteParamEditQst (); Par_PutHiddenParamChar ("OnlyThisQst",'N'); Par_PutHiddenParamUnsigned ("Order",(unsigned) Gbl.Test.SelectedOrderType); Par_PutHiddenParamChar ("CreateXML",'Y'); - - /***** Put a link to create a file with questions *****/ - Act_LinkFormSubmit (Txt_Export_questions_to_XML_file,The_ClassFormBold[Gbl.Prefs.Theme]); - Lay_PutIconWithText ("export16x16.gif", - Txt_Export_questions_to_XML_file, - Txt_Export_questions); - fprintf (Gbl.F.Out,""); - Act_FormEnd (); } /*****************************************************************************/ @@ -110,20 +111,14 @@ void TsI_PutFormToExportQuestions (void) void TsI_PutFormToImportQuestions (void) { - extern const char *The_ClassFormBold[The_NUM_THEMES]; extern const char *Txt_Import_questions_from_XML_file; extern const char *Txt_Import_questions; - /***** Start form *****/ - Act_FormStart (ActReqImpTstQst); - /***** Put a link to create a file with questions *****/ - Act_LinkFormSubmit (Txt_Import_questions_from_XML_file,The_ClassFormBold[Gbl.Prefs.Theme]); - Lay_PutIconWithText ("import16x16.gif", - Txt_Import_questions_from_XML_file, - Txt_Import_questions); - fprintf (Gbl.F.Out,""); - Act_FormEnd (); + Lay_PutContextualLink (ActReqImpTstQst,NULL, + "import16x16.gif", + Txt_Import_questions_from_XML_file, + Txt_Import_questions); } /*****************************************************************************/