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: 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)
|
||||
1 change necessary in database:
|
||||
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 *****/
|
||||
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 *****/
|
||||
Gam_PutFormsEditionGame (&Game,Txt,ItsANewGame);
|
||||
|
||||
/***** Show games again *****/
|
||||
/***** Show games or questions *****/
|
||||
if (ItsANewGame)
|
||||
/* Show games again */
|
||||
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_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 *****/
|
||||
Gam_SetCurrentGamCod (Game->GamCod); // Used to pass parameter
|
||||
Frm_StartForm (ItsANewGame ? ActNewGam :
|
||||
|
@ -1378,8 +1386,7 @@ static void Gam_PutFormsEditionGame (struct Game *Game,
|
|||
HTM_TD_Begin ("class=\"LT\"");
|
||||
HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" rows=\"5\""
|
||||
" class=\"TITLE_DESCRIPTION_WIDTH\"");
|
||||
if (!ItsANewGame)
|
||||
HTM_Txt (Txt);
|
||||
HTM_Txt (Txt);
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -1393,10 +1400,6 @@ static void Gam_PutFormsEditionGame (struct Game *Game,
|
|||
|
||||
/***** End form *****/
|
||||
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)
|
||||
Gam_CreateGame (&Game,Txt); // Add new game to database
|
||||
else
|
||||
Gam_UpdateGame (&Game,Txt);
|
||||
}
|
||||
Gam_UpdateGame (&Game,Txt); // Update game data in database
|
||||
|
||||
/***** Put forms to create/edit a game *****/
|
||||
Gam_PutFormsEditionGame (&Game,Txt,ItsANewGame);
|
||||
/***** Put forms to edit the game created or updated *****/
|
||||
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
|
||||
Lay_NoPermissionExit ();
|
||||
|
||||
/***** Show games again *****/
|
||||
if (ItsANewGame)
|
||||
Gam_ListAllGames ();
|
||||
}
|
||||
|
||||
static void Gam_ReceiveGameFieldsFromForm (struct Game *Game,
|
||||
|
|
Loading…
Reference in New Issue