Version 16.254

This commit is contained in:
Antonio Cañas Vargas 2017-09-13 09:47:45 +02:00
parent 31ca093287
commit 0190be8851
5 changed files with 105 additions and 50 deletions

View File

@ -491,6 +491,7 @@ Assessment:
360. ActRemSvyQst Confirm the removal of a question of a survey
NEW. ActSeeOneGam Show one game
NEW. ActPlyGam Start playing a game
NEW. ActAnsGam Answer a game
NEW. ActFrmNewGam Form to create a new game
NEW. ActEdiOneGam Edit one game
@ -1953,6 +1954,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActSeeOneTstResOth*/{1082,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Tst_ShowOneTestResult ,NULL},
/* ActSeeOneGam */{1650,-1,TabUnk,ActSeeAllGam ,0x3F8,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Gam_SeeOneGame ,NULL},
/* ActPlyGam */{1670,-1,TabUnk,ActSeeAllGam ,0x3F8,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Gam_PlayGame ,NULL},
/* ActAnsGam */{1651,-1,TabUnk,ActSeeAllGam ,0x3F8,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Gam_ReceiveGameAnswers ,NULL},
/* ActFrmNewGam */{1652,-1,TabUnk,ActSeeAllGam ,0x3E0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Gam_RequestCreatOrEditGame ,NULL},
/* ActEdiOneGam */{1653,-1,TabUnk,ActSeeAllGam ,0x3E0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Gam_RequestCreatOrEditGame ,NULL},
@ -4717,6 +4719,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
ActAddTstQstToGam, // #1667
ActUp_GamQst, // #1668
ActDwnGamQst, // #1669
ActPlyGam, // #1670
};
/*****************************************************************************/

View File

