mirror of https://github.com/acanas/swad-core.git
Version 22.8: Sep 18, 2022 Links to games in program.
This commit is contained in:
parent
e878405ecd
commit
004c451068
|
@ -822,6 +822,7 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
||||||
[ActRemGamQst ] = {1665,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_RemoveQstFromGame ,NULL},
|
[ActRemGamQst ] = {1665,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_RemoveQstFromGame ,NULL},
|
||||||
[ActUp_GamQst ] = {1668,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_MoveUpQst ,NULL},
|
[ActUp_GamQst ] = {1668,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_MoveUpQst ,NULL},
|
||||||
[ActDwnGamQst ] = {1669,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_MoveDownQst ,NULL},
|
[ActDwnGamQst ] = {1669,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_MoveDownQst ,NULL},
|
||||||
|
[ActReqLnkGam ] = {1935,-1,TabUnk,ActSeeAllGam ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_GetLinkToGame ,NULL},
|
||||||
|
|
||||||
[ActSeeSvy ] = { 982,-1,TabUnk,ActSeeAllSvy ,0x3F8,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Svy_SeeOneSurvey ,NULL},
|
[ActSeeSvy ] = { 982,-1,TabUnk,ActSeeAllSvy ,0x3F8,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Svy_SeeOneSurvey ,NULL},
|
||||||
[ActAnsSvy ] = { 983,-1,TabUnk,ActSeeAllSvy ,0x3F8,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Svy_ReceiveSurveyAnswers ,NULL},
|
[ActAnsSvy ] = { 983,-1,TabUnk,ActSeeAllSvy ,0x3F8,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Svy_ReceiveSurveyAnswers ,NULL},
|
||||||
|
@ -3779,6 +3780,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
|
||||||
ActSeeCliPrgRsc, // #1932
|
ActSeeCliPrgRsc, // #1932
|
||||||
ActChgLnkPrgRsc, // #1933
|
ActChgLnkPrgRsc, // #1933
|
||||||
ActReqLnkCfe, // #1934
|
ActReqLnkCfe, // #1934
|
||||||
|
ActReqLnkGam, // #1935
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -65,7 +65,7 @@ typedef enum
|
||||||
|
|
||||||
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
||||||
|
|
||||||
#define Act_MAX_ACTION_COD 1934
|
#define Act_MAX_ACTION_COD 1935
|
||||||
|
|
||||||
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13
|
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13
|
||||||
|
|
||||||
|
@ -776,23 +776,24 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
|
||||||
#define ActRemGamQst (ActChgCrsTT1stDay + 222)
|
#define ActRemGamQst (ActChgCrsTT1stDay + 222)
|
||||||
#define ActUp_GamQst (ActChgCrsTT1stDay + 223)
|
#define ActUp_GamQst (ActChgCrsTT1stDay + 223)
|
||||||
#define ActDwnGamQst (ActChgCrsTT1stDay + 224)
|
#define ActDwnGamQst (ActChgCrsTT1stDay + 224)
|
||||||
|
#define ActReqLnkGam (ActChgCrsTT1stDay + 225)
|
||||||
|
|
||||||
#define ActSeeSvy (ActChgCrsTT1stDay + 225)
|
#define ActSeeSvy (ActChgCrsTT1stDay + 226)
|
||||||
#define ActAnsSvy (ActChgCrsTT1stDay + 226)
|
#define ActAnsSvy (ActChgCrsTT1stDay + 227)
|
||||||
#define ActFrmNewSvy (ActChgCrsTT1stDay + 227)
|
#define ActFrmNewSvy (ActChgCrsTT1stDay + 228)
|
||||||
#define ActEdiOneSvy (ActChgCrsTT1stDay + 228)
|
#define ActEdiOneSvy (ActChgCrsTT1stDay + 229)
|
||||||
#define ActNewSvy (ActChgCrsTT1stDay + 229)
|
#define ActNewSvy (ActChgCrsTT1stDay + 230)
|
||||||
#define ActChgSvy (ActChgCrsTT1stDay + 230)
|
#define ActChgSvy (ActChgCrsTT1stDay + 231)
|
||||||
#define ActReqRemSvy (ActChgCrsTT1stDay + 231)
|
#define ActReqRemSvy (ActChgCrsTT1stDay + 232)
|
||||||
#define ActRemSvy (ActChgCrsTT1stDay + 232)
|
#define ActRemSvy (ActChgCrsTT1stDay + 233)
|
||||||
#define ActReqRstSvy (ActChgCrsTT1stDay + 233)
|
#define ActReqRstSvy (ActChgCrsTT1stDay + 234)
|
||||||
#define ActRstSvy (ActChgCrsTT1stDay + 234)
|
#define ActRstSvy (ActChgCrsTT1stDay + 235)
|
||||||
#define ActHidSvy (ActChgCrsTT1stDay + 235)
|
#define ActHidSvy (ActChgCrsTT1stDay + 236)
|
||||||
#define ActUnhSvy (ActChgCrsTT1stDay + 236)
|
#define ActUnhSvy (ActChgCrsTT1stDay + 237)
|
||||||
#define ActEdiOneSvyQst (ActChgCrsTT1stDay + 237)
|
#define ActEdiOneSvyQst (ActChgCrsTT1stDay + 238)
|
||||||
#define ActRcvSvyQst (ActChgCrsTT1stDay + 238)
|
#define ActRcvSvyQst (ActChgCrsTT1stDay + 239)
|
||||||
#define ActReqRemSvyQst (ActChgCrsTT1stDay + 239)
|
#define ActReqRemSvyQst (ActChgCrsTT1stDay + 240)
|
||||||
#define ActRemSvyQst (ActChgCrsTT1stDay + 240)
|
#define ActRemSvyQst (ActChgCrsTT1stDay + 241)
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************************** Files tab **********************************/
|
/******************************** Files tab **********************************/
|
||||||
|
|
|
@ -1688,7 +1688,49 @@ static void Cfe_GetNotifContentCallForExam (const struct Cfe_CallsForExams *Call
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************** Write file name in course program **********************/
|
/************************ Get link to call for exam **************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Cfe_GetLinkToCallForExam (void)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Link_to_resource_X_copied_into_clipboard;
|
||||||
|
struct Cfe_CallsForExams *CallsForExams = Cfe_GetGlobalCallsForExams ();
|
||||||
|
long ExaCod;
|
||||||
|
char SessionAndDate[Cfe_MAX_BYTES_SESSION_AND_DATE];
|
||||||
|
|
||||||
|
/***** Reset calls for exams context *****/
|
||||||
|
Cfe_ResetCallsForExams (CallsForExams);
|
||||||
|
|
||||||
|
/***** Get the code of the call for exam *****/
|
||||||
|
if ((ExaCod = Cfe_GetParamExaCod ()) <= 0)
|
||||||
|
Err_WrongCallForExamExit ();
|
||||||
|
|
||||||
|
/***** Get data of call for exam *****/
|
||||||
|
Cfe_AllocMemCallForExam (CallsForExams);
|
||||||
|
Cfe_GetDataCallForExamFromDB (CallsForExams,ExaCod);
|
||||||
|
|
||||||
|
/***** Session and date of the exam *****/
|
||||||
|
Cfe_BuildSessionAndDate (CallsForExams,SessionAndDate);
|
||||||
|
|
||||||
|
/***** Copy link to call for exam into resource clipboard *****/
|
||||||
|
Prg_DB_CopyToClipboard (PrgRsc_CALL_FOR_EXAM,ExaCod);
|
||||||
|
|
||||||
|
/***** Write sucess message *****/
|
||||||
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
||||||
|
SessionAndDate);
|
||||||
|
|
||||||
|
/***** Free memory of the call for exam *****/
|
||||||
|
Cfe_FreeMemCallForExam (CallsForExams);
|
||||||
|
|
||||||
|
/***** Set exam to be highlighted *****/
|
||||||
|
CallsForExams->HighlightExaCod = ExaCod;
|
||||||
|
|
||||||
|
/***** Show again the list of calls for exams *****/
|
||||||
|
Cfe_ListCallsForExamsEdit ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/******************* Write call for exam in course program *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Cfe_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo)
|
void Cfe_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo)
|
||||||
|
@ -1735,48 +1777,6 @@ void Cfe_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************************ Get link to call for exam **************************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
void Cfe_GetLinkToCallForExam (void)
|
|
||||||
{
|
|
||||||
extern const char *Txt_Link_to_resource_X_copied_into_clipboard;
|
|
||||||
struct Cfe_CallsForExams *CallsForExams = Cfe_GetGlobalCallsForExams ();
|
|
||||||
long ExaCod;
|
|
||||||
char SessionAndDate[Cfe_MAX_BYTES_SESSION_AND_DATE];
|
|
||||||
|
|
||||||
/***** Reset calls for exams context *****/
|
|
||||||
Cfe_ResetCallsForExams (CallsForExams);
|
|
||||||
|
|
||||||
/***** Get the code of the call for exam *****/
|
|
||||||
if ((ExaCod = Cfe_GetParamExaCod ()) <= 0)
|
|
||||||
Err_WrongCallForExamExit ();
|
|
||||||
|
|
||||||
/***** Get data of call for exam *****/
|
|
||||||
Cfe_AllocMemCallForExam (CallsForExams);
|
|
||||||
Cfe_GetDataCallForExamFromDB (CallsForExams,ExaCod);
|
|
||||||
|
|
||||||
/***** Session and date of the exam *****/
|
|
||||||
Cfe_BuildSessionAndDate (CallsForExams,SessionAndDate);
|
|
||||||
|
|
||||||
/***** Copy link to call for exam into resource clipboard *****/
|
|
||||||
Prg_DB_CopyToClipboard (PrgRsc_CALL_FOR_EXAM,ExaCod);
|
|
||||||
|
|
||||||
/***** Write sucess message *****/
|
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
|
||||||
SessionAndDate);
|
|
||||||
|
|
||||||
/***** Free memory of the call for exam *****/
|
|
||||||
Cfe_FreeMemCallForExam (CallsForExams);
|
|
||||||
|
|
||||||
/***** Set exam to be highlighted *****/
|
|
||||||
CallsForExams->HighlightExaCod = ExaCod;
|
|
||||||
|
|
||||||
/***** Show again the list of calls for exams *****/
|
|
||||||
Cfe_ListCallsForExamsEdit ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************** Get call for exam text from call for exam code ***************/
|
/************** Get call for exam text from call for exam code ***************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -126,9 +126,9 @@ void Cfe_GetSummaryAndContentCallForExam (char SummaryStr[Ntf_MAX_BYTES_SUMMARY
|
||||||
char **ContentStr,
|
char **ContentStr,
|
||||||
long ExaCod,bool GetContent);
|
long ExaCod,bool GetContent);
|
||||||
|
|
||||||
void Cfe_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo);
|
//--------------------------- Program resources -------------------------------
|
||||||
|
|
||||||
void Cfe_GetLinkToCallForExam (void);
|
void Cfe_GetLinkToCallForExam (void);
|
||||||
|
void Cfe_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo);
|
||||||
void Cfe_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
|
void Cfe_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -606,14 +606,15 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate
|
||||||
|
|
||||||
TODO: Attach pdf files in multimedia.
|
TODO: Attach pdf files in multimedia.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 22.7 (2022-09-17)"
|
#define Log_PLATFORM_VERSION "SWAD 22.8 (2022-09-18)"
|
||||||
#define CSS_FILE "swad22.7.css"
|
#define CSS_FILE "swad22.7.css"
|
||||||
#define JS_FILE "swad21.100.js"
|
#define JS_FILE "swad21.100.js"
|
||||||
/*
|
/*
|
||||||
Version 22.7: Sep 18, 2022 Link to calls for exams in program.
|
Version 22.8: Sep 18, 2022 Links to games in program. (330355 lines)
|
||||||
|
Version 22.7: Sep 18, 2022 Links to calls for exams in program.
|
||||||
Notification of a call for exam now links to the call. (330230 lines)
|
Notification of a call for exam now links to the call. (330230 lines)
|
||||||
Version 22.6: Sep 17, 2022 Changes in edition of program items. (330065 lines)
|
Version 22.6: Sep 17, 2022 Changes in edition of program items. (330065 lines)
|
||||||
Version 22.5: Sep 16, 2022 Link to download document in program. (330018 lines)
|
Version 22.5: Sep 16, 2022 Links to download documents in program. (330018 lines)
|
||||||
Version 22.4.2: Sep 16, 2022 Changes in edition of program items. (329982 lines)
|
Version 22.4.2: Sep 16, 2022 Changes in edition of program items. (329982 lines)
|
||||||
Version 22.4.1: Sep 15, 2022 Changes in edition of program items. (329955 lines)
|
Version 22.4.1: Sep 15, 2022 Changes in edition of program items. (329955 lines)
|
||||||
Copy the following icon to icon public directory:
|
Copy the following icon to icon public directory:
|
||||||
|
|
|
@ -1484,7 +1484,7 @@ unsigned Exa_DB_GetDataOfSessionByCod (MYSQL_RES **mysql_res,long SesCod)
|
||||||
" AND ExaCod IN" // Extra check
|
" AND ExaCod IN" // Extra check
|
||||||
" (SELECT ExaCod"
|
" (SELECT ExaCod"
|
||||||
" FROM exa_exams"
|
" FROM exa_exams"
|
||||||
" WHERE CrsCod='%ld')",
|
" WHERE CrsCod=%ld)",
|
||||||
SesCod,
|
SesCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
}
|
}
|
||||||
|
|
96
swad_game.c
96
swad_game.c
|
@ -47,6 +47,7 @@
|
||||||
#include "swad_match_database.h"
|
#include "swad_match_database.h"
|
||||||
#include "swad_match_result.h"
|
#include "swad_match_result.h"
|
||||||
#include "swad_pagination.h"
|
#include "swad_pagination.h"
|
||||||
|
#include "swad_program_database.h"
|
||||||
#include "swad_role.h"
|
#include "swad_role.h"
|
||||||
#include "swad_test.h"
|
#include "swad_test.h"
|
||||||
#include "swad_test_visibility.h"
|
#include "swad_test_visibility.h"
|
||||||
|
@ -116,7 +117,7 @@ static void Gam_PutParamsToCreateNewGame (void *Games);
|
||||||
static void Gam_ShowOneGame (struct Gam_Games *Games,
|
static void Gam_ShowOneGame (struct Gam_Games *Games,
|
||||||
struct Gam_Game *Game,bool ShowOnlyThisGame);
|
struct Gam_Game *Game,bool ShowOnlyThisGame);
|
||||||
|
|
||||||
static void Gam_PutIconToShowResultsOfGame (void *Games);
|
static void Gam_PutIconsOneGame (void *Games);
|
||||||
static void Gam_WriteAuthor (struct Gam_Game *Game);
|
static void Gam_WriteAuthor (struct Gam_Game *Game);
|
||||||
|
|
||||||
static void Gam_PutHiddenParamGameOrder (Gam_Order_t SelectedOrder);
|
static void Gam_PutHiddenParamGameOrder (Gam_Order_t SelectedOrder);
|
||||||
|
@ -487,7 +488,7 @@ void Gam_ShowOnlyOneGameBegin (struct Gam_Games *Games,
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Games->GamCod = Game->GamCod;
|
Games->GamCod = Game->GamCod;
|
||||||
Box_BoxBegin (NULL,Txt_Game,
|
Box_BoxBegin (NULL,Txt_Game,
|
||||||
Gam_PutIconToShowResultsOfGame,Games,
|
Gam_PutIconsOneGame,Games,
|
||||||
Hlp_ASSESSMENT_Games,Box_NOT_CLOSABLE);
|
Hlp_ASSESSMENT_Games,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Show game *****/
|
/***** Show game *****/
|
||||||
|
@ -691,7 +692,7 @@ static void Gam_ShowOneGame (struct Gam_Games *Games,
|
||||||
/************* Put icon to show results of matches in a game *****************/
|
/************* Put icon to show results of matches in a game *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Gam_PutIconToShowResultsOfGame (void *Games)
|
static void Gam_PutIconsOneGame (void *Games)
|
||||||
{
|
{
|
||||||
static const Act_Action_t NextAction[Rol_NUM_ROLES] =
|
static const Act_Action_t NextAction[Rol_NUM_ROLES] =
|
||||||
{
|
{
|
||||||
|
@ -702,10 +703,17 @@ static void Gam_PutIconToShowResultsOfGame (void *Games)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Games)
|
if (Games)
|
||||||
|
{
|
||||||
/***** Put icon to view matches results *****/
|
/***** Put icon to view matches results *****/
|
||||||
if (NextAction[Gbl.Usrs.Me.Role.Logged])
|
if (NextAction[Gbl.Usrs.Me.Role.Logged])
|
||||||
Ico_PutContextualIconToShowResults (NextAction[Gbl.Usrs.Me.Role.Logged],MchRes_RESULTS_BOX_ID,
|
Ico_PutContextualIconToShowResults (NextAction[Gbl.Usrs.Me.Role.Logged],MchRes_RESULTS_BOX_ID,
|
||||||
Gam_PutParams,Games);
|
Gam_PutParams,Games);
|
||||||
|
|
||||||
|
/***** Link to get resource link *****/
|
||||||
|
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // Only if I am superuser // TODO: Include teachers
|
||||||
|
Ico_PutContextualIconToGetLink (ActReqLnkGam,NULL,
|
||||||
|
Gam_PutParams,Games);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2342,3 +2350,85 @@ void Gam_GetAndShowGamesStats (void)
|
||||||
/***** End table and box *****/
|
/***** End table and box *****/
|
||||||
Box_BoxTableEnd ();
|
Box_BoxTableEnd ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/***************************** Get link to game ******************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Gam_GetLinkToGame (void)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Link_to_resource_X_copied_into_clipboard;
|
||||||
|
struct Gam_Games Games;
|
||||||
|
struct Gam_Game Game;
|
||||||
|
|
||||||
|
/***** Reset games context *****/
|
||||||
|
Gam_ResetGames (&Games);
|
||||||
|
|
||||||
|
/***** Reset game *****/
|
||||||
|
Gam_ResetGame (&Game);
|
||||||
|
|
||||||
|
/***** Get parameters *****/
|
||||||
|
if ((Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||||
|
Err_WrongGameExit ();
|
||||||
|
|
||||||
|
/***** Get data of the game from database *****/
|
||||||
|
Gam_GetDataOfGameByCod (&Game);
|
||||||
|
|
||||||
|
/***** Copy link to call for exam into resource clipboard *****/
|
||||||
|
Prg_DB_CopyToClipboard (PrgRsc_GAME,Game.GamCod);
|
||||||
|
|
||||||
|
/***** Write sucess message *****/
|
||||||
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
||||||
|
Game.Title);
|
||||||
|
|
||||||
|
/***** Show games again *****/
|
||||||
|
Gam_ListAllGames (&Games);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********************** Write game in course program ************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Gam_WriteGameInCrsProgram (long GamCod,bool PutFormToGo)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||||
|
char Title[Gam_MAX_BYTES_TITLE + 1];
|
||||||
|
|
||||||
|
/***** Get game title *****/
|
||||||
|
Gam_DB_GetGameTitle (GamCod,Title);
|
||||||
|
|
||||||
|
/***** Begin form to download file *****/
|
||||||
|
if (PutFormToGo)
|
||||||
|
{
|
||||||
|
Frm_BeginForm (ActSeeGam);
|
||||||
|
Gam_PutParamGameCod (GamCod);
|
||||||
|
HTM_BUTTON_Submit_Begin (Txt_Actions[ActSeeOneCfe],
|
||||||
|
"class=\"LM BT_LINK PRG_RSC_%s\"",
|
||||||
|
The_GetSuffix ());
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Write Name of the course and date of exam *****/
|
||||||
|
HTM_Txt (Title);
|
||||||
|
|
||||||
|
/***** End form to download file *****/
|
||||||
|
if (PutFormToGo)
|
||||||
|
{
|
||||||
|
/* End form */
|
||||||
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
|
Frm_EndForm ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************** Get game title from call for exam code ***************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Gam_GetTitleFromGamCod (long GamCod,char *Title,size_t TitleSize)
|
||||||
|
{
|
||||||
|
char TitleFromDB[Gam_MAX_BYTES_TITLE + 1];
|
||||||
|
|
||||||
|
/***** Get game title *****/
|
||||||
|
Gam_DB_GetGameTitle (GamCod,TitleFromDB);
|
||||||
|
Str_Copy (Title,TitleFromDB,TitleSize);
|
||||||
|
}
|
||||||
|
|
|
@ -167,4 +167,9 @@ void Gam_GetScoreRange (long GamCod,double *MinScore,double *MaxScore);
|
||||||
//-------------------------------- Figures ------------------------------------
|
//-------------------------------- Figures ------------------------------------
|
||||||
void Gam_GetAndShowGamesStats (void);
|
void Gam_GetAndShowGamesStats (void);
|
||||||
|
|
||||||
|
//--------------------------- Program resources -------------------------------
|
||||||
|
void Gam_GetLinkToGame (void);
|
||||||
|
void Gam_WriteGameInCrsProgram (long GamCod,bool PutFormToGo);
|
||||||
|
void Gam_GetTitleFromGamCod (long GamCod,char *Title,size_t TitleSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -217,18 +217,32 @@ unsigned Gam_DB_GetDataOfGameByCod (MYSQL_RES **mysql_res,long GamCod)
|
||||||
" LEFT JOIN mch_matches"
|
" LEFT JOIN mch_matches"
|
||||||
" ON gam_games.GamCod=mch_matches.GamCod"
|
" ON gam_games.GamCod=mch_matches.GamCod"
|
||||||
" WHERE gam_games.GamCod=%ld"
|
" WHERE gam_games.GamCod=%ld"
|
||||||
" AND gam_games.CrsCod='%ld'", // Extra check
|
" AND gam_games.CrsCod=%ld", // Extra check
|
||||||
GamCod,
|
GamCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********************** Get game title from database ************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Gam_DB_GetGameTitle (long GamCod,char Title[Gam_MAX_BYTES_TITLE + 1])
|
||||||
|
{
|
||||||
|
DB_QuerySELECTString (Title,Gam_MAX_BYTES_TITLE,"can not get game title",
|
||||||
|
"SELECT Title" // row[0]
|
||||||
|
" FROM gam_games"
|
||||||
|
" WHERE GamCod=%ld"
|
||||||
|
" AND gam_games.CrsCod=%ld", // Extra check
|
||||||
|
GamCod,
|
||||||
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************** Get game text from database ************************/
|
/********************** Get game text from database ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Gam_DB_GetGameTxt (long GamCod,char Txt[Cns_MAX_BYTES_TEXT + 1])
|
void Gam_DB_GetGameTxt (long GamCod,char Txt[Cns_MAX_BYTES_TEXT + 1])
|
||||||
{
|
{
|
||||||
/***** Get text of game from database *****/
|
|
||||||
DB_QuerySELECTString (Txt,Cns_MAX_BYTES_TEXT,"can not get game text",
|
DB_QuerySELECTString (Txt,Cns_MAX_BYTES_TEXT,"can not get game text",
|
||||||
"SELECT Txt" // row[0]
|
"SELECT Txt" // row[0]
|
||||||
" FROM gam_games"
|
" FROM gam_games"
|
||||||
|
|
|
@ -42,6 +42,7 @@ void Gam_DB_HideOrUnhideGame (long GamCod,bool Hide);
|
||||||
unsigned Gam_DB_GetListGames (MYSQL_RES **mysql_res,Gam_Order_t SelectedOrder);
|
unsigned Gam_DB_GetListGames (MYSQL_RES **mysql_res,Gam_Order_t SelectedOrder);
|
||||||
unsigned Gam_DB_GetListAvailableGames (MYSQL_RES **mysql_res);
|
unsigned Gam_DB_GetListAvailableGames (MYSQL_RES **mysql_res);
|
||||||
unsigned Gam_DB_GetDataOfGameByCod (MYSQL_RES **mysql_res,long GamCod);
|
unsigned Gam_DB_GetDataOfGameByCod (MYSQL_RES **mysql_res,long GamCod);
|
||||||
|
void Gam_DB_GetGameTitle (long GamCod,char Title[Gam_MAX_BYTES_TITLE + 1]);
|
||||||
void Gam_DB_GetGameTxt (long GamCod,char Txt[Cns_MAX_BYTES_TEXT + 1]);
|
void Gam_DB_GetGameTxt (long GamCod,char Txt[Cns_MAX_BYTES_TEXT + 1]);
|
||||||
bool Gam_DB_CheckIfSimilarGameExists (const struct Gam_Game *Game);
|
bool Gam_DB_CheckIfSimilarGameExists (const struct Gam_Game *Game);
|
||||||
unsigned Gam_DB_GetNumCoursesWithGames (HieLvl_Level_t Scope);
|
unsigned Gam_DB_GetNumCoursesWithGames (HieLvl_Level_t Scope);
|
||||||
|
|
|
@ -192,7 +192,7 @@ unsigned Mch_DB_GetDataOfMatchByCod (MYSQL_RES **mysql_res,long MchCod)
|
||||||
" AND GamCod IN" // Extra check
|
" AND GamCod IN" // Extra check
|
||||||
" (SELECT GamCod"
|
" (SELECT GamCod"
|
||||||
" FROM gam_games"
|
" FROM gam_games"
|
||||||
" WHERE CrsCod='%ld')",
|
" WHERE CrsCod=%ld)",
|
||||||
MchCod,
|
MchCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "swad_call_for_exam.h"
|
#include "swad_call_for_exam.h"
|
||||||
#include "swad_error.h"
|
#include "swad_error.h"
|
||||||
#include "swad_form.h"
|
#include "swad_form.h"
|
||||||
|
#include "swad_game.h"
|
||||||
#include "swad_global.h"
|
#include "swad_global.h"
|
||||||
#include "swad_program.h"
|
#include "swad_program.h"
|
||||||
#include "swad_program_database.h"
|
#include "swad_program_database.h"
|
||||||
|
@ -1020,7 +1021,11 @@ static void PrgRsc_WriteLinkName (const struct Prg_Link *Link,bool PutForm)
|
||||||
Cfe_WriteCallForExamInCrsProgram (Link->Cod,PutForm);
|
Cfe_WriteCallForExamInCrsProgram (Link->Cod,PutForm);
|
||||||
break;
|
break;
|
||||||
case PrgRsc_EXAM:
|
case PrgRsc_EXAM:
|
||||||
|
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
||||||
|
break;
|
||||||
case PrgRsc_GAME:
|
case PrgRsc_GAME:
|
||||||
|
Gam_WriteGameInCrsProgram (Link->Cod,PutForm);
|
||||||
|
break;
|
||||||
case PrgRsc_SURVEY:
|
case PrgRsc_SURVEY:
|
||||||
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
||||||
break;
|
break;
|
||||||
|
@ -1064,7 +1069,13 @@ static void PrgRsc_GetResourceTitleFromLink (struct Prg_Item *Item)
|
||||||
sizeof (Item->Resource.Title) - 1);
|
sizeof (Item->Resource.Title) - 1);
|
||||||
break;
|
break;
|
||||||
case PrgRsc_EXAM:
|
case PrgRsc_EXAM:
|
||||||
|
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
||||||
|
break;
|
||||||
case PrgRsc_GAME:
|
case PrgRsc_GAME:
|
||||||
|
Gam_GetTitleFromGamCod (Item->Resource.Link.Cod,
|
||||||
|
Item->Resource.Title,
|
||||||
|
sizeof (Item->Resource.Title) - 1);
|
||||||
|
break;
|
||||||
case PrgRsc_SURVEY:
|
case PrgRsc_SURVEY:
|
||||||
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -286,11 +286,11 @@ unsigned Qst_DB_GetQsts (MYSQL_RES **mysql_res,
|
||||||
"tst_tags",
|
"tst_tags",
|
||||||
Qst_MAX_BYTES_QUERY_QUESTIONS);
|
Qst_MAX_BYTES_QUERY_QUESTIONS);
|
||||||
|
|
||||||
Str_Concat (Query," WHERE tst_questions.CrsCod='",
|
Str_Concat (Query," WHERE tst_questions.CrsCod=",
|
||||||
Qst_MAX_BYTES_QUERY_QUESTIONS);
|
Qst_MAX_BYTES_QUERY_QUESTIONS);
|
||||||
snprintf (CrsCodStr,sizeof (CrsCodStr),"%ld",Gbl.Hierarchy.Crs.CrsCod);
|
snprintf (CrsCodStr,sizeof (CrsCodStr),"%ld",Gbl.Hierarchy.Crs.CrsCod);
|
||||||
Str_Concat (Query,CrsCodStr,Qst_MAX_BYTES_QUERY_QUESTIONS);
|
Str_Concat (Query,CrsCodStr,Qst_MAX_BYTES_QUERY_QUESTIONS);
|
||||||
Str_Concat (Query,"' AND tst_questions.EditTime>=FROM_UNIXTIME('",
|
Str_Concat (Query," AND tst_questions.EditTime>=FROM_UNIXTIME('",
|
||||||
Qst_MAX_BYTES_QUERY_QUESTIONS);
|
Qst_MAX_BYTES_QUERY_QUESTIONS);
|
||||||
snprintf (LongStr,sizeof (LongStr),"%ld",
|
snprintf (LongStr,sizeof (LongStr),"%ld",
|
||||||
(long) Gbl.DateRange.TimeUTC[Dat_STR_TIME]);
|
(long) Gbl.DateRange.TimeUTC[Dat_STR_TIME]);
|
||||||
|
@ -307,10 +307,9 @@ unsigned Qst_DB_GetQsts (MYSQL_RES **mysql_res,
|
||||||
{
|
{
|
||||||
Str_Concat (Query," AND tst_questions.QstCod=tst_question_tags.QstCod"
|
Str_Concat (Query," AND tst_questions.QstCod=tst_question_tags.QstCod"
|
||||||
" AND tst_question_tags.TagCod=tst_tags.TagCod"
|
" AND tst_question_tags.TagCod=tst_tags.TagCod"
|
||||||
" AND tst_tags.CrsCod='",
|
" AND tst_tags.CrsCod=",
|
||||||
Qst_MAX_BYTES_QUERY_QUESTIONS);
|
Qst_MAX_BYTES_QUERY_QUESTIONS);
|
||||||
Str_Concat (Query,CrsCodStr,Qst_MAX_BYTES_QUERY_QUESTIONS);
|
Str_Concat (Query,CrsCodStr,Qst_MAX_BYTES_QUERY_QUESTIONS);
|
||||||
Str_Concat (Query,"'",Qst_MAX_BYTES_QUERY_QUESTIONS);
|
|
||||||
LengthQuery = strlen (Query);
|
LengthQuery = strlen (Query);
|
||||||
NumItemInList = 0;
|
NumItemInList = 0;
|
||||||
Ptr = Questions->Tags.List;
|
Ptr = Questions->Tags.List;
|
||||||
|
|
|
@ -13607,6 +13607,29 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
||||||
"Move down game question" // Precisa de tradução
|
"Move down game question" // Precisa de tradução
|
||||||
#elif L==10 // tr
|
#elif L==10 // tr
|
||||||
"Move down game question" // Çeviri lazim!
|
"Move down game question" // Çeviri lazim!
|
||||||
|
#endif
|
||||||
|
,
|
||||||
|
[ActReqLnkGam] =
|
||||||
|
#if L==1 // ca
|
||||||
|
"Copy link to game" // Necessita traducció
|
||||||
|
#elif L==2 // de
|
||||||
|
"Copy link to game" // Need Übersetzung
|
||||||
|
#elif L==3 // en
|
||||||
|
"Copy link to game"
|
||||||
|
#elif L==4 // es
|
||||||
|
"Copiar enlace a juego"
|
||||||
|
#elif L==5 // fr
|
||||||
|
"Copy link to game" // Besoin de traduction
|
||||||
|
#elif L==6 // gn
|
||||||
|
"Copiar enlace a juego" // Okoteve traducción
|
||||||
|
#elif L==7 // it
|
||||||
|
"Copy link to game" // Bisogno di traduzione
|
||||||
|
#elif L==8 // pl
|
||||||
|
"Copy link to game" // Potrzebujesz tlumaczenie
|
||||||
|
#elif L==9 // pt
|
||||||
|
"Copy link to game" // Precisa de tradução
|
||||||
|
#elif L==10 // tr
|
||||||
|
"Copy link to game" // Çeviri lazim!
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[ActSeeSvy] =
|
[ActSeeSvy] =
|
||||||
|
|
Loading…
Reference in New Issue