2023-03-17 12:51:11 +01:00
|
|
|
|
// swad_rubric_type.h: definition of types for rubrics
|
|
|
|
|
|
|
|
|
|
#ifndef _SWAD_RUB_TYP
|
|
|
|
|
#define _SWAD_RUB_TYP
|
|
|
|
|
/*
|
|
|
|
|
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<EFBFBD>as Vargas
|
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General 3 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 "swad_date.h"
|
|
|
|
|
#include "swad_hierarchy_level.h"
|
2023-03-26 20:46:28 +02:00
|
|
|
|
#include "swad_program_resource.h"
|
2023-03-17 12:51:11 +01:00
|
|
|
|
#include "swad_string.h"
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************** Public types and constants ***********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#define Rub_MAX_CHARS_TITLE (128 - 1) // 127
|
|
|
|
|
#define Rub_MAX_BYTES_TITLE ((Rub_MAX_CHARS_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
|
|
|
|
|
2023-03-29 00:11:55 +02:00
|
|
|
|
#define RubCri_MAX_CHARS_TITLE (256 - 1) // 255
|
|
|
|
|
#define RubCri_MAX_BYTES_TITLE ((RubCri_MAX_CHARS_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 4095
|
2023-03-17 12:51:11 +01:00
|
|
|
|
|
2023-04-18 22:13:37 +02:00
|
|
|
|
#define RubCri_NUM_VALUES 2
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
RubCri_MIN = 0,
|
|
|
|
|
RubCri_MAX = 1,
|
|
|
|
|
} RubCri_ValueRange_t;
|
|
|
|
|
|
2023-03-17 12:51:11 +01:00
|
|
|
|
struct Rub_Rubric
|
|
|
|
|
{
|
|
|
|
|
long RubCod; // Rubric code
|
|
|
|
|
long CrsCod; // Course code
|
|
|
|
|
long UsrCod; // Author code
|
2023-04-17 23:55:22 +02:00
|
|
|
|
char Title[Rub_MAX_BYTES_TITLE + 1]; // Title
|
|
|
|
|
char *Txt; // Text (dynamically allocated)
|
2023-03-17 12:51:11 +01:00
|
|
|
|
};
|
|
|
|
|
|
2023-04-18 22:13:37 +02:00
|
|
|
|
struct RubCri_Criterion
|
|
|
|
|
{
|
|
|
|
|
long RubCod; // Rubric code
|
|
|
|
|
long CriCod; // Criterion code
|
|
|
|
|
unsigned CriInd; // Criterion index (position in the rubric)
|
|
|
|
|
struct Rsc_Link Link;
|
|
|
|
|
double Values[RubCri_NUM_VALUES];
|
|
|
|
|
double Weight; // Relative weight (from 0.0 to 1.0)
|
|
|
|
|
char Title[RubCri_MAX_BYTES_TITLE + 1]; // Title of the criterion
|
|
|
|
|
};
|
|
|
|
|
|
2023-03-17 12:51:11 +01:00
|
|
|
|
struct Rub_Rubrics
|
|
|
|
|
{
|
|
|
|
|
bool LstIsRead; // Is the list already read from database...
|
|
|
|
|
// ...or it needs to be read?
|
|
|
|
|
unsigned Num; // Total number of rubrics
|
2023-04-17 23:55:22 +02:00
|
|
|
|
long *Lst; // List of rubric codes
|
2023-03-17 12:51:11 +01:00
|
|
|
|
unsigned CurrentPage;
|
2023-04-18 22:13:37 +02:00
|
|
|
|
struct Rub_Rubric Rubric; // Selected/current rubric
|
|
|
|
|
struct RubCri_Criterion Criterion; // Selected/current criterion
|
2023-03-17 12:51:11 +01:00
|
|
|
|
};
|
|
|
|
|
|
2023-03-24 13:09:44 +01:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
Rub_EXISTING_RUBRIC,
|
|
|
|
|
Rub_NEW_RUBRIC,
|
|
|
|
|
} Rub_ExistingNewRubric_t;
|
|
|
|
|
|
2023-03-17 12:51:11 +01:00
|
|
|
|
#endif
|