mirror of https://github.com/acanas/swad-core.git
Version19.145.4
This commit is contained in:
parent
7fa13f6bc6
commit
da5d5eaafc
|
@ -526,6 +526,7 @@ Param
|
||||||
// TODO: Oresti Baños: cambiar ojos por candados en descriptores para prohibir/permitir y dejar los ojos para poder elegir descriptores
|
// TODO: Oresti Baños: cambiar ojos por candados en descriptores para prohibir/permitir y dejar los ojos para poder elegir descriptores
|
||||||
// TODO: Comprobar los resultados de partidas de juegos con preguntas eliminadas
|
// TODO: Comprobar los resultados de partidas de juegos con preguntas eliminadas
|
||||||
|
|
||||||
|
Version 19.145.4: Mar 09, 2020 Changes in edition of games. (282385 lines)
|
||||||
Version 19.145.3: Mar 09, 2020 Increased maximum size of title of projects. (282369 lines)
|
Version 19.145.3: Mar 09, 2020 Increased maximum size of title of projects. (282369 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
ALTER TABLE projects CHANGE Title Title VARCHAR(4095) NOT NULL;
|
ALTER TABLE projects CHANGE Title Title VARCHAR(4095) NOT NULL;
|
||||||
|
|
68
swad_game.c
68
swad_game.c
|
@ -1270,12 +1270,31 @@ void Gam_RequestCreatOrEditGame (void)
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
ItsANewGame = ((Game.GamCod = Gam_GetParams ()) < 0);
|
ItsANewGame = ((Game.GamCod = Gam_GetParams ()) < 0);
|
||||||
|
|
||||||
|
/***** Get game data *****/
|
||||||
|
if (ItsANewGame)
|
||||||
|
{
|
||||||
|
/* Initialize to empty game */
|
||||||
|
Gam_ResetGame (&Game);
|
||||||
|
Txt[0] = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Get game data from database */
|
||||||
|
Gam_GetDataOfGameByCod (&Game);
|
||||||
|
Gam_GetGameTxtFromDB (Game.GamCod,Txt);
|
||||||
|
}
|
||||||
|
|
||||||
/***** Put forms to create/edit a game *****/
|
/***** Put forms to create/edit a game *****/
|
||||||
Gam_PutFormsEditionGame (&Game,Txt,ItsANewGame);
|
Gam_PutFormsEditionGame (&Game,Txt,ItsANewGame);
|
||||||
|
|
||||||
/***** Show games again *****/
|
/***** Show games or questions *****/
|
||||||
if (ItsANewGame)
|
if (ItsANewGame)
|
||||||
|
/* Show games again */
|
||||||
Gam_ListAllGames ();
|
Gam_ListAllGames ();
|
||||||
|
else
|
||||||
|
/* Show questions of the game ready to be edited */
|
||||||
|
Gam_ListGameQuestions (&Game);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1298,17 +1317,6 @@ static void Gam_PutFormsEditionGame (struct Game *Game,
|
||||||
extern const char *Txt_Create_game;
|
extern const char *Txt_Create_game;
|
||||||
extern const char *Txt_Save_changes;
|
extern const char *Txt_Save_changes;
|
||||||
|
|
||||||
/***** Get game data *****/
|
|
||||||
if (ItsANewGame)
|
|
||||||
/* Initialize to empty game */
|
|
||||||
Gam_ResetGame (Game);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Get game data from database */
|
|
||||||
Gam_GetDataOfGameByCod (Game);
|
|
||||||
Gam_GetGameTxtFromDB (Game->GamCod,Txt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Begin form *****/
|
/***** Begin form *****/
|
||||||
Gam_SetCurrentGamCod (Game->GamCod); // Used to pass parameter
|
Gam_SetCurrentGamCod (Game->GamCod); // Used to pass parameter
|
||||||
Frm_StartForm (ItsANewGame ? ActNewGam :
|
Frm_StartForm (ItsANewGame ? ActNewGam :
|
||||||
|
@ -1378,8 +1386,7 @@ static void Gam_PutFormsEditionGame (struct Game *Game,
|
||||||
HTM_TD_Begin ("class=\"LT\"");
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" rows=\"5\""
|
HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" rows=\"5\""
|
||||||
" class=\"TITLE_DESCRIPTION_WIDTH\"");
|
" class=\"TITLE_DESCRIPTION_WIDTH\"");
|
||||||
if (!ItsANewGame)
|
HTM_Txt (Txt);
|
||||||
HTM_Txt (Txt);
|
|
||||||
HTM_TEXTAREA_End ();
|
HTM_TEXTAREA_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
@ -1393,10 +1400,6 @@ static void Gam_PutFormsEditionGame (struct Game *Game,
|
||||||
|
|
||||||
/***** End form *****/
|
/***** End form *****/
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
|
||||||
/***** Show questions of the game ready to be edited *****/
|
|
||||||
if (!ItsANewGame)
|
|
||||||
Gam_ListGameQuestions (Game);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1426,18 +1429,31 @@ void Gam_RecFormGame (void)
|
||||||
if (ItsANewGame)
|
if (ItsANewGame)
|
||||||
Gam_CreateGame (&Game,Txt); // Add new game to database
|
Gam_CreateGame (&Game,Txt); // Add new game to database
|
||||||
else
|
else
|
||||||
Gam_UpdateGame (&Game,Txt);
|
Gam_UpdateGame (&Game,Txt); // Update game data in database
|
||||||
}
|
|
||||||
|
|
||||||
/***** Put forms to create/edit a game *****/
|
/***** Put forms to edit the game created or updated *****/
|
||||||
Gam_PutFormsEditionGame (&Game,Txt,ItsANewGame);
|
Gam_PutFormsEditionGame (&Game,Txt,
|
||||||
|
false); // No new game
|
||||||
|
|
||||||
|
/***** Show questions of the game ready to be edited ******/
|
||||||
|
Gam_ListGameQuestions (&Game);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/***** Put forms to create/edit the game *****/
|
||||||
|
Gam_PutFormsEditionGame (&Game,Txt,ItsANewGame);
|
||||||
|
|
||||||
|
/***** Show games or questions *****/
|
||||||
|
if (ItsANewGame)
|
||||||
|
/* Show games again */
|
||||||
|
Gam_ListAllGames ();
|
||||||
|
else
|
||||||
|
/* Show questions of the game ready to be edited */
|
||||||
|
Gam_ListGameQuestions (&Game);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Lay_NoPermissionExit ();
|
Lay_NoPermissionExit ();
|
||||||
|
|
||||||
/***** Show games again *****/
|
|
||||||
if (ItsANewGame)
|
|
||||||
Gam_ListAllGames ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Gam_ReceiveGameFieldsFromForm (struct Game *Game,
|
static void Gam_ReceiveGameFieldsFromForm (struct Game *Game,
|
||||||
|
|
Loading…
Reference in New Issue