Version 16.252

This commit is contained in:
Antonio Cañas Vargas 2017-09-08 01:18:20 +02:00
parent 3276b8171a
commit 498723ff9d
7 changed files with 49 additions and 63 deletions

View File

@ -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)

View File

@ -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,"<input type=\"image\" src=\"%s/edit64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" />",
Gbl.Prefs.IconsURL,
Txt_Edit_question,
Txt_Edit_question);
Act_FormEnd ();
Gbl.Test.QstCod = QstCod;
Ico_PutContextualIconToEdit (ActEdiOneTstQst,Tst_PutParamQstCod);
fprintf (Gbl.F.Out,"</td>");
@ -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 *****/

View File

@ -358,4 +358,3 @@ void Ico_PutIconRemove (void)
Txt_Remove,
Txt_Remove);
}

View File

@ -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,"<td class=\"BT%u\">",Gbl.RowEvenOdd);
/* Write icon to remove the question */
fprintf (Gbl.F.Out,"<td class=\"BT%u\">",Gbl.RowEvenOdd);
Act_FormStart (ActReqRemSvyQst);
Svy_PutParamSvyCod (Svy->SvyCod);
Svy_PutParamQstCod (SvyQst->QstCod);
Ico_PutIconRemove ();
Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>");
/* Write icon to edit the question */
fprintf (Gbl.F.Out,"<td class=\"BT%u\">",Gbl.RowEvenOdd);
Act_FormStart (ActEdiOneSvyQst);
Svy_PutParamSvyCod (Svy->SvyCod);
Svy_PutParamQstCod (SvyQst->QstCod);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/edit64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" />",
Gbl.Prefs.IconsURL,
Txt_Edit_question,
Txt_Edit_question);
Act_FormEnd ();
Gbl.Svys.SvyCodToEdit = Svy->SvyCod;
Gbl.Svys.SvyQstCodToEdit = SvyQst->QstCod;
Ico_PutContextualIconToEdit (ActEdiOneSvyQst,Svy_PutParamsToEditQuestion);
fprintf (Gbl.F.Out,"</td>");
}
@ -3303,6 +3296,16 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ
Box_EndBox ();
}
/*****************************************************************************/
/******************** Put parameters to edit a question **********************/
/*****************************************************************************/
static void Svy_PutParamsToEditQuestion (void)
{
Svy_PutParamSvyCod (Gbl.Svys.SvyCodToEdit);
Svy_PutParamQstCod (Gbl.Svys.SvyQstCodToEdit);
}
/*****************************************************************************/
/***************** Put icon to add a new question to survey ******************/
/*****************************************************************************/

View File

@ -257,7 +257,6 @@ static void Tst_PutParamsRemoveOneQst (void);
static void Tst_PutParamsRemoveQst (void);
static long Tst_GetQstCod (void);
static void Tst_PutParamQstCod (void);
static void Tst_InsertOrUpdateQstIntoDB (void);
static void Tst_InsertTagsIntoDB (void);
@ -2826,7 +2825,6 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows,
extern const char *Txt_TST_STR_ORDER_SHORT[Tst_NUM_TYPES_ORDER_QST];
extern const char *Txt_TST_STR_ANSWER_TYPES[Tst_NUM_ANS_TYPES];
extern const char *Txt_Shuffle;
extern const char *Txt_Edit_question;
extern const char *Txt_Today;
Tst_QuestionsOrder_t Order;
unsigned long NumRow;
@ -2941,15 +2939,7 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows,
Act_FormEnd ();
/* Write icon to edit the question */
Act_FormStart (ActEdiOneTstQst);
Tst_PutParamQstCod ();
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/edit64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" />",
Gbl.Prefs.IconsURL,
Txt_Edit_question,
Txt_Edit_question);
Act_FormEnd ();
Ico_PutContextualIconToEdit (ActEdiOneTstQst,Tst_PutParamQstCod);
fprintf (Gbl.F.Out,"</td>");
@ -6459,7 +6449,7 @@ static long Tst_GetQstCod (void)
/************ Put parameter with question code to edit, remove... ************/
/*****************************************************************************/
static void Tst_PutParamQstCod (void)
void Tst_PutParamQstCod (void)
{
Par_PutHiddenParamLong ("QstCod",Gbl.Test.QstCod);
}

View File

@ -188,6 +188,9 @@ double Tst_GetFloatAnsFromStr (char *Str);
void Tst_RequestRemoveQst (void);
void Tst_RemoveQst (void);
void Tst_ChangeShuffleQst (void);
void Tst_PutParamQstCod (void);
void Tst_InsertOrUpdateQstTagsAnsIntoDB (void);
void Tst_FreeTagsList (void);

View File

@ -10318,27 +10318,6 @@ const char *Txt_Edit_my_webs_networks =
"Editar as minhas webs / redes";
#endif
const char *Txt_Edit_question =
#if L==1
"Editar pregunta";
#elif L==2
"Frage bearbeiten";
#elif L==3
"Edit question";
#elif L==4
"Editar pregunta";
#elif L==5
"&Eacute;diter question";
#elif L==6
"Editar pregunta"; // Okoteve traducción
#elif L==7
"Editare domanda";
#elif L==8
"Edytuj pytanie";
#elif L==9
"Editar quest&atilde;o";
#endif
const char *Txt_Edit_record_fields =
#if L==1
"Editar camps de fitxes";