mirror of https://github.com/acanas/swad-core.git
Version 15.180
This commit is contained in:
parent
ca6dc01d08
commit
b5e4814063
|
@ -1236,7 +1236,8 @@ Statistics:
|
|||
1060. ActShoSvy Show survey
|
||||
1061. ActEdiOneSvyQst Edit a new question for a survey
|
||||
1062. ActRcvSvyQst Receive a question of a survey
|
||||
1063. ActRemSvyQst Remove a question of a survey
|
||||
NEW 1063. ActReqRemSvyQst Request the removal of a question of a survey
|
||||
1063. ActRemSvyQst Confirm the removal of a question of a survey
|
||||
1064. ActSeeUseGbl Show use of the platform
|
||||
1065. ActPrnPhoDeg Show vista of impresión of the class photo with the average photos of the students of each degree.
|
||||
1066. ActCalPhoDeg Compute the average photos of the students of each degree
|
||||
|
@ -2597,6 +2598,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
/* ActShoSvy */{ 978,-1,TabSta,ActSeeAllSvy ,0x1F0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Svy_UnhideSurvey ,NULL},
|
||||
/* ActEdiOneSvyQst */{ 979,-1,TabSta,ActSeeAllSvy ,0x1F0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Svy_RequestEditQuestion ,NULL},
|
||||
/* ActRcvSvyQst */{ 980,-1,TabSta,ActSeeAllSvy ,0x1F0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Svy_ReceiveQst ,NULL},
|
||||
/* ActReqRemSvyQst */{1524,-1,TabSta,ActSeeAllSvy ,0x1F0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Svy_RequestRemoveQst ,NULL},
|
||||
/* ActRemSvyQst */{ 981,-1,TabSta,ActSeeAllSvy ,0x1F0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Svy_RemoveQst ,NULL},
|
||||
|
||||
/* ActSeeUseGbl */{ 84,-1,TabSta,ActReqUseGbl ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Sta_ShowUseOfPlatform ,NULL},
|
||||
|
@ -4241,6 +4243,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
|
|||
ActFrmLogIn, // #1521
|
||||
ActUpdSignUpReq, // #1522
|
||||
ActReqRemTstQst, // #1523
|
||||
ActReqRemSvyQst, // #1524
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -71,9 +71,9 @@ typedef enum
|
|||
|
||||
typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
||||
|
||||
#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+205+184+144+172+36+27+83)
|
||||
#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+205+184+144+172+36+28+83)
|
||||
|
||||
#define Act_MAX_ACTION_COD 1523
|
||||
#define Act_MAX_ACTION_COD 1524
|
||||
|
||||
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 20
|
||||
|
||||
|
@ -1287,15 +1287,16 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
|
|||
#define ActShoSvy (ActUnbUsrLst+ 17)
|
||||
#define ActEdiOneSvyQst (ActUnbUsrLst+ 18)
|
||||
#define ActRcvSvyQst (ActUnbUsrLst+ 19)
|
||||
#define ActRemSvyQst (ActUnbUsrLst+ 20)
|
||||
#define ActReqRemSvyQst (ActUnbUsrLst+ 20)
|
||||
#define ActRemSvyQst (ActUnbUsrLst+ 21)
|
||||
|
||||
#define ActSeeUseGbl (ActUnbUsrLst+ 21)
|
||||
#define ActPrnPhoDeg (ActUnbUsrLst+ 22)
|
||||
#define ActCalPhoDeg (ActUnbUsrLst+ 23)
|
||||
#define ActSeeAccGbl (ActUnbUsrLst+ 24)
|
||||
#define ActReqAccCrs (ActUnbUsrLst+ 25)
|
||||
#define ActSeeAccCrs (ActUnbUsrLst+ 26)
|
||||
#define ActSeeAllStaCrs (ActUnbUsrLst+ 27)
|
||||
#define ActSeeUseGbl (ActUnbUsrLst+ 22)
|
||||
#define ActPrnPhoDeg (ActUnbUsrLst+ 23)
|
||||
#define ActCalPhoDeg (ActUnbUsrLst+ 24)
|
||||
#define ActSeeAccGbl (ActUnbUsrLst+ 25)
|
||||
#define ActReqAccCrs (ActUnbUsrLst+ 26)
|
||||
#define ActSeeAccCrs (ActUnbUsrLst+ 27)
|
||||
#define ActSeeAllStaCrs (ActUnbUsrLst+ 28)
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************** Profile tab ********************************/
|
||||
|
|
|
@ -128,19 +128,22 @@
|
|||
// TODO: In Statistics > Degrees, show only degrees with students
|
||||
// TODO: Change layout of confirm / reject registration. Use green and red buttons
|
||||
|
||||
// TODO: Ask for confirmation when removing a survey question.
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.179.1 (2016-04-05)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.180 (2016-04-05)"
|
||||
#define CSS_FILE "swad15.178.2.css"
|
||||
#define JS_FILE "swad15.178.2.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 15.180: Apr 05, 2016 Changes in form to edit a test question.
|
||||
Ask for confirmation when removing a survey question. (198429 lines)
|
||||
1 change necessary in database:
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1524','es','N','Preguntar si eliminar pregunta encuesta');
|
||||
|
||||
Version 15.179.1: Apr 05, 2016 Contextual link to remove one test question. (198384 lines)
|
||||
Version 15.179: Apr 05, 2016 Fixed bug when getting a parameter.
|
||||
Ask for confirmation when removing a test question. (198355 lines)
|
||||
|
|
|
@ -140,7 +140,6 @@ static unsigned Svy_GetNextQuestionIndexInSvy (long SvyCod);
|
|||
static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQst);
|
||||
static void Svy_PutIconToAddNewQuestion (void);
|
||||
static void Svy_PutButtonToCreateNewQuestion (void);
|
||||
static void Svy_WriteParamEditQst (struct SurveyQuestion *SvyQst);
|
||||
static void Svy_WriteQstStem (const char *Stem);
|
||||
static void Svy_WriteAnswersOfAQst (struct Survey *Svy,struct SurveyQuestion *SvyQst,bool PutFormAnswerSurvey);
|
||||
static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs);
|
||||
|
@ -2806,7 +2805,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ
|
|||
MYSQL_ROW row;
|
||||
unsigned NumQsts;
|
||||
unsigned NumQst;
|
||||
bool Editing = (Gbl.Action.Act == ActEdiOneSvy ||
|
||||
bool Editing = (Gbl.Action.Act == ActEdiOneSvy ||
|
||||
Gbl.Action.Act == ActEdiOneSvyQst ||
|
||||
Gbl.Action.Act == ActRcvSvyQst);
|
||||
bool PutFormAnswerSurvey = Svy->Status.ICanAnswer && !Editing;
|
||||
|
@ -2870,11 +2869,9 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ
|
|||
{
|
||||
/* Write icon to remove the question */
|
||||
fprintf (Gbl.F.Out,"<td class=\"BT%u\">",Gbl.RowEvenOdd);
|
||||
Act_FormStart (ActRemSvyQst);
|
||||
Act_FormStart (ActReqRemSvyQst);
|
||||
Svy_PutParamSvyCod (Svy->SvyCod);
|
||||
Svy_PutParamQstCod (SvyQst->QstCod);
|
||||
Sta_WriteParamsDatesSeeAccesses ();
|
||||
Svy_WriteParamEditQst (SvyQst);
|
||||
Lay_PutIconRemove ();
|
||||
Act_FormEnd ();
|
||||
fprintf (Gbl.F.Out,"</td>");
|
||||
|
@ -2971,18 +2968,6 @@ static void Svy_PutButtonToCreateNewQuestion (void)
|
|||
Act_FormEnd ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********* Write hidden parameters for edition of survey questions ***********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Svy_WriteParamEditQst (struct SurveyQuestion *SvyQst)
|
||||
{
|
||||
Par_PutHiddenParamChar ("AllAnsTypes",
|
||||
SvyQst->AllAnsTypes ? 'Y' :
|
||||
'N');
|
||||
Par_PutHiddenParamString ("AnswerType",SvyQst->ListAnsTypes);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** Write the heading of a survey question *******************/
|
||||
/*****************************************************************************/
|
||||
|
@ -3131,6 +3116,47 @@ static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs)
|
|||
Gbl.Title);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************** Request the removal of a question ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Svy_RequestRemoveQst (void)
|
||||
{
|
||||
extern const char *Txt_Do_you_really_want_to_remove_the_question_X;
|
||||
extern const char *Txt_Remove_question;
|
||||
long SvyCod;
|
||||
struct SurveyQuestion SvyQst;
|
||||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get survey code */
|
||||
if ((SvyCod = Svy_GetParamSvyCod ()) == -1L)
|
||||
Lay_ShowErrorAndExit ("Code of survey is missing.");
|
||||
|
||||
/* Get question code */
|
||||
if ((SvyQst.QstCod = Svy_GetParamQstCod ()) < 0)
|
||||
Lay_ShowErrorAndExit ("Wrong code of question.");
|
||||
|
||||
/* Get question index */
|
||||
SvyQst.QstInd = Svy_GetQstIndFromQstCod (SvyQst.QstCod);
|
||||
|
||||
/***** Start form *****/
|
||||
Act_FormStart (ActRemSvyQst);
|
||||
Svy_PutParamSvyCod (SvyCod);
|
||||
Svy_PutParamQstCod (SvyQst.QstCod);
|
||||
|
||||
/***** Ask for confirmation of removing *****/
|
||||
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_question_X,
|
||||
(unsigned long) (SvyQst.QstInd + 1));
|
||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
Lay_PutRemoveButton (Txt_Remove_question);
|
||||
|
||||
/***** End form *****/
|
||||
Act_FormEnd ();
|
||||
|
||||
/***** Show current survey *****/
|
||||
Svy_ShowOneSurvey (SvyCod,&SvyQst,true);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************************** Remove a question ****************************/
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -102,6 +102,8 @@ void Svy_RemoveCrsSurveys (long CrsCod);
|
|||
|
||||
void Svy_RequestEditQuestion (void);
|
||||
void Svy_ReceiveQst (void);
|
||||
|
||||
void Svy_RequestRemoveQst (void);
|
||||
void Svy_RemoveQst (void);
|
||||
|
||||
void Svy_ReceiveSurveyAnswers (void);
|
||||
|
|
60
swad_test.c
60
swad_test.c
|
@ -157,7 +157,8 @@ static void Tst_WriteQstAndAnsExam (unsigned NumQst,long QstCod,MYSQL_ROW row,
|
|||
double *ScoreThisQst,bool *AnswerIsNotBlank);
|
||||
static void Tst_PutFormToEditQstImage (struct Image *Image,const char *ClassImg,
|
||||
const char *ParamAction,
|
||||
const char *ParamFile);
|
||||
const char *ParamFile,
|
||||
bool OptionsDisabled);
|
||||
static void Tst_UpdateScoreQst (long QstCod,float ScoreThisQst,bool AnswerIsNotBlank);
|
||||
static void Tst_UpdateMyNumAccessTst (unsigned NumAccessesTst);
|
||||
static void Tst_UpdateLastAccTst (void);
|
||||
|
@ -1045,7 +1046,8 @@ void Tst_WriteQstStem (const char *Stem,const char *ClassStem)
|
|||
|
||||
static void Tst_PutFormToEditQstImage (struct Image *Image,const char *ClassImg,
|
||||
const char *ParamAction,
|
||||
const char *ParamFile)
|
||||
const char *ParamFile,
|
||||
bool OptionsDisabled)
|
||||
{
|
||||
extern const char *The_ClassForm[The_NUM_THEMES];
|
||||
extern const char *Txt_No_image;
|
||||
|
@ -1059,6 +1061,8 @@ static void Tst_PutFormToEditQstImage (struct Image *Image,const char *ClassImg,
|
|||
ParamAction,Img_ACTION_NO_IMAGE);
|
||||
if (!Image->Name[0])
|
||||
fprintf (Gbl.F.Out," checked=\"checked\"");
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," />"
|
||||
"<label class=\"%s\">"
|
||||
"%s"
|
||||
|
@ -1069,11 +1073,14 @@ static void Tst_PutFormToEditQstImage (struct Image *Image,const char *ClassImg,
|
|||
/***** Current image *****/
|
||||
if (Image->Name[0])
|
||||
{
|
||||
fprintf (Gbl.F.Out,"<input type=\"radio\" name=\"%s\" value=\"%u\" checked=\"checked\" />"
|
||||
"<label class=\"%s\">"
|
||||
fprintf (Gbl.F.Out,"<input type=\"radio\" name=\"%s\" value=\"%u\" checked=\"checked\"",
|
||||
ParamAction,Img_ACTION_KEEP_IMAGE);
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," />"
|
||||
"<label class=\"%s\">"
|
||||
"%s"
|
||||
"</label><br />",
|
||||
ParamAction,Img_ACTION_KEEP_IMAGE,
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_Current_image);
|
||||
Img_ShowImage (Image,ClassImg);
|
||||
|
@ -1082,27 +1089,39 @@ static void Tst_PutFormToEditQstImage (struct Image *Image,const char *ClassImg,
|
|||
/***** Change/new image *****/
|
||||
UniqueId++;
|
||||
if (Image->Name[0]) // Image exists
|
||||
{
|
||||
/***** Change image *****/
|
||||
fprintf (Gbl.F.Out,"<input type=\"radio\" id=\"chg_img_%u\" name=\"%s\""
|
||||
" value=\"%u\">"
|
||||
"<label class=\"%s\">"
|
||||
" value=\"%u\"",
|
||||
UniqueId,ParamAction,Img_ACTION_CHANGE_IMAGE); // Replace existing image by new image
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," />"
|
||||
"<label class=\"%s\">"
|
||||
"%s: "
|
||||
"</label>",
|
||||
UniqueId,ParamAction,Img_ACTION_CHANGE_IMAGE, // Replace existing image by new image
|
||||
The_ClassForm[Gbl.Prefs.Theme],Txt_Change_image);
|
||||
}
|
||||
else // Image does not exist
|
||||
{
|
||||
/***** New image *****/
|
||||
fprintf (Gbl.F.Out,"<input type=\"radio\" id=\"chg_img_%u\" name=\"%s\""
|
||||
" value=\"%u\">"
|
||||
" value=\"%u\">",
|
||||
UniqueId,ParamAction,Img_ACTION_NEW_IMAGE); // Upload new image
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," />"
|
||||
"<label class=\"%s\">"
|
||||
"%s: "
|
||||
"</label>",
|
||||
UniqueId,ParamAction,Img_ACTION_NEW_IMAGE, // Upload new image
|
||||
The_ClassForm[Gbl.Prefs.Theme],Txt_New_image);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"<input type=\"file\" name=\"%s\""
|
||||
" size=\"40\" maxlength=\"100\" value=\"\""
|
||||
" onchange=\"document.getElementById('chg_img_%u').checked = true;\" />",
|
||||
ParamFile,
|
||||
" size=\"40\" maxlength=\"100\" value=\"\"",
|
||||
ParamFile);
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," onchange=\"document.getElementById('chg_img_%u').checked = true;\" />",
|
||||
UniqueId);
|
||||
}
|
||||
|
||||
|
@ -4403,7 +4422,7 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback)
|
|||
Stem);
|
||||
Tst_PutFormToEditQstImage (&Gbl.Test.Image,
|
||||
"TEST_IMG_EDIT_ONE_STEM",
|
||||
"ImgAct","FileImg");
|
||||
"ImgAct","FileImg",false);
|
||||
fprintf (Gbl.F.Out,"</td>"
|
||||
"</tr>");
|
||||
|
||||
|
@ -4608,9 +4627,7 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback)
|
|||
sprintf (ParamFile,"FileImg%u",NumOpt);
|
||||
Tst_PutFormToEditQstImage (&Gbl.Test.Answer.Options[NumOpt].Image,
|
||||
"TEST_IMG_EDIT_ONE_ANS",
|
||||
ParamAction,ParamFile);
|
||||
// if (OptionsDisabled)
|
||||
// fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
ParamAction,ParamFile,OptionsDisabled);
|
||||
fprintf (Gbl.F.Out,"</td>"
|
||||
"</tr>");
|
||||
}
|
||||
|
@ -5512,12 +5529,13 @@ void Tst_RequestRemoveQst (void)
|
|||
char YN[1+1];
|
||||
bool EditingOnlyThisQst;
|
||||
|
||||
/***** Get the question code *****/
|
||||
/***** Get main parameters from form *****/
|
||||
/* Get the question code */
|
||||
if (!Tst_GetQstCod ())
|
||||
Lay_ShowErrorAndExit ("Wrong code of question.");
|
||||
|
||||
/***** Get a parameter that indicates whether it's necessary
|
||||
to continue listing the rest of questions ******/
|
||||
/* Get a parameter that indicates whether it's necessary
|
||||
to continue listing the rest of questions */
|
||||
Par_GetParToText ("OnlyThisQst",YN,1);
|
||||
EditingOnlyThisQst = (Str_ConvertToUpperLetter (YN[0]) == 'Y');
|
||||
|
||||
|
@ -5539,7 +5557,7 @@ void Tst_RequestRemoveQst (void)
|
|||
|
||||
/***** Ask for confirmation of removing *****/
|
||||
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_question_X,
|
||||
Gbl.Test.QstCod);
|
||||
(unsigned long) Gbl.Test.QstCod);
|
||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
Lay_PutRemoveButton (Txt_Remove_question);
|
||||
|
||||
|
|
20
swad_text.c
20
swad_text.c
|
@ -9003,25 +9003,25 @@ const char *Txt_Do_you_really_want_to_remove_the_group_X_Y_students_ = // Warnin
|
|||
"Doing so will remove %u students from that group."; // Necessita de tradução
|
||||
#endif
|
||||
|
||||
const char *Txt_Do_you_really_want_to_remove_the_question_X = // Warning: it is very important to include %ld in the following sentences
|
||||
const char *Txt_Do_you_really_want_to_remove_the_question_X = // Warning: it is very important to include %lu in the following sentences
|
||||
#if L==1
|
||||
"¿Realmente desea eliminar la pregunta <strong>%ld</strong>?"; // Necessita traduccio
|
||||
"¿Realmente desea eliminar la pregunta <strong>%lu</strong>?"; // Necessita traduccio
|
||||
#elif L==2
|
||||
"Wollen Sie die Frage <strong>%ld</strong> wirklich entfernen?";
|
||||
"Wollen Sie die Frage <strong>%lu</strong> wirklich entfernen?";
|
||||
#elif L==3
|
||||
"Do you really want to remove the question <strong>%ld</strong>?";
|
||||
"Do you really want to remove the question <strong>%lu</strong>?";
|
||||
#elif L==4
|
||||
"¿Realmente desea eliminar la pregunta <strong>%ld</strong>?";
|
||||
"¿Realmente desea eliminar la pregunta <strong>%lu</strong>?";
|
||||
#elif L==5
|
||||
"Voulez-vous vraiment supprimer la question <strong>%ld</strong>?";
|
||||
"Voulez-vous vraiment supprimer la question <strong>%lu</strong>?";
|
||||
#elif L==6
|
||||
"¿Realmente desea eliminar la pregunta <strong>%ld</strong>?"; // Okoteve traducción
|
||||
"¿Realmente desea eliminar la pregunta <strong>%lu</strong>?"; // Okoteve traducción
|
||||
#elif L==7
|
||||
"Vuoi realmente rimuovere la domanda <strong>%ld</strong>?";
|
||||
"Vuoi realmente rimuovere la domanda <strong>%lu</strong>?";
|
||||
#elif L==8
|
||||
"Czy na pewno chcesz usunac pytanie <strong>%ld</strong>?";
|
||||
"Czy na pewno chcesz usunac pytanie <strong>%lu</strong>?";
|
||||
#elif L==9
|
||||
"Você realmente deseja remover a questão <strong>%ld</strong>?";
|
||||
"Você realmente deseja remover a questão <strong>%lu</strong>?";
|
||||
#endif
|
||||
|
||||
const char *Txt_Do_you_really_want_to_remove_the_survey_X = // Warning: it is very important to include %s in the following sentences
|
||||
|
|
Loading…
Reference in New Issue