2023-03-26 20:46:28 +02:00
|
|
|
|
// 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.
|
2024-02-07 00:40:28 +01:00
|
|
|
|
Copyright (C) 1999-2024 Antonio Ca<EFBFBD>as Vargas
|
2023-03-26 20:46:28 +02:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
2023-04-06 12:39:13 +02:00
|
|
|
|
#include "swad_form.h"
|
2023-03-30 21:50:11 +02:00
|
|
|
|
#include "swad_HTML.h"
|
2023-03-26 20:46:28 +02:00
|
|
|
|
#include "swad_string.h"
|
2024-04-01 17:59:51 +02:00
|
|
|
|
#include "swad_user.h"
|
2023-03-26 20:46:28 +02:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************** 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
|
|
|
|
|
|
2023-03-27 09:14:16 +02:00
|
|
|
|
#define Rsc_NUM_TYPES 12
|
2023-03-26 20:46:28 +02:00
|
|
|
|
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,
|
2023-03-26 23:57:12 +02:00
|
|
|
|
Rsc_RUBRIC,
|
2023-03-26 20:46:28 +02:00
|
|
|
|
Rsc_DOCUMENT,
|
|
|
|
|
Rsc_MARKS,
|
|
|
|
|
// grp GROUPS // ??? User select groups
|
|
|
|
|
Rsc_ATTENDANCE_EVENT,
|
|
|
|
|
Rsc_FORUM_THREAD,
|
2023-03-26 23:57:12 +02:00
|
|
|
|
Rsc_SURVEY,
|
2023-03-26 20:46:28 +02:00
|
|
|
|
} Rsc_Type_t;
|
|
|
|
|
|
|
|
|
|
struct Rsc_Link
|
|
|
|
|
{
|
|
|
|
|
Rsc_Type_t Type;
|
|
|
|
|
long Cod;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************************** Public prototypes *****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2023-03-29 15:26:49 +02:00
|
|
|
|
void Rsc_ShowClipboard (void);
|
2023-03-31 09:49:09 +02:00
|
|
|
|
void Rsc_ShowClipboardToChangeLink (const struct Rsc_Link *CurrentLink);
|
2023-03-27 22:57:43 +02:00
|
|
|
|
void Rsc_WriteRowClipboard (const struct Rsc_Link *Link,
|
2023-03-30 18:30:44 +02:00
|
|
|
|
HTM_SubmitOnClick_t SubmitOnClick,bool Checked);
|
2023-11-06 00:32:41 +01:00
|
|
|
|
void Rsc_WriteLinkName (const struct Rsc_Link *Link,Frm_PutForm_t PutFormToGo);
|
2023-03-26 20:46:28 +02:00
|
|
|
|
|
2023-04-06 21:43:41 +02:00
|
|
|
|
void Rsc_GetResourceTitleFromLink (const struct Rsc_Link *Link,
|
2023-03-26 20:46:28 +02:00
|
|
|
|
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);
|
|
|
|
|
|
2023-03-27 22:57:43 +02:00
|
|
|
|
bool Rsc_GetParLink (struct Rsc_Link *Link);
|
|
|
|
|
|
2024-04-19 12:00:30 +02:00
|
|
|
|
Usr_Can_t Rsc_CheckIfICanGetLink (void);
|
2023-03-26 20:46:28 +02:00
|
|
|
|
|
|
|
|
|
#endif
|