diff --git a/swad_changelog.h b/swad_changelog.h index be7706e22..0cce936f5 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -238,13 +238,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.251.13 (2017-09-06)" +#define Log_PLATFORM_VERSION "SWAD 16.252 (2017-09-08)" #define CSS_FILE "swad16.251.8.css" #define JS_FILE "swad16.206.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 16.252: Sep 08, 2017 Icons to move up and down questions in a game. (226852 lines) Version 16.251.13:Sep 07, 2017 Option Remote Control moved after Test. (226873 lines) Version 16.251.12:Sep 07, 2017 Module swad_game is renamed swad_game. (226872 lines) Version 16.251.11:Sep 07, 2017 Listing games for remote control. Not finished. (226868 lines) diff --git a/swad_game.c b/swad_game.c index 193bc913c..171b2af05 100644 --- a/swad_game.c +++ b/swad_game.c @@ -139,7 +139,7 @@ static unsigned Gam_GetNumUsrsWhoAnswered (long GamCod,long QstCod,unsigned AnsI static void Gam_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs); // static void Gam_PutIconToRemoveOneQst (void); -static void Gam_PutParamsRemoveOneQst (void); +static void Gam_PutParamsOneQst (void); static void Gam_ReceiveAndStoreUserAnswersToAGame (long GamCod); static void Gam_IncreaseAnswerInDB (long QstCod,unsigned AnsInd); @@ -2725,12 +2725,14 @@ static void Gam_ListOneOrMoreQuestionsForEdition (struct Game *Game, extern const char *Txt_Code; extern const char *Txt_Tags; extern const char *Txt_Question; - extern const char *Txt_Edit_question; + extern const char *Txt_Move_up_X; + extern const char *Txt_Move_down_X; extern const char *Txt_TST_STR_ANSWER_TYPES[Tst_NUM_ANS_TYPES]; unsigned NumQst; MYSQL_ROW row; unsigned UniqueId; long QstCod; + char StrNumQst[10 + 1]; /***** Write the heading *****/ Tbl_StartTableWideMargin (2); @@ -2790,16 +2792,25 @@ static void Gam_ListOneOrMoreQuestionsForEdition (struct Game *Game, Ico_PutIconRemove (); Act_FormEnd (); + /* Write icon to move up the question */ + sprintf (StrNumQst,"%u",NumQst + 1); + + sprintf (Gbl.Title,Txt_Move_up_X,StrNumQst); + Lay_PutContextualLink (ActEdiOneTstQst,NULL,Gam_PutParamsOneQst, + "up_on16x16.gif", + Gbl.Title,NULL, + NULL); + + /* Write icon to move down the question */ + sprintf (Gbl.Title,Txt_Move_down_X,StrNumQst); + Lay_PutContextualLink (ActEdiOneTstQst,NULL,Gam_PutParamsOneQst, + "down_on16x16.gif", + Gbl.Title,NULL, + NULL); + /* Write icon to edit the question */ - Act_FormStart (ActEdiOneTstQst); - Gam_PutParamQstCod (QstCod); - fprintf (Gbl.F.Out,"", - Gbl.Prefs.IconsURL, - Txt_Edit_question, - Txt_Edit_question); - Act_FormEnd (); + Gbl.Test.QstCod = QstCod; + Ico_PutContextualIconToEdit (ActEdiOneTstQst,Tst_PutParamQstCod); fprintf (Gbl.F.Out,""); @@ -3092,10 +3103,10 @@ static void Gam_PutIconToRemoveOneQst (void) } */ /*****************************************************************************/ -/****************** Put parameter to remove one question *********************/ +/**************** Put parameter to move/remove one question ******************/ /*****************************************************************************/ -static void Gam_PutParamsRemoveOneQst (void) +static void Gam_PutParamsOneQst (void) { Gam_PutParamGameCod (Gbl.Games.CurrentGamCod); Gam_PutParamQstCod (Gbl.Games.CurrentQstCod); @@ -3131,7 +3142,7 @@ void Gam_RequestRemoveQst (void) sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_question_X, (unsigned long) (QstInd + 1)); Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, - ActRemGamQst,NULL,NULL,Gam_PutParamsRemoveOneQst, + ActRemGamQst,NULL,NULL,Gam_PutParamsOneQst, Btn_REMOVE_BUTTON,Txt_Remove_question); /***** Show current game *****/ diff --git a/swad_icon.c b/swad_icon.c index 93ce0edef..19abb99dd 100644 --- a/swad_icon.c +++ b/swad_icon.c @@ -358,4 +358,3 @@ void Ico_PutIconRemove (void) Txt_Remove, Txt_Remove); } - diff --git a/swad_survey.c b/swad_survey.c index c32a044d5..4c82822bc 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -145,6 +145,7 @@ static void Svy_FreeTextChoiceAnswer (struct SurveyQuestion *SvyQst,unsigned Num static unsigned Svy_GetQstIndFromQstCod (long QstCod); static unsigned Svy_GetNextQuestionIndexInSvy (long SvyCod); static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQst); +static void Svy_PutParamsToEditQuestion (void); static void Svy_PutIconToAddNewQuestion (void); static void Svy_PutButtonToCreateNewQuestion (void); static void Svy_WriteQstStem (const char *Stem); @@ -3159,7 +3160,6 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ extern const char *Txt_SURVEY_STR_ANSWER_TYPES[Svy_NUM_ANS_TYPES]; extern const char *Txt_This_survey_has_no_questions; extern const char *Txt_Done; - extern const char *Txt_Edit_question; char Query[256]; MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -3227,27 +3227,20 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ if (Svy->Status.ICanEdit) { + fprintf (Gbl.F.Out,"