mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-16 05:34:12 +02:00
Version 15.180.2
This commit is contained in:
parent
3ae564fe8a
commit
b87dcf03e9
|
@ -132,13 +132,14 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 15.180.1 (2016-04-05)"
|
#define Log_PLATFORM_VERSION "SWAD 15.180.2 (2016-04-05)"
|
||||||
#define CSS_FILE "swad15.178.2.css"
|
#define CSS_FILE "swad15.178.2.css"
|
||||||
#define JS_FILE "swad15.178.2.js"
|
#define JS_FILE "swad15.178.2.js"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// 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
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 15.180.2: Apr 05, 2016 Contextual link to remove one survey question. (198459 lines)
|
||||||
Version 15.180.1: Apr 05, 2016 Fized minor layout bug in edition of a test question. (198430 lines)
|
Version 15.180.1: Apr 05, 2016 Fized minor layout bug in edition of a test question. (198430 lines)
|
||||||
Version 15.180: Apr 05, 2016 Changes in form to edit a test question.
|
Version 15.180: Apr 05, 2016 Changes in form to edit a test question.
|
||||||
Ask for confirmation when removing a survey question. (198429 lines)
|
Ask for confirmation when removing a survey question. (198429 lines)
|
||||||
|
|
|
@ -696,6 +696,7 @@ struct Globals
|
||||||
long *LstSvyCods; // List of survey codes
|
long *LstSvyCods; // List of survey codes
|
||||||
tSvysOrderType SelectedOrderType;
|
tSvysOrderType SelectedOrderType;
|
||||||
long SvyCodToEdit; // Used as parameter in contextual links
|
long SvyCodToEdit; // Used as parameter in contextual links
|
||||||
|
long SvyQstCodToEdit; // Used as parameter in contextual links
|
||||||
} Svys;
|
} Svys;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -143,6 +143,10 @@ static void Svy_PutButtonToCreateNewQuestion (void);
|
||||||
static void Svy_WriteQstStem (const char *Stem);
|
static void Svy_WriteQstStem (const char *Stem);
|
||||||
static void Svy_WriteAnswersOfAQst (struct Survey *Svy,struct SurveyQuestion *SvyQst,bool PutFormAnswerSurvey);
|
static void Svy_WriteAnswersOfAQst (struct Survey *Svy,struct SurveyQuestion *SvyQst,bool PutFormAnswerSurvey);
|
||||||
static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs);
|
static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs);
|
||||||
|
|
||||||
|
static void Svy_PutIconToRemoveOneQst (void);
|
||||||
|
static void Svy_PutParamsRemoveOneQst (void);
|
||||||
|
|
||||||
static void Svy_ReceiveAndStoreUserAnswersToASurvey (long SvyCod);
|
static void Svy_ReceiveAndStoreUserAnswersToASurvey (long SvyCod);
|
||||||
static void Svy_IncreaseAnswerInDB (long QstCod,unsigned AnsInd);
|
static void Svy_IncreaseAnswerInDB (long QstCod,unsigned AnsInd);
|
||||||
static void Svy_RegisterIHaveAnsweredSvy (long SvyCod);
|
static void Svy_RegisterIHaveAnsweredSvy (long SvyCod);
|
||||||
|
@ -1523,15 +1527,13 @@ void Svy_RequestCreatOrEditSvy (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Start form *****/
|
/***** Start form *****/
|
||||||
Gbl.Svys.SvyCodToEdit = ItsANewSurvey ? -1L :
|
Gbl.Svys.SvyCodToEdit = Svy.SvyCod;
|
||||||
Svy.SvyCod;
|
|
||||||
Act_FormStart (ItsANewSurvey ? ActNewSvy :
|
Act_FormStart (ItsANewSurvey ? ActNewSvy :
|
||||||
ActChgSvy);
|
ActChgSvy);
|
||||||
Svy_PutParams ();
|
Svy_PutParams ();
|
||||||
|
|
||||||
/***** Start frame *****/
|
/***** Start frame and table *****/
|
||||||
Lay_StartRoundFrameTable (NULL,2,
|
Lay_StartRoundFrameTable (NULL,2,ItsANewSurvey ? Txt_New_survey :
|
||||||
ItsANewSurvey ? Txt_New_survey :
|
|
||||||
Txt_Edit_survey);
|
Txt_Edit_survey);
|
||||||
|
|
||||||
/***** Survey for anywhere, degree or course? *****/
|
/***** Survey for anywhere, degree or course? *****/
|
||||||
|
@ -2299,21 +2301,28 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,ch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***** Start frame *****/
|
||||||
|
if (SvyQst->QstCod > 0) // If the question already has assigned a code
|
||||||
|
{
|
||||||
|
/* Parameters for contextual icon */
|
||||||
|
Gbl.Svys.SvyCodToEdit = SvyCod;
|
||||||
|
Gbl.Svys.SvyQstCodToEdit = SvyQst->QstCod;
|
||||||
|
|
||||||
|
sprintf (Gbl.Title,"%s %u",
|
||||||
|
Txt_Question,SvyQst->QstInd + 1); // Question index may be 0, 1, 2, 3,...
|
||||||
|
Lay_StartRoundFrame (NULL,Gbl.Title,Svy_PutIconToRemoveOneQst);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Lay_StartRoundFrame (NULL,Txt_New_question,NULL);
|
||||||
|
|
||||||
/***** Start form *****/
|
/***** Start form *****/
|
||||||
Act_FormStart (ActRcvSvyQst);
|
Act_FormStart (ActRcvSvyQst);
|
||||||
Svy_PutParamSvyCod (SvyCod);
|
Svy_PutParamSvyCod (SvyCod);
|
||||||
if (SvyQst->QstCod > 0) // If the question already has assigned a code
|
if (SvyQst->QstCod > 0) // If the question already has assigned a code
|
||||||
Svy_PutParamQstCod (SvyQst->QstCod);
|
Svy_PutParamQstCod (SvyQst->QstCod);
|
||||||
|
|
||||||
/***** Start frame *****/
|
/***** Start table *****/
|
||||||
if (SvyQst->QstCod > 0) // If the question already has assigned a code
|
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\">");
|
||||||
{
|
|
||||||
sprintf (Gbl.Title,"%s %u",
|
|
||||||
Txt_Question,SvyQst->QstInd + 1); // Question index may be 0, 1, 2, 3,...
|
|
||||||
Lay_StartRoundFrameTable (NULL,2,Gbl.Title);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Lay_StartRoundFrameTable (NULL,2,Txt_New_question);
|
|
||||||
|
|
||||||
/***** Stem *****/
|
/***** Stem *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
@ -2383,15 +2392,22 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,ch
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
/***** Send button and end frame *****/
|
/***** End table *****/
|
||||||
|
fprintf (Gbl.F.Out,"</table>");
|
||||||
|
|
||||||
|
/***** Send button *****/
|
||||||
if (SvyQst->QstCod > 0) // If the question already has assigned a code
|
if (SvyQst->QstCod > 0) // If the question already has assigned a code
|
||||||
Lay_EndRoundFrameTableWithButton (Lay_CONFIRM_BUTTON,Txt_Save);
|
Lay_PutConfirmButton (Txt_Save);
|
||||||
else
|
else
|
||||||
Lay_EndRoundFrameTableWithButton (Lay_CREATE_BUTTON,Txt_Create_question);
|
Lay_PutCreateButton (Txt_Create_question);
|
||||||
|
|
||||||
/***** End form *****/
|
/***** End form *****/
|
||||||
Act_FormEnd ();
|
Act_FormEnd ();
|
||||||
|
|
||||||
|
/***** End frame *****/
|
||||||
|
Lay_EndRoundFrame ();
|
||||||
|
|
||||||
|
/***** Free memory for answers *****/
|
||||||
Svy_FreeTextChoiceAnswers (SvyQst,NumAnswers);
|
Svy_FreeTextChoiceAnswers (SvyQst,NumAnswers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3116,6 +3132,28 @@ static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs)
|
||||||
Gbl.Title);
|
Gbl.Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********************* Put icon to remove one question ***********************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Svy_PutIconToRemoveOneQst (void)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Remove;
|
||||||
|
|
||||||
|
Lay_PutContextualLink (ActReqRemSvyQst,Svy_PutParamsRemoveOneQst,
|
||||||
|
"remove-on64x64.png",Txt_Remove,NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/****************** Put parameter to remove one question *********************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Svy_PutParamsRemoveOneQst (void)
|
||||||
|
{
|
||||||
|
Svy_PutParamSvyCod (Gbl.Svys.SvyCodToEdit);
|
||||||
|
Svy_PutParamQstCod (Gbl.Svys.SvyQstCodToEdit);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************** Request the removal of a question ********************/
|
/********************** Request the removal of a question ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -230,7 +230,7 @@ static long Tst_GetTagCodFromTagTxt (const char *TagTxt);
|
||||||
static long Tst_CreateNewTag (long CrsCod,const char *TagTxt);
|
static long Tst_CreateNewTag (long CrsCod,const char *TagTxt);
|
||||||
static void Tst_EnableOrDisableTag (long TagCod,bool TagHidden);
|
static void Tst_EnableOrDisableTag (long TagCod,bool TagHidden);
|
||||||
|
|
||||||
static void Tst_PutIconToRemove (void);
|
static void Tst_PutIconToRemoveOneQst (void);
|
||||||
static void Tst_PutParamsRemoveOneQst (void);
|
static void Tst_PutParamsRemoveOneQst (void);
|
||||||
|
|
||||||
static bool Tst_GetQstCod (void);
|
static bool Tst_GetQstCod (void);
|
||||||
|
@ -4319,7 +4319,7 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback)
|
||||||
if (Gbl.Test.QstCod > 0) // The question already has assigned a code
|
if (Gbl.Test.QstCod > 0) // The question already has assigned a code
|
||||||
{
|
{
|
||||||
sprintf (Title,Txt_Question_code_X,Gbl.Test.QstCod);
|
sprintf (Title,Txt_Question_code_X,Gbl.Test.QstCod);
|
||||||
Lay_StartRoundFrame (NULL,Title,Tst_PutIconToRemove);
|
Lay_StartRoundFrame (NULL,Title,Tst_PutIconToRemoveOneQst);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Lay_StartRoundFrame (NULL,Txt_New_question,NULL);
|
Lay_StartRoundFrame (NULL,Txt_New_question,NULL);
|
||||||
|
@ -5500,7 +5500,7 @@ static void Tst_EnableOrDisableTag (long TagCod,bool TagHidden)
|
||||||
/********************* Put icon to remove one question ***********************/
|
/********************* Put icon to remove one question ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Tst_PutIconToRemove (void)
|
static void Tst_PutIconToRemoveOneQst (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Remove;
|
extern const char *Txt_Remove;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user