Version 16.103

This commit is contained in:
Antonio Cañas Vargas 2016-12-16 00:52:27 +01:00
parent bb19d4d89f
commit 94a1f63fb4
6 changed files with 142 additions and 15 deletions

View File

@ -65,7 +65,7 @@ CC = gcc
# LIBS when using MariaDB (also valid with MySQL):
LIBS = -lssl -lcrypto -lpthread -lrt -lmysqlclient -lz -L/usr/lib64/mysql -lm -lgsoap
CFLAGS = -Wall -Wextra -pedantic -mtune=native -O2 -s
CFLAGS = -Wall -Wextra -mtune=native -O2 -s
all: swad_ca swad_de swad_en swad_es swad_fr swad_gn swad_it swad_pl swad_pt

View File

@ -182,18 +182,20 @@
// TODO: Fix bug in notification content about files sent to plugins like SWADroid: do not write internal name (for example "comun"). Call instead Brw_GetFileNameToShow or similar.
// TODO: Draw future dates in attendance, surveys, assignments in blue?
// TODO: change checkbox "Obligar a los estudiantes a leer esta información"
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.102 (2016-12-15)"
#define Log_PLATFORM_VERSION "SWAD 16.103 (2016-12-16)"
#define CSS_FILE "swad16.97.css"
#define JS_FILE "swad16.101.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
/*
Version 16.103: Dec 16, 2016 Contextual help on course info. (211130 lines)
Version 16.102: Dec 15, 2016 Fixed bug in mail to students, reported by GitHub user raistmaj.
Fixed bug in file of marks, reported by GitHub user raistmaj.
Fixed bug in course indicators, reported by GitHub user raistmaj.

View File

@ -102,7 +102,15 @@ const char *Hlp_DEGREE_Shared = WIKI "DEGREE.Shared";
/***** COURSE tab *****/
const char *Hlp_COURSE_Information = WIKI "COURSE.Information";
const char *Hlp_COURSE_Information = WIKI "COURSE.Information";
const char *Hlp_COURSE_Information_textual_information = WIKI "COURSE.Information#textual-information";
const char *Hlp_COURSE_Information_edit = WIKI "COURSE.Information#edit";
const char *Hlp_COURSE_Guide = WIKI "COURSE.Guide";
const char *Hlp_COURSE_Guide_edit = WIKI "COURSE.Guide#edit";
const char *Hlp_COURSE_Syllabus = WIKI "COURSE.Syllabus";
const char *Hlp_COURSE_Syllabus_edit = WIKI "COURSE.Syllabus#edit";
const char *Hlp_COURSE_Documents = WIKI "COURSE.Documents";
const char *Hlp_COURSE_Private = WIKI "COURSE.Private";
@ -110,8 +118,20 @@ const char *Hlp_COURSE_Shared = WIKI "COURSE.Shared";
const char *Hlp_COURSE_Timetable = WIKI "COURSE.Timetable";
const char *Hlp_COURSE_Bibliography = WIKI "COURSE.Bibliography";
const char *Hlp_COURSE_Bibliography_edit = WIKI "COURSE.Bibliography#edit";
const char *Hlp_COURSE_FAQ = WIKI "COURSE.FAQ";
const char *Hlp_COURSE_FAQ_edit = WIKI "COURSE.FAQ#edit";
const char *Hlp_COURSE_Links = WIKI "COURSE.Links";
const char *Hlp_COURSE_Links_edit = WIKI "COURSE.Links#edit";
/***** ASSESSMENT tab *****/
const char *Hlp_ASSESSMENT_System = WIKI "ASSESSMENT.System";
const char *Hlp_ASSESSMENT_System_edit = WIKI "ASSESSMENT.System#edit";
const char *Hlp_ASSESSMENT_Assignments = WIKI "ASSESSMENT.Assignments";
const char *Hlp_ASSESSMENT_Assignments_new_assignment = WIKI "ASSESSMENT.Assignments#new-assignment";
const char *Hlp_ASSESSMENT_Assignments_edit_assignment = WIKI "ASSESSMENT.Assignments#edit-assignment";

View File

