-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathswad_test_visibility.h
65 lines (53 loc) · 2.88 KB
/
swad_test_visibility.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// swad_test_visibility.h: visibility of test results
#ifndef _SWAD_TST_VIS
#define _SWAD_TST_VIS
/*
SWAD (Shared Workspace At a Distance in Spanish),
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-2025 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 "swad_user.h"
/*****************************************************************************/
/******************************* Public types ********************************/
/*****************************************************************************/
#define TstVis_NUM_ITEMS_VISIBILITY 5
typedef enum
{
TstVis_VISIBLE_QST_ANS_TXT = 0, // Questions and answers text
TstVis_VISIBLE_FEEDBACK_TXT = 1, // Feedback text
TstVis_VISIBLE_CORRECT_ANSWER = 2, // Correct answers
TstVis_VISIBLE_EACH_QST_SCORE = 3, // Score of each question
TstVis_VISIBLE_TOTAL_SCORE = 4, // Total score
} TstVis_Visibility_t;
#define TstVis_MIN_VISIBILITY 0 // Nothing visible
#define TstVis_MAX_VISIBILITY ((1 << TstVis_NUM_ITEMS_VISIBILITY) - 1) // All visible
#define TstVis_VISIBILITY_DEFAULT TstVis_MAX_VISIBILITY
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void TstVis_ShowVisibilityIcons (unsigned SelectedVisibility,
HidVis_HiddenOrVisible_t HiddenOrVisible);
void TstVis_PutVisibilityCheckboxes (unsigned SelectedVisibility);
unsigned TstVis_GetVisibilityFromForm (void);
unsigned TstVis_GetVisibilityFromStr (const char *Str);
bool TstVis_IsVisibleQstAndAnsTxt (unsigned Visibility);
bool TstVis_IsVisibleFeedbackTxt (unsigned Visibility);
bool TstVis_IsVisibleCorrectAns (unsigned Visibility);
bool TstVis_IsVisibleEachQstScore (unsigned Visibility);
bool TstVis_IsVisibleTotalScore (unsigned Visibility);
#endif