@ -57,9 +57,9 @@ typedef enum
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
#define Act_NUM_ACTIONS (1 + 9 + 43 + 17 + 47 + 33 + 24 + 115 + 92 + 416 + 165 + 172 + 42 + 14 + 97)
#define Act_NUM_ACTIONS (1 + 9 + 43 + 17 + 47 + 33 + 24 + 115 + 93 + 416 + 165 + 172 + 42 + 14 + 97)
#define Act_MAX_ACTION_COD 1669
#define Act_MAX_ACTION_COD 1670
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 12
@ -486,51 +486,52 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
#define ActSeeOneTstResOth (ActChgCalCrs1stDay + 48)
#define ActSeeOneGam (ActChgCalCrs1stDay + 49)
#define ActAnsGam (ActChgCalCrs1stDay + 50)
#define ActFrmNewGam (ActChgCalCrs1stDay + 51)
#define ActEdiOneGam (ActChgCalCrs1stDay + 52)
#define ActNewGam (ActChgCalCrs1stDay + 53)
#define ActChgGam (ActChgCalCrs1stDay + 54)
#define ActReqRemGam (ActChgCalCrs1stDay + 55)
#define ActRemGam (ActChgCalCrs1stDay + 56)
#define ActReqRstGam (ActChgCalCrs1stDay + 57)
#define ActRstGam (ActChgCalCrs1stDay + 58)
#define ActHidGam (ActChgCalCrs1stDay + 59)
#define ActShoGam (ActChgCalCrs1stDay + 60)
#define ActAddOneGamQst (ActChgCalCrs1stDay + 61)
#define ActGamLstTstQst (ActChgCalCrs1stDay + 62)
#define ActAddTstQstToGam (ActChgCalCrs1stDay + 63)
#define ActReqRemGamQst (ActChgCalCrs1stDay + 64)
#define ActRemGamQst (ActChgCalCrs1stDay + 65)
#define ActUp_GamQst (ActChgCalCrs1stDay + 66)
#define ActDwnGamQst (ActChgCalCrs1stDay + 67)
#define ActPlyGam (ActChgCalCrs1stDay + 50)
#define ActAnsGam (ActChgCalCrs1stDay + 51)
#define ActFrmNewGam (ActChgCalCrs1stDay + 52)
#define ActEdiOneGam (ActChgCalCrs1stDay + 53)
#define ActNewGam (ActChgCalCrs1stDay + 54)
#define ActChgGam (ActChgCalCrs1stDay + 55)
#define ActReqRemGam (ActChgCalCrs1stDay + 56)
#define ActRemGam (ActChgCalCrs1stDay + 57)
#define ActReqRstGam (ActChgCalCrs1stDay + 58)
#define ActRstGam (ActChgCalCrs1stDay + 59)
#define ActHidGam (ActChgCalCrs1stDay + 60)
#define ActShoGam (ActChgCalCrs1stDay + 61)
#define ActAddOneGamQst (ActChgCalCrs1stDay + 62)
#define ActGamLstTstQst (ActChgCalCrs1stDay + 63)
#define ActAddTstQstToGam (ActChgCalCrs1stDay + 64)
#define ActReqRemGamQst (ActChgCalCrs1stDay + 65)
#define ActRemGamQst (ActChgCalCrs1stDay + 66)
#define ActUp_GamQst (ActChgCalCrs1stDay + 67)
#define ActDwnGamQst (ActChgCalCrs1stDay + 68)
#define ActSeeOneSvy (ActChgCalCrs1stDay + 68)
#define ActAnsSvy (ActChgCalCrs1stDay + 69)
#define ActFrmNewSvy (ActChgCalCrs1stDay + 70)
#define ActEdiOneSvy (ActChgCalCrs1stDay + 71)
#define ActNewSvy (ActChgCalCrs1stDay + 72)
#define ActChgSvy (ActChgCalCrs1stDay + 73)
#define ActReqRemSvy (ActChgCalCrs1stDay + 74)
#define ActRemSvy (ActChgCalCrs1stDay + 75)
#define ActReqRstSvy (ActChgCalCrs1stDay + 76)
#define ActRstSvy (ActChgCalCrs1stDay + 77)
#define ActHidSvy (ActChgCalCrs1stDay + 78)
#define ActShoSvy (ActChgCalCrs1stDay + 79)
#define ActEdiOneSvyQst (ActChgCalCrs1stDay + 80)
#define ActRcvSvyQst (ActChgCalCrs1stDay + 81)
#define ActReqRemSvyQst (ActChgCalCrs1stDay + 82)
#define ActRemSvyQst (ActChgCalCrs1stDay + 83)
#define ActSeeOneSvy (ActChgCalCrs1stDay + 69)
#define ActAnsSvy (ActChgCalCrs1stDay + 70)
#define ActFrmNewSvy (ActChgCalCrs1stDay + 71)
#define ActEdiOneSvy (ActChgCalCrs1stDay + 72)
#define ActNewSvy (ActChgCalCrs1stDay + 73)
#define ActChgSvy (ActChgCalCrs1stDay + 74)
#define ActReqRemSvy (ActChgCalCrs1stDay + 75)
#define ActRemSvy (ActChgCalCrs1stDay + 76)
#define ActReqRstSvy (ActChgCalCrs1stDay + 77)
#define ActRstSvy (ActChgCalCrs1stDay + 78)
#define ActHidSvy (ActChgCalCrs1stDay + 79)
#define ActShoSvy (ActChgCalCrs1stDay + 80)
#define ActEdiOneSvyQst (ActChgCalCrs1stDay + 81)
#define ActRcvSvyQst (ActChgCalCrs1stDay + 82)
#define ActReqRemSvyQst (ActChgCalCrs1stDay + 83)
#define ActRemSvyQst (ActChgCalCrs1stDay + 84)
#define ActSeeOneExaAnn (ActChgCalCrs1stDay + 84)
#define ActSeeDatExaAnn (ActChgCalCrs1stDay + 85)
#define ActEdiExaAnn (ActChgCalCrs1stDay + 86)
#define ActRcvExaAnn (ActChgCalCrs1stDay + 87)
#define ActPrnExaAnn (ActChgCalCrs1stDay + 88)
#define ActReqRemExaAnn (ActChgCalCrs1stDay + 89)
#define ActRemExaAnn (ActChgCalCrs1stDay + 90)
#define ActHidExaAnn (ActChgCalCrs1stDay + 91)
#define ActShoExaAnn (ActChgCalCrs1stDay + 92)
#define ActSeeOneExaAnn (ActChgCalCrs1stDay + 85)
#define ActSeeDatExaAnn (ActChgCalCrs1stDay + 86)
#define ActEdiExaAnn (ActChgCalCrs1stDay + 87)
#define ActRcvExaAnn (ActChgCalCrs1stDay + 88)
#define ActPrnExaAnn (ActChgCalCrs1stDay + 89)
#define ActReqRemExaAnn (ActChgCalCrs1stDay + 90)
#define ActRemExaAnn (ActChgCalCrs1stDay + 91)
#define ActHidExaAnn (ActChgCalCrs1stDay + 92)
#define ActShoExaAnn (ActChgCalCrs1stDay + 93)
/*****************************************************************************/
/******************************** Files tab **********************************/

View File