@ -276,6 +276,23 @@ const char *Inf_NamesInDBForInfoType[Inf_NUM_INFO_TYPES] =
"assessment",
};
/***** Help *****/
extern const char *Hlp_COURSE_Information_textual_information;
extern const char *Hlp_COURSE_Guide;
extern const char *Hlp_COURSE_Syllabus;
extern const char *Hlp_COURSE_Bibliography;
extern const char *Hlp_COURSE_FAQ;
extern const char *Hlp_COURSE_Links;
extern const char *Hlp_ASSESSMENT_System;
extern const char *Hlp_COURSE_Information_edit;
extern const char *Hlp_COURSE_Guide_edit;
extern const char *Hlp_COURSE_Syllabus_edit;
extern const char *Hlp_COURSE_Bibliography_edit;
extern const char *Hlp_COURSE_FAQ_edit;
extern const char *Hlp_COURSE_Links_edit;
extern const char *Hlp_ASSESSMENT_System_edit;
/*****************************************************************************/
/**************************** Private prototypes *****************************/
/*****************************************************************************/
@ -325,12 +342,25 @@ void Inf_ShowInfo (void)
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
bool ShowWarningNoInfo = false;
const char *Help[Inf_NUM_INFO_TYPES] =
{
Hlp_COURSE_Information_textual_information, // Inf_INTRODUCTION
Hlp_COURSE_Guide, // Inf_TEACHING_GUIDE
Hlp_COURSE_Syllabus, // Inf_LECTURES
Hlp_COURSE_Syllabus, // Inf_PRACTICALS
Hlp_COURSE_Bibliography, // Inf_BIBLIOGRAPHY
Hlp_COURSE_FAQ, // Inf_FAQ
Hlp_COURSE_Links, // Inf_LINKS
Hlp_ASSESSMENT_System, // Inf_ASSESSMENT
};
/***** Set info type *****/
Gbl.CurrentCrs.Info.Type = Inf_AsignInfoType ();
/***** Get info source from database *****/
Inf_GetAndCheckInfoSrcFromDB (Gbl.CurrentCrs.Crs.CrsCod,Gbl.CurrentCrs.Info.Type,&InfoSrc,&MustBeRead);
Inf_GetAndCheckInfoSrcFromDB (Gbl.CurrentCrs.Crs.CrsCod,
Gbl.CurrentCrs.Info.Type,
&InfoSrc,&MustBeRead);
switch (Gbl.CurrentCrs.Info.Type)
{
@ -402,7 +432,7 @@ void Inf_ShowInfo (void)
Lay_StartRoundFrame ("100%",Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type],
ICanEdit ? Inf_PutIconToEditInfo :
NULL,
NULL);
Help[Gbl.CurrentCrs.Info.Type]);
Lay_ShowAlert (Lay_INFO,Txt_No_information);
if (ICanEdit)
Inf_PutButtonToEditInfo ();
@ -993,12 +1023,23 @@ static void Inf_ShowPage (const char *URL)
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES];
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
const char *Help[Inf_NUM_INFO_TYPES] =
{
Hlp_COURSE_Information_textual_information, // Inf_INTRODUCTION
Hlp_COURSE_Guide, // Inf_TEACHING_GUIDE
Hlp_COURSE_Syllabus, // Inf_LECTURES
Hlp_COURSE_Syllabus, // Inf_PRACTICALS
Hlp_COURSE_Bibliography, // Inf_BIBLIOGRAPHY
Hlp_COURSE_FAQ, // Inf_FAQ
Hlp_COURSE_Links, // Inf_LINKS
Hlp_ASSESSMENT_System, // Inf_ASSESSMENT
};
/***** Start of frame *****/
Lay_StartRoundFrame (NULL,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type],
ICanEdit ? Inf_PutIconToEditInfo :
NULL,
NULL);
Help[Gbl.CurrentCrs.Info.Type]);
/***** Link to view in a new window *****/
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\" class=\"%s\">",
@ -1043,12 +1084,25 @@ void Inf_FormsToSelSendInfo (void)
Inf_InfoSrc_t InfoSrcSelected;
bool InfoAvailable[Inf_NUM_INFO_SOURCES];
bool MustBeRead;
const char *HelpEdit[Inf_NUM_INFO_TYPES] =
{
Hlp_COURSE_Information_edit, // Inf_INTRODUCTION
Hlp_COURSE_Guide_edit, // Inf_TEACHING_GUIDE
Hlp_COURSE_Syllabus_edit, // Inf_LECTURES
Hlp_COURSE_Syllabus_edit, // Inf_PRACTICALS
Hlp_COURSE_Bibliography_edit, // Inf_BIBLIOGRAPHY
Hlp_COURSE_FAQ_edit, // Inf_FAQ
Hlp_COURSE_Links_edit, // Inf_LINKS
Hlp_ASSESSMENT_System_edit, // Inf_ASSESSMENT
};
/***** Set info type *****/
Gbl.CurrentCrs.Info.Type = Inf_AsignInfoType ();
/***** Get current info source from database *****/
Inf_GetAndCheckInfoSrcFromDB (Gbl.CurrentCrs.Crs.CrsCod,Gbl.CurrentCrs.Info.Type,&InfoSrcSelected,&MustBeRead);
Inf_GetAndCheckInfoSrcFromDB (Gbl.CurrentCrs.Crs.CrsCod,
Gbl.CurrentCrs.Info.Type,
&InfoSrcSelected,&MustBeRead);
/***** Check if info available *****/
for (InfoSrc = (Inf_InfoSrc_t) 0;
@ -1067,7 +1121,8 @@ void Inf_FormsToSelSendInfo (void)
/***** Form to choice between alternatives *****/
/* Start of table */
Lay_StartRoundFrameTable (NULL,Txt_Source_of_information,NULL,NULL,4);
Lay_StartRoundFrameTable (NULL,Txt_Source_of_information,
NULL,HelpEdit[Gbl.CurrentCrs.Info.Type],4);
/* Options */
for (InfoSrc = (Inf_InfoSrc_t) 0;
@ -1496,7 +1551,8 @@ Inf_InfoSrc_t Inf_GetInfoSrcFromDB (long CrsCod,Inf_InfoType_t InfoType)
/***** Get and check info source for a type of course info from database *****/
/*****************************************************************************/
void Inf_GetAndCheckInfoSrcFromDB (long CrsCod,Inf_InfoType_t InfoType,
void Inf_GetAndCheckInfoSrcFromDB (long CrsCod,
Inf_InfoType_t InfoType,
Inf_InfoSrc_t *InfoSrc,bool *MustBeRead)
{
char Query[512];
@ -1725,6 +1781,17 @@ static bool Inf_CheckAndShowPlainTxt (void)
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT+1];
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
const char *Help[Inf_NUM_INFO_TYPES] =
{
Hlp_COURSE_Information_textual_information, // Inf_INTRODUCTION
Hlp_COURSE_Guide, // Inf_TEACHING_GUIDE
Hlp_COURSE_Syllabus, // Inf_LECTURES
Hlp_COURSE_Syllabus, // Inf_PRACTICALS
Hlp_COURSE_Bibliography, // Inf_BIBLIOGRAPHY
Hlp_COURSE_FAQ, // Inf_FAQ
Hlp_COURSE_Links, // Inf_LINKS
Hlp_ASSESSMENT_System, // Inf_ASSESSMENT
};
/***** Get info text from database *****/
Inf_GetInfoTxtFromDB (Gbl.CurrentCrs.Crs.CrsCod,Gbl.CurrentCrs.Info.Type,
@ -1736,7 +1803,7 @@ static bool Inf_CheckAndShowPlainTxt (void)
Lay_StartRoundFrame (NULL,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type],
ICanEdit ? Inf_PutIconToEditInfo :
NULL,
NULL);
Help[Gbl.CurrentCrs.Info.Type]);
if (Gbl.CurrentCrs.Info.Type == Inf_INTRODUCTION ||
Gbl.CurrentCrs.Info.Type == Inf_TEACHING_GUIDE)
@ -1798,6 +1865,17 @@ static bool Inf_CheckAndShowRichTxt (void)
int ReturnCode;
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
const char *Help[Inf_NUM_INFO_TYPES] =
{
Hlp_COURSE_Information_textual_information, // Inf_INTRODUCTION
Hlp_COURSE_Guide, // Inf_TEACHING_GUIDE
Hlp_COURSE_Syllabus, // Inf_LECTURES
Hlp_COURSE_Syllabus, // Inf_PRACTICALS
Hlp_COURSE_Bibliography, // Inf_BIBLIOGRAPHY
Hlp_COURSE_FAQ, // Inf_FAQ
Hlp_COURSE_Links, // Inf_LINKS
Hlp_ASSESSMENT_System, // Inf_ASSESSMENT
};
/***** Get info text from database *****/
Inf_GetInfoTxtFromDB (Gbl.CurrentCrs.Crs.CrsCod,Gbl.CurrentCrs.Info.Type,
@ -1809,7 +1887,7 @@ static bool Inf_CheckAndShowRichTxt (void)
Lay_StartRoundFrame (NULL,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type],
ICanEdit ? Inf_PutIconToEditInfo :
NULL,
NULL);
Help[Gbl.CurrentCrs.Info.Type]);
if (Gbl.CurrentCrs.Info.Type == Inf_INTRODUCTION ||
Gbl.CurrentCrs.Info.Type == Inf_TEACHING_GUIDE)
@ -1977,6 +2055,17 @@ void Inf_EditPlainTxtInfo (void)
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES];
extern const char *Txt_Save;
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT+1];
const char *HelpEdit[Inf_NUM_INFO_TYPES] =
{
Hlp_COURSE_Information_edit, // Inf_INTRODUCTION
Hlp_COURSE_Guide_edit, // Inf_TEACHING_GUIDE
Hlp_COURSE_Syllabus_edit, // Inf_LECTURES
Hlp_COURSE_Syllabus_edit, // Inf_PRACTICALS
Hlp_COURSE_Bibliography_edit, // Inf_BIBLIOGRAPHY
Hlp_COURSE_FAQ_edit, // Inf_FAQ
Hlp_COURSE_Links_edit, // Inf_LINKS
Hlp_ASSESSMENT_System_edit, // Inf_ASSESSMENT
};
/***** Set info type *****/
Gbl.CurrentCrs.Info.Type = Inf_AsignInfoType ();
@ -1984,7 +2073,7 @@ void Inf_EditPlainTxtInfo (void)
/***** Start form and frame *****/
Act_FormStart (Inf_ActionsRcvPlaTxtInfo[Gbl.CurrentCrs.Info.Type]);
Lay_StartRoundFrame (NULL,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type],
NULL,NULL);
NULL,HelpEdit[Gbl.CurrentCrs.Info.Type]);
if (Gbl.CurrentCrs.Info.Type == Inf_INTRODUCTION ||
Gbl.CurrentCrs.Info.Type == Inf_TEACHING_GUIDE)
@ -2017,6 +2106,17 @@ void Inf_EditRichTxtInfo (void)
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES];
extern const char *Txt_Save;
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT+1];
const char *HelpEdit[Inf_NUM_INFO_TYPES] =
{
Hlp_COURSE_Information_edit, // Inf_INTRODUCTION
Hlp_COURSE_Guide_edit, // Inf_TEACHING_GUIDE
Hlp_COURSE_Syllabus_edit, // Inf_LECTURES
Hlp_COURSE_Syllabus_edit, // Inf_PRACTICALS
Hlp_COURSE_Bibliography_edit, // Inf_BIBLIOGRAPHY
Hlp_COURSE_FAQ_edit, // Inf_FAQ
Hlp_COURSE_Links_edit, // Inf_LINKS
Hlp_ASSESSMENT_System_edit, // Inf_ASSESSMENT
};
/***** Set info type *****/
Gbl.CurrentCrs.Info.Type = Inf_AsignInfoType ();
@ -2024,7 +2124,7 @@ void Inf_EditRichTxtInfo (void)
/***** Start form and frame *****/
Act_FormStart (Inf_ActionsRcvRchTxtInfo[Gbl.CurrentCrs.Info.Type]);
Lay_StartRoundFrame (NULL,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type],
NULL,NULL);
NULL,HelpEdit[Gbl.CurrentCrs.Info.Type]);
if (Gbl.CurrentCrs.Info.Type == Inf_INTRODUCTION ||
Gbl.CurrentCrs.Info.Type == Inf_TEACHING_GUIDE)

View File

@ -86,7 +86,8 @@ void Inf_FormToSendURL (Inf_InfoSrc_t InfoSrc);
Inf_InfoSrc_t Inf_GetInfoSrcFromForm (void);
void Inf_SetInfoSrcIntoDB (Inf_InfoSrc_t InfoSrc);
Inf_InfoSrc_t Inf_GetInfoSrcFromDB (long CrsCod,Inf_InfoType_t InfoType);
void Inf_GetAndCheckInfoSrcFromDB (long CrsCod,Inf_InfoType_t InfoType,
void Inf_GetAndCheckInfoSrcFromDB (long CrsCod,
Inf_InfoType_t InfoType,
Inf_InfoSrc_t *InfoSrc,bool *MustBeRead);
Inf_InfoType_t Inf_ConvertFromStrDBToInfoType (const char *StrInfoTypeDB);
Inf_InfoSrc_t Inf_ConvertFromStrDBToInfoSrc (const char *StrInfoSrcDB);

View File

@ -213,6 +213,8 @@ bool Syl_CheckSyllabus (long CrsCod,Inf_InfoType_t InfoType)
bool Syl_CheckAndEditSyllabus (void)
{
extern const char *Hlp_COURSE_Syllabus_edit;
extern const char *Hlp_COURSE_Syllabus;
extern const Act_Action_t Inf_ActionsSeeInfo[Inf_NUM_INFO_TYPES];
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES];
extern const char *Txt_Done;
@ -238,7 +240,9 @@ bool Syl_CheckAndEditSyllabus (void)
Lay_StartRoundFrameTable (NULL,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type],
PutIconToEdit ? Inf_PutIconToEditInfo :
NULL,
NULL,1);
Gbl.Syllabus.EditionIsActive ? Hlp_COURSE_Syllabus_edit :
Hlp_COURSE_Syllabus,
1);
/***** Write the current syllabus *****/
Syl_ShowSyllabus ();