mirror of https://github.com/acanas/swad-core.git
Version 22.81: Mar 26, 2023 New module swad_resource.
This commit is contained in:
parent
d7b20db859
commit
f7ca97a096
6
Makefile
6
Makefile
|
@ -83,9 +83,9 @@ OBJS = swad_account.o swad_account_database.o swad_action.o swad_action_list.o \
|
||||||
swad_question.o swad_question_database.o swad_question_import.o \
|
swad_question.o swad_question_database.o swad_question_import.o \
|
||||||
swad_QR.o \
|
swad_QR.o \
|
||||||
swad_record.o swad_record_database.o swad_report.o \
|
swad_record.o swad_record_database.o swad_report.o \
|
||||||
swad_report_database.o swad_role.o swad_role_database.o swad_room.o \
|
swad_report_database.o swad_resource.o swad_role.o swad_role_database.o \
|
||||||
swad_room_database.o swad_RSS.o swad_rubric.o swad_rubric_criteria.o \
|
swad_room.o swad_room_database.o swad_RSS.o swad_rubric.o \
|
||||||
swad_rubric_database.o \
|
swad_rubric_criteria.o swad_rubric_database.o \
|
||||||
swad_scope.o swad_search.o swad_session.o swad_session_database.o \
|
swad_scope.o swad_search.o swad_session.o swad_session_database.o \
|
||||||
swad_setting.o swad_setting_database.o swad_statistic.o \
|
swad_setting.o swad_setting_database.o swad_statistic.o \
|
||||||
swad_statistic_database.o swad_string.o swad_survey.o \
|
swad_statistic_database.o swad_string.o swad_survey.o \
|
||||||
|
|
|
@ -850,7 +850,7 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] =
|
||||||
[ActUp_RubCri ] = {1962,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_MoveUpCriterion ,NULL},
|
[ActUp_RubCri ] = {1962,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_MoveUpCriterion ,NULL},
|
||||||
[ActDwnRubCri ] = {1963,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_MoveDownCriterion ,NULL},
|
[ActDwnRubCri ] = {1963,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_MoveDownCriterion ,NULL},
|
||||||
[ActChgTitRubCri ] = {1964,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeTitle ,NULL},
|
[ActChgTitRubCri ] = {1964,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeTitle ,NULL},
|
||||||
[ActChgSrcRubCri ] = {1968,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeSource ,NULL},
|
[ActChgSrcRubCri ] = {1968,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeType ,NULL},
|
||||||
[ActChgMinRubCri ] = {1965,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeMinValue ,NULL},
|
[ActChgMinRubCri ] = {1965,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeMinValue ,NULL},
|
||||||
[ActChgMaxRubCri ] = {1966,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeMaxValue ,NULL},
|
[ActChgMaxRubCri ] = {1966,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeMaxValue ,NULL},
|
||||||
[ActChgWeiRubCri ] = {1967,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeWeight ,NULL},
|
[ActChgWeiRubCri ] = {1967,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeWeight ,NULL},
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
#include "swad_pagination.h"
|
#include "swad_pagination.h"
|
||||||
#include "swad_parameter_code.h"
|
#include "swad_parameter_code.h"
|
||||||
#include "swad_photo.h"
|
#include "swad_photo.h"
|
||||||
#include "swad_program_resource.h"
|
#include "swad_resource.h"
|
||||||
#include "swad_role.h"
|
#include "swad_role.h"
|
||||||
#include "swad_setting.h"
|
#include "swad_setting.h"
|
||||||
#include "swad_string.h"
|
#include "swad_string.h"
|
||||||
|
@ -302,7 +302,7 @@ static void Asg_PutIconsListAssignments (void *Assignments)
|
||||||
Asg_PutIconToCreateNewAsg (Assignments);
|
Asg_PutIconToCreateNewAsg (Assignments);
|
||||||
|
|
||||||
/***** Link to get resource link *****/
|
/***** Link to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
{
|
{
|
||||||
((struct Asg_Assignments *) Assignments)->Asg.AsgCod = -1L;
|
((struct Asg_Assignments *) Assignments)->Asg.AsgCod = -1L;
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkAsg,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkAsg,NULL,
|
||||||
|
@ -748,7 +748,7 @@ static void Asg_PutIconsToRemEditOneAsg (struct Asg_Assignments *Assignments,
|
||||||
Asg_PutPars,Assignments);
|
Asg_PutPars,Assignments);
|
||||||
|
|
||||||
/***** Link to get resource link *****/
|
/***** Link to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkAsg,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkAsg,NULL,
|
||||||
Asg_PutPars,Assignments);
|
Asg_PutPars,Assignments);
|
||||||
/* falls through */
|
/* falls through */
|
||||||
|
|
|
@ -61,7 +61,7 @@ void AsgRsc_GetLinkToAssignment (void)
|
||||||
AsgRsc_GetTitleFromAsgCod (Assignments.Asg.AsgCod,Title,sizeof (Title) - 1);
|
AsgRsc_GetTitleFromAsgCod (Assignments.Asg.AsgCod,Title,sizeof (Title) - 1);
|
||||||
|
|
||||||
/***** Copy link to assignment into resource clipboard *****/
|
/***** Copy link to assignment into resource clipboard *****/
|
||||||
Prg_DB_CopyToClipboard (PrgRsc_ASSIGNMENT,Assignments.Asg.AsgCod);
|
Prg_DB_CopyToClipboard (Rsc_ASSIGNMENT,Assignments.Asg.AsgCod);
|
||||||
|
|
||||||
/***** Write sucess message *****/
|
/***** Write sucess message *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
||||||
|
@ -76,11 +76,11 @@ void AsgRsc_GetLinkToAssignment (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************* Write assignment in course program ********************/
|
/************************ Write assignment as resource ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void AsgRsc_WriteAssignmentInCrsProgram (long AsgCod,bool PutFormToGo,
|
void AsgRsc_WriteResourceAssignment (long AsgCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle)
|
const char *Icon,const char *IconTitle)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||||
Act_Action_t NextAction;
|
Act_Action_t NextAction;
|
||||||
|
@ -115,9 +115,7 @@ void AsgRsc_WriteAssignmentInCrsProgram (long AsgCod,bool PutFormToGo,
|
||||||
/***** End form to download file *****/
|
/***** End form to download file *****/
|
||||||
if (PutFormToGo)
|
if (PutFormToGo)
|
||||||
{
|
{
|
||||||
/* End form */
|
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void AsgRsc_GetLinkToAssignment (void);
|
void AsgRsc_GetLinkToAssignment (void);
|
||||||
void AsgRsc_WriteAssignmentInCrsProgram (long AsgCod,bool PutFormToGo,
|
void AsgRsc_WriteResourceAssignment (long AsgCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle);
|
const char *Icon,const char *IconTitle);
|
||||||
void AsgRsc_GetTitleFromAsgCod (long AsgCod,char *Title,size_t TitleSize);
|
void AsgRsc_GetTitleFromAsgCod (long AsgCod,char *Title,size_t TitleSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -50,8 +50,8 @@
|
||||||
#include "swad_pagination.h"
|
#include "swad_pagination.h"
|
||||||
#include "swad_parameter.h"
|
#include "swad_parameter.h"
|
||||||
#include "swad_photo.h"
|
#include "swad_photo.h"
|
||||||
#include "swad_program_database.h"
|
|
||||||
#include "swad_QR.h"
|
#include "swad_QR.h"
|
||||||
|
#include "swad_resource.h"
|
||||||
#include "swad_setting.h"
|
#include "swad_setting.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -375,7 +375,7 @@ static void Att_PutIconsInListOfEvents (void *Events)
|
||||||
Usr_PutParMyUsrCodEncrypted,Gbl.Usrs.Me.UsrDat.EnUsrCod);
|
Usr_PutParMyUsrCodEncrypted,Gbl.Usrs.Me.UsrDat.EnUsrCod);
|
||||||
|
|
||||||
/***** Put icon to get resource link *****/
|
/***** Put icon to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkAtt,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkAtt,NULL,
|
||||||
Att_PutPars,Events);
|
Att_PutPars,Events);
|
||||||
}
|
}
|
||||||
|
@ -621,7 +621,7 @@ static void Att_PutFormsToRemEditOneEvent (struct Att_Events *Events,
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Icon to get resource link *****/
|
/***** Icon to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkAtt,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkAtt,NULL,
|
||||||
Att_PutPars,Events);
|
Att_PutPars,Events);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ void AttRsc_GetLinkToEvent (void)
|
||||||
AttRsc_GetTitleFromAttCod (AttCod,Title,sizeof (Title) - 1);
|
AttRsc_GetTitleFromAttCod (AttCod,Title,sizeof (Title) - 1);
|
||||||
|
|
||||||
/***** Copy link to attendance event into resource clipboard *****/
|
/***** Copy link to attendance event into resource clipboard *****/
|
||||||
Prg_DB_CopyToClipboard (PrgRsc_ATTENDANCE_EVENT,AttCod);
|
Prg_DB_CopyToClipboard (Rsc_ATTENDANCE_EVENT,AttCod);
|
||||||
|
|
||||||
/***** Write sucess message *****/
|
/***** Write sucess message *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
||||||
|
@ -62,11 +62,11 @@ void AttRsc_GetLinkToEvent (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**************** Write attendance event in course program *******************/
|
/****************** Write attendance event as resource ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void AttRsc_WriteEventInCrsProgram (long AttCod,bool PutFormToGo,
|
void AttRsc_WriteResourceEvent (long AttCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle)
|
const char *Icon,const char *IconTitle)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||||
Act_Action_t NextAction;
|
Act_Action_t NextAction;
|
||||||
|
@ -100,9 +100,7 @@ void AttRsc_WriteEventInCrsProgram (long AttCod,bool PutFormToGo,
|
||||||
/***** End form to download file *****/
|
/***** End form to download file *****/
|
||||||
if (PutFormToGo)
|
if (PutFormToGo)
|
||||||
{
|
{
|
||||||
/* End form */
|
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void AttRsc_GetLinkToEvent (void);
|
void AttRsc_GetLinkToEvent (void);
|
||||||
void AttRsc_WriteEventInCrsProgram (long AttCod,bool PutFormToGo,
|
void AttRsc_WriteResourceEvent (long AttCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle);
|
const char *Icon,const char *IconTitle);
|
||||||
void AttRsc_GetTitleFromAttCod (long AttCod,char *Title,size_t TitleSize);
|
void AttRsc_GetTitleFromAttCod (long AttCod,char *Title,size_t TitleSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -68,9 +68,9 @@
|
||||||
#include "swad_photo.h"
|
#include "swad_photo.h"
|
||||||
#include "swad_profile.h"
|
#include "swad_profile.h"
|
||||||
#include "swad_profile_database.h"
|
#include "swad_profile_database.h"
|
||||||
#include "swad_program_database.h"
|
|
||||||
#include "swad_project.h"
|
#include "swad_project.h"
|
||||||
#include "swad_project_database.h"
|
#include "swad_project_database.h"
|
||||||
|
#include "swad_resource.h"
|
||||||
#include "swad_role.h"
|
#include "swad_role.h"
|
||||||
#include "swad_setting.h"
|
#include "swad_setting.h"
|
||||||
#include "swad_setting_database.h"
|
#include "swad_setting_database.h"
|
||||||
|
@ -3297,7 +3297,7 @@ static void Brw_PutIconsFileBrowser (__attribute__((unused)) void *Args)
|
||||||
|
|
||||||
/***** Put icon to get resource link *****/
|
/***** Put icon to get resource link *****/
|
||||||
if (Brw_ActReqLnk[Gbl.FileBrowser.Type] != ActUnk &&
|
if (Brw_ActReqLnk[Gbl.FileBrowser.Type] != ActUnk &&
|
||||||
PrgRsc_CheckIfICanGetLink ())
|
Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (Brw_ActReqLnk[Gbl.FileBrowser.Type],NULL,
|
Ico_PutContextualIconToGetLink (Brw_ActReqLnk[Gbl.FileBrowser.Type],NULL,
|
||||||
NULL,NULL);
|
NULL,NULL);
|
||||||
|
|
||||||
|
@ -7558,7 +7558,7 @@ void Brw_ShowFileMetadata (void)
|
||||||
if (Brw_ActReqLnk[Gbl.FileBrowser.Type] != ActUnk &&
|
if (Brw_ActReqLnk[Gbl.FileBrowser.Type] != ActUnk &&
|
||||||
(FileMetadata.FilFolLnk.Type == Brw_IS_FILE || // Only files or links
|
(FileMetadata.FilFolLnk.Type == Brw_IS_FILE || // Only files or links
|
||||||
FileMetadata.FilFolLnk.Type == Brw_IS_LINK) &&
|
FileMetadata.FilFolLnk.Type == Brw_IS_LINK) &&
|
||||||
PrgRsc_CheckIfICanGetLink ())
|
Rsc_CheckIfICanGetLink ())
|
||||||
Box_BoxShadowBegin (NULL,NULL,
|
Box_BoxShadowBegin (NULL,NULL,
|
||||||
Brw_PutIconToGetLinkToFile,&FileMetadata,
|
Brw_PutIconToGetLinkToFile,&FileMetadata,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
|
@ -52,7 +52,7 @@ void BrwRsc_GetLinkToFile (void)
|
||||||
extern const char *Txt_Link_to_resource_X_copied_into_clipboard;
|
extern const char *Txt_Link_to_resource_X_copied_into_clipboard;
|
||||||
long FilCod;
|
long FilCod;
|
||||||
char Title[NAME_MAX + 1]; // File or link name
|
char Title[NAME_MAX + 1]; // File or link name
|
||||||
PrgRsc_Type_t Type;
|
Rsc_Type_t Type;
|
||||||
|
|
||||||
/***** Get parameters related to file browser *****/
|
/***** Get parameters related to file browser *****/
|
||||||
Brw_GetParAndInitFileBrowser ();
|
Brw_GetParAndInitFileBrowser ();
|
||||||
|
@ -65,16 +65,16 @@ void BrwRsc_GetLinkToFile (void)
|
||||||
{
|
{
|
||||||
case ActReqLnkSeeDocCrs:
|
case ActReqLnkSeeDocCrs:
|
||||||
case ActReqLnkAdmDocCrs:
|
case ActReqLnkAdmDocCrs:
|
||||||
Type = PrgRsc_DOCUMENT;
|
Type = Rsc_DOCUMENT;
|
||||||
BrwRsc_GetDocTitleFromFilCod (FilCod,Title,sizeof (Title) - 1);
|
BrwRsc_GetTitleFromDocFilCod (FilCod,Title,sizeof (Title) - 1);
|
||||||
break;
|
break;
|
||||||
case ActReqLnkSeeMrkCrs:
|
case ActReqLnkSeeMrkCrs:
|
||||||
case ActReqLnkAdmMrkCrs:
|
case ActReqLnkAdmMrkCrs:
|
||||||
Type = PrgRsc_MARKS;
|
Type = Rsc_MARKS;
|
||||||
BrwRsc_GetMrkTitleFromFilCod (FilCod,Title,sizeof (Title) - 1);
|
BrwRsc_GetTitleFromMrkFilCod (FilCod,Title,sizeof (Title) - 1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Type = PrgRsc_NONE; // Initialized to avoid warning
|
Type = Rsc_NONE; // Initialized to avoid warning
|
||||||
Err_WrongTypeExit ();
|
Err_WrongTypeExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -91,11 +91,11 @@ void BrwRsc_GetLinkToFile (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************** Write file name in course program **********************/
|
/************************ Write document as resource *************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void BrwRsc_WriteDocFileNameInCrsProgram (long FilCod,bool PutFormToGo,
|
void BrwRsc_WriteResourceDocument (long FilCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle)
|
const char *Icon,const char *IconTitle)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Documents;
|
extern const char *Txt_Documents;
|
||||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||||
|
@ -166,17 +166,16 @@ void BrwRsc_WriteDocFileNameInCrsProgram (long FilCod,bool PutFormToGo,
|
||||||
if (PutFormToGo)
|
if (PutFormToGo)
|
||||||
{
|
{
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************** Write file name in course program **********************/
|
/************************ Write marks file as resource ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void BrwRsc_WriteMrkFileNameInCrsProgram (long FilCod,bool PutFormToGo,
|
void BrwRsc_WriteResourceMarksFile (long FilCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle)
|
const char *Icon,const char *IconTitle)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Marks_area;
|
extern const char *Txt_Marks_area;
|
||||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||||
|
@ -227,7 +226,6 @@ void BrwRsc_WriteMrkFileNameInCrsProgram (long FilCod,bool PutFormToGo,
|
||||||
if (PutFormToGo)
|
if (PutFormToGo)
|
||||||
{
|
{
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +235,7 @@ void BrwRsc_WriteMrkFileNameInCrsProgram (long FilCod,bool PutFormToGo,
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// The trailing null character is not counted in TitleSize
|
// The trailing null character is not counted in TitleSize
|
||||||
|
|
||||||
void BrwRsc_GetDocTitleFromFilCod (long FilCod,char *Title,size_t TitleSize)
|
void BrwRsc_GetTitleFromDocFilCod (long FilCod,char *Title,size_t TitleSize)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Documents;
|
extern const char *Txt_Documents;
|
||||||
struct Brw_FileMetadata FileMetadata;
|
struct Brw_FileMetadata FileMetadata;
|
||||||
|
@ -261,7 +259,7 @@ void BrwRsc_GetDocTitleFromFilCod (long FilCod,char *Title,size_t TitleSize)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// The trailing null character is not counted in TitleSize
|
// The trailing null character is not counted in TitleSize
|
||||||
|
|
||||||
void BrwRsc_GetMrkTitleFromFilCod (long FilCod,char *Title,size_t TitleSize)
|
void BrwRsc_GetTitleFromMrkFilCod (long FilCod,char *Title,size_t TitleSize)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Marks_area;
|
extern const char *Txt_Marks_area;
|
||||||
struct Brw_FileMetadata FileMetadata;
|
struct Brw_FileMetadata FileMetadata;
|
||||||
|
|
|
@ -34,11 +34,11 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void BrwRsc_GetLinkToFile (void);
|
void BrwRsc_GetLinkToFile (void);
|
||||||
void BrwRsc_WriteDocFileNameInCrsProgram (long FilCod,bool PutFormToGo,
|
void BrwRsc_WriteResourceDocument (long FilCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle);
|
const char *Icon,const char *IconTitle);
|
||||||
void BrwRsc_WriteMrkFileNameInCrsProgram (long FilCod,bool PutFormToGo,
|
void BrwRsc_WriteResourceMarksFile (long FilCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle);
|
const char *Icon,const char *IconTitle);
|
||||||
void BrwRsc_GetDocTitleFromFilCod (long FilCod,char *Title,size_t TitleSize);
|
void BrwRsc_GetTitleFromDocFilCod (long FilCod,char *Title,size_t TitleSize);
|
||||||
void BrwRsc_GetMrkTitleFromFilCod (long FilCod,char *Title,size_t TitleSize);
|
void BrwRsc_GetTitleFromMrkFilCod (long FilCod,char *Title,size_t TitleSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -684,7 +684,7 @@ static void Cfe_PutIconsCallsForExams (__attribute__((unused)) void *Args)
|
||||||
Ico_PutContextualIconToAdd (ActEdiCfe,NULL,NULL,NULL);
|
Ico_PutContextualIconToAdd (ActEdiCfe,NULL,NULL,NULL);
|
||||||
|
|
||||||
/***** Icon to get resource link *****/
|
/***** Icon to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkCfe,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkCfe,NULL,
|
||||||
NULL,NULL);
|
NULL,NULL);
|
||||||
}
|
}
|
||||||
|
@ -1518,7 +1518,7 @@ static void Cfe_PutIconsCallForExam (void *CallsForExams)
|
||||||
&((struct Cfe_CallsForExams *) CallsForExams)->ExaCod);
|
&((struct Cfe_CallsForExams *) CallsForExams)->ExaCod);
|
||||||
|
|
||||||
/***** Link to get resource link *****/
|
/***** Link to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkCfe,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkCfe,NULL,
|
||||||
Cfe_PutParExaCod,
|
Cfe_PutParExaCod,
|
||||||
&((struct Cfe_CallsForExams *) CallsForExams)->ExaCod);
|
&((struct Cfe_CallsForExams *) CallsForExams)->ExaCod);
|
||||||
|
|
|
@ -52,7 +52,7 @@ void Cfe_GetLinkToCallForExam (void)
|
||||||
CfeRsc_GetTitleFromExaCod (ExaCod,Title,sizeof (Title) - 1);
|
CfeRsc_GetTitleFromExaCod (ExaCod,Title,sizeof (Title) - 1);
|
||||||
|
|
||||||
/***** Copy link to call for exam into resource clipboard *****/
|
/***** Copy link to call for exam into resource clipboard *****/
|
||||||
Prg_DB_CopyToClipboard (PrgRsc_CALL_FOR_EXAM,ExaCod);
|
Prg_DB_CopyToClipboard (Rsc_CALL_FOR_EXAM,ExaCod);
|
||||||
|
|
||||||
/***** Write sucess message *****/
|
/***** Write sucess message *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
||||||
|
@ -67,11 +67,11 @@ void Cfe_GetLinkToCallForExam (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************* Write call for exam in course program *******************/
|
/********************** Write call for exam as resource **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void CfeRsc_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo,
|
void CfeRsc_WriteResourceCallForExam (long ExaCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle)
|
const char *Icon,const char *IconTitle)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||||
Act_Action_t NextAction;
|
Act_Action_t NextAction;
|
||||||
|
@ -112,9 +112,7 @@ void CfeRsc_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo,
|
||||||
/***** End form to download file *****/
|
/***** End form to download file *****/
|
||||||
if (PutFormToGo)
|
if (PutFormToGo)
|
||||||
{
|
{
|
||||||
/* End form */
|
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Cfe_GetLinkToCallForExam (void);
|
void Cfe_GetLinkToCallForExam (void);
|
||||||
void CfeRsc_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo,
|
void CfeRsc_WriteResourceCallForExam (long ExaCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle);
|
const char *Icon,const char *IconTitle);
|
||||||
void CfeRsc_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
|
void CfeRsc_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -629,10 +629,11 @@ TODO: Emilce Barrera Mesa: Podr
|
||||||
TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen.
|
TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 22.80 (2023-03-25)"
|
#define Log_PLATFORM_VERSION "SWAD 22.81 (2023-03-26)"
|
||||||
#define CSS_FILE "swad22.78.15.css"
|
#define CSS_FILE "swad22.78.15.css"
|
||||||
#define JS_FILE "swad22.49.js"
|
#define JS_FILE "swad22.49.js"
|
||||||
/*
|
/*
|
||||||
|
Version 22.81: Mar 26, 2023 New module swad_resource. (337946 lines)
|
||||||
Version 22.80: Mar 25, 2023 Resources in rubric criteria. Not finished. (338110 lines)
|
Version 22.80: Mar 25, 2023 Resources in rubric criteria. Not finished. (338110 lines)
|
||||||
Version 22.79.3: Mar 24, 2023 Translation of some actions. (337938 lines)
|
Version 22.79.3: Mar 24, 2023 Translation of some actions. (337938 lines)
|
||||||
Version 22.79.2: Mar 24, 2023 Code refactoring in rubrics. (337937 lines)
|
Version 22.79.2: Mar 24, 2023 Code refactoring in rubrics. (337937 lines)
|
||||||
|
|
|
@ -2593,7 +2593,7 @@ mysql> DESCRIBE prg_resources;
|
||||||
"'mrk',"
|
"'mrk',"
|
||||||
"'att',"
|
"'att',"
|
||||||
"'for') NOT NULL DEFAULT 'non',"
|
"'for') NOT NULL DEFAULT 'non',"
|
||||||
"Title VARCHAR(2047) NOT NULL," // PrgRsc_MAX_BYTES_PROGRAM_RESOURCE_TITLE
|
"Title VARCHAR(2047) NOT NULL," // Rsc_MAX_BYTES_RESOURCE_TITLE
|
||||||
"UNIQUE INDEX(RscCod),"
|
"UNIQUE INDEX(RscCod),"
|
||||||
"UNIQUE INDEX(ItmCod,RscInd))");
|
"UNIQUE INDEX(ItmCod,RscInd))");
|
||||||
|
|
||||||
|
|
|
@ -353,7 +353,7 @@ static void Exa_PutIconsListExams (void *Exams)
|
||||||
NULL,NULL);
|
NULL,NULL);
|
||||||
|
|
||||||
/***** Link to get resource link *****/
|
/***** Link to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkExa,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkExa,NULL,
|
||||||
Exa_PutPars,Exams);
|
Exa_PutPars,Exams);
|
||||||
|
|
||||||
|
@ -702,7 +702,7 @@ static void Exa_PutIconsToRemEditOneExam (struct Exa_Exams *Exams,
|
||||||
Exa_PutPars,Exams);
|
Exa_PutPars,Exams);
|
||||||
|
|
||||||
/***** Link to get resource link *****/
|
/***** Link to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkExa,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkExa,NULL,
|
||||||
Exa_PutPars,Exams);
|
Exa_PutPars,Exams);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ void ExaRsc_GetLinkToExam (void)
|
||||||
ExaRsc_GetTitleFromExaCod (Exams.Exam.ExaCod,Title,sizeof (Title) - 1);
|
ExaRsc_GetTitleFromExaCod (Exams.Exam.ExaCod,Title,sizeof (Title) - 1);
|
||||||
|
|
||||||
/***** Copy link to exam into resource clipboard *****/
|
/***** Copy link to exam into resource clipboard *****/
|
||||||
Prg_DB_CopyToClipboard (PrgRsc_EXAM,Exams.Exam.ExaCod);
|
Prg_DB_CopyToClipboard (Rsc_EXAM,Exams.Exam.ExaCod);
|
||||||
|
|
||||||
/***** Write sucess message *****/
|
/***** Write sucess message *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
||||||
|
@ -66,11 +66,11 @@ void ExaRsc_GetLinkToExam (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Write exam in course program ************************/
|
/**************************** Write exam as resource *************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void ExaRsc_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo,
|
void ExaRsc_WriteResourceExam (long ExaCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle)
|
const char *Icon,const char *IconTitle)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||||
Act_Action_t NextAction;
|
Act_Action_t NextAction;
|
||||||
|
@ -103,9 +103,7 @@ void ExaRsc_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo,
|
||||||
/***** End form to download file *****/
|
/***** End form to download file *****/
|
||||||
if (PutFormToGo)
|
if (PutFormToGo)
|
||||||
{
|
{
|
||||||
/* End form */
|
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void ExaRsc_GetLinkToExam (void);
|
void ExaRsc_GetLinkToExam (void);
|
||||||
void ExaRsc_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo,
|
void ExaRsc_WriteResourceExam (long ExaCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle);
|
const char *Icon,const char *IconTitle);
|
||||||
void ExaRsc_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
|
void ExaRsc_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -831,7 +831,7 @@ static void For_PutIconsOneThread (void *Forums)
|
||||||
|
|
||||||
/***** Put icon to get resource link *****/
|
/***** Put icon to get resource link *****/
|
||||||
if (((struct For_Forums *) Forums)->Forum.Type == For_FORUM_COURSE_USRS &&
|
if (((struct For_Forums *) Forums)->Forum.Type == For_FORUM_COURSE_USRS &&
|
||||||
PrgRsc_CheckIfICanGetLink ())
|
Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkForCrsUsr,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkForCrsUsr,NULL,
|
||||||
For_PutParsNewPost,Forums);
|
For_PutParsNewPost,Forums);
|
||||||
}
|
}
|
||||||
|
@ -2112,7 +2112,7 @@ static void For_PutIconsThreads (void *Forums)
|
||||||
|
|
||||||
/***** Put icon to get resource link *****/
|
/***** Put icon to get resource link *****/
|
||||||
if (((struct For_Forums *) Forums)->Forum.Type == For_FORUM_COURSE_USRS &&
|
if (((struct For_Forums *) Forums)->Forum.Type == For_FORUM_COURSE_USRS &&
|
||||||
PrgRsc_CheckIfICanGetLink ())
|
Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkForCrsUsr,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkForCrsUsr,NULL,
|
||||||
For_PutParsNewPost,Forums);
|
For_PutParsNewPost,Forums);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ void ForRsc_GetLinkToThread (void)
|
||||||
ForRsc_GetTitleFromThrCod (Forums.Thread.Current,Subject,sizeof (Subject) - 1);
|
ForRsc_GetTitleFromThrCod (Forums.Thread.Current,Subject,sizeof (Subject) - 1);
|
||||||
|
|
||||||
/***** Copy link to thread into resource clipboard *****/
|
/***** Copy link to thread into resource clipboard *****/
|
||||||
Prg_DB_CopyToClipboard (PrgRsc_FORUM_THREAD,Forums.Thread.Current);
|
Prg_DB_CopyToClipboard (Rsc_FORUM_THREAD,Forums.Thread.Current);
|
||||||
|
|
||||||
/***** Write sucess message *****/
|
/***** Write sucess message *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
||||||
|
@ -76,11 +76,11 @@ void ForRsc_GetLinkToThread (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************** Write thread subject in course program ********************/
|
/************************ Write thread as resource ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void ForRsc_WriteThreadInCrsProgram (long ThrCod,bool PutFormToGo,
|
void ForRsc_WriteResourceThread (long ThrCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle)
|
const char *Icon,const char *IconTitle)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||||
Act_Action_t NextAction;
|
Act_Action_t NextAction;
|
||||||
|
@ -123,9 +123,7 @@ void ForRsc_WriteThreadInCrsProgram (long ThrCod,bool PutFormToGo,
|
||||||
/***** End form to download file *****/
|
/***** End form to download file *****/
|
||||||
if (PutFormToGo)
|
if (PutFormToGo)
|
||||||
{
|
{
|
||||||
/* End form */
|
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void ForRsc_GetLinkToThread (void);
|
void ForRsc_GetLinkToThread (void);
|
||||||
void ForRsc_WriteThreadInCrsProgram (long ThrCod,bool PutFormToGo,
|
void ForRsc_WriteResourceThread (long ThrCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle);
|
const char *Icon,const char *IconTitle);
|
||||||
void ForRsc_GetTitleFromThrCod (long ThrCod,char *Title,size_t TitleSize);
|
void ForRsc_GetTitleFromThrCod (long ThrCod,char *Title,size_t TitleSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -392,7 +392,7 @@ static void Gam_PutIconsListGames (void *Games)
|
||||||
NULL,NULL);
|
NULL,NULL);
|
||||||
|
|
||||||
/***** Link to get resource link *****/
|
/***** Link to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkGam,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkGam,NULL,
|
||||||
Gam_PutPars,Games);
|
Gam_PutPars,Games);
|
||||||
|
|
||||||
|
@ -757,7 +757,7 @@ static void Gam_PutIconsToRemEditOneGame (struct Gam_Games *Games,
|
||||||
Gam_PutPars,Games);
|
Gam_PutPars,Games);
|
||||||
|
|
||||||
/***** Link to get resource link *****/
|
/***** Link to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkGam,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkGam,NULL,
|
||||||
Gam_PutPars,Games);
|
Gam_PutPars,Games);
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ void GamRsc_GetLinkToGame (void)
|
||||||
GamRsc_GetTitleFromGamCod (GamCod,Title,sizeof (Title) - 1);
|
GamRsc_GetTitleFromGamCod (GamCod,Title,sizeof (Title) - 1);
|
||||||
|
|
||||||
/***** Copy link to game into resource clipboard *****/
|
/***** Copy link to game into resource clipboard *****/
|
||||||
Prg_DB_CopyToClipboard (PrgRsc_GAME,GamCod);
|
Prg_DB_CopyToClipboard (Rsc_GAME,GamCod);
|
||||||
|
|
||||||
/***** Write sucess message *****/
|
/***** Write sucess message *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
||||||
|
@ -67,11 +67,11 @@ void GamRsc_GetLinkToGame (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Write game in course program ************************/
|
/************************** Write game as resource ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void GamRsc_WriteGameInCrsProgram (long GamCod,bool PutFormToGo,
|
void GamRsc_WriteResourceGame (long GamCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle)
|
const char *Icon,const char *IconTitle)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||||
Act_Action_t NextAction;
|
Act_Action_t NextAction;
|
||||||
|
@ -104,9 +104,7 @@ void GamRsc_WriteGameInCrsProgram (long GamCod,bool PutFormToGo,
|
||||||
/***** End form to go to game *****/
|
/***** End form to go to game *****/
|
||||||
if (PutFormToGo)
|
if (PutFormToGo)
|
||||||
{
|
{
|
||||||
/* End form */
|
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void GamRsc_GetLinkToGame (void);
|
void GamRsc_GetLinkToGame (void);
|
||||||
void GamRsc_WriteGameInCrsProgram (long GamCod,bool PutFormToGo,
|
void GamRsc_WriteResourceGame (long GamCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle);
|
const char *Icon,const char *IconTitle);
|
||||||
void GamRsc_GetTitleFromGamCod (long GamCod,char *Title,size_t TitleSize);
|
void GamRsc_GetTitleFromGamCod (long GamCod,char *Title,size_t TitleSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1322,7 +1322,7 @@ void Prg_ResetResource (struct Prg_Item *Item)
|
||||||
Item->Resource.Hierarchy.RscCod = -1L;
|
Item->Resource.Hierarchy.RscCod = -1L;
|
||||||
Item->Resource.Hierarchy.RscInd = 0;
|
Item->Resource.Hierarchy.RscInd = 0;
|
||||||
Item->Resource.Hierarchy.Hidden = false;
|
Item->Resource.Hierarchy.Hidden = false;
|
||||||
Item->Resource.Link.Type = PrgRsc_NONE;
|
Item->Resource.Link.Type = Rsc_NONE;
|
||||||
Item->Resource.Link.Cod = -1L;
|
Item->Resource.Link.Cod = -1L;
|
||||||
Item->Resource.Title[0] = '\0';
|
Item->Resource.Title[0] = '\0';
|
||||||
Item->Resource.Title[0] = '\0';
|
Item->Resource.Title[0] = '\0';
|
||||||
|
|
|
@ -32,14 +32,12 @@
|
||||||
|
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
#include "swad_date.h"
|
#include "swad_date.h"
|
||||||
|
#include "swad_resource.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************** Public types and constants ***********************/
|
/************************** Public types and constants ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE (128 - 1) // 127
|
|
||||||
#define PrgRsc_MAX_BYTES_PROGRAM_RESOURCE_TITLE ((PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
|
||||||
|
|
||||||
struct Prg_ResourceHierarchy
|
struct Prg_ResourceHierarchy
|
||||||
{
|
{
|
||||||
long RscCod;
|
long RscCod;
|
||||||
|
@ -47,35 +45,6 @@ struct Prg_ResourceHierarchy
|
||||||
bool Hidden;
|
bool Hidden;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PrgRsc_NUM_TYPES 11
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
PrgRsc_NONE,
|
|
||||||
// gui TEACHING_GUIDE // Link to teaching guide
|
|
||||||
// bib BIBLIOGRAPHY // Link to bibliography
|
|
||||||
// faq FAQ // Link to FAQ
|
|
||||||
// lnk LINKS // Link to links
|
|
||||||
// tmt TIMETABLE // Link to timetable
|
|
||||||
PrgRsc_ASSIGNMENT,
|
|
||||||
PrgRsc_PROJECT, // A project is only for some students
|
|
||||||
PrgRsc_CALL_FOR_EXAM,
|
|
||||||
// tst TEST // User selects tags, teacher should select
|
|
||||||
PrgRsc_EXAM,
|
|
||||||
PrgRsc_GAME,
|
|
||||||
PrgRsc_SURVEY,
|
|
||||||
PrgRsc_DOCUMENT,
|
|
||||||
PrgRsc_MARKS,
|
|
||||||
// grp GROUPS // ??? User select groups
|
|
||||||
PrgRsc_ATTENDANCE_EVENT,
|
|
||||||
PrgRsc_FORUM_THREAD,
|
|
||||||
} PrgRsc_Type_t;
|
|
||||||
|
|
||||||
struct PrgRsc_Link
|
|
||||||
{
|
|
||||||
PrgRsc_Type_t Type;
|
|
||||||
long Cod;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define Prg_MAX_CHARS_PROGRAM_ITEM_TITLE (128 - 1) // 127
|
#define Prg_MAX_CHARS_PROGRAM_ITEM_TITLE (128 - 1) // 127
|
||||||
#define Prg_MAX_BYTES_PROGRAM_ITEM_TITLE ((Prg_MAX_CHARS_PROGRAM_ITEM_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
#define Prg_MAX_BYTES_PROGRAM_ITEM_TITLE ((Prg_MAX_CHARS_PROGRAM_ITEM_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
||||||
|
|
||||||
|
@ -98,8 +67,8 @@ struct Prg_Item
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
struct Prg_ResourceHierarchy Hierarchy;
|
struct Prg_ResourceHierarchy Hierarchy;
|
||||||
struct PrgRsc_Link Link;
|
struct Rsc_Link Link;
|
||||||
char Title[PrgRsc_MAX_BYTES_PROGRAM_RESOURCE_TITLE + 1];
|
char Title[Rsc_MAX_BYTES_RESOURCE_TITLE + 1];
|
||||||
} Resource;
|
} Resource;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,26 +34,26 @@
|
||||||
/**************************** Private constants ******************************/
|
/**************************** Private constants ******************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES] =
|
const char *Rsc_ResourceTypesDB[Rsc_NUM_TYPES] =
|
||||||
{
|
{
|
||||||
[PrgRsc_NONE ] = "non",
|
[Rsc_NONE ] = "non",
|
||||||
// gui TEACHING_GUIDE // Link to teaching guide
|
// gui TEACHING_GUIDE // Link to teaching guide
|
||||||
// bib BIBLIOGRAPHY // Link to bibliography
|
// bib BIBLIOGRAPHY // Link to bibliography
|
||||||
// faq FAQ // Link to FAQ
|
// faq FAQ // Link to FAQ
|
||||||
// lnk LINKS // Link to links
|
// lnk LINKS // Link to links
|
||||||
// tmt TIMETABLE // Link to timetable
|
// tmt TIMETABLE // Link to timetable
|
||||||
[PrgRsc_ASSIGNMENT ] = "asg",
|
[Rsc_ASSIGNMENT ] = "asg",
|
||||||
[PrgRsc_PROJECT ] = "prj",
|
[Rsc_PROJECT ] = "prj",
|
||||||
[PrgRsc_CALL_FOR_EXAM ] = "cfe",
|
[Rsc_CALL_FOR_EXAM ] = "cfe",
|
||||||
// tst TEST // User selects tags, teacher should select
|
// tst TEST // User selects tags, teacher should select
|
||||||
[PrgRsc_EXAM ] = "exa",
|
[Rsc_EXAM ] = "exa",
|
||||||
[PrgRsc_GAME ] = "gam",
|
[Rsc_GAME ] = "gam",
|
||||||
[PrgRsc_SURVEY ] = "svy",
|
[Rsc_SURVEY ] = "svy",
|
||||||
[PrgRsc_DOCUMENT ] = "doc",
|
[Rsc_DOCUMENT ] = "doc",
|
||||||
[PrgRsc_MARKS ] = "mrk",
|
[Rsc_MARKS ] = "mrk",
|
||||||
// grp GROUPS // ??? User select groups
|
// grp GROUPS // ??? User select groups
|
||||||
[PrgRsc_ATTENDANCE_EVENT] = "att",
|
[Rsc_ATTENDANCE_EVENT] = "att",
|
||||||
[PrgRsc_FORUM_THREAD ] = "for",
|
[Rsc_FORUM_THREAD ] = "for",
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -474,7 +474,7 @@ long Prg_DB_CreateResource (const struct Prg_Item *Item)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Prg_DB_UpdateResourceTitle (long ItmCod,long RscCod,
|
void Prg_DB_UpdateResourceTitle (long ItmCod,long RscCod,
|
||||||
const char NewTitle[PrgRsc_MAX_BYTES_PROGRAM_RESOURCE_TITLE + 1])
|
const char NewTitle[Rsc_MAX_BYTES_RESOURCE_TITLE + 1])
|
||||||
{
|
{
|
||||||
DB_QueryUPDATE ("can not update the title of a resource",
|
DB_QueryUPDATE ("can not update the title of a resource",
|
||||||
"UPDATE prg_resources,"
|
"UPDATE prg_resources,"
|
||||||
|
@ -663,7 +663,7 @@ void Prg_DB_UpdateRscLink (const struct Prg_Item *Item)
|
||||||
" SET Type='%s',"
|
" SET Type='%s',"
|
||||||
"Cod=%ld"
|
"Cod=%ld"
|
||||||
" WHERE RscCod=%ld",
|
" WHERE RscCod=%ld",
|
||||||
Prg_ResourceTypesDB[Item->Resource.Link.Type],
|
Rsc_ResourceTypesDB[Item->Resource.Link.Type],
|
||||||
Item->Resource.Link.Cod,
|
Item->Resource.Link.Cod,
|
||||||
Item->Resource.Hierarchy.RscCod);
|
Item->Resource.Hierarchy.RscCod);
|
||||||
}
|
}
|
||||||
|
@ -672,7 +672,7 @@ void Prg_DB_UpdateRscLink (const struct Prg_Item *Item)
|
||||||
/********************** Copy link to resource into clipboard *****************/
|
/********************** Copy link to resource into clipboard *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Prg_DB_CopyToClipboard (PrgRsc_Type_t Type,long Cod)
|
void Prg_DB_CopyToClipboard (Rsc_Type_t Type,long Cod)
|
||||||
{
|
{
|
||||||
DB_QueryREPLACE ("can not copy link to resource clipboard",
|
DB_QueryREPLACE ("can not copy link to resource clipboard",
|
||||||
"REPLACE INTO prg_clipboards"
|
"REPLACE INTO prg_clipboards"
|
||||||
|
@ -681,7 +681,7 @@ void Prg_DB_CopyToClipboard (PrgRsc_Type_t Type,long Cod)
|
||||||
" (%ld,%ld,'%s',%ld,NOW())",
|
" (%ld,%ld,'%s',%ld,NOW())",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod,
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
Prg_ResourceTypesDB[Type],
|
Rsc_ResourceTypesDB[Type],
|
||||||
Cod);
|
Cod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -707,7 +707,7 @@ unsigned Prg_DB_GetClipboard (MYSQL_RES **mysql_res)
|
||||||
/*************************** Remove link from clipboard **********************/
|
/*************************** Remove link from clipboard **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Prg_DB_RemoveLinkFromClipboard (struct PrgRsc_Link *Link)
|
void Prg_DB_RemoveLinkFromClipboard (struct Rsc_Link *Link)
|
||||||
{
|
{
|
||||||
DB_QueryDELETE ("can not remove link from clipboard",
|
DB_QueryDELETE ("can not remove link from clipboard",
|
||||||
"DELETE FROM prg_clipboards"
|
"DELETE FROM prg_clipboards"
|
||||||
|
@ -717,7 +717,7 @@ void Prg_DB_RemoveLinkFromClipboard (struct PrgRsc_Link *Link)
|
||||||
" AND Cod=%ld",
|
" AND Cod=%ld",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod,
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
Prg_ResourceTypesDB[Link->Type],
|
Rsc_ResourceTypesDB[Link->Type],
|
||||||
Link->Cod);
|
Link->Cod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ void Prg_DB_RemoveCrsItems (long CrsCod);
|
||||||
long Prg_DB_CreateResource (const struct Prg_Item *Item);
|
long Prg_DB_CreateResource (const struct Prg_Item *Item);
|
||||||
|
|
||||||
void Prg_DB_UpdateResourceTitle (long ItmCod,long RscCod,
|
void Prg_DB_UpdateResourceTitle (long ItmCod,long RscCod,
|
||||||
const char NewTitle[PrgRsc_MAX_BYTES_PROGRAM_RESOURCE_TITLE + 1]);
|
const char NewTitle[Rsc_MAX_BYTES_RESOURCE_TITLE + 1]);
|
||||||
|
|
||||||
unsigned Prg_DB_GetListResources (MYSQL_RES **mysql_res,long ItmCod,
|
unsigned Prg_DB_GetListResources (MYSQL_RES **mysql_res,long ItmCod,
|
||||||
bool ShowHiddenResources);
|
bool ShowHiddenResources);
|
||||||
|
@ -77,9 +77,9 @@ void Prg_DB_LockTableResources (void);
|
||||||
void Prg_DB_UpdateRscInd (long RscCod,int RscInd);
|
void Prg_DB_UpdateRscInd (long RscCod,int RscInd);
|
||||||
void Prg_DB_UpdateRscLink (const struct Prg_Item *Item);
|
void Prg_DB_UpdateRscLink (const struct Prg_Item *Item);
|
||||||
|
|
||||||
void Prg_DB_CopyToClipboard (PrgRsc_Type_t Type,long Cod);
|
void Prg_DB_CopyToClipboard (Rsc_Type_t Type,long Cod);
|
||||||
unsigned Prg_DB_GetClipboard (MYSQL_RES **mysql_res);
|
unsigned Prg_DB_GetClipboard (MYSQL_RES **mysql_res);
|
||||||
void Prg_DB_RemoveLinkFromClipboard (struct PrgRsc_Link *Link);
|
void Prg_DB_RemoveLinkFromClipboard (struct Rsc_Link *Link);
|
||||||
|
|
||||||
void Prg_DB_InsertItemInExpandedItems (long ItmCod);
|
void Prg_DB_InsertItemInExpandedItems (long ItmCod);
|
||||||
bool Prg_DB_GetIfExpandedItem (long ItmCod);
|
bool Prg_DB_GetIfExpandedItem (long ItmCod);
|
||||||
|
|
|
@ -26,60 +26,24 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define _GNU_SOURCE // For asprintf
|
#define _GNU_SOURCE // For asprintf
|
||||||
|
#include <mysql/mysql.h> // To access MySQL databases
|
||||||
#include <stdio.h> // For asprintf
|
#include <stdio.h> // For asprintf
|
||||||
#include <stdlib.h> // For free
|
|
||||||
#include <string.h> // For string functions
|
|
||||||
|
|
||||||
#include "swad_action_list.h"
|
#include "swad_action_list.h"
|
||||||
#include "swad_alert.h"
|
#include "swad_alert.h"
|
||||||
#include "swad_assignment_resource.h"
|
|
||||||
#include "swad_attendance_resource.h"
|
|
||||||
#include "swad_box.h"
|
#include "swad_box.h"
|
||||||
#include "swad_browser_resource.h"
|
#include "swad_button.h"
|
||||||
#include "swad_call_for_exam_resource.h"
|
|
||||||
#include "swad_error.h"
|
#include "swad_error.h"
|
||||||
#include "swad_exam_resource.h"
|
|
||||||
#include "swad_form.h"
|
#include "swad_form.h"
|
||||||
#include "swad_forum_resource.h"
|
|
||||||
#include "swad_game_resource.h"
|
|
||||||
#include "swad_global.h"
|
#include "swad_global.h"
|
||||||
#include "swad_parameter.h"
|
#include "swad_parameter.h"
|
||||||
#include "swad_parameter_code.h"
|
#include "swad_parameter_code.h"
|
||||||
#include "swad_program.h"
|
#include "swad_program.h"
|
||||||
#include "swad_program_database.h"
|
#include "swad_program_database.h"
|
||||||
#include "swad_program_resource.h"
|
|
||||||
#include "swad_project_resource.h"
|
|
||||||
#include "swad_survey_resource.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/**************************** Private constants ******************************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
const char *Prg_ResourceTypesIcons[PrgRsc_NUM_TYPES] =
|
|
||||||
{
|
|
||||||
[PrgRsc_NONE ] = "link-slash.svg",
|
|
||||||
// gui TEACHING_GUIDE // Link to teaching guide
|
|
||||||
// bib BIBLIOGRAPHY // Link to bibliography
|
|
||||||
// faq FAQ // Link to FAQ
|
|
||||||
// lnk LINKS // Link to links
|
|
||||||
// tmt TIMETABLE // Link to timetable
|
|
||||||
[PrgRsc_ASSIGNMENT ] = "edit.svg",
|
|
||||||
[PrgRsc_PROJECT ] = "file-invoice.svg",
|
|
||||||
[PrgRsc_CALL_FOR_EXAM ] = "bullhorn.svg",
|
|
||||||
// tst TEST // User selects tags, teacher should select
|
|
||||||
[PrgRsc_EXAM ] = "file-signature.svg",
|
|
||||||
[PrgRsc_GAME ] = "gamepad.svg",
|
|
||||||
[PrgRsc_SURVEY ] = "poll.svg",
|
|
||||||
[PrgRsc_DOCUMENT ] = "folder-open.svg",
|
|
||||||
[PrgRsc_MARKS ] = "list-alt.svg",
|
|
||||||
// grp GROUPS // ??? User select groups
|
|
||||||
[PrgRsc_ATTENDANCE_EVENT] = "calendar-check.svg",
|
|
||||||
[PrgRsc_FORUM_THREAD ] = "comments.svg",
|
|
||||||
};
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************** External global variables from others modules ****************/
|
/************** External global variables from others modules ****************/
|
||||||
/*****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
extern struct Globals Gbl;
|
extern struct Globals Gbl;
|
||||||
|
|
||||||
|
@ -126,15 +90,6 @@ static bool PrgRsc_ExchangeResources (const struct Prg_ResourceHierarchy *Rsc1,
|
||||||
const struct Prg_ResourceHierarchy *Rsc2);
|
const struct Prg_ResourceHierarchy *Rsc2);
|
||||||
|
|
||||||
static void PrgRsc_ShowClipboard (struct Prg_Item *Item);
|
static void PrgRsc_ShowClipboard (struct Prg_Item *Item);
|
||||||
static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct PrgRsc_Link *Link);
|
|
||||||
static void PrgRsc_WriteLinkName (const struct PrgRsc_Link *Link,bool PutFormToGo,
|
|
||||||
const char *Icon,const char *IconTitle);
|
|
||||||
static void PrgRsc_WriteEmptyLinkInCrsProgram (__attribute__((unused)) long Cod,
|
|
||||||
__attribute__((unused)) bool PutFormToGo,
|
|
||||||
const char *Icon,const char *IconTitle);
|
|
||||||
static void PrgRsc_GetResourceTitleFromLink (struct Prg_Item *Item);
|
|
||||||
static void PrgRsc_GetLinkDataFromRow (MYSQL_RES *mysql_res,
|
|
||||||
struct PrgRsc_Link *Link);
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** View resources *******************************/
|
/****************************** View resources *******************************/
|
||||||
|
@ -396,7 +351,7 @@ static void PrgRsc_GetResourceDataFromRow (MYSQL_RES *mysql_res,
|
||||||
Item->Resource.Hierarchy.Hidden = (row[3][0] == 'Y');
|
Item->Resource.Hierarchy.Hidden = (row[3][0] == 'Y');
|
||||||
|
|
||||||
/***** Get link type and code (row[4], row[5]) *****/
|
/***** Get link type and code (row[4], row[5]) *****/
|
||||||
Item->Resource.Link.Type = PrgRsc_GetTypeFromString (row[4]);
|
Item->Resource.Link.Type = Rsc_GetTypeFromString (row[4]);
|
||||||
Item->Resource.Link.Cod = Str_ConvertStrCodToLongCod (row[5]);
|
Item->Resource.Link.Cod = Str_ConvertStrCodToLongCod (row[5]);
|
||||||
|
|
||||||
/***** Get the title of the item resource (row[6]) *****/
|
/***** Get the title of the item resource (row[6]) *****/
|
||||||
|
@ -410,7 +365,8 @@ static void PrgRsc_GetResourceDataFromRow (MYSQL_RES *mysql_res,
|
||||||
static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
||||||
const struct Prg_Item *Item)
|
const struct Prg_Item *Item)
|
||||||
{
|
{
|
||||||
extern const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES];
|
extern const char *Rsc_ResourceTypesIcons[Rsc_NUM_TYPES];
|
||||||
|
extern const char *Txt_RESOURCE_TYPES[Rsc_NUM_TYPES];
|
||||||
|
|
||||||
/***** Begin row *****/
|
/***** Begin row *****/
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -426,9 +382,9 @@ static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
||||||
The_GetSuffix (),The_GetColorRows1 (1));
|
The_GetSuffix (),The_GetColorRows1 (1));
|
||||||
HTM_Txt (Item->Resource.Title);
|
HTM_Txt (Item->Resource.Title);
|
||||||
HTM_BR ();
|
HTM_BR ();
|
||||||
PrgRsc_WriteLinkName (&Item->Resource.Link,
|
Rsc_WriteLinkName (&Item->Resource.Link,
|
||||||
true, // Put form
|
true, // Put form
|
||||||
Prg_ResourceTypesIcons[Item->Resource.Link.Type],
|
Rsc_ResourceTypesIcons[Item->Resource.Link.Type],
|
||||||
Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
|
Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
@ -443,7 +399,8 @@ static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
||||||
static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
|
static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
|
||||||
struct Prg_Item *Item,bool EditLink)
|
struct Prg_Item *Item,bool EditLink)
|
||||||
{
|
{
|
||||||
extern const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES];
|
extern const char *Rsc_ResourceTypesIcons[Rsc_NUM_TYPES];
|
||||||
|
extern const char *Txt_RESOURCE_TYPES[Rsc_NUM_TYPES];
|
||||||
|
|
||||||
/***** Begin row *****/
|
/***** Begin row *****/
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -466,7 +423,7 @@ static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
|
||||||
/* Title */
|
/* Title */
|
||||||
Frm_BeginFormAnchor (ActRenPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
Frm_BeginFormAnchor (ActRenPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
||||||
ParCod_PutPar (ParCod_Rsc,Item->Resource.Hierarchy.RscCod);
|
ParCod_PutPar (ParCod_Rsc,Item->Resource.Hierarchy.RscCod);
|
||||||
HTM_INPUT_TEXT ("Title",PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE,Item->Resource.Title,
|
HTM_INPUT_TEXT ("Title",Rsc_MAX_CHARS_RESOURCE_TITLE,Item->Resource.Title,
|
||||||
HTM_SUBMIT_ON_CHANGE,
|
HTM_SUBMIT_ON_CHANGE,
|
||||||
"class=\"PRG_RSC_INPUT INPUT_%s\"",
|
"class=\"PRG_RSC_INPUT INPUT_%s\"",
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
|
@ -480,10 +437,10 @@ static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
|
||||||
PrgRsc_ShowClipboard (Item);
|
PrgRsc_ShowClipboard (Item);
|
||||||
else
|
else
|
||||||
/* Show current link */
|
/* Show current link */
|
||||||
PrgRsc_WriteLinkName (&Item->Resource.Link,
|
Rsc_WriteLinkName (&Item->Resource.Link,
|
||||||
true, // Put form
|
true, // Put form
|
||||||
Prg_ResourceTypesIcons[Item->Resource.Link.Type],
|
Rsc_ResourceTypesIcons[Item->Resource.Link.Type],
|
||||||
Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
|
Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
|
||||||
|
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
@ -520,7 +477,7 @@ static void PrgRsc_WriteRowNewResource (unsigned NumResources,
|
||||||
/* Title */
|
/* Title */
|
||||||
Frm_BeginFormAnchor (ActNewPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
Frm_BeginFormAnchor (ActNewPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
||||||
ParCod_PutPar (ParCod_Itm,Item->Hierarchy.ItmCod);
|
ParCod_PutPar (ParCod_Itm,Item->Hierarchy.ItmCod);
|
||||||
HTM_INPUT_TEXT ("Title",PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE,"",
|
HTM_INPUT_TEXT ("Title",Rsc_MAX_CHARS_RESOURCE_TITLE,"",
|
||||||
HTM_SUBMIT_ON_CHANGE,
|
HTM_SUBMIT_ON_CHANGE,
|
||||||
"placeholder=\"%s\""
|
"placeholder=\"%s\""
|
||||||
" class=\"PRG_RSC_INPUT INPUT_%s\"",
|
" class=\"PRG_RSC_INPUT INPUT_%s\"",
|
||||||
|
@ -636,7 +593,7 @@ void PrgRsc_CreateResource (void)
|
||||||
Prg_GetPars (&Item);
|
Prg_GetPars (&Item);
|
||||||
|
|
||||||
/* Get the new title for the new resource */
|
/* Get the new title for the new resource */
|
||||||
Par_GetParText ("Title",Item.Resource.Title,PrgRsc_MAX_BYTES_PROGRAM_RESOURCE_TITLE);
|
Par_GetParText ("Title",Item.Resource.Title,Rsc_MAX_BYTES_RESOURCE_TITLE);
|
||||||
|
|
||||||
/***** Create resource *****/
|
/***** Create resource *****/
|
||||||
Item.Resource.Hierarchy.RscCod = Prg_DB_CreateResource (&Item);
|
Item.Resource.Hierarchy.RscCod = Prg_DB_CreateResource (&Item);
|
||||||
|
@ -655,7 +612,7 @@ void PrgRsc_CreateResource (void)
|
||||||
void PrgRsc_RenameResource (void)
|
void PrgRsc_RenameResource (void)
|
||||||
{
|
{
|
||||||
struct Prg_Item Item;
|
struct Prg_Item Item;
|
||||||
char NewTitle[PrgRsc_MAX_BYTES_PROGRAM_RESOURCE_TITLE + 1];
|
char NewTitle[Rsc_MAX_BYTES_RESOURCE_TITLE + 1];
|
||||||
|
|
||||||
/***** Get list of program items *****/
|
/***** Get list of program items *****/
|
||||||
Prg_GetListItems ();
|
Prg_GetListItems ();
|
||||||
|
@ -667,7 +624,7 @@ void PrgRsc_RenameResource (void)
|
||||||
|
|
||||||
/***** Rename resource *****/
|
/***** Rename resource *****/
|
||||||
/* Get the new title for the resource */
|
/* Get the new title for the resource */
|
||||||
Par_GetParText ("Title",NewTitle,PrgRsc_MAX_BYTES_PROGRAM_RESOURCE_TITLE);
|
Par_GetParText ("Title",NewTitle,Rsc_MAX_BYTES_RESOURCE_TITLE);
|
||||||
|
|
||||||
/* Update database changing old title by new title */
|
/* Update database changing old title by new title */
|
||||||
Prg_DB_UpdateResourceTitle (Item.Hierarchy.ItmCod,Item.Resource.Hierarchy.RscCod,NewTitle);
|
Prg_DB_UpdateResourceTitle (Item.Hierarchy.ItmCod,Item.Resource.Hierarchy.RscCod,NewTitle);
|
||||||
|
@ -907,10 +864,10 @@ static void PrgRsc_ShowClipboard (struct Prg_Item *Item)
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
unsigned NumLink;
|
unsigned NumLink;
|
||||||
unsigned NumLinks;
|
unsigned NumLinks;
|
||||||
struct PrgRsc_Link Link;
|
struct Rsc_Link Link;
|
||||||
static const struct PrgRsc_Link EmptyLink =
|
static const struct Rsc_Link EmptyLink =
|
||||||
{
|
{
|
||||||
.Type = PrgRsc_NONE,
|
.Type = Rsc_NONE,
|
||||||
.Cod = -1L,
|
.Cod = -1L,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -926,11 +883,11 @@ static void PrgRsc_ShowClipboard (struct Prg_Item *Item)
|
||||||
HTM_UL_Begin ("class=\"PRG_CLIPBOARD\"");
|
HTM_UL_Begin ("class=\"PRG_CLIPBOARD\"");
|
||||||
|
|
||||||
/***** Current link (empty or not) *****/
|
/***** Current link (empty or not) *****/
|
||||||
PrgRsc_WriteRowClipboard (false,&Item->Resource.Link);
|
Rsc_WriteRowClipboard (false,&Item->Resource.Link);
|
||||||
|
|
||||||
/***** Row with empty link to remove the current link *****/
|
/***** Row with empty link to remove the current link *****/
|
||||||
if (Item->Resource.Link.Type != PrgRsc_NONE)
|
if (Item->Resource.Link.Type != Rsc_NONE)
|
||||||
PrgRsc_WriteRowClipboard (true,&EmptyLink);
|
Rsc_WriteRowClipboard (true,&EmptyLink);
|
||||||
|
|
||||||
/***** Get links in clipboard from database and write them *****/
|
/***** Get links in clipboard from database and write them *****/
|
||||||
NumLinks = Prg_DB_GetClipboard (&mysql_res);
|
NumLinks = Prg_DB_GetClipboard (&mysql_res);
|
||||||
|
@ -938,8 +895,8 @@ static void PrgRsc_ShowClipboard (struct Prg_Item *Item)
|
||||||
NumLink <= NumLinks;
|
NumLink <= NumLinks;
|
||||||
NumLink++)
|
NumLink++)
|
||||||
{
|
{
|
||||||
PrgRsc_GetLinkDataFromRow (mysql_res,&Link);
|
Rsc_GetLinkDataFromRow (mysql_res,&Link);
|
||||||
PrgRsc_WriteRowClipboard (true,&Link);
|
Rsc_WriteRowClipboard (true,&Link);
|
||||||
}
|
}
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
|
@ -950,116 +907,6 @@ static void PrgRsc_ShowClipboard (struct Prg_Item *Item)
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************************ Show one link from clipboard ***********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct PrgRsc_Link *Link)
|
|
||||||
{
|
|
||||||
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES];
|
|
||||||
extern const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES];
|
|
||||||
|
|
||||||
HTM_LI_Begin ("class=\"PRG_RSC_%s\"",The_GetSuffix ());
|
|
||||||
HTM_LABEL_Begin (NULL);
|
|
||||||
|
|
||||||
/***** Radio selector *****/
|
|
||||||
HTM_INPUT_RADIO ("Link",SubmitOnClick,
|
|
||||||
"value=\"%s_%ld\"%s",
|
|
||||||
Prg_ResourceTypesDB[Link->Type],Link->Cod,
|
|
||||||
SubmitOnClick ? "" :
|
|
||||||
" checked=\"checked\"");
|
|
||||||
|
|
||||||
/***** Name *****/
|
|
||||||
PrgRsc_WriteLinkName (Link,
|
|
||||||
false, // Don't put form
|
|
||||||
Prg_ResourceTypesIcons[Link->Type],
|
|
||||||
Txt_RESOURCE_TYPES[Link->Type]);
|
|
||||||
|
|
||||||
HTM_LABEL_End ();
|
|
||||||
HTM_LI_End ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************* Write link name (filename, assignment title...) ***************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void PrgRsc_WriteLinkName (const struct PrgRsc_Link *Link,bool PutFormToGo,
|
|
||||||
const char *Icon,const char *IconTitle)
|
|
||||||
{
|
|
||||||
static void (*WriteLinkName[PrgRsc_NUM_TYPES]) (long Cod,bool PutFormToGo,
|
|
||||||
const char *Icon,
|
|
||||||
const char *IconTitle) =
|
|
||||||
{
|
|
||||||
[PrgRsc_NONE ] = PrgRsc_WriteEmptyLinkInCrsProgram,
|
|
||||||
[PrgRsc_ASSIGNMENT ] = AsgRsc_WriteAssignmentInCrsProgram,
|
|
||||||
[PrgRsc_PROJECT ] = PrjRsc_WriteProjectInCrsProgram,
|
|
||||||
[PrgRsc_CALL_FOR_EXAM ] = CfeRsc_WriteCallForExamInCrsProgram,
|
|
||||||
[PrgRsc_EXAM ] = ExaRsc_WriteExamInCrsProgram,
|
|
||||||
[PrgRsc_GAME ] = GamRsc_WriteGameInCrsProgram,
|
|
||||||
[PrgRsc_SURVEY ] = SvyRsc_WriteSurveyInCrsProgram,
|
|
||||||
[PrgRsc_DOCUMENT ] = BrwRsc_WriteDocFileNameInCrsProgram,
|
|
||||||
[PrgRsc_MARKS ] = BrwRsc_WriteMrkFileNameInCrsProgram,
|
|
||||||
[PrgRsc_ATTENDANCE_EVENT] = AttRsc_WriteEventInCrsProgram,
|
|
||||||
[PrgRsc_FORUM_THREAD ] = ForRsc_WriteThreadInCrsProgram,
|
|
||||||
};
|
|
||||||
|
|
||||||
/***** Write link name *****/
|
|
||||||
if (WriteLinkName[Link->Type])
|
|
||||||
WriteLinkName[Link->Type] (Link->Cod,PutFormToGo,Icon,IconTitle);
|
|
||||||
else
|
|
||||||
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/******************** Write empty link in course program *********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void PrgRsc_WriteEmptyLinkInCrsProgram (__attribute__((unused)) long Cod,
|
|
||||||
__attribute__((unused)) bool PutFormToGo,
|
|
||||||
const char *Icon,const char *IconTitle)
|
|
||||||
{
|
|
||||||
extern const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES];
|
|
||||||
|
|
||||||
/***** Icon depending on type ******/
|
|
||||||
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
|
|
||||||
|
|
||||||
/***** Write text *****/
|
|
||||||
HTM_Txt (Txt_RESOURCE_TYPES[PrgRsc_NONE]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************* Get the title for a new resource from link title **************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void PrgRsc_GetResourceTitleFromLink (struct Prg_Item *Item)
|
|
||||||
{
|
|
||||||
static void (*GetTitle[PrgRsc_NUM_TYPES]) (long Cod,char *Title,size_t TitleSize) =
|
|
||||||
{
|
|
||||||
[PrgRsc_NONE ] = NULL,
|
|
||||||
[PrgRsc_ASSIGNMENT ] = AsgRsc_GetTitleFromAsgCod,
|
|
||||||
[PrgRsc_PROJECT ] = PrjRsc_GetTitleFromPrjCod,
|
|
||||||
[PrgRsc_CALL_FOR_EXAM ] = CfeRsc_GetTitleFromExaCod,
|
|
||||||
[PrgRsc_EXAM ] = ExaRsc_GetTitleFromExaCod,
|
|
||||||
[PrgRsc_GAME ] = GamRsc_GetTitleFromGamCod,
|
|
||||||
[PrgRsc_SURVEY ] = SvyRsc_GetTitleFromSvyCod,
|
|
||||||
[PrgRsc_DOCUMENT ] = BrwRsc_GetDocTitleFromFilCod,
|
|
||||||
[PrgRsc_MARKS ] = BrwRsc_GetMrkTitleFromFilCod,
|
|
||||||
[PrgRsc_ATTENDANCE_EVENT] = AttRsc_GetTitleFromAttCod,
|
|
||||||
[PrgRsc_FORUM_THREAD ] = ForRsc_GetTitleFromThrCod,
|
|
||||||
};
|
|
||||||
|
|
||||||
/***** Reset title *****/
|
|
||||||
Item->Resource.Title[0] = '\0';
|
|
||||||
|
|
||||||
/***** Get title *****/
|
|
||||||
if (GetTitle[Item->Resource.Link.Type])
|
|
||||||
GetTitle[Item->Resource.Link.Type] (Item->Resource.Link.Cod,
|
|
||||||
Item->Resource.Title,
|
|
||||||
sizeof (Item->Resource.Title) - 1);
|
|
||||||
else
|
|
||||||
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************** Show clipboard to change resource link ********************/
|
/***************** Show clipboard to change resource link ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1084,7 +931,7 @@ void PrgRsc_ChangeLink (void)
|
||||||
Par_GetParText ("Link",TypeCod,sizeof (TypeCod) - 1);
|
Par_GetParText ("Link",TypeCod,sizeof (TypeCod) - 1);
|
||||||
if (sscanf (TypeCod,"%3s_%ld",TypeStr,&Cod) == 2)
|
if (sscanf (TypeCod,"%3s_%ld",TypeStr,&Cod) == 2)
|
||||||
{
|
{
|
||||||
Item.Resource.Link.Type = PrgRsc_GetTypeFromString (TypeStr);
|
Item.Resource.Link.Type = Rsc_GetTypeFromString (TypeStr);
|
||||||
Item.Resource.Link.Cod = Cod;
|
Item.Resource.Link.Cod = Cod;
|
||||||
|
|
||||||
/***** Is it an existing resource? *****/
|
/***** Is it an existing resource? *****/
|
||||||
|
@ -1092,7 +939,8 @@ void PrgRsc_ChangeLink (void)
|
||||||
{
|
{
|
||||||
/* No resource selected, so it's a new resource at the end of the item */
|
/* No resource selected, so it's a new resource at the end of the item */
|
||||||
/* Get the new title for the new resource from link title */
|
/* Get the new title for the new resource from link title */
|
||||||
PrgRsc_GetResourceTitleFromLink (&Item);
|
Rsc_GetResourceTitleFromLink (&Item.Resource.Link,
|
||||||
|
Item.Resource.Title);
|
||||||
|
|
||||||
/***** Create resource *****/
|
/***** Create resource *****/
|
||||||
Item.Resource.Hierarchy.RscCod = Prg_DB_CreateResource (&Item);
|
Item.Resource.Hierarchy.RscCod = Prg_DB_CreateResource (&Item);
|
||||||
|
@ -1111,59 +959,3 @@ void PrgRsc_ChangeLink (void)
|
||||||
/***** Free list of program items *****/
|
/***** Free list of program items *****/
|
||||||
Prg_FreeListItems ();
|
Prg_FreeListItems ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/********************** Get resource data from clipboard *********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void PrgRsc_GetLinkDataFromRow (MYSQL_RES *mysql_res,
|
|
||||||
struct PrgRsc_Link *Link)
|
|
||||||
{
|
|
||||||
MYSQL_ROW row;
|
|
||||||
|
|
||||||
/***** Get row *****/
|
|
||||||
row = mysql_fetch_row (mysql_res);
|
|
||||||
/*
|
|
||||||
Type row[0]
|
|
||||||
Cod row[1]
|
|
||||||
*/
|
|
||||||
/***** Get type (row[0]) *****/
|
|
||||||
Link->Type = PrgRsc_GetTypeFromString (row[0]);
|
|
||||||
|
|
||||||
/***** Get code (row[1]) *****/
|
|
||||||
Link->Cod = Str_ConvertStrCodToLongCod (row[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/********************** Convert from string to type **************************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
PrgRsc_Type_t PrgRsc_GetTypeFromString (const char *Str)
|
|
||||||
{
|
|
||||||
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES];
|
|
||||||
PrgRsc_Type_t Type;
|
|
||||||
|
|
||||||
/***** Compare string with all string types *****/
|
|
||||||
for (Type = (PrgRsc_Type_t) 0;
|
|
||||||
Type <= (PrgRsc_Type_t) (PrgRsc_NUM_TYPES - 1);
|
|
||||||
Type++)
|
|
||||||
if (!strcmp (Prg_ResourceTypesDB[Type],Str))
|
|
||||||
return Type;
|
|
||||||
|
|
||||||
return PrgRsc_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************************** Check if I can get link **************************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
bool PrgRsc_CheckIfICanGetLink (void)
|
|
||||||
{
|
|
||||||
static const bool ICanGetLink[Rol_NUM_ROLES] =
|
|
||||||
{
|
|
||||||
[Rol_TCH ] = true,
|
|
||||||
[Rol_SYS_ADM] = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
return ICanGetLink[Gbl.Usrs.Me.Role.Logged];
|
|
||||||
}
|
|
||||||
|
|
|
@ -57,10 +57,7 @@ void PrgRsc_MoveUpResource (void);
|
||||||
void PrgRsc_MoveDownResource (void);
|
void PrgRsc_MoveDownResource (void);
|
||||||
|
|
||||||
void PrgRsc_ShowClipboardToChgLink (void);
|
void PrgRsc_ShowClipboardToChgLink (void);
|
||||||
|
|
||||||
void PrgRsc_ChangeLink (void);
|
void PrgRsc_ChangeLink (void);
|
||||||
|
|
||||||
PrgRsc_Type_t PrgRsc_GetTypeFromString (const char *Str);
|
|
||||||
|
|
||||||
bool PrgRsc_CheckIfICanGetLink (void);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1265,7 +1265,7 @@ static void Prj_PutIconsListProjects (void *Projects)
|
||||||
NULL,NULL);
|
NULL,NULL);
|
||||||
|
|
||||||
/***** Link to get resource link *****/
|
/***** Link to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkPrj,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkPrj,NULL,
|
||||||
Prj_PutCurrentPars,Projects);
|
Prj_PutCurrentPars,Projects);
|
||||||
|
|
||||||
|
@ -3213,7 +3213,7 @@ static void Prj_PutIconsToRemEditOnePrj (struct Prj_Projects *Projects,
|
||||||
Prj_PutIconOffLockedUnlocked (&Projects->Prj);
|
Prj_PutIconOffLockedUnlocked (&Projects->Prj);
|
||||||
|
|
||||||
/***** Link to get resource link *****/
|
/***** Link to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkPrj,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkPrj,NULL,
|
||||||
Prj_PutCurrentPars,Projects);
|
Prj_PutCurrentPars,Projects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ void PrjRsc_GetLinkToProject (void)
|
||||||
PrjRsc_GetTitleFromPrjCod (Projects.Prj.PrjCod,Title,sizeof (Title) - 1);
|
PrjRsc_GetTitleFromPrjCod (Projects.Prj.PrjCod,Title,sizeof (Title) - 1);
|
||||||
|
|
||||||
/***** Copy link to PROJECT into resource clipboard *****/
|
/***** Copy link to PROJECT into resource clipboard *****/
|
||||||
Prg_DB_CopyToClipboard (PrgRsc_PROJECT,Projects.Prj.PrjCod);
|
Prg_DB_CopyToClipboard (Rsc_PROJECT,Projects.Prj.PrjCod);
|
||||||
|
|
||||||
/***** Write sucess message *****/
|
/***** Write sucess message *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
||||||
|
@ -70,11 +70,11 @@ void PrjRsc_GetLinkToProject (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Write game in course program ************************/
|
/*********************** Write project as resource ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void PrjRsc_WriteProjectInCrsProgram (long PrjCod,bool PutFormToGo,
|
void PrjRsc_WriteResourceProject (long PrjCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle)
|
const char *Icon,const char *IconTitle)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||||
Act_Action_t NextAction;
|
Act_Action_t NextAction;
|
||||||
|
@ -101,15 +101,13 @@ void PrjRsc_WriteProjectInCrsProgram (long PrjCod,bool PutFormToGo,
|
||||||
else
|
else
|
||||||
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
|
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
|
||||||
|
|
||||||
/***** Write project title of exam *****/
|
/***** Write project title *****/
|
||||||
HTM_Txt (Title);
|
HTM_Txt (Title);
|
||||||
|
|
||||||
/***** End form to go to project *****/
|
/***** End form to go to project *****/
|
||||||
if (PutFormToGo)
|
if (PutFormToGo)
|
||||||
{
|
{
|
||||||
/* End form */
|
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void PrjRsc_GetLinkToProject (void);
|
void PrjRsc_GetLinkToProject (void);
|
||||||
void PrjRsc_WriteProjectInCrsProgram (long PrjCod,bool PutFormToGo,
|
void PrjRsc_WriteResourceProject (long PrjCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle);
|
const char *Icon,const char *IconTitle);
|
||||||
void PrjRsc_GetTitleFromPrjCod (long PrjCod,char *Title,size_t TitleSize);
|
void PrjRsc_GetTitleFromPrjCod (long PrjCod,char *Title,size_t TitleSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,241 @@
|
||||||
|
// swad_resource.c: resources for course program and rubrics
|
||||||
|
|
||||||
|
/*
|
||||||
|
SWAD (Shared Workspace At a Distance),
|
||||||
|
is a web platform developed at the University of Granada (Spain),
|
||||||
|
and used to support university teaching.
|
||||||
|
|
||||||
|
This file is part of SWAD core.
|
||||||
|
Copyright (C) 1999-2023 Antonio Cañas Vargas
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********************************* Headers ***********************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdbool.h> // For boolean type
|
||||||
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
|
#include "swad_alert.h"
|
||||||
|
#include "swad_assignment_resource.h"
|
||||||
|
#include "swad_attendance_resource.h"
|
||||||
|
#include "swad_browser_resource.h"
|
||||||
|
#include "swad_call_for_exam_resource.h"
|
||||||
|
#include "swad_exam_resource.h"
|
||||||
|
#include "swad_forum_resource.h"
|
||||||
|
#include "swad_game_resource.h"
|
||||||
|
#include "swad_global.h"
|
||||||
|
#include "swad_HTML.h"
|
||||||
|
#include "swad_project_resource.h"
|
||||||
|
#include "swad_resource.h"
|
||||||
|
#include "swad_role.h"
|
||||||
|
#include "swad_survey_resource.h"
|
||||||
|
#include "swad_theme.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/***************************** Public constants ******************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
const char *Rsc_ResourceTypesIcons[Rsc_NUM_TYPES] =
|
||||||
|
{
|
||||||
|
[Rsc_NONE ] = "link-slash.svg",
|
||||||
|
// gui TEACHING_GUIDE // Link to teaching guide
|
||||||
|
// bib BIBLIOGRAPHY // Link to bibliography
|
||||||
|
// faq FAQ // Link to FAQ
|
||||||
|
// lnk LINKS // Link to links
|
||||||
|
// tmt TIMETABLE // Link to timetable
|
||||||
|
[Rsc_ASSIGNMENT ] = "edit.svg",
|
||||||
|
[Rsc_PROJECT ] = "file-invoice.svg",
|
||||||
|
[Rsc_CALL_FOR_EXAM ] = "bullhorn.svg",
|
||||||
|
// tst TEST // User selects tags, teacher should select
|
||||||
|
[Rsc_EXAM ] = "file-signature.svg",
|
||||||
|
[Rsc_GAME ] = "gamepad.svg",
|
||||||
|
[Rsc_SURVEY ] = "poll.svg",
|
||||||
|
[Rsc_DOCUMENT ] = "folder-open.svg",
|
||||||
|
[Rsc_MARKS ] = "list-alt.svg",
|
||||||
|
// grp GROUPS // ??? User select groups
|
||||||
|
[Rsc_ATTENDANCE_EVENT] = "calendar-check.svg",
|
||||||
|
[Rsc_FORUM_THREAD ] = "comments.svg",
|
||||||
|
};
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************** External global variables from others modules ****************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
extern struct Globals Gbl;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************************ Show one link from clipboard ***********************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Rsc_WriteRowClipboard (bool SubmitOnClick,const struct Rsc_Link *Link)
|
||||||
|
{
|
||||||
|
extern const char *Rsc_ResourceTypesDB[Rsc_NUM_TYPES];
|
||||||
|
extern const char *Txt_RESOURCE_TYPES[Rsc_NUM_TYPES];
|
||||||
|
|
||||||
|
HTM_LI_Begin ("class=\"PRG_RSC_%s\"",The_GetSuffix ());
|
||||||
|
HTM_LABEL_Begin (NULL);
|
||||||
|
|
||||||
|
/***** Radio selector *****/
|
||||||
|
HTM_INPUT_RADIO ("Link",SubmitOnClick,
|
||||||
|
"value=\"%s_%ld\"%s",
|
||||||
|
Rsc_ResourceTypesDB[Link->Type],Link->Cod,
|
||||||
|
SubmitOnClick ? "" :
|
||||||
|
" checked=\"checked\"");
|
||||||
|
|
||||||
|
/***** Name *****/
|
||||||
|
Rsc_WriteLinkName (Link,
|
||||||
|
false, // Don't put form
|
||||||
|
Rsc_ResourceTypesIcons[Link->Type],
|
||||||
|
Txt_RESOURCE_TYPES[Link->Type]);
|
||||||
|
|
||||||
|
HTM_LABEL_End ();
|
||||||
|
HTM_LI_End ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************* Write link name (filename, assignment title...) ***************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Rsc_WriteLinkName (const struct Rsc_Link *Link,bool PutFormToGo,
|
||||||
|
const char *Icon,const char *IconTitle)
|
||||||
|
{
|
||||||
|
static void (*WriteLinkName[Rsc_NUM_TYPES]) (long Cod,bool PutFormToGo,
|
||||||
|
const char *Icon,
|
||||||
|
const char *IconTitle) =
|
||||||
|
{
|
||||||
|
[Rsc_NONE ] = Rsc_WriteResourceEmpty,
|
||||||
|
[Rsc_ASSIGNMENT ] = AsgRsc_WriteResourceAssignment,
|
||||||
|
[Rsc_PROJECT ] = PrjRsc_WriteResourceProject,
|
||||||
|
[Rsc_CALL_FOR_EXAM ] = CfeRsc_WriteResourceCallForExam,
|
||||||
|
[Rsc_EXAM ] = ExaRsc_WriteResourceExam,
|
||||||
|
[Rsc_GAME ] = GamRsc_WriteResourceGame,
|
||||||
|
[Rsc_SURVEY ] = SvyRsc_WriteResourceSurvey,
|
||||||
|
[Rsc_DOCUMENT ] = BrwRsc_WriteResourceDocument,
|
||||||
|
[Rsc_MARKS ] = BrwRsc_WriteResourceMarksFile,
|
||||||
|
[Rsc_ATTENDANCE_EVENT] = AttRsc_WriteResourceEvent,
|
||||||
|
[Rsc_FORUM_THREAD ] = ForRsc_WriteResourceThread,
|
||||||
|
};
|
||||||
|
|
||||||
|
/***** Write link name *****/
|
||||||
|
if (WriteLinkName[Link->Type])
|
||||||
|
WriteLinkName[Link->Type] (Link->Cod,PutFormToGo,Icon,IconTitle);
|
||||||
|
else
|
||||||
|
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/******************** Write empty resource as resource ***********************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Rsc_WriteResourceEmpty (__attribute__((unused)) long Cod,
|
||||||
|
__attribute__((unused)) bool PutFormToGo,
|
||||||
|
const char *Icon,const char *IconTitle)
|
||||||
|
{
|
||||||
|
extern const char *Txt_RESOURCE_TYPES[Rsc_NUM_TYPES];
|
||||||
|
|
||||||
|
/***** Icon depending on type ******/
|
||||||
|
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
|
||||||
|
|
||||||
|
/***** Write text *****/
|
||||||
|
HTM_Txt (Txt_RESOURCE_TYPES[Rsc_NONE]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************* Get the title for a new resource from link title **************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Rsc_GetResourceTitleFromLink (struct Rsc_Link *Link,
|
||||||
|
char Title[Rsc_MAX_BYTES_RESOURCE_TITLE + 1])
|
||||||
|
{
|
||||||
|
static void (*GetTitle[Rsc_NUM_TYPES]) (long Cod,char *Title,size_t TitleSize) =
|
||||||
|
{
|
||||||
|
[Rsc_NONE ] = NULL,
|
||||||
|
[Rsc_ASSIGNMENT ] = AsgRsc_GetTitleFromAsgCod,
|
||||||
|
[Rsc_PROJECT ] = PrjRsc_GetTitleFromPrjCod,
|
||||||
|
[Rsc_CALL_FOR_EXAM ] = CfeRsc_GetTitleFromExaCod,
|
||||||
|
[Rsc_EXAM ] = ExaRsc_GetTitleFromExaCod,
|
||||||
|
[Rsc_GAME ] = GamRsc_GetTitleFromGamCod,
|
||||||
|
[Rsc_SURVEY ] = SvyRsc_GetTitleFromSvyCod,
|
||||||
|
[Rsc_DOCUMENT ] = BrwRsc_GetTitleFromDocFilCod,
|
||||||
|
[Rsc_MARKS ] = BrwRsc_GetTitleFromMrkFilCod,
|
||||||
|
[Rsc_ATTENDANCE_EVENT] = AttRsc_GetTitleFromAttCod,
|
||||||
|
[Rsc_FORUM_THREAD ] = ForRsc_GetTitleFromThrCod,
|
||||||
|
};
|
||||||
|
|
||||||
|
/***** Reset title *****/
|
||||||
|
Title[0] = '\0';
|
||||||
|
|
||||||
|
/***** Get title *****/
|
||||||
|
if (GetTitle[Link->Type])
|
||||||
|
GetTitle[Link->Type] (Link->Cod,Title,Rsc_MAX_BYTES_RESOURCE_TITLE);
|
||||||
|
else
|
||||||
|
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********************** Get resource data from clipboard *********************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Rsc_GetLinkDataFromRow (MYSQL_RES *mysql_res,struct Rsc_Link *Link)
|
||||||
|
{
|
||||||
|
MYSQL_ROW row;
|
||||||
|
|
||||||
|
/***** Get row *****/
|
||||||
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
/*
|
||||||
|
Type row[0]
|
||||||
|
Cod row[1]
|
||||||
|
*/
|
||||||
|
/***** Get type (row[0]) *****/
|
||||||
|
Link->Type = Rsc_GetTypeFromString (row[0]);
|
||||||
|
|
||||||
|
/***** Get code (row[1]) *****/
|
||||||
|
Link->Cod = Str_ConvertStrCodToLongCod (row[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********************** Convert from string to type **************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
Rsc_Type_t Rsc_GetTypeFromString (const char *Str)
|
||||||
|
{
|
||||||
|
extern const char *Rsc_ResourceTypesDB[Rsc_NUM_TYPES];
|
||||||
|
Rsc_Type_t Type;
|
||||||
|
|
||||||
|
/***** Compare string with all string types *****/
|
||||||
|
for (Type = (Rsc_Type_t) 0;
|
||||||
|
Type <= (Rsc_Type_t) (Rsc_NUM_TYPES - 1);
|
||||||
|
Type++)
|
||||||
|
if (!strcmp (Rsc_ResourceTypesDB[Type],Str))
|
||||||
|
return Type;
|
||||||
|
|
||||||
|
return Rsc_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************************** Check if I can get link **************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
bool Rsc_CheckIfICanGetLink (void)
|
||||||
|
{
|
||||||
|
static const bool ICanGetLink[Rol_NUM_ROLES] =
|
||||||
|
{
|
||||||
|
[Rol_TCH ] = true,
|
||||||
|
[Rol_SYS_ADM] = true,
|
||||||
|
};
|
||||||
|
|
||||||
|
return ICanGetLink[Gbl.Usrs.Me.Role.Logged];
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
// swad_resource.h: resources for course program and rubrics
|
||||||
|
|
||||||
|
#ifndef _SWAD_RSC
|
||||||
|
#define _SWAD_RSC
|
||||||
|
/*
|
||||||
|
SWAD (Shared Workspace At a Distance),
|
||||||
|
is a web platform developed at the University of Granada (Spain),
|
||||||
|
and used to support university teaching.
|
||||||
|
|
||||||
|
This file is part of SWAD core.
|
||||||
|
Copyright (C) 1999-2023 Antonio Cañas Vargas
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********************************* Headers ***********************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <mysql/mysql.h> // To access MySQL databases
|
||||||
|
|
||||||
|
#include "swad_string.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************************** Public types and constants ***********************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#define Rsc_MAX_CHARS_RESOURCE_TITLE (128 - 1) // 127
|
||||||
|
#define Rsc_MAX_BYTES_RESOURCE_TITLE ((Rsc_MAX_CHARS_RESOURCE_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
||||||
|
|
||||||
|
#define Rsc_NUM_TYPES 11
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
Rsc_NONE,
|
||||||
|
// gui TEACHING_GUIDE // Link to teaching guide
|
||||||
|
// bib BIBLIOGRAPHY // Link to bibliography
|
||||||
|
// faq FAQ // Link to FAQ
|
||||||
|
// lnk LINKS // Link to links
|
||||||
|
// tmt TIMETABLE // Link to timetable
|
||||||
|
Rsc_ASSIGNMENT,
|
||||||
|
Rsc_PROJECT, // A project is only for some students
|
||||||
|
Rsc_CALL_FOR_EXAM,
|
||||||
|
// tst TEST // User selects tags, teacher should select
|
||||||
|
Rsc_EXAM,
|
||||||
|
Rsc_GAME,
|
||||||
|
Rsc_SURVEY,
|
||||||
|
Rsc_DOCUMENT,
|
||||||
|
Rsc_MARKS,
|
||||||
|
// grp GROUPS // ??? User select groups
|
||||||
|
Rsc_ATTENDANCE_EVENT,
|
||||||
|
Rsc_FORUM_THREAD,
|
||||||
|
} Rsc_Type_t;
|
||||||
|
|
||||||
|
struct Rsc_Link
|
||||||
|
{
|
||||||
|
Rsc_Type_t Type;
|
||||||
|
long Cod;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/***************************** Public prototypes *****************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Rsc_WriteRowClipboard (bool SubmitOnClick,const struct Rsc_Link *Link);
|
||||||
|
void Rsc_WriteLinkName (const struct Rsc_Link *Link,bool PutFormToGo,
|
||||||
|
const char *Icon,const char *IconTitle);
|
||||||
|
void Rsc_WriteResourceEmpty (__attribute__((unused)) long Cod,
|
||||||
|
__attribute__((unused)) bool PutFormToGo,
|
||||||
|
const char *Icon,const char *IconTitle);
|
||||||
|
|
||||||
|
void Rsc_GetResourceTitleFromLink (struct Rsc_Link *Link,
|
||||||
|
char Title[Rsc_MAX_BYTES_RESOURCE_TITLE + 1]);
|
||||||
|
|
||||||
|
void Rsc_GetLinkDataFromRow (MYSQL_RES *mysql_res,struct Rsc_Link *Link);
|
||||||
|
Rsc_Type_t Rsc_GetTypeFromString (const char *Str);
|
||||||
|
|
||||||
|
bool Rsc_CheckIfICanGetLink (void);
|
||||||
|
|
||||||
|
#endif
|
|
@ -63,26 +63,6 @@ static const char *RubCri_ParValues[RubCri_NUM_VALUES] =
|
||||||
[RubCri_MAX] = "MaxVal",
|
[RubCri_MAX] = "MaxVal",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *RubCri_SourceDB[RubCri_NUM_SOURCES] =
|
|
||||||
{
|
|
||||||
[RubCri_FROM_TEACHER ] = "teacher",
|
|
||||||
[RubCri_FROM_ANOTHER_RUBRIC] = "rubric",
|
|
||||||
[RubCri_FROM_EXAM_PRINT ] = "exam",
|
|
||||||
[RubCri_FROM_GAME_MATCH ] = "game",
|
|
||||||
};
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/**************************** Private constants ******************************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
const char *RubCri_SourceIcons[RubCri_NUM_SOURCES] =
|
|
||||||
{
|
|
||||||
[RubCri_FROM_TEACHER ] = "user-tie.svg",
|
|
||||||
[RubCri_FROM_ANOTHER_RUBRIC] = "tasks.svg",
|
|
||||||
[RubCri_FROM_EXAM_PRINT ] = "file-signature.svg",
|
|
||||||
[RubCri_FROM_GAME_MATCH ] = "gamepad.svg",
|
|
||||||
};
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************************** Private prototypes ****************************/
|
/***************************** Private prototypes ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -95,7 +75,7 @@ static void RubCri_PutFormNewCriterion (struct Rub_Rubrics *Rubrics,
|
||||||
static void RubCri_ReceiveCriterionFieldsFromForm (struct RubCri_Criterion *Criterion);
|
static void RubCri_ReceiveCriterionFieldsFromForm (struct RubCri_Criterion *Criterion);
|
||||||
static bool RubCri_CheckCriterionTitleReceivedFromForm (const struct RubCri_Criterion *Criterion,
|
static bool RubCri_CheckCriterionTitleReceivedFromForm (const struct RubCri_Criterion *Criterion,
|
||||||
const char NewTitle[RubCri_MAX_BYTES_TITLE + 1]);
|
const char NewTitle[RubCri_MAX_BYTES_TITLE + 1]);
|
||||||
static RubCri_Source_t RubCri_GetParSource (void);
|
static Rsc_Type_t RubCri_GetParType (void);
|
||||||
|
|
||||||
static void RubCri_ChangeValueCriterion (RubCri_ValueRange_t ValueRange);
|
static void RubCri_ChangeValueCriterion (RubCri_ValueRange_t ValueRange);
|
||||||
|
|
||||||
|
@ -118,17 +98,9 @@ static void RubCri_GetAndCheckPars (struct Rub_Rubrics *Rubrics,
|
||||||
static void RubCri_ExchangeCriteria (long RubCod,
|
static void RubCri_ExchangeCriteria (long RubCod,
|
||||||
unsigned CriIndTop,unsigned CriIndBottom);
|
unsigned CriIndTop,unsigned CriIndBottom);
|
||||||
|
|
||||||
static void RubCri_ShowResource (struct RubCri_Criterion *Criterion,
|
static void RubCri_ShowResource (const struct RubCri_Criterion *Criterion,
|
||||||
bool Editing,const char *Anchor);
|
bool Editing,const char *Anchor);
|
||||||
static void RubCri_ShowClipboard (struct RubCri_Criterion *Criterion,const char *Anchor);
|
static void RubCri_ShowClipboard (const struct RubCri_Criterion *Criterion,const char *Anchor);
|
||||||
static void RubCri_GetLinkDataFromRow (MYSQL_RES *mysql_res,
|
|
||||||
struct RubCri_Criterion *Criterion);
|
|
||||||
static void RubCri_WriteRowClipboard (bool SubmitOnClick,
|
|
||||||
const struct RubCri_Criterion *Criterion);
|
|
||||||
static void RubCri_WriteLinkName (const struct RubCri_Criterion *Criterion,bool PutFormToGo);
|
|
||||||
static void RubCri_WriteEmptyLinkInRubricCriterion (__attribute__((unused)) long Cod,
|
|
||||||
__attribute__((unused)) bool PutFormToGo,
|
|
||||||
const char *Icon,const char *IconTitle);
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*************** Put parameter to edit one rubric criterion ******************/
|
/*************** Put parameter to edit one rubric criterion ******************/
|
||||||
|
@ -179,9 +151,9 @@ static void RubCri_PutFormNewCriterion (struct Rub_Rubrics *Rubrics,
|
||||||
unsigned MaxCriInd)
|
unsigned MaxCriInd)
|
||||||
{
|
{
|
||||||
extern const char *Txt_New_criterion;
|
extern const char *Txt_New_criterion;
|
||||||
extern const char *Txt_RUBRIC_CRITERION_SOURCES[RubCri_NUM_SOURCES];
|
|
||||||
extern const char *Txt_Create_criterion;
|
extern const char *Txt_Create_criterion;
|
||||||
RubCri_Source_t Source;
|
extern const char *Txt_RESOURCE_TYPES[Rsc_NUM_TYPES];
|
||||||
|
Rsc_Type_t Type;
|
||||||
unsigned SourceUnsigned;
|
unsigned SourceUnsigned;
|
||||||
RubCri_ValueRange_t ValueRange;
|
RubCri_ValueRange_t ValueRange;
|
||||||
|
|
||||||
|
@ -224,14 +196,14 @@ static void RubCri_PutFormNewCriterion (struct Rub_Rubrics *Rubrics,
|
||||||
HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,
|
HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,
|
||||||
"name=\"Source\" class=\"INPUT_%s\"",
|
"name=\"Source\" class=\"INPUT_%s\"",
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
for (Source = (RubCri_Source_t) 0;
|
for (Type = (Rsc_Type_t) 0;
|
||||||
Source <= (RubCri_Source_t) (RubCri_NUM_SOURCES - 1);
|
Type <= (Rsc_Type_t) (Rsc_NUM_TYPES - 1);
|
||||||
Source++)
|
Type++)
|
||||||
{
|
{
|
||||||
SourceUnsigned = (unsigned) Source;
|
SourceUnsigned = (unsigned) Type;
|
||||||
HTM_OPTION (HTM_Type_UNSIGNED,&SourceUnsigned,
|
HTM_OPTION (HTM_Type_UNSIGNED,&SourceUnsigned,
|
||||||
Source == Criterion->Source,false,
|
Type == Criterion->Link.Type,false,
|
||||||
"%s",Txt_RUBRIC_CRITERION_SOURCES[Source]);
|
"%s",Txt_RESOURCE_TYPES[Type]);
|
||||||
}
|
}
|
||||||
HTM_SELECT_End ();
|
HTM_SELECT_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -313,7 +285,7 @@ static void RubCri_ReceiveCriterionFieldsFromForm (struct RubCri_Criterion *Crit
|
||||||
Par_GetParText ("Title",Criterion->Title,RubCri_MAX_BYTES_TITLE);
|
Par_GetParText ("Title",Criterion->Title,RubCri_MAX_BYTES_TITLE);
|
||||||
|
|
||||||
/***** Get criterion source *****/
|
/***** Get criterion source *****/
|
||||||
Criterion->Source = RubCri_GetParSource ();
|
Criterion->Link.Type = RubCri_GetParType ();
|
||||||
|
|
||||||
/***** Get minimum and maximum values of criterion *****/
|
/***** Get minimum and maximum values of criterion *****/
|
||||||
for (ValueRange = (RubCri_ValueRange_t) 0;
|
for (ValueRange = (RubCri_ValueRange_t) 0;
|
||||||
|
@ -365,13 +337,13 @@ static bool RubCri_CheckCriterionTitleReceivedFromForm (const struct RubCri_Crit
|
||||||
/****************** Get parameter with criterion source **********************/
|
/****************** Get parameter with criterion source **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static RubCri_Source_t RubCri_GetParSource (void)
|
static Rsc_Type_t RubCri_GetParType (void)
|
||||||
{
|
{
|
||||||
return (RubCri_Source_t)
|
return (Rsc_Type_t)
|
||||||
Par_GetParUnsignedLong ("Source",
|
Par_GetParUnsignedLong ("Type",
|
||||||
0,
|
0,
|
||||||
RubCri_NUM_SOURCES - 1,
|
Rsc_NUM_TYPES - 1,
|
||||||
(unsigned long) RubCri_SOURCE_DEFAULT);
|
(unsigned long) Rsc_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -417,10 +389,10 @@ void RubCri_ChangeTitle (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************** Receive form to change criterion source ******************/
|
/******************* Receive form to change criterion type *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void RubCri_ChangeSource (void)
|
void RubCri_ChangeType (void)
|
||||||
{
|
{
|
||||||
struct Rub_Rubrics Rubrics;
|
struct Rub_Rubrics Rubrics;
|
||||||
struct RubCri_Criterion Criterion;
|
struct RubCri_Criterion Criterion;
|
||||||
|
@ -446,12 +418,12 @@ void RubCri_ChangeSource (void)
|
||||||
if (!Rub_CheckIfEditable (&Rubrics.Rubric))
|
if (!Rub_CheckIfEditable (&Rubrics.Rubric))
|
||||||
Err_NoPermissionExit ();
|
Err_NoPermissionExit ();
|
||||||
|
|
||||||
/***** Receive new source from form *****/
|
/***** Receive new type from form *****/
|
||||||
Criterion.Source = RubCri_GetParSource ();
|
Criterion.Link.Type = RubCri_GetParType ();
|
||||||
|
|
||||||
/***** Change source *****/
|
/***** Change type *****/
|
||||||
/* Update the table changing old source by new source */
|
/* Update the table changing old type by new type */
|
||||||
Rub_DB_UpdateCriterionSource (&Criterion);
|
Rub_DB_UpdateCriterionType (&Criterion);
|
||||||
|
|
||||||
/***** Show current rubric and its criteria *****/
|
/***** Show current rubric and its criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Criterion,
|
Rub_PutFormsOneRubric (&Rubrics,&Criterion,
|
||||||
|
@ -632,7 +604,7 @@ static void RubCri_ListOneOrMoreCriteriaForEdition (struct Rub_Rubrics *Rubrics,
|
||||||
{
|
{
|
||||||
extern const char *Txt_Criteria;
|
extern const char *Txt_Criteria;
|
||||||
extern const char *Txt_Movement_not_allowed;
|
extern const char *Txt_Movement_not_allowed;
|
||||||
extern const char *Txt_RUBRIC_CRITERION_SOURCES[RubCri_NUM_SOURCES];
|
extern const char *Txt_RESOURCE_TYPES[Rsc_NUM_TYPES];
|
||||||
// Actions to change minimum/maximum criterion values
|
// Actions to change minimum/maximum criterion values
|
||||||
static Act_Action_t RubCri_ActionsValues[RubCri_NUM_VALUES] =
|
static Act_Action_t RubCri_ActionsValues[RubCri_NUM_VALUES] =
|
||||||
{
|
{
|
||||||
|
@ -642,7 +614,7 @@ static void RubCri_ListOneOrMoreCriteriaForEdition (struct Rub_Rubrics *Rubrics,
|
||||||
unsigned NumCriterion;
|
unsigned NumCriterion;
|
||||||
struct RubCri_Criterion Criterion;
|
struct RubCri_Criterion Criterion;
|
||||||
char *Anchor;
|
char *Anchor;
|
||||||
RubCri_Source_t Source;
|
Rsc_Type_t Type;
|
||||||
unsigned SourceUnsigned;
|
unsigned SourceUnsigned;
|
||||||
RubCri_ValueRange_t ValueRange;
|
RubCri_ValueRange_t ValueRange;
|
||||||
|
|
||||||
|
@ -746,14 +718,14 @@ static void RubCri_ListOneOrMoreCriteriaForEdition (struct Rub_Rubrics *Rubrics,
|
||||||
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
|
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
|
||||||
"name=\"Source\" class=\"INPUT_%s\"",
|
"name=\"Source\" class=\"INPUT_%s\"",
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
for (Source = (RubCri_Source_t) 0;
|
for (Type = (Rsc_Type_t) 0;
|
||||||
Source <= (RubCri_Source_t) (RubCri_NUM_SOURCES - 1);
|
Type <= (Rsc_Type_t) (Rsc_NUM_TYPES - 1);
|
||||||
Source++)
|
Type++)
|
||||||
{
|
{
|
||||||
SourceUnsigned = (unsigned) Source;
|
SourceUnsigned = (unsigned) Type;
|
||||||
HTM_OPTION (HTM_Type_UNSIGNED,&SourceUnsigned,
|
HTM_OPTION (HTM_Type_UNSIGNED,&SourceUnsigned,
|
||||||
Source == Criterion.Source,false,
|
Type == Criterion.Link.Type,false,
|
||||||
"%s",Txt_RUBRIC_CRITERION_SOURCES[Source]);
|
"%s",Txt_RESOURCE_TYPES[Type]);
|
||||||
}
|
}
|
||||||
HTM_SELECT_End ();
|
HTM_SELECT_End ();
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
@ -867,9 +839,9 @@ static void RubCri_GetCriterionDataFromRow (MYSQL_RES *mysql_res,
|
||||||
/***** Get criterion index (row[2]) *****/
|
/***** Get criterion index (row[2]) *****/
|
||||||
Criterion->CriInd = Str_ConvertStrToUnsigned (row[2]);
|
Criterion->CriInd = Str_ConvertStrToUnsigned (row[2]);
|
||||||
|
|
||||||
/***** Get source (row[3]) and code (row[4]) *****/
|
/***** Get type (row[3]) and code (row[4]) *****/
|
||||||
Criterion->Source = RubCri_GetSourceFromDBStr (row[3]);
|
Criterion->Link.Type = Rsc_GetTypeFromString (row[3]);
|
||||||
Criterion->Cod = Str_ConvertStrCodToLongCod (row[4]);
|
Criterion->Link.Cod = Str_ConvertStrCodToLongCod (row[4]);
|
||||||
|
|
||||||
/***** Get criterion minimum and maximum values (row[5], row[6]) *****/
|
/***** Get criterion minimum and maximum values (row[5], row[6]) *****/
|
||||||
for (ValueRange = (RubCri_ValueRange_t) 0;
|
for (ValueRange = (RubCri_ValueRange_t) 0;
|
||||||
|
@ -885,35 +857,6 @@ static void RubCri_GetCriterionDataFromRow (MYSQL_RES *mysql_res,
|
||||||
sizeof (Criterion->Title) - 1);
|
sizeof (Criterion->Title) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/*********************** Get source from database string *********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
RubCri_Source_t RubCri_GetSourceFromDBStr (const char *SourceDBStr)
|
|
||||||
{
|
|
||||||
RubCri_Source_t Source;
|
|
||||||
|
|
||||||
for (Source = (RubCri_Source_t) 0;
|
|
||||||
Source <= (RubCri_Source_t) (RubCri_NUM_SOURCES - 1);
|
|
||||||
Source++)
|
|
||||||
if (!strcmp (RubCri_GetDBStrFromSource (Source),SourceDBStr))
|
|
||||||
return Source;
|
|
||||||
|
|
||||||
return RubCri_SOURCE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/*********************** Get database string from source *********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
const char *RubCri_GetDBStrFromSource (RubCri_Source_t Source)
|
|
||||||
{
|
|
||||||
if (Source >= RubCri_NUM_SOURCES)
|
|
||||||
Source = RubCri_SOURCE_DEFAULT;
|
|
||||||
|
|
||||||
return RubCri_SourceDB[Source];
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************** Put table heading for rubric criteria ********************/
|
/****************** Put table heading for rubric criteria ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -960,8 +903,8 @@ void RubCri_ResetCriterion (struct RubCri_Criterion *Criterion)
|
||||||
Criterion->RubCod = -1L;
|
Criterion->RubCod = -1L;
|
||||||
Criterion->CriCod = -1L;
|
Criterion->CriCod = -1L;
|
||||||
Criterion->CriInd = 0;
|
Criterion->CriInd = 0;
|
||||||
Criterion->Source = RubCri_SOURCE_DEFAULT;
|
Criterion->Link.Type = Rsc_NONE;
|
||||||
Criterion->Cod = -1L;
|
Criterion->Link.Cod = -1L;
|
||||||
for (ValueRange = (RubCri_ValueRange_t) 0;
|
for (ValueRange = (RubCri_ValueRange_t) 0;
|
||||||
ValueRange <= (RubCri_ValueRange_t) (RubCri_NUM_VALUES - 1);
|
ValueRange <= (RubCri_ValueRange_t) (RubCri_NUM_VALUES - 1);
|
||||||
ValueRange++)
|
ValueRange++)
|
||||||
|
@ -1213,30 +1156,34 @@ static void RubCri_ExchangeCriteria (long RubCod,
|
||||||
/************************** Show criterion resource **************************/
|
/************************** Show criterion resource **************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void RubCri_ShowResource (struct RubCri_Criterion *Criterion,
|
static void RubCri_ShowResource (const struct RubCri_Criterion *Criterion,
|
||||||
bool Editing,const char *Anchor)
|
bool Editing,const char *Anchor)
|
||||||
{
|
{
|
||||||
|
extern const char *Rsc_ResourceTypesIcons[Rsc_NUM_TYPES];
|
||||||
|
extern const char *Txt_RESOURCE_TYPES[Rsc_NUM_TYPES];
|
||||||
|
|
||||||
return; // TODO: Provisional. Remove!
|
return; // TODO: Provisional. Remove!
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
if (Editing)
|
if (Editing)
|
||||||
RubCri_ShowClipboard (Criterion,Anchor);
|
RubCri_ShowClipboard (Criterion,Anchor);
|
||||||
else
|
else
|
||||||
RubCri_WriteLinkName (Criterion,
|
Rsc_WriteLinkName (&Criterion->Link,
|
||||||
true); // Put form
|
true, // Put form
|
||||||
|
Rsc_ResourceTypesIcons[Criterion->Link.Type],
|
||||||
|
Txt_RESOURCE_TYPES[Criterion->Link.Type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************** Show clipboard to change resource link ********************/
|
/***************** Show clipboard to change resource link ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void RubCri_ShowClipboard (struct RubCri_Criterion *Criterion,const char *Anchor)
|
static void RubCri_ShowClipboard (const struct RubCri_Criterion *Criterion,const char *Anchor)
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
unsigned NumLink;
|
unsigned NumLink;
|
||||||
unsigned NumLinks;
|
unsigned NumLinks;
|
||||||
// struct PrgRsc_Link Link;
|
struct Rsc_Link Link;
|
||||||
struct RubCri_Criterion Cri;
|
|
||||||
/*
|
/*
|
||||||
static const struct PrgRsc_Link EmptyLink =
|
static const struct PrgRsc_Link EmptyLink =
|
||||||
{
|
{
|
||||||
|
@ -1258,7 +1205,7 @@ static void RubCri_ShowClipboard (struct RubCri_Criterion *Criterion,const char
|
||||||
HTM_UL_Begin ("class=\"PRG_CLIPBOARD\"");
|
HTM_UL_Begin ("class=\"PRG_CLIPBOARD\"");
|
||||||
|
|
||||||
/***** Current link (empty or not) *****/
|
/***** Current link (empty or not) *****/
|
||||||
RubCri_WriteRowClipboard (false,Criterion);
|
Rsc_WriteRowClipboard (false,&Criterion->Link);
|
||||||
|
|
||||||
/***** Row with empty link to remove the current link *****/
|
/***** Row with empty link to remove the current link *****/
|
||||||
/*
|
/*
|
||||||
|
@ -1271,12 +1218,8 @@ static void RubCri_ShowClipboard (struct RubCri_Criterion *Criterion,const char
|
||||||
NumLink <= NumLinks;
|
NumLink <= NumLinks;
|
||||||
NumLink++)
|
NumLink++)
|
||||||
{
|
{
|
||||||
RubCri_GetLinkDataFromRow (mysql_res,&Cri);
|
Rsc_GetLinkDataFromRow (mysql_res,&Link);
|
||||||
/*
|
Rsc_WriteRowClipboard (true,&Link);
|
||||||
Cri.Source = Link->Type;
|
|
||||||
Cri.Cod = Link->Cod;
|
|
||||||
*/
|
|
||||||
RubCri_WriteRowClipboard (true,&Cri);
|
|
||||||
}
|
}
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
|
@ -1286,93 +1229,3 @@ static void RubCri_ShowClipboard (struct RubCri_Criterion *Criterion,const char
|
||||||
/***** End form *****/
|
/***** End form *****/
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/********************** Get resource data from clipboard *********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void RubCri_GetLinkDataFromRow (MYSQL_RES *mysql_res,
|
|
||||||
struct RubCri_Criterion *Criterion)
|
|
||||||
{
|
|
||||||
MYSQL_ROW row;
|
|
||||||
|
|
||||||
/***** Get row *****/
|
|
||||||
row = mysql_fetch_row (mysql_res);
|
|
||||||
/*
|
|
||||||
Type row[0]
|
|
||||||
Cod row[1]
|
|
||||||
*/
|
|
||||||
/***** Get type (row[0]) *****/
|
|
||||||
Criterion->Source = (RubCri_Source_t) PrgRsc_GetTypeFromString (row[0]); // TODO
|
|
||||||
|
|
||||||
/***** Get code (row[1]) *****/
|
|
||||||
Criterion->Cod = Str_ConvertStrCodToLongCod (row[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************************ Show one link from clipboard ***********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void RubCri_WriteRowClipboard (bool SubmitOnClick,
|
|
||||||
const struct RubCri_Criterion *Criterion)
|
|
||||||
{
|
|
||||||
HTM_LI_Begin ("class=\"PRG_RSC_%s\"",The_GetSuffix ());
|
|
||||||
HTM_LABEL_Begin (NULL);
|
|
||||||
|
|
||||||
/***** Radio selector *****/
|
|
||||||
HTM_INPUT_RADIO ("Link",SubmitOnClick,
|
|
||||||
"value=\"%s_%ld\"%s",
|
|
||||||
RubCri_SourceDB[Criterion->Source],Criterion->Cod,
|
|
||||||
SubmitOnClick ? "" :
|
|
||||||
" checked=\"checked\"");
|
|
||||||
|
|
||||||
/***** Name *****/
|
|
||||||
RubCri_WriteLinkName (Criterion,
|
|
||||||
false); // Don't put form
|
|
||||||
|
|
||||||
HTM_LABEL_End ();
|
|
||||||
HTM_LI_End ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************* Write link name (filename, assignment title...) ***************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void RubCri_WriteLinkName (const struct RubCri_Criterion *Criterion,bool PutFormToGo)
|
|
||||||
{
|
|
||||||
extern const char *Txt_RUBRIC_CRITERION_SOURCES[RubCri_NUM_SOURCES];
|
|
||||||
static void (*WriteLinkName[RubCri_NUM_SOURCES]) (long Cod,bool PutFormToGo,
|
|
||||||
const char *Icon,
|
|
||||||
const char *IconTitle) =
|
|
||||||
{
|
|
||||||
[RubCri_FROM_TEACHER ] = RubCri_WriteEmptyLinkInRubricCriterion,
|
|
||||||
[RubCri_FROM_ANOTHER_RUBRIC] = AsgRsc_WriteAssignmentInCrsProgram,
|
|
||||||
[RubCri_FROM_EXAM_PRINT ] = ExaRsc_WriteExamInCrsProgram,
|
|
||||||
[RubCri_FROM_GAME_MATCH ] = GamRsc_WriteGameInCrsProgram,
|
|
||||||
};
|
|
||||||
|
|
||||||
/***** Write link name *****/
|
|
||||||
if (WriteLinkName[Criterion->Source])
|
|
||||||
WriteLinkName[Criterion->Source] (Criterion->Cod,PutFormToGo,
|
|
||||||
RubCri_SourceIcons[Criterion->Source],
|
|
||||||
Txt_RUBRIC_CRITERION_SOURCES[Criterion->Source]);
|
|
||||||
else
|
|
||||||
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/******************** Write empty link in course program *********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void RubCri_WriteEmptyLinkInRubricCriterion (__attribute__((unused)) long Cod,
|
|
||||||
__attribute__((unused)) bool PutFormToGo,
|
|
||||||
const char *Icon,const char *IconTitle)
|
|
||||||
{
|
|
||||||
extern const char *Txt_RUBRIC_CRITERION_SOURCES[RubCri_NUM_SOURCES];
|
|
||||||
|
|
||||||
/***** Icon depending on type ******/
|
|
||||||
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
|
|
||||||
|
|
||||||
/***** Write text *****/
|
|
||||||
HTM_Txt (Txt_RUBRIC_CRITERION_SOURCES[RubCri_FROM_TEACHER]);
|
|
||||||
}
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ void RubCri_GetCriterionDataByCod (struct RubCri_Criterion *Criterion);
|
||||||
|
|
||||||
void RubCri_ReceiveFormCriterion (void);
|
void RubCri_ReceiveFormCriterion (void);
|
||||||
void RubCri_ChangeTitle (void);
|
void RubCri_ChangeTitle (void);
|
||||||
void RubCri_ChangeSource (void);
|
void RubCri_ChangeType (void);
|
||||||
void RubCri_ChangeMinValue (void);
|
void RubCri_ChangeMinValue (void);
|
||||||
void RubCri_ChangeMaxValue (void);
|
void RubCri_ChangeMaxValue (void);
|
||||||
void RubCri_ChangeWeight (void);
|
void RubCri_ChangeWeight (void);
|
||||||
|
@ -45,9 +45,6 @@ void RubCri_ChangeWeight (void);
|
||||||
void RubCri_ListCriteria (struct Rub_Rubrics *Rubrics,
|
void RubCri_ListCriteria (struct Rub_Rubrics *Rubrics,
|
||||||
struct RubCri_Criterion *Criterion);
|
struct RubCri_Criterion *Criterion);
|
||||||
|
|
||||||
RubCri_Source_t RubCri_GetSourceFromDBStr (const char *SourceDBStr);
|
|
||||||
const char *RubCri_GetDBStrFromSource (RubCri_Source_t Source);
|
|
||||||
|
|
||||||
void RubCri_ResetCriterion (struct RubCri_Criterion *Criterion);
|
void RubCri_ResetCriterion (struct RubCri_Criterion *Criterion);
|
||||||
|
|
||||||
void RubCri_ReqRemCriterion (void);
|
void RubCri_ReqRemCriterion (void);
|
||||||
|
|
|
@ -351,6 +351,7 @@ void Rub_DB_RemoveCrsRubrics (long CrsCod)
|
||||||
|
|
||||||
long Rub_DB_CreateCriterion (const struct RubCri_Criterion *Criterion)
|
long Rub_DB_CreateCriterion (const struct RubCri_Criterion *Criterion)
|
||||||
{
|
{
|
||||||
|
extern const char *Rsc_ResourceTypesDB[Rsc_NUM_TYPES];
|
||||||
long CriCod;
|
long CriCod;
|
||||||
|
|
||||||
Str_SetDecimalPointToUS (); // To write the decimal point as a dot
|
Str_SetDecimalPointToUS (); // To write the decimal point as a dot
|
||||||
|
@ -364,8 +365,8 @@ long Rub_DB_CreateCriterion (const struct RubCri_Criterion *Criterion)
|
||||||
RubCri_ValuesFields[RubCri_MAX],
|
RubCri_ValuesFields[RubCri_MAX],
|
||||||
Criterion->RubCod,
|
Criterion->RubCod,
|
||||||
Criterion->CriInd,
|
Criterion->CriInd,
|
||||||
RubCri_GetDBStrFromSource (Criterion->Source),
|
Rsc_ResourceTypesDB[Criterion->Link.Type],
|
||||||
Criterion->Cod,
|
Criterion->Link.Cod,
|
||||||
Criterion->Values[RubCri_MIN],
|
Criterion->Values[RubCri_MIN],
|
||||||
Criterion->Values[RubCri_MAX],
|
Criterion->Values[RubCri_MAX],
|
||||||
Criterion->Weight,
|
Criterion->Weight,
|
||||||
|
@ -392,17 +393,19 @@ void Rub_DB_UpdateCriterionTitle (const struct RubCri_Criterion *Criterion)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************* Update criterion source in database *******************/
|
/********************** Update criterion type in database ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Rub_DB_UpdateCriterionSource (const struct RubCri_Criterion *Criterion)
|
void Rub_DB_UpdateCriterionType (const struct RubCri_Criterion *Criterion)
|
||||||
{
|
{
|
||||||
|
extern const char *Rsc_ResourceTypesDB[Rsc_NUM_TYPES];
|
||||||
|
|
||||||
DB_QueryUPDATE ("can not update the value of a criterion",
|
DB_QueryUPDATE ("can not update the value of a criterion",
|
||||||
"UPDATE rub_criteria"
|
"UPDATE rub_criteria"
|
||||||
" SET Source='%s'"
|
" SET Source='%s'"
|
||||||
" WHERE CriCod=%ld"
|
" WHERE CriCod=%ld"
|
||||||
" AND RubCod=%ld", // Extra check
|
" AND RubCod=%ld", // Extra check
|
||||||
RubCri_GetDBStrFromSource (Criterion->Source),
|
Rsc_ResourceTypesDB[Criterion->Link.Type],
|
||||||
Criterion->CriCod,
|
Criterion->CriCod,
|
||||||
Criterion->RubCod);
|
Criterion->RubCod);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ void Rub_DB_RemoveCrsRubrics (long CrsCod);
|
||||||
//--------------------------- Rubric criteria -------------------------------
|
//--------------------------- Rubric criteria -------------------------------
|
||||||
long Rub_DB_CreateCriterion (const struct RubCri_Criterion *Criterion);
|
long Rub_DB_CreateCriterion (const struct RubCri_Criterion *Criterion);
|
||||||
void Rub_DB_UpdateCriterionTitle (const struct RubCri_Criterion *Criterion);
|
void Rub_DB_UpdateCriterionTitle (const struct RubCri_Criterion *Criterion);
|
||||||
void Rub_DB_UpdateCriterionSource (const struct RubCri_Criterion *Criterion);
|
void Rub_DB_UpdateCriterionType (const struct RubCri_Criterion *Criterion);
|
||||||
void Rub_DB_UpdateCriterionValue (const struct RubCri_Criterion *Criterion,
|
void Rub_DB_UpdateCriterionValue (const struct RubCri_Criterion *Criterion,
|
||||||
RubCri_ValueRange_t ValueRange);
|
RubCri_ValueRange_t ValueRange);
|
||||||
void Rub_DB_UpdateCriterionWeight (const struct RubCri_Criterion *Criterion);
|
void Rub_DB_UpdateCriterionWeight (const struct RubCri_Criterion *Criterion);
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include "swad_date.h"
|
#include "swad_date.h"
|
||||||
#include "swad_hierarchy_level.h"
|
#include "swad_hierarchy_level.h"
|
||||||
|
#include "swad_program_resource.h"
|
||||||
#include "swad_string.h"
|
#include "swad_string.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -78,23 +79,14 @@ typedef enum
|
||||||
RubCri_MAX = 1,
|
RubCri_MAX = 1,
|
||||||
} RubCri_ValueRange_t;
|
} RubCri_ValueRange_t;
|
||||||
|
|
||||||
#define RubCri_NUM_SOURCES 4
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
RubCri_FROM_TEACHER,
|
|
||||||
RubCri_FROM_ANOTHER_RUBRIC,
|
|
||||||
RubCri_FROM_EXAM_PRINT,
|
|
||||||
RubCri_FROM_GAME_MATCH,
|
|
||||||
} RubCri_Source_t;
|
|
||||||
#define RubCri_SOURCE_DEFAULT RubCri_FROM_TEACHER
|
|
||||||
|
|
||||||
struct RubCri_Criterion
|
struct RubCri_Criterion
|
||||||
{
|
{
|
||||||
long RubCod; // Rubric code
|
long RubCod; // Rubric code
|
||||||
long CriCod; // Criterion code
|
long CriCod; // Criterion code
|
||||||
unsigned CriInd; // Criterion index (position in the rubric)
|
unsigned CriInd; // Criterion index (position in the rubric)
|
||||||
RubCri_Source_t Source;
|
struct Rsc_Link Link;
|
||||||
long Cod;
|
// Rsc_Type_t Source;
|
||||||
|
// long Cod;
|
||||||
double Values[RubCri_NUM_VALUES];
|
double Values[RubCri_NUM_VALUES];
|
||||||
double Weight; // Relative weight (from 0.0 to 1.0)
|
double Weight; // Relative weight (from 0.0 to 1.0)
|
||||||
char Title[RubCri_MAX_BYTES_TITLE + 1]; // Title of the criterion
|
char Title[RubCri_MAX_BYTES_TITLE + 1]; // Title of the criterion
|
||||||
|
|
|
@ -236,7 +236,7 @@ void Svy_ListAllSurveys (struct Svy_Surveys *Surveys)
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
if (Surveys->Svy.Status.ICanEdit ||
|
if (Surveys->Svy.Status.ICanEdit ||
|
||||||
PrgRsc_CheckIfICanGetLink ())
|
Rsc_CheckIfICanGetLink ())
|
||||||
HTM_TH_Span (NULL,HTM_HEAD_CENTER,1,1,"CONTEXT_COL"); // Column for contextual icons
|
HTM_TH_Span (NULL,HTM_HEAD_CENTER,1,1,"CONTEXT_COL"); // Column for contextual icons
|
||||||
|
|
||||||
for (Order = (Dat_StartEndTime_t) 0;
|
for (Order = (Dat_StartEndTime_t) 0;
|
||||||
|
@ -328,7 +328,7 @@ static void Svy_PutIconsListSurveys (void *Surveys)
|
||||||
Svy_PutIconToCreateNewSvy ((struct Svy_Surveys *) Surveys);
|
Svy_PutIconToCreateNewSvy ((struct Svy_Surveys *) Surveys);
|
||||||
|
|
||||||
/***** Put icon to get resource link *****/
|
/***** Put icon to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkSvy,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkSvy,NULL,
|
||||||
Svy_PutPars,Surveys);
|
Svy_PutPars,Surveys);
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys,
|
||||||
HTM_TD_Begin ("rowspan=\"2\" class=\"CONTEXT_COL %s\"",
|
HTM_TD_Begin ("rowspan=\"2\" class=\"CONTEXT_COL %s\"",
|
||||||
The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
if (Surveys->Svy.Status.ICanEdit ||
|
if (Surveys->Svy.Status.ICanEdit ||
|
||||||
PrgRsc_CheckIfICanGetLink ())
|
Rsc_CheckIfICanGetLink ())
|
||||||
Svy_PutFormsToRemEditOneSvy (Surveys,Anchor);
|
Svy_PutFormsToRemEditOneSvy (Surveys,Anchor);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
}
|
}
|
||||||
|
@ -919,7 +919,7 @@ static void Svy_PutFormsToRemEditOneSvy (struct Svy_Surveys *Surveys,
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Icon to get resource link *****/
|
/***** Icon to get resource link *****/
|
||||||
if (PrgRsc_CheckIfICanGetLink ())
|
if (Rsc_CheckIfICanGetLink ())
|
||||||
Ico_PutContextualIconToGetLink (ActReqLnkSvy,NULL,
|
Ico_PutContextualIconToGetLink (ActReqLnkSvy,NULL,
|
||||||
Svy_PutPars,Surveys);
|
Svy_PutPars,Surveys);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ void SvyRsc_GetLinkToSurvey (void)
|
||||||
SvyRsc_GetTitleFromSvyCod (Surveys.Svy.SvyCod,Title,sizeof (Title) - 1);
|
SvyRsc_GetTitleFromSvyCod (Surveys.Svy.SvyCod,Title,sizeof (Title) - 1);
|
||||||
|
|
||||||
/***** Copy link to survey into resource clipboard *****/
|
/***** Copy link to survey into resource clipboard *****/
|
||||||
Prg_DB_CopyToClipboard (PrgRsc_SURVEY,Surveys.Svy.SvyCod);
|
Prg_DB_CopyToClipboard (Rsc_SURVEY,Surveys.Svy.SvyCod);
|
||||||
|
|
||||||
/***** Write sucess message *****/
|
/***** Write sucess message *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
|
||||||
|
@ -66,11 +66,11 @@ void SvyRsc_GetLinkToSurvey (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************** Write survey in course program ***********************/
|
/************************* Write survey as resource **************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void SvyRsc_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo,
|
void SvyRsc_WriteResourceSurvey (long SvyCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle)
|
const char *Icon,const char *IconTitle)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||||
Act_Action_t NextAction;
|
Act_Action_t NextAction;
|
||||||
|
@ -103,9 +103,7 @@ void SvyRsc_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo,
|
||||||
/***** End form to download file *****/
|
/***** End form to download file *****/
|
||||||
if (PutFormToGo)
|
if (PutFormToGo)
|
||||||
{
|
{
|
||||||
/* End form */
|
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void SvyRsc_GetLinkToSurvey (void);
|
void SvyRsc_GetLinkToSurvey (void);
|
||||||
void SvyRsc_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo,
|
void SvyRsc_WriteResourceSurvey (long SvyCod,bool PutFormToGo,
|
||||||
const char *Icon,const char *IconTitle);
|
const char *Icon,const char *IconTitle);
|
||||||
void SvyRsc_GetTitleFromSvyCod (long SvyCod,char *Title,size_t TitleSize);
|
void SvyRsc_GetTitleFromSvyCod (long SvyCod,char *Title,size_t TitleSize);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
119
swad_text.c
119
swad_text.c
|
@ -36407,9 +36407,9 @@ const char *Txt_Resource_X_removed = // Warning: it is very important to include
|
||||||
"Kaynak <strong>s</strong> kaldırıldı.";
|
"Kaynak <strong>s</strong> kaldırıldı.";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES] =
|
const char *Txt_RESOURCE_TYPES[Rsc_NUM_TYPES] =
|
||||||
{
|
{
|
||||||
[PrgRsc_NONE] =
|
[Rsc_NONE] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Sense enllaç"
|
"Sense enllaç"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -36432,7 +36432,7 @@ const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES] =
|
||||||
"Bağlantı yok"
|
"Bağlantı yok"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[PrgRsc_ASSIGNMENT] =
|
[Rsc_ASSIGNMENT] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Activitat"
|
"Activitat"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -36455,7 +36455,7 @@ const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES] =
|
||||||
"Atama"
|
"Atama"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[PrgRsc_PROJECT] =
|
[Rsc_PROJECT] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Projecte"
|
"Projecte"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -36478,7 +36478,7 @@ const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES] =
|
||||||
"Projesi"
|
"Projesi"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[PrgRsc_CALL_FOR_EXAM] =
|
[Rsc_CALL_FOR_EXAM] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Convocatòria d'examen"
|
"Convocatòria d'examen"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -36501,7 +36501,7 @@ const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES] =
|
||||||
"Sınav için arayın"
|
"Sınav için arayın"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[PrgRsc_EXAM] =
|
[Rsc_EXAM] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Exàmen"
|
"Exàmen"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -36524,7 +36524,7 @@ const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES] =
|
||||||
"Sınav"
|
"Sınav"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[PrgRsc_GAME] =
|
[Rsc_GAME] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Joc"
|
"Joc"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -36547,7 +36547,7 @@ const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES] =
|
||||||
"Oyun"
|
"Oyun"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[PrgRsc_SURVEY] =
|
[Rsc_SURVEY] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Enquesta"
|
"Enquesta"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -36570,7 +36570,7 @@ const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES] =
|
||||||
"Anket"
|
"Anket"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[PrgRsc_DOCUMENT] =
|
[Rsc_DOCUMENT] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Document"
|
"Document"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -36593,7 +36593,7 @@ const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES] =
|
||||||
"Belge"
|
"Belge"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[PrgRsc_MARKS] =
|
[Rsc_MARKS] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Qualificacions" // Necessita traducció
|
"Qualificacions" // Necessita traducció
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -36616,7 +36616,7 @@ const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES] =
|
||||||
"Marks" // Çeviri lazim!
|
"Marks" // Çeviri lazim!
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[PrgRsc_ATTENDANCE_EVENT] =
|
[Rsc_ATTENDANCE_EVENT] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Assistència"
|
"Assistència"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -36639,7 +36639,7 @@ const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES] =
|
||||||
"Katılım"
|
"Katılım"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[PrgRsc_FORUM_THREAD] =
|
[Rsc_FORUM_THREAD] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Discussió de fòrum"
|
"Discussió de fòrum"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -42813,101 +42813,6 @@ const char *Txt_Rubric_X_removed = // Warning: it is very important to include %
|
||||||
"Değerlendirme listesi <strong>%s</strong> kaldırıldı.";
|
"Değerlendirme listesi <strong>%s</strong> kaldırıldı.";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *Txt_RUBRIC_CRITERION_SOURCES[RubCri_NUM_SOURCES] =
|
|
||||||
{
|
|
||||||
[RubCri_FROM_TEACHER] =
|
|
||||||
#if L==1 // ca
|
|
||||||
"Professor/a"
|
|
||||||
#elif L==2 // de
|
|
||||||
"Lehrkraft"
|
|
||||||
#elif L==3 // en
|
|
||||||
"Teacher"
|
|
||||||
#elif L==4 // es
|
|
||||||
"Profesor/a"
|
|
||||||
#elif L==5 // fr
|
|
||||||
"Enseignant/e"
|
|
||||||
#elif L==6 // gn
|
|
||||||
"Mbo'ehára"
|
|
||||||
#elif L==7 // it
|
|
||||||
"Professore/ssa"
|
|
||||||
#elif L==8 // pl
|
|
||||||
"Nauczyciel"
|
|
||||||
#elif L==9 // pt
|
|
||||||
"Professor/a"
|
|
||||||
#elif L==10 // tr
|
|
||||||
"Öğretmen"
|
|
||||||
#endif
|
|
||||||
,
|
|
||||||
[RubCri_FROM_ANOTHER_RUBRIC] =
|
|
||||||
#if L==1 // ca
|
|
||||||
"Rúbrica"
|
|
||||||
#elif L==2 // de
|
|
||||||
"Rubrik"
|
|
||||||
#elif L==3 // en
|
|
||||||
"Rubric"
|
|
||||||
#elif L==4 // es
|
|
||||||
"Rúbrica"
|
|
||||||
#elif L==5 // fr
|
|
||||||
"Rubrique"
|
|
||||||
#elif L==6 // gn
|
|
||||||
"Rúbrica" // Okoteve traducción
|
|
||||||
#elif L==7 // it
|
|
||||||
"Rubriche"
|
|
||||||
#elif L==8 // pl
|
|
||||||
"Rubryki"
|
|
||||||
#elif L==9 // pt
|
|
||||||
"Rubrica"
|
|
||||||
#elif L==10 // tr
|
|
||||||
"Değerlendirme"
|
|
||||||
#endif
|
|
||||||
,
|
|
||||||
[RubCri_FROM_EXAM_PRINT] =
|
|
||||||
#if L==1 // ca
|
|
||||||
"Exàmen"
|
|
||||||
#elif L==2 // de
|
|
||||||
"Prüfung"
|
|
||||||
#elif L==3 // en
|
|
||||||
"Exam"
|
|
||||||
#elif L==4 // es
|
|
||||||
"Examen"
|
|
||||||
#elif L==5 // fr
|
|
||||||
"Examen"
|
|
||||||
#elif L==6 // gn
|
|
||||||
"Aranduchauka"
|
|
||||||
#elif L==7 // it
|
|
||||||
"Esame"
|
|
||||||
#elif L==8 // pl
|
|
||||||
"Egzamin"
|
|
||||||
#elif L==9 // pt
|
|
||||||
"Exame"
|
|
||||||
#elif L==10 // tr
|
|
||||||
"Sınav"
|
|
||||||
#endif
|
|
||||||
,
|
|
||||||
[RubCri_FROM_GAME_MATCH] =
|
|
||||||
#if L==1 // ca
|
|
||||||
"Joc"
|
|
||||||
#elif L==2 // de
|
|
||||||
"Spiel"
|
|
||||||
#elif L==3 // en
|
|
||||||
"Game"
|
|
||||||
#elif L==4 // es
|
|
||||||
"Juego"
|
|
||||||
#elif L==5 // fr
|
|
||||||
"Jeu"
|
|
||||||
#elif L==6 // gn
|
|
||||||
"Ñeha'a"
|
|
||||||
#elif L==7 // it
|
|
||||||
"Gioco"
|
|
||||||
#elif L==8 // pl
|
|
||||||
"Gra"
|
|
||||||
#elif L==9 // pt
|
|
||||||
"Jogo"
|
|
||||||
#elif L==10 // tr
|
|
||||||
"Oyun"
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
const char *Txt_Rubrics =
|
const char *Txt_Rubrics =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Rúbriques";
|
"Rúbriques";
|
||||||
|
|
Loading…
Reference in New Issue