@ -234,19 +234,33 @@
// TODO: "Solicitar inscripción" como superusuario: "Usted no tiene permiso para realizar esta acción"
// TODO: Poner icono con enlace a días festivos en calendario de centro, titulación y asignatura, además del actual calendario de institución
// TODO: Cuando vamos a inscribir a un nuevo usuario en la asignatura,
// debe salir por defecto estudiante en la opción Estudiantes y profesor en la opción Profesores,
// pero si el usuario ya existe en la asignatura, debe salir siempre el rol actual
// (para no cambiarlo sin querer si lo único que queremos hacer es cambiar la inscripción a grupos)
// TODO: No se ve bien la lista de usuarios conectados (en Usuarios > Conectados). El ancho de la tabla no es correcto debido a la fecha demasiado ancha (por ej. los miércoles)
// TODO: Fix bug: Un superusuario se apunta a grupos, cuando pulsa "Cambiar de grupos" no ocurre nada.
// TODO: "Administrar varios profesores no editores" -> debería poder hacerlo un profesor (Perico)
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.253 (2017-09-11)"
#define Log_PLATFORM_VERSION "SWAD 16.254.1 (2017-09-13)"
#define CSS_FILE "swad16.252.2.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.254: Sep 12, 2017 Action to start playing a game. (227113 lines)
1 change necessary in database:
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1670','es','N','Bajar posición pregunta juego');
Version 16.253: Sep 11, 2017 Actions to move up and down questions in a game. (227070 lines)
4 changes necessary in database:
UPDATE actions SET Txt='Subir posición item teoría' WHERE ActCod='221' AND Language='es';

View File

@ -517,7 +517,21 @@ static void Gam_ShowOneGame (long GamCod,bool ShowOnlyThisGameComplete)
fprintf (Gbl.F.Out,"\">");
Gam_WriteStatus (&Game);
if (!ShowOnlyThisGameComplete)
if (ShowOnlyThisGameComplete)
{
fprintf (Gbl.F.Out,"<div class=\"BUTTONS_AFTER_ALERT\">");
Act_FormStart (ActPlyGam);
Gam_PutParamGameCod (Game.GamCod);
Gam_PutHiddenParamGameOrder ();
Grp_PutParamWhichGrps ();
Pag_PutHiddenParamPagNum (Pag_SURVEYS,Gbl.Games.CurrentPage);
Btn_PutCreateButtonInline (Txt_Play);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</div>");
}
else // Show several games
{
/* Possible button to answer this game */
if (Game.Status.ICanAnswer)
@ -2172,11 +2186,11 @@ void Gam_RecFormGame (void)
}
/*****************************************************************************/
/*********** Update number of users notified in table of games *************/
/************ Update number of users notified in table of games **************/
/*****************************************************************************/
static void Gam_UpdateNumUsrsNotifiedByEMailAboutGame (long GamCod,
unsigned NumUsrsToBeNotifiedByEMail)
unsigned NumUsrsToBeNotifiedByEMail)
{
char Query[256];
@ -2188,7 +2202,7 @@ static void Gam_UpdateNumUsrsNotifiedByEMailAboutGame (long GamCod,
}
/*****************************************************************************/
/*************************** Create a new game *****************************/
/**************************** Create a new game ******************************/
/*****************************************************************************/
static void Gam_CreateGame (struct Game *Game,const char *Txt)
@ -3444,6 +3458,27 @@ static void Gam_ExchangeQuestions (long GamCod,
"Can not unlock tables after moving game questions");
}
/*****************************************************************************/
/************************* Start playing a game ******************************/
/*****************************************************************************/
void Gam_PlayGame (void)
{
struct Game Game;
/***** Get parameters *****/
Gam_GetParamGameOrder ();
Grp_GetParamWhichGrps ();
Gbl.Games.CurrentPage = Pag_GetParamPagNum (Pag_SURVEYS);
/***** Get game code *****/
if ((Game.GamCod = Gam_GetParamGameCod ()) == -1L)
Lay_ShowErrorAndExit ("Code of game is missing.");
/***** Show game *****/
Gam_ShowOneGame (Game.GamCod,true);
}
/*****************************************************************************/
/************************ Receive answers of a game ************************/
/*****************************************************************************/

View File

@ -125,6 +125,8 @@ void Gam_RemoveQst (void);
void Gam_MoveUpQst (void);
void Gam_MoveDownQst (void);
void Gam_PlayGame (void);
void Gam_ReceiveGameAnswers (void);
unsigned Gam_GetNumCoursesWithCrsGames (Sco_Scope_t Scope);