Version19.146

This commit is contained in:
acanas 2020-03-12 13:53:37 +01:00
parent babd2a7f8d
commit 78016d202f
25 changed files with 249 additions and 154 deletions

View File

@ -333,7 +333,7 @@ a:hover /* Default ==> underlined */
}
#current_day
{
color:#606060;
color:#404040;
margin:2px 0 -2px 0;
font-size:20pt;
font-weight:bold;
@ -341,12 +341,12 @@ a:hover /* Default ==> underlined */
}
.CURRENT_DAY
{
color:#606060;
color:#404040;
}
#current_time
{
border-radius:0 0 2px 2px;
color:#606060;
color:#404040;
font-size:12pt;
font-weight:bold;
}
@ -1118,14 +1118,14 @@ a:hover /* Default ==> underlined */
.MENU_TXT_PINK {color:#63474e;}
/****************** Title of current action in main block ********************/
.TITLE_ACTION_WHITE {color:#606060; font-size:20pt;}
.TITLE_ACTION_WHITE {color:#404040; font-size:20pt;}
.TITLE_ACTION_GREY {color:#606060; font-size:20pt;}
.TITLE_ACTION_PURPLE {color:#573c4d; font-size:20pt;}
.TITLE_ACTION_BLUE {color:#4D88A1; font-size:20pt;}
.TITLE_ACTION_YELLOW {color:#7c4d2a; font-size:20pt;}
.TITLE_ACTION_PINK {color:#63474e; font-size:20pt;}
.SUBTITLE_ACTION_WHITE {color:#606060; font-size:12pt;}
.SUBTITLE_ACTION_WHITE {color:#404040; font-size:12pt;}
.SUBTITLE_ACTION_GREY {color:#606060; font-size:12pt;}
.SUBTITLE_ACTION_PURPLE {color:#573c4d; font-size:12pt;}
.SUBTITLE_ACTION_BLUE {color:#4D88A1; font-size:12pt;}
@ -1987,7 +1987,7 @@ a:hover img.CENTRE_PHOTO_SHOW
}
.FRAME_TITLE_BIG
{
color:#606060;
color:#404040;
font-size:22pt;
}
.FRAME_TITLE_SMALL
@ -2383,9 +2383,9 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
.T2 {color:#202020; font-size:13pt;}
.T3 {color:#202020; font-size:12pt;}
.DAT {color:#606060; font-size:13pt;}
.DAT_NOBR {color:#606060; font-size:13pt; white-space:nowrap;}
.DAT_BOLD {color:#606060; font-size:13pt; font-weight:bold;}
.DAT {color:#404040; font-size:13pt;}
.DAT_NOBR {color:#404040; font-size:13pt; white-space:nowrap;}
.DAT_BOLD {color:#404040; font-size:13pt; font-weight:bold;}
.DAT_GREEN {color:darkgreen; font-size:13pt;}
.DAT_RED {color:darkred; font-size:13pt;}
.DAT_LIGHT {color:#A0A0A0; font-size:13pt;}
@ -2402,9 +2402,9 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
border-width:1px;
}
.DAT_SMALL {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#606060; font-size:12pt;}
.DAT_SMALL {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#404040; font-size:12pt;}
.DAT_SMALL_LIGHT {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#A0A0A0; font-size:12pt;}
.DAT_SMALL_NOBR {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#606060; font-size:12pt; white-space:nowrap;}
.DAT_SMALL_NOBR {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:#404040; font-size:12pt; white-space:nowrap;}
.DAT_SMALL_N {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:black; font-size:12pt;}
.DAT_SMALL_NOBR_N {font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif; color:black; font-size:12pt; white-space:nowrap;}
@ -2531,13 +2531,13 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
/******************************** Class photo ********************************/
.CLASSPHOTO_TITLE
{
color:#606060;
color:#404040;
font-family:Georgia,"DejaVu LGC Serif","Bitstream Vera Serif",serif;
font-size:13pt;
}
.CLASSPHOTO
{
color:#606060;
color:#404040;
font-size:10pt;
line-height:110%;
white-space:nowrap;
@ -2738,6 +2738,14 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
}
/********************************** Matches **********************************/
.MCH_BG
{
background-image:url("/swad/icon/bg.jpg");
background-size:cover;
background-repeat:no-repeat;
height:100%;
background-color:white;
}
.MCH_CONT
{
box-sizing:border-box;
@ -2745,38 +2753,52 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
margin:2%;
width:96%;
}
.MCH_LEFT
.MCH_LEFT_TCH
{
box-sizing:border-box;
float:left;
width:25%;
width:20%;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.MCH_RIGHT
.MCH_LEFT_STD
{
box-sizing:border-box;
float:left;
width:40%;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.MCH_RIGHT_TCH
{
box-sizing:border-box;
display:table;
float:left;
width:75%;
width:80%;
}
.MCH_RIGHT_STD
{
box-sizing:border-box;
display:table;
float:left;
width:60%;
}
.MCH_TOP
{
box-sizing:border-box;
width:100%;
height:48px;
color:#808080;
font-size:14pt;
height:64px;
color:#404040;
font-size:16pt;
font-weight:bold;
text-align:center;
text-overflow:ellipsis;
}
.MCH_BOTTOM
{
box-sizing:border-box;
width:100%;
padding:0 12px;
}
.MCH_REFRESHABLE_TEACHER
@ -2789,15 +2811,15 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
}
.MCH_NUM_QST
{
color:#808080;
font-size:28pt;
color:#404040;
font-size:32pt;
font-weight:bold;
text-align:center;
vertical-align:top;
}
.MCH_TIME_QST
{
color:#808080;
color:#404040;
font-size:16pt;
font-weight:bold;
text-align:center;
@ -2812,7 +2834,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
{
text-align:center;
padding:8pt 0;
color:#808080;
color:#404040;
font-size:16pt;
}
@ -2852,7 +2874,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
{
box-sizing:border-box;
display:inline-block;
font-size:28pt;
font-size:32pt;
font-weight:bold;
padding:2px;
text-align:center;
@ -2899,7 +2921,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
{
color:#202020;
font-size:24pt;
padding-bottom:12pt;
padding-bottom:24pt;
}
.MCH_TCH_ANS
{
@ -2910,12 +2932,13 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
.MCH_WAIT_CONT
{
box-sizing:border-box;
margin-top:5%;
text-align:center;
}
.MCH_WAIT_IMG
{
box-sizing:border-box;
width:25%;
width:100px;
}
.MCH_SCO_SCO
@ -2973,7 +2996,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
{
box-sizing:border-box;
width:64px;
margin:8px;
margin:0 16px;
padding:8px;
border-radius:2px;
border-width:1px;
@ -2984,6 +3007,29 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
line-height:normal;
white-space:nowrap;
}
.MCH_NUM_COL_OFF
{
display:table-cell;
box-sizing:border-box;
padding:6px;
text-align:center;
vertical-align:middle;
border:solid 1px;
border-color:transparent;
}
.MCH_NUM_COL_ON
{
display:table-cell;
box-sizing:border-box;
padding:6px;
text-align:center;
vertical-align:middle;
border:solid 1px;
border-color:#404040;
background-color:rgba(0,0,0,0.1);
}
.MCH_STD_CELL
{
text-align:center;
@ -3020,14 +3066,14 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
.MCH_RESULT
{
padding:10px 0;
color:#606060;
color:#404040;
font-size:16pt;
text-align:left;
vertical-align:top;
}
.MCH_RES_TR
{
height:24px;
height:10px;
}
.MCH_RES_CORRECT
{
@ -3042,7 +3088,6 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
.MCH_RES_VOID
{
width:1%;
background:white;
}
.BT_A {background-color:#e21c3d; border-color:#a9152d;} /* red */
@ -3172,7 +3217,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
{
font-family:"Arial Narrow","Nimbus Sans L","DejaVu LGC Sans Condensed",sans-serif;
font-size:11pt;
color:#606060;
color:#404040;
}
.LOG_R
{

BIN
icon/Spin-1s-200px.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
icon/bg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 KiB

View File

@ -1336,7 +1336,7 @@ void HTM_INPUT_RADIO (const char *Name,bool SubmitOnClick,
HTM_Txt (" />");
}
void HTM_INPUT_CHECKBOX (const char *Name,bool SubmitOnChange,
void HTM_INPUT_CHECKBOX (const char *Name,HTM_SubmitOnChange_t SubmitOnChange,
const char *fmt,...)
{
va_list ap;
@ -1362,7 +1362,7 @@ void HTM_INPUT_CHECKBOX (const char *Name,bool SubmitOnChange,
}
}
if (SubmitOnChange)
if (SubmitOnChange == HTM_SUBMIT_ON_CHANGE)
HTM_TxtF (" onchange=\"document.getElementById('%s').submit();return false;\"",
Gbl.Form.Id);

View File

@ -44,6 +44,12 @@ typedef enum
HTM_Type_STRING,
} HTM_Type_t;
typedef enum
{
HTM_DONT_SUBMIT_ON_CHANGE,
HTM_SUBMIT_ON_CHANGE,
} HTM_SubmitOnChange_t;
/*****************************************************************************/
/****************************** Public prototypes ****************************/
/*****************************************************************************/
@ -138,7 +144,7 @@ void HTM_INPUT_FLOAT (const char *Name,double Min,double Max,double Step,double
const char *fmt,...);
void HTM_INPUT_RADIO (const char *Name,bool SubmitOnClick,
const char *fmt,...);
void HTM_INPUT_CHECKBOX (const char *Name,bool SubmitOnChange,
void HTM_INPUT_CHECKBOX (const char *Name,HTM_SubmitOnChange_t SubmitOnChange,
const char *fmt,...);
void HTM_BUTTON_OnMouseDown_Begin (const char *Title,const char *Class);

View File

@ -1270,7 +1270,7 @@ static void Asg_ShowLstGrpsToEditAssignment (long AsgCod)
HTM_TD_Begin ("colspan=\"7\" class=\"DAT LM\"");
HTM_LABEL_Begin (NULL);
HTM_INPUT_CHECKBOX ("WholeCrs",false,
HTM_INPUT_CHECKBOX ("WholeCrs",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"WholeCrs\" value=\"Y\"%s"
" onclick=\"uncheckChildren(this,'GrpCods')\"",
Asg_CheckIfAsgIsAssociatedToGrps (AsgCod) ? "" : " checked=\"checked\"");

View File

@ -1178,7 +1178,7 @@ static void Att_ShowLstGrpsToEditAttEvent (long AttCod)
HTM_TD_Begin ("colspan=\"7\" class=\"DAT LM\"");
HTM_LABEL_Begin (NULL);
HTM_INPUT_CHECKBOX ("WholeCrs",false,
HTM_INPUT_CHECKBOX ("WholeCrs",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"WholeCrs\" value=\"Y\"%s"
" onclick=\"uncheckChildren(this,'GrpCods')\"",
Att_CheckIfAttEventIsAssociatedToGrps (AttCod) ? "" : " checked=\"checked\"");
@ -2049,7 +2049,7 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr,
/***** Checkbox to select user *****/
HTM_TD_Begin ("class=\"CT COLOR%u\"",Gbl.RowEvenOdd);
HTM_INPUT_CHECKBOX ("UsrCodStd",false,
HTM_INPUT_CHECKBOX ("UsrCodStd",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Std%u\" value=\"%s\"%s%s",
NumUsr,UsrDat->EncryptedUsrCod,
Present ? " checked=\"checked\"" : "",
@ -3045,7 +3045,7 @@ static void Att_ListEventsToSelect (void)
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"DAT CT COLOR%u\"",Gbl.RowEvenOdd);
HTM_INPUT_CHECKBOX ("AttCods",false,
HTM_INPUT_CHECKBOX ("AttCods",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Att%u\" value=\"%ld\"%s",
NumAttEvent,Gbl.AttEvents.Lst[NumAttEvent].AttCod,
Gbl.AttEvents.Lst[NumAttEvent].Selected ? " checked=\"checked\"" : "");

View File

@ -497,8 +497,8 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.145.6 (2020-03-11)"
#define CSS_FILE "swad19.145.5.css"
#define Log_PLATFORM_VERSION "SWAD 19.146 (2020-03-12)"
#define CSS_FILE "swad19.146.css"
#define JS_FILE "swad19.91.1.js"
/*
*
@ -523,7 +523,15 @@ Param
// TODO: Miguel Damas: al principio de los exámenes tendría que poner cuánto resta cada pregunta
// TODO: Si el alumno ha marcado "Permitir que los profesores...", entonces pedir confirmación al pulsar el botón azul, para evitar que se envíe por error antes de tiempo
// TODO: Oresti Baños: cambiar ojos por candados en descriptores para prohibir/permitir y dejar los ojos para poder elegir descriptores
// TODO: Instalar la última versión de MathJax de https://www.jsdelivr.com/package/npm/mathjax y comprobar que funciona bien con pandoc
Version 19.146: Mar 12, 2020 Background and changes in layout of matches. (282484 lines)
Copy the following background image to icon public directory:
sudo cp icon/bg.jpg /var/www/html/swad/icon/
Copy the following icon to icon public directory:
sudo cp icon/Spin-1s-200px.gif /var/www/html/swad/icon/
Version 19.145.7: Mar 11, 2020 Code refactoring related to HTML. (282418 lines)
Version 19.145.6: Mar 11, 2020 By default, teachers are allowed to see test exams. Suggested by Miguel Damas Hermoso. (282391 lines)
Version 19.145.5: Mar 10, 2020 Changed icon to comment in timeline. (282390 lines)
1 change necessary in database:

View File

@ -81,7 +81,7 @@ void Coo_EditMyPrefsOnCookies (void)
"DAT");
/* Check box */
HTM_LABEL_Begin (NULL);
HTM_INPUT_CHECKBOX ("cookies",true,
HTM_INPUT_CHECKBOX ("cookies",HTM_SUBMIT_ON_CHANGE,
"value=\"Y\"%s",
Gbl.Usrs.Me.UsrDat.Prefs.AcceptThirdPartyCookies ? " checked=\"checked\"" : "");
HTM_Txt (Txt_Accept_third_party_cookies_to_view_multimedia_content_from_other_websites);

View File

@ -453,7 +453,7 @@ static void Grp_PutCheckboxAllGrps (Grp_WhichGroups_t GroupsSelectableByStdsOrNE
HTM_DIV_Begin ("class=\"CONTEXT_OPT\"");
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_INPUT_CHECKBOX ("AllGroups",false,
HTM_INPUT_CHECKBOX ("AllGroups",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"Y\"%s",
ICanSelUnselGroup ? (Gbl.Usrs.ClassPhoto.AllGroups ? " checked=\"checked\""
" onclick=\"togglecheckChildren(this,'GrpCods')\"" :
@ -1713,7 +1713,7 @@ void Grp_ListGrpsToEditAsgAttSvyMch (struct GroupType *GrpTyp,long Cod,
HTM_TD_Begin ("class=\"LM LIGHT_BLUE\"");
else
HTM_TD_Begin ("class=\"LM\"");
HTM_INPUT_CHECKBOX ("GrpCods",false,
HTM_INPUT_CHECKBOX ("GrpCods",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Grp%ld\" value=\"%ld\"%s%s"
" onclick=\"uncheckParent(this,'WholeCrs')\"",
Grp->GrpCod,Grp->GrpCod,
@ -2029,7 +2029,7 @@ static bool Grp_ListGrpsForChangeMySelection (struct GroupType *GrpTyp,
}
else
/* Put a checkbox item */
HTM_INPUT_CHECKBOX (StrGrpCod,false,
HTM_INPUT_CHECKBOX (StrGrpCod,HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Grp%ld\" value=\"%ld\"%s%s",
Grp->GrpCod,Grp->GrpCod,
IBelongToThisGroup ? " checked=\"checked\"" : "",
@ -2129,7 +2129,7 @@ static void Grp_ListGrpsToAddOrRemUsrs (struct GroupType *GrpTyp,long UsrCod)
snprintf (StrGrpCod,sizeof (StrGrpCod),
"GrpCod%ld",
GrpTyp->GrpTypCod);
HTM_INPUT_CHECKBOX (StrGrpCod,false,
HTM_INPUT_CHECKBOX (StrGrpCod,HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Grp%ld\" value=\"%ld\"%s",
Grp->GrpCod,Grp->GrpCod,
UsrBelongsToThisGroup ? " checked=\"checked\"" : ""); // I can not register
@ -2227,7 +2227,7 @@ static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp,
HTM_TD_Begin ("class=\"LM LIGHT_BLUE\"");
else
HTM_TD_Begin ("class=\"LM\"");
HTM_INPUT_CHECKBOX ("GrpCods",false,
HTM_INPUT_CHECKBOX ("GrpCods",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Grp%ld\" value=\"%ld\"%s%s",
Grp->GrpCod,Grp->GrpCod,
Checked ? " checked=\"checked\"" : "",
@ -2267,12 +2267,12 @@ static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp,
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"LM\"");
HTM_INPUT_CHECKBOX ("GrpCods",false,
HTM_INPUT_CHECKBOX ("GrpCods",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Grp%ld\" value=\"%ld\"%s"
" onclick=\"checkParent(this,'AllGroups')\"",
-GrpTyp->GrpTypCod,-GrpTyp->GrpTypCod,
ICanSelUnselGroup ? (Checked ? " checked=\"checked\"" : "") :
" disabled=\"disabled\"");
" disabled=\"disabled\"");
HTM_TD_End ();
/* Column closed/open */

View File

@ -656,7 +656,7 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1
if (PutForm)
{
HTM_TD_Begin ("class=\"%s\"",Class);
HTM_INPUT_CHECKBOX ("Indicators",true,
HTM_INPUT_CHECKBOX ("Indicators",HTM_SUBMIT_ON_CHANGE,
"id=\"Indicators%u\" value=\"%u\"%s",
Ind,Ind,
Gbl.Stat.IndicatorsSelected[Ind] ? " checked=\"checked\"" : "");

View File

@ -274,8 +274,24 @@ void Lay_WriteStartOfPage (void)
break;
case Act_BRW_NEW_TAB:
case Act_BRW_2ND_TAB:
HTM_Txt ("<body onload=\"init();\">\n");
Gbl.Layout.WritingHTMLStart = false;
HTM_Txt ("<body onload=\"init();\"");
switch (Gbl.Action.Act)
{
case ActNewMch:
case ActResMch:
case ActBckMch:
case ActPlyPauMch:
case ActFwdMch:
case ActChgNumColMch:
case ActChgVisResMchQst:
case ActMchCntDwn:
HTM_Txt (" class=\"MCH_BG\"");
break;
default:
break;
}
HTM_Txt (">\n");
Gbl.Layout.WritingHTMLStart = false;
Gbl.Layout.HTMLStartWritten =
Gbl.Layout.DivsEndWritten = true;
return;
@ -1258,10 +1274,12 @@ void Lay_PutContextualCheckbox (Act_Action_t NextAction,
HTM_LABEL_Begin (NULL);
/****** Checkbox *****/
HTM_INPUT_CHECKBOX (CheckboxName,true,
HTM_INPUT_CHECKBOX (CheckboxName,HTM_SUBMIT_ON_CHANGE,
"value=\"Y\"%s%s",
Checked ? " checked=\"checked\"" : "",
Disabled ? " disabled=\"disabled\"" : "");
Checked ? " checked=\"checked\"" :
"",
Disabled ? " disabled=\"disabled\"" :
"");
/***** Text *****/
if (Text)

View File

@ -184,7 +184,9 @@ static void Mch_PutMatchControlButtons (const struct Match *Match);
static void Mch_ShowFormColumns (const struct Match *Match);
static void Mch_PutParamNumCols (unsigned NumCols);
static void Mch_ShowMatchTitle (const struct Match *Match);
static void Mch_ShowMatchTitleTch (const struct Match *Match);
static void Mch_ShowMatchTitleStd (const struct Match *Match);
static void Mch_PutCheckboxResult (const struct Match *Match);
static void Mch_PutIfAnswered (const struct Match *Match,bool Answered);
static void Mch_PutIconToRemoveMyAnswer (const struct Match *Match);
@ -221,9 +223,7 @@ static void Mch_RemoveMyAnswerToMatchQuestion (const struct Match *Match);
static double Mch_ComputeScore (unsigned NumQsts);
static unsigned Mch_GetNumUsrsWhoHaveChosenAns (long MchCod,unsigned QstInd,unsigned AnsInd);
static unsigned Mch_GetNumUsrsWhoHaveAnswerMch (long MchCod);
static void Mch_DrawBarNumUsrs (unsigned NumRespondersAns,unsigned NumRespondersQst,bool Correct);
static long Mch_GetCurrentMchCod (void);
@ -1305,7 +1305,7 @@ static void Mch_ShowLstGrpsToCreateMatch (void)
HTM_TD_Begin ("colspan=\"7\" class=\"DAT LM\"");
HTM_LABEL_Begin (NULL);
HTM_INPUT_CHECKBOX ("WholeCrs",true,
HTM_INPUT_CHECKBOX ("WholeCrs",HTM_SUBMIT_ON_CHANGE,
"id=\"WholeCrs\" value=\"Y\" checked=\"checked\""
" onclick=\"uncheckChildren(this,'GrpCods')\"");
HTM_TxtF ("%s&nbsp;%s",Txt_The_whole_course,Gbl.Hierarchy.Crs.ShrtName);
@ -1656,7 +1656,7 @@ static void Mch_UpdateMatchStatusInDB (const struct Match *Match)
/***** Update end time only if match is currently being played *****/
if (Match->Status.Playing) // Match is being played
{
if (asprintf (&MchSubQuery,"mch_matches.EndTime=NOW(),") < 0) // Background
if (asprintf (&MchSubQuery,"mch_matches.EndTime=NOW(),") < 0)
Lay_NotEnoughMemoryExit ();
}
else // Match is paused, not being played
@ -2189,7 +2189,7 @@ bool Mch_CheckIfICanPlayThisMatchBasedOnGrps (const struct Match *Match)
static void Mch_ShowLeftColumnTch (struct Match *Match)
{
/***** Start left container *****/
HTM_DIV_Begin ("class=\"MCH_LEFT\"");
HTM_DIV_Begin ("class=\"MCH_LEFT_TCH\"");
/***** Refreshable part *****/
HTM_DIV_Begin ("id=\"match_left\" class=\"MCH_REFRESHABLE_TEACHER\"");
@ -2244,7 +2244,7 @@ static void Mch_WriteElapsedTimeInMch (struct Match *Match)
{
struct Time Time;
HTM_DIV_Begin ("class=\"MCH_TOP\"");
HTM_DIV_Begin ("class=\"MCH_TOP CT\"");
/***** Get elapsed time in match *****/
Mch_GetElapsedTimeInMatch (Match,&Time);
@ -2463,10 +2463,10 @@ static void Mch_PutFormCountdown (struct Match *Match,long Seconds,const char *C
static void Mch_ShowRightColumnTch (const struct Match *Match)
{
/***** Start right container *****/
HTM_DIV_Begin ("class=\"MCH_RIGHT\"");
HTM_DIV_Begin ("class=\"MCH_RIGHT_TCH\"");
/***** Top row: match title *****/
Mch_ShowMatchTitle (Match);
Mch_ShowMatchTitleTch (Match);
/***** Bottom row: current question and possible answers *****/
if (Match->Status.Showing == Mch_END) // Match over
@ -2488,10 +2488,10 @@ static void Mch_ShowLeftColumnStd (const struct Match *Match,
bool Answered = UsrAnswer->NumOpt >= 0;
/***** Start left container *****/
HTM_DIV_Begin ("class=\"MCH_LEFT\"");
HTM_DIV_Begin ("class=\"MCH_LEFT_STD\"");
/***** Top *****/
HTM_DIV_Begin ("class=\"MCH_TOP\"");
HTM_DIV_Begin ("class=\"MCH_TOP CT\"");
HTM_DIV_End ();
/***** Write number of question *****/
@ -2529,10 +2529,10 @@ static void Mch_ShowRightColumnStd (struct Match *Match,
extern const char *Txt_Please_wait_;
/***** Start right container *****/
HTM_DIV_Begin ("class=\"MCH_RIGHT\"");
HTM_DIV_Begin ("class=\"MCH_RIGHT_STD\"");
/***** Top row *****/
Mch_ShowMatchTitle (Match);
Mch_ShowMatchTitleStd (Match);
/***** Bottom row *****/
if (Match->Status.Playing) // Match is being played
@ -2690,8 +2690,8 @@ static void Mch_ShowFormColumns (const struct Match *Match)
{
/* Begin container for this option */
HTM_DIV_Begin ("class=\"%s\"",
(Match->Status.NumCols == NumCols) ? "PREF_ON" :
"PREF_OFF");
(Match->Status.NumCols == NumCols) ? "MCH_NUM_COL_ON" :
"MCH_NUM_COL_OFF");
/* Begin form */
Frm_StartForm (ActChgNumColMch);
@ -2837,10 +2837,18 @@ static void Mch_PutIconToRemoveMyAnswer (const struct Match *Match)
/***************************** Show match title ******************************/
/*****************************************************************************/
static void Mch_ShowMatchTitle (const struct Match *Match)
static void Mch_ShowMatchTitleTch (const struct Match *Match)
{
/***** Match title *****/
HTM_DIV_Begin ("class=\"MCH_TOP\"");
HTM_DIV_Begin ("class=\"MCH_TOP LT\"");
HTM_Txt (Match->Title);
HTM_DIV_End ();
}
static void Mch_ShowMatchTitleStd (const struct Match *Match)
{
/***** Match title *****/
HTM_DIV_Begin ("class=\"MCH_TOP CT\"");
HTM_Txt (Match->Title);
HTM_DIV_End ();
}
@ -3327,7 +3335,7 @@ static void Mch_PutBigButtonClose (void)
static void Mch_ShowWaitImage (const char *Txt)
{
HTM_DIV_Begin ("class=\"MCH_WAIT_CONT\"");
Ico_PutIcon ("wait.gif",Txt,"MCH_WAIT_IMG");
Ico_PutIcon ("Spin-1s-200px.gif",Txt,"MCH_WAIT_IMG");
HTM_DIV_End ();
}
@ -3806,22 +3814,6 @@ static double Mch_ComputeScore (unsigned NumQsts)
return TotalScore;
}
/*****************************************************************************/
/*** Get number of users who selected this answer and draw proportional bar **/
/*****************************************************************************/
void Mch_GetAndDrawBarNumUsrsWhoHaveChosenAns (long MchCod,unsigned QstInd,unsigned AnsInd,
unsigned NumRespondersQst,bool Correct)
{
unsigned NumRespondersAns;
/***** Get number of users who selected this answer *****/
NumRespondersAns = Mch_GetNumUsrsWhoHaveChosenAns (MchCod,QstInd,AnsInd);
/***** Show stats of this answer *****/
Mch_DrawBarNumUsrs (NumRespondersAns,NumRespondersQst,Correct);
}
/*****************************************************************************/
/********** Get number of users who answered a question in a match ***********/
/*****************************************************************************/
@ -3841,7 +3833,7 @@ unsigned Mch_GetNumUsrsWhoAnsweredQst (long MchCod,unsigned QstInd)
/*** Get number of users who have chosen a given answer of a game question ***/
/*****************************************************************************/
static unsigned Mch_GetNumUsrsWhoHaveChosenAns (long MchCod,unsigned QstInd,unsigned AnsInd)
unsigned Mch_GetNumUsrsWhoHaveChosenAns (long MchCod,unsigned QstInd,unsigned AnsInd)
{
/***** Get number of users who have chosen
an answer of a question from database *****/
@ -3871,10 +3863,9 @@ static unsigned Mch_GetNumUsrsWhoHaveAnswerMch (long MchCod)
/***************** Draw a bar with the percentage of answers *****************/
/*****************************************************************************/
// #define Mch_MAX_BAR_WIDTH 400
#define Mch_MAX_BAR_WIDTH 100
static void Mch_DrawBarNumUsrs (unsigned NumRespondersAns,unsigned NumRespondersQst,bool Correct)
void Mch_DrawBarNumUsrs (unsigned NumRespondersAns,unsigned NumRespondersQst,bool Correct)
{
extern const char *Txt_of_PART_OF_A_TOTAL;
unsigned i;
@ -3905,14 +3896,13 @@ static void Mch_DrawBarNumUsrs (unsigned NumRespondersAns,unsigned NumResponders
HTM_TABLE_End ();
/***** Write the number of users *****/
if (NumRespondersQst)
if (NumRespondersAns && NumRespondersQst)
HTM_TxtF ("%u&nbsp;(%u%%&nbsp;%s&nbsp;%u)",
NumRespondersAns,
(unsigned) ((((double) NumRespondersAns * 100.0) / (double) NumRespondersQst) + 0.5),
Txt_of_PART_OF_A_TOTAL,NumRespondersQst);
NumRespondersAns,
(unsigned) ((((double) NumRespondersAns * 100.0) / (double) NumRespondersQst) + 0.5),
Txt_of_PART_OF_A_TOTAL,NumRespondersQst);
else
HTM_TxtF ("0&nbsp;(0%%&nbsp;%s&nbsp;%u)",
Txt_of_PART_OF_A_TOTAL,NumRespondersQst);
HTM_NBSP ();
/***** End container *****/
HTM_DIV_End ();

View File

@ -130,9 +130,9 @@ void Mch_GetQstAnsFromDB (long MchCod,long UsrCod,unsigned QstInd,
struct Mch_UsrAnswer *UsrAnswer);
void Mch_ReceiveQuestionAnswer (void);
void Mch_GetAndDrawBarNumUsrsWhoHaveChosenAns (long MchCod,unsigned QstInd,unsigned AnsInd,
unsigned NumRespondersQst,bool Correct);
unsigned Mch_GetNumUsrsWhoAnsweredQst (long MchCod,unsigned QstInd);
unsigned Mch_GetNumUsrsWhoHaveChosenAns (long MchCod,unsigned QstInd,unsigned AnsInd);
void Mch_DrawBarNumUsrs (unsigned NumRespondersAns,unsigned NumRespondersQst,bool Correct);
void Mch_SetCurrentMchCod (long MchCod);

View File

@ -548,10 +548,11 @@ static void McR_ListGamesToSelect (void)
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"DAT CT COLOR%u\"",Gbl.RowEvenOdd);
HTM_INPUT_CHECKBOX ("GamCod",false,
HTM_INPUT_CHECKBOX ("GamCod",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Gam%u\" value=\"%ld\"%s",
NumGame,Gbl.Games.Lst[NumGame].GamCod,
Gbl.Games.Lst[NumGame].Selected ? " checked=\"checked\"" : "");
Gbl.Games.Lst[NumGame].Selected ? " checked=\"checked\"" :
"");
HTM_TD_End ();
HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd);

View File

@ -2705,9 +2705,10 @@ static void Msg_ShowFormToShowOnlyUnreadMessages (void)
/***** Put checkbox to select whether to show only unread (received) messages *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_INPUT_CHECKBOX ("OnlyUnreadMsgs",false,
HTM_INPUT_CHECKBOX ("OnlyUnreadMsgs",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"Y\"%s",
Gbl.Msg.ShowOnlyUnreadMsgs ? " checked=\"checked\"" : "");
Gbl.Msg.ShowOnlyUnreadMsgs ? " checked=\"checked\"" :
"");
HTM_Txt (Txt_only_unread_messages);
HTM_LABEL_End ();
}

View File

@ -1928,17 +1928,19 @@ void Ntf_PutFormChangeNotifSentByEMail (void)
HTM_TD_End ();
HTM_TD_Begin ("class=\"CM\"");
HTM_INPUT_CHECKBOX (Ntf_ParamNotifMeAboutNotifyEvents[NotifyEvent],false,
HTM_INPUT_CHECKBOX (Ntf_ParamNotifMeAboutNotifyEvents[NotifyEvent],HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"Y\"%s",
(Gbl.Usrs.Me.UsrDat.NtfEvents.CreateNotif &
(1 << NotifyEvent)) ? " checked=\"checked\"" : "");
(1 << NotifyEvent)) ? " checked=\"checked\"" :
"");
HTM_TD_End ();
HTM_TD_Begin ("class=\"CM\"");
HTM_INPUT_CHECKBOX (Ntf_ParamEmailMeAboutNotifyEvents[NotifyEvent],false,
HTM_INPUT_CHECKBOX (Ntf_ParamEmailMeAboutNotifyEvents[NotifyEvent],HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"Y\"%s",
(Gbl.Usrs.Me.UsrDat.NtfEvents.SendEmail &
(1 << NotifyEvent)) ? " checked=\"checked\"" : "");
(1 << NotifyEvent)) ? " checked=\"checked\"" :
"");
HTM_TD_End ();
HTM_TR_End ();

View File

@ -852,7 +852,7 @@ void Pwd_AskForConfirmationOnDangerousAction (void)
/***** Checkbox *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_INPUT_CHECKBOX ("Consent",false,
HTM_INPUT_CHECKBOX ("Consent",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"Y\"");
HTM_Txt (Txt_I_understand_that_this_action_can_not_be_undone);
HTM_LABEL_End ();

View File

@ -3917,9 +3917,10 @@ void Prj_ShowFormConfig (void)
/* Data */
HTM_TD_Begin ("class=\"LT\"");
HTM_INPUT_CHECKBOX ("Editable",false,
HTM_INPUT_CHECKBOX ("Editable",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Editable\" value=\"Y\"%s",
Gbl.Prjs.Config.Editable ? " checked=\"checked\"" : "");
Gbl.Prjs.Config.Editable ? " checked=\"checked\"" :
"");
HTM_Txt (Txt_Editable_by_non_editing_teachers);
HTM_TD_End ();

View File

@ -541,7 +541,7 @@ void Rol_ChangeMyRole (void)
/*****************************************************************************/
void Rol_WriteSelectorRoles (unsigned RolesAllowed,unsigned RolesSelected,
bool Disabled,bool SendOnChange)
bool Disabled,HTM_SubmitOnChange_t SubmitOnChange)
{
extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
Rol_Role_t Role;
@ -552,11 +552,13 @@ void Rol_WriteSelectorRoles (unsigned RolesAllowed,unsigned RolesSelected,
if ((RolesAllowed & (1 << Role)))
{
HTM_LABEL_Begin (NULL);
HTM_INPUT_CHECKBOX ("Role",SendOnChange,
HTM_INPUT_CHECKBOX ("Role",SubmitOnChange,
"id=\"Role\" value=\"%u\"%s%s",
(unsigned) Role,
(RolesSelected & (1 << Role)) ? " checked=\"checked\"" : "",
Disabled ? " disabled=\"disabled\"" : "");
(RolesSelected & (1 << Role)) ? " checked=\"checked\"" :
"",
Disabled ? " disabled=\"disabled\"" :
"");
HTM_Txt (Txt_ROLES_PLURAL_abc[Role][Usr_SEX_UNKNOWN]);
HTM_LABEL_End ();
HTM_BR ();

View File

@ -27,6 +27,7 @@
/********************************** Headers **********************************/
/*****************************************************************************/
#include "swad_HTML.h"
#include "swad_user.h"
/*****************************************************************************/
@ -56,7 +57,7 @@ void Rol_PutFormToChangeMyRole (const char *ClassSelect);
void Rol_ChangeMyRole (void);
void Rol_WriteSelectorRoles (unsigned RolesAllowed,unsigned RolesSelected,
bool Disabled,bool SendOnChange);
bool Disabled,HTM_SubmitOnChange_t SubmitOnChange);
void Rol_PutHiddenParamRoles (unsigned Roles);
unsigned Rol_GetSelectedRoles (void);

View File

@ -2063,9 +2063,10 @@ static void Svy_ShowLstGrpsToEditSurvey (long SvyCod)
HTM_TD_Begin ("colspan=\"7\" class=\"DAT LM\"");
HTM_LABEL_Begin (NULL);
HTM_INPUT_CHECKBOX ("WholeCrs",false,
HTM_INPUT_CHECKBOX ("WholeCrs",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"WholeCrs\" value=\"Y\"%s onclick=\"uncheckChildren(this,'GrpCods')\"",
Svy_CheckIfSvyIsAssociatedToGrps (SvyCod) ? "" : " checked=\"checked\"");
Svy_CheckIfSvyIsAssociatedToGrps (SvyCod) ? "" :
" checked=\"checked\"");
HTM_TxtF ("%s&nbsp;%s",Txt_The_whole_course,Gbl.Hierarchy.Crs.ShrtName);
HTM_LABEL_End ();
HTM_TD_End ();
@ -3429,7 +3430,7 @@ static void Svy_WriteAnswersOfAQst (struct Survey *Svy,
NumAns,
(unsigned) SvyQst->QstCod,NumAnswers);
else // SvyQst->AnswerType == Svy_ANS_MULTIPLE_CHOICE
HTM_INPUT_CHECKBOX (StrAns,false,
HTM_INPUT_CHECKBOX (StrAns,HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Ans%010u_%010u\" value=\"%u\"",
(unsigned) SvyQst->QstCod,NumAns,NumAns,
NumAns);

View File

@ -398,7 +398,7 @@ void Tst_ShowNewTest (void)
/***** Test result will be saved? *****/
HTM_DIV_Begin ("class=\"CM\"");
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_INPUT_CHECKBOX ("AllowTchs",false, // Don't submit on change
HTM_INPUT_CHECKBOX ("AllowTchs",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"Y\"%s",
Gbl.Test.AllowTeachers ? " checked=\"checked\"" :
"");
@ -1665,9 +1665,10 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res,
HTM_TD_Begin ("class=\"LM\"");
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_INPUT_CHECKBOX ("AllTags",false,
HTM_INPUT_CHECKBOX ("AllTags",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"Y\"%s onclick=\"togglecheckChildren(this,'ChkTag');\"",
Gbl.Test.Tags.All ? " checked=\"checked\"" : "");
Gbl.Test.Tags.All ? " checked=\"checked\"" :
"");
HTM_TxtF ("&nbsp;%s",Txt_All_tags);
HTM_LABEL_End ();
HTM_TD_End ();
@ -1710,10 +1711,11 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res,
HTM_TD_Begin ("class=\"LM\"");
HTM_LABEL_Begin ("class=\"DAT\"");
HTM_INPUT_CHECKBOX ("ChkTag",false,
HTM_INPUT_CHECKBOX ("ChkTag",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"%s\"%s onclick=\"checkParent(this,'AllTags');\"",
row[1],
Checked ? " checked=\"checked\"" : "");
Checked ? " checked=\"checked\"" :
"");
HTM_TxtF ("&nbsp;%s",row[1]);
HTM_LABEL_End ();
HTM_TD_End ();
@ -2256,9 +2258,10 @@ static void Tst_ShowFormAnswerTypes (void)
HTM_TD_Begin ("class=\"LM\"");
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_INPUT_CHECKBOX ("AllAnsTypes",false,
HTM_INPUT_CHECKBOX ("AllAnsTypes",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"Y\"%s onclick=\"togglecheckChildren(this,'AnswerType');\"",
Gbl.Test.AllAnsTypes ? " checked=\"checked\"" : "");
Gbl.Test.AllAnsTypes ? " checked=\"checked\"" :
"");
HTM_TxtF ("&nbsp;%s",Txt_All_types_of_answers);
HTM_LABEL_End ();
HTM_TD_End ();
@ -2285,10 +2288,11 @@ static void Tst_ShowFormAnswerTypes (void)
}
HTM_TD_Begin ("class=\"LM\"");
HTM_LABEL_Begin ("class=\"DAT\"");
HTM_INPUT_CHECKBOX ("AnswerType",false,
HTM_INPUT_CHECKBOX ("AnswerType",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"%u\"%s onclick=\"checkParent(this,'AllAnsTypes');\"",
(unsigned) AnsType,
Checked ? " checked=\"checked\"" : "");
Checked ? " checked=\"checked\"" :
"");
HTM_TxtF ("&nbsp;%s",Txt_TST_STR_ANSWER_TYPES[AnsType]);
HTM_LABEL_End ();
HTM_TD_End ();
@ -2873,9 +2877,10 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows,
if (NumRows == 1)
Par_PutHiddenParamChar ("OnlyThisQst",'Y'); // If editing only one question, don't edit others
Par_PutHiddenParamUnsigned (NULL,"Order",(unsigned) Gbl.Test.SelectedOrder);
HTM_INPUT_CHECKBOX ("Shuffle",true,
HTM_INPUT_CHECKBOX ("Shuffle",HTM_SUBMIT_ON_CHANGE,
"value=\"Y\"%s",
row[3][0] == 'Y' ? " checked=\"checked\"" : "");
row[3][0] == 'Y' ? " checked=\"checked\"" :
"");
Frm_EndForm ();
}
HTM_TD_End ();
@ -3038,7 +3043,7 @@ static void Tst_ListOneOrMoreQuestionsForSelection (unsigned long NumRows,
HTM_TD_Begin ("class=\"BT%u\"",Gbl.RowEvenOdd);
/* Write checkbox to select the question */
HTM_INPUT_CHECKBOX ("QstCods",false,
HTM_INPUT_CHECKBOX ("QstCods",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"%ld\"",
Gbl.Test.QstCod);
@ -3077,9 +3082,10 @@ static void Tst_ListOneOrMoreQuestionsForSelection (unsigned long NumRows,
/* Write if shuffle is enabled (row[3]) */
HTM_TD_Begin ("class=\"DAT_SMALL CT COLOR%u\"",Gbl.RowEvenOdd);
HTM_INPUT_CHECKBOX ("Shuffle",false,
HTM_INPUT_CHECKBOX ("Shuffle",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"Y\"%s disabled=\"disabled\"",
row[3][0] == 'Y' ? " checked=\"checked\"" : "");
row[3][0] == 'Y' ? " checked=\"checked\"" :
"");
HTM_TD_End ();
/* Write stem (row[4]) */
@ -3671,7 +3677,7 @@ static void Tst_WriteChoiceAnsViewTest (unsigned NumQst,long QstCod,bool Shuffle
Index,
NumQst,Gbl.Test.Answer.NumOptions);
else // Gbl.Test.AnswerType == Tst_ANS_MULTIPLE_CHOICE
HTM_INPUT_CHECKBOX (StrAns,false,
HTM_INPUT_CHECKBOX (StrAns,HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Ans%06u_%u\" value=\"%u\"",
NumQst,NumOpt,
Index);
@ -4059,11 +4065,12 @@ void Tst_WriteChoiceAnsViewMatch (long MchCod,unsigned QstInd,long QstCod,
bool RowIsOpen = false;
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned NumAnswerersQst;
unsigned NumRespondersQst;
unsigned NumRespondersAns;
unsigned Indexes[Tst_MAX_OPTIONS_PER_QUESTION]; // Indexes of all answers of this question
/***** Get number of users who have answered this question from database *****/
NumAnswerersQst = Mch_GetNumUsrsWhoAnsweredQst (MchCod,QstInd);
NumRespondersQst = Mch_GetNumUsrsWhoAnsweredQst (MchCod,QstInd);
/***** Get answers of a question from database *****/
Gbl.Test.Answer.NumOptions = Tst_GetAnswersQst (QstCod,&mysql_res,false);
@ -4109,7 +4116,7 @@ void Tst_WriteChoiceAnsViewMatch (long MchCod,unsigned QstInd,long QstCod,
Mch_GetIndexes (MchCod,QstInd,Indexes);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (10);
HTM_TABLE_BeginWidePadding (0);
/***** Show options distributed in columns *****/
for (NumOpt = 0;
@ -4141,11 +4148,19 @@ void Tst_WriteChoiceAnsViewMatch (long MchCod,unsigned QstInd,long QstCod,
/* Show result (number of users who answered? */
if (ShowResult)
/* Get number of users who selected this answer
and draw proportional bar */
Mch_GetAndDrawBarNumUsrsWhoHaveChosenAns (MchCod,QstInd,Indexes[NumOpt],
NumAnswerersQst,
Gbl.Test.Answer.Options[Indexes[NumOpt]].Correct);
{
/* Get number of users who selected this answer */
NumRespondersAns = Mch_GetNumUsrsWhoHaveChosenAns (MchCod,QstInd,Indexes[NumOpt]);
/* Draw proportional bar for this answer */
Mch_DrawBarNumUsrs (NumRespondersAns,NumRespondersQst,
Gbl.Test.Answer.Options[Indexes[NumOpt]].Correct);
}
else
/* Draw empty bar for this answer
in order to show the same layout that the one shown with results */
Mch_DrawBarNumUsrs (0,0,
false); // Not used when length of bar is 0
HTM_TD_End ();
@ -5246,11 +5261,12 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1],
HTM_TD_Begin ("class=\"LT\"");
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_INPUT_CHECKBOX ("Shuffle",false,
HTM_INPUT_CHECKBOX ("Shuffle",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"Y\"%s%s",
Gbl.Test.Shuffle ? " checked=\"checked\"" : "",
Gbl.Test.AnswerType != Tst_ANS_UNIQUE_CHOICE &&
Gbl.Test.AnswerType != Tst_ANS_MULTIPLE_CHOICE ? " disabled=\"disabled\"" : "");
Gbl.Test.AnswerType != Tst_ANS_MULTIPLE_CHOICE ? " disabled=\"disabled\"" :
"");
HTM_Txt (Txt_Shuffle);
HTM_LABEL_End ();
HTM_TD_End ();
@ -5294,11 +5310,12 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1],
Gbl.Test.AnswerType == Tst_ANS_UNIQUE_CHOICE ? "" : " disabled=\"disabled\"");
/* Checkbox for multiple choice answers */
HTM_INPUT_CHECKBOX ("AnsMulti",false,
HTM_INPUT_CHECKBOX ("AnsMulti",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"%u\"%s%s",
NumOpt,
Gbl.Test.Answer.Options[NumOpt].Correct ? " checked=\"checked\"" : "",
Gbl.Test.AnswerType == Tst_ANS_MULTIPLE_CHOICE ? "" : " disabled=\"disabled\"");
Gbl.Test.AnswerType == Tst_ANS_MULTIPLE_CHOICE ? "" :
" disabled=\"disabled\"");
HTM_TD_End ();

View File

@ -129,7 +129,7 @@ void TsV_PutVisibilityCheckboxes (unsigned SelectedVisibility)
{
ItemVisible = (SelectedVisibility & (1 << Visibility)) != 0;
HTM_LABEL_Begin ("class=\"DAT\"");
HTM_INPUT_CHECKBOX ("Visibility",false,
HTM_INPUT_CHECKBOX ("Visibility",HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"%u\"%s",
(unsigned) Visibility,
ItemVisible ? " checked=\"checked\"" :

View File

@ -6492,7 +6492,7 @@ static void Usr_PutCheckboxToSelectAllUsers (Rol_Role_t Role,
if (Usr_NameSelUnsel[Role] && Usr_ParamUsrCod[Role])
{
Usr_BuildParamName (&ParamName,Usr_ParamUsrCod[Role],SelectedUsrs->ParamSuffix);
HTM_INPUT_CHECKBOX (Usr_NameSelUnsel[Role],false,
HTM_INPUT_CHECKBOX (Usr_NameSelUnsel[Role],HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"\" onclick=\"togglecheckChildren(this,'%s')\"",
ParamName);
free (ParamName);
@ -6569,10 +6569,11 @@ static void Usr_PutCheckboxToSelectUser (Rol_Role_t Role,
/***** Check box *****/
Usr_BuildParamName (&ParamName,Usr_ParamUsrCod[Role],SelectedUsrs->ParamSuffix);
HTM_INPUT_CHECKBOX (ParamName,false,
HTM_INPUT_CHECKBOX (ParamName,HTM_DONT_SUBMIT_ON_CHANGE,
"value=\"%s\"%s onclick=\"checkParent(this,'%s')\"",
EncryptedUsrCod,
CheckboxChecked ? " checked=\"checked\"" : "",
CheckboxChecked ? " checked=\"checked\"" :
"",
Usr_NameSelUnsel[Role]);
free (ParamName);
}
@ -6593,9 +6594,10 @@ static void Usr_PutCheckboxListWithPhotos (void)
/***** Put checkbox to select whether list users with photos *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_INPUT_CHECKBOX ("WithPhotos",true,
HTM_INPUT_CHECKBOX ("WithPhotos",HTM_SUBMIT_ON_CHANGE,
"value=\"Y\"%s",
Gbl.Usrs.Listing.WithPhotos ? " checked=\"checked\"" : "");
Gbl.Usrs.Listing.WithPhotos ? " checked=\"checked\"" :
"");
HTM_Txt (Txt_Display_photos);
HTM_LABEL_End ();
}