Version 21.85.1: Mar 24, 2022 Working on design of dark theme.

This commit is contained in:
acanas 2022-03-24 20:31:18 +01:00
parent 1c70e5c92b
commit 274b5572e8
12 changed files with 292 additions and 190 deletions

View File

@ -2914,8 +2914,21 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
.STATUS_RED_LIGHT {color:#f98a8a; font-size:12pt;}
/********************** Number of question, project, etc. ********************/
.BIG_INDEX {color:#808080; font-size:20pt; font-weight:bold;}
.BIG_INDEX_RED {color:#660000; font-size:20pt; font-weight:bold;}
.BIG_INDEX_WHITE,
.BIG_INDEX_GREY,
.BIG_INDEX_PURPLE,
.BIG_INDEX_BLUE,
.BIG_INDEX_YELLOW,
.BIG_INDEX_PINK {color:#808080; font-size:20pt; font-weight:bold;}
.BIG_INDEX_DARK {color:#d0d0d0; font-size:20pt; font-weight:bold;}
.BIG_INDEX_RED_WHITE,
.BIG_INDEX_RED_GREY,
.BIG_INDEX_RED_PURPLE,
.BIG_INDEX_RED_BLUE,
.BIG_INDEX_RED_YELLOW,
.BIG_INDEX_RED_PINK {color:#660000; font-size:20pt; font-weight:bold;}
.BIG_INDEX_RED_DARK {color:#ff8080; font-size:20pt; font-weight:bold;}
/******************************** Update links *******************************/
.UPD
@ -2974,94 +2987,142 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
{
width:596px;
}
.ANS_0 {color:#202020; font-size:12pt; font-weight:bold;}
.ANS_OK {color:#008000; font-size:12pt; font-weight:bold;}
.ANS_BAD {color:red; font-size:12pt; font-weight:bold;}
.TEST_SUBTITLE
.Tst_SUBTITLE
{
margin:10px;
color:#202020;
font-size:13pt;
text-align:center;
vertical-align:middle;
}
.TEST_TXT {color:#202020; font-size:12pt;}
.TEST_TXT_RED {color:#660000; font-size:12pt;}
.TEST_TXT_LIGHT {color:#a0a0a0; font-size:12pt;}
.TEST_TXT_LIGHT_RED {color:#f98a8a; font-size:12pt;}
.TEST_TAG_LIST
.Qst_TXT_WHITE,
.Qst_TXT_GREY,
.Qst_TXT_PURPLE,
.Qst_TXT_BLUE,
.Qst_TXT_YELLOW,
.Qst_TXT_PINK {color:#202020; font-size:12pt;}
.Qst_TXT_DARK {color:#e0e0e0; font-size:12pt;}
.Qst_TXT_RED_WHITE,
.Qst_TXT_RED_GREY,
.Qst_TXT_RED_PURPLE,
.Qst_TXT_RED_BLUE,
.Qst_TXT_RED_YELLOW,
.Qst_TXT_RED_PINK {color:#660000; font-size:12pt;}
.Qst_TXT_RED_DARK {color:#ff8080; font-size:12pt;}
.Qst_TXT_LIGHT_WHITE,
.Qst_TXT_LIGHT_GREY,
.Qst_TXT_LIGHT_PURPLE,
.Qst_TXT_LIGHT_BLUE,
.Qst_TXT_LIGHT_YELLOW,
.Qst_TXT_LIGHT_PINK {color:#a0a0a0; font-size:12pt;}
.Qst_TXT_LIGHT_DARK {color:#808080; font-size:12pt;}
.Qst_TXT_LIGHT_RED_WHITE,
.Qst_TXT_LIGHT_RED_GREY,
.Qst_TXT_LIGHT_RED_PURPLE,
.Qst_TXT_LIGHT_RED_BLUE,
.Qst_TXT_LIGHT_RED_YELLOW,
.Qst_TXT_LIGHT_RED_PINK {color:#f98a8a; font-size:12pt;}
.Qst_TXT_LIGHT_RED_DARK {color:#f98a8a; font-size:12pt;}
.Qst_ANS_0_WHITE,
.Qst_ANS_0_GREY,
.Qst_ANS_0_PURPLE,
.Qst_ANS_0_BLUE,
.Qst_ANS_0_YELLOW,
.Qst_ANS_0_PINK {color:#202020; font-size:12pt; font-weight:bold;}
.Qst_ANS_0_DARK {color:#e0e0e0; font-size:12pt; font-weight:bold;}
.Qst_ANS_OK_WHITE,
.Qst_ANS_OK_GREY,
.Qst_ANS_OK_PURPLE,
.Qst_ANS_OK_BLUE,
.Qst_ANS_OK_YELLOW,
.Qst_ANS_OK_PINK {color:#246600; font-size:12pt; font-weight:bold;}
.Qst_ANS_OK_DARK {color:#80c040; font-size:12pt; font-weight:bold;}
.Qst_ANS_BAD_WHITE,
.Qst_ANS_BAD_GREY,
.Qst_ANS_BAD_PURPLE,
.Qst_ANS_BAD_BLUE,
.Qst_ANS_BAD_YELLOW,
.Qst_ANS_BAD_PINK {color:#660000; font-size:12pt; font-weight:bold;}
.Qst_ANS_BAD_DARK {color:#ff8080; font-size:12pt; font-weight:bold;}
.Tst_TAG_LIST
{
padding:0;
margin:0 0 0 1em;
}
.TEST_MED_SHOW_CONT
.Tst_MED_SHOW_CONT
{
box-sizing:border-box;
width:50%;
margin:10px 0;
}
.TEST_MED_SHOW
.Tst_MED_SHOW
{
box-sizing:border-box;
width:100%;
border-radius:2px;
}
.TEST_MED_EDIT_LIST_CONT
.Tst_MED_EDIT_LIST_CONT
{
box-sizing:border-box;
width:50%;
margin:5px 0;
}
.TEST_MED_EDIT_LIST
.Tst_MED_EDIT_LIST
{
box-sizing:border-box;
width:100%;
border-radius:2px;
}
.TEST_MED_EDIT_FORM
.Tst_MED_EDIT_FORM
{
box-sizing:border-box;
margin:15px 0;
text-align:left;
vertical-align:top;
}
.TEST_MED_INPUT
.Tst_MED_INPUT
{
box-sizing:border-box;
margin:0 auto;
width:400px;
}
.TEST_MED_EDIT_ONE_CONT
.Tst_MED_EDIT_ONE_CONT
{
box-sizing:border-box;
width:100%;
}
.TEST_MED_EDIT_ONE
.Tst_MED_EDIT_ONE
{
box-sizing:border-box;
width:100%;
border-radius:2px;
}
.TEST_EDI_ANS_LEFT_COL
.Tst_EDI_ANS_LEFT_COL
{
box-sizing:border-box;
width:48px;
text-align:left;
vertical-align:top;
}
.TEST_EDI_ANS_CENTER_COL
.Tst_EDI_ANS_CENTER_COL
{
box-sizing:border-box;
width:48px;
text-align:right;
vertical-align:top;
}
.TEST_EDI_ANS_RIGHT_COL
.Tst_EDI_ANS_RIGHT_COL
{
box-sizing:border-box;
width:600px;
@ -3069,7 +3130,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
vertical-align:top;
}
.TEST_FILE_CONTENT
.Tst_FILE_CONTENT
{
padding-bottom:20px;
}

View File

@ -606,10 +606,11 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate
TODO: Attach pdf files in multimedia.
*/
#define Log_PLATFORM_VERSION "SWAD 21.85 (2022-03-23)"
#define CSS_FILE "swad21.85.css"
#define Log_PLATFORM_VERSION "SWAD 21.85.1 (2022-03-23)"
#define CSS_FILE "swad21.85.1.css"
#define JS_FILE "swad21.78.2.js"
/*
Version 21.85.1: Mar 24, 2022 Working on design of dark theme. (323724 lines)
Version 21.85: Mar 24, 2022 Working on design of dark theme. (323634 lines)
Version 21.84: Mar 19, 2022 Code refactoring on row colors. (323626 lines)
Version 21.83.8: Mar 16, 2022 Working on design of dark theme. (323610 lines)

View File

@ -696,7 +696,6 @@ static void ExaPrn_WriteQstAndAnsToFill (const struct ExaPrn_Print *Print,
unsigned QstInd,
struct Qst_Question *Question)
{
extern const char *The_ClassDatSmall[The_NUM_THEMES];
static struct ExaSet_Set CurrentSet =
{
.ExaCod = -1L,
@ -726,20 +725,19 @@ static void ExaPrn_WriteQstAndAnsToFill (const struct ExaPrn_Print *Print,
/***** Number of question and answer type *****/
HTM_TD_Begin ("class=\"RT\"");
Qst_WriteNumQst (QstInd + 1,"BIG_INDEX");
Qst_WriteAnswerType (Question->Answer.Type,
The_ClassDatSmall[Gbl.Prefs.Theme]);
Qst_WriteAnswerType (Question->Answer.Type,"DAT_SMALL");
HTM_TD_End ();
/***** Stem, media and answers *****/
HTM_TD_Begin ("class=\"LT\"");
/* Stem */
Qst_WriteQstStem (Question->Stem,"TEST_TXT",true);
Qst_WriteQstStem (Question->Stem,"Qst_TXT",true);
/* Media */
Med_ShowMedia (&Question->Media,
"TEST_MED_SHOW_CONT",
"TEST_MED_SHOW");
"Tst_MED_SHOW_CONT",
"Tst_MED_SHOW");
/* Answers */
Frm_BeginFormNoAction (); // Form that can not be submitted, to avoid enter key to send it
@ -848,6 +846,7 @@ static void ExaPrn_WriteChoAnsToFill (const struct ExaPrn_Print *Print,
unsigned QstInd,
struct Qst_Question *Question)
{
extern const char *The_Colors[The_NUM_THEMES];
unsigned NumOpt;
unsigned Indexes[Qst_MAX_OPTIONS_PER_QUESTION]; // Indexes of all answers of this question
bool UsrAnswers[Qst_MAX_OPTIONS_PER_QUESTION];
@ -890,19 +889,21 @@ static void ExaPrn_WriteChoAnsToFill (const struct ExaPrn_Print *Print,
HTM_TD_End ();
HTM_TD_Begin ("class=\"LT\"");
HTM_LABEL_Begin ("for=\"Ans%010u_%u\" class=\"TEST_TXT\"",QstInd,NumOpt);
HTM_LABEL_Begin ("for=\"Ans%010u_%u\" class=\"Qst_TXT_%s\"",
QstInd,NumOpt,The_Colors[Gbl.Prefs.Theme]);
HTM_TxtF ("%c) ",'a' + (char) NumOpt);
HTM_LABEL_End ();
HTM_TD_End ();
/***** Write the option text *****/
HTM_TD_Begin ("class=\"LT\"");
HTM_LABEL_Begin ("for=\"Ans%010u_%u\" class=\"TEST_TXT\"",QstInd,NumOpt);
HTM_LABEL_Begin ("for=\"Ans%010u_%u\" class=\"Qst_TXT_%s\"",
QstInd,NumOpt,The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Question->Answer.Options[Indexes[NumOpt]].Text);
HTM_LABEL_End ();
Med_ShowMedia (&Question->Answer.Options[Indexes[NumOpt]].Media,
"TEST_MED_SHOW_CONT",
"TEST_MED_SHOW");
"Tst_MED_SHOW_CONT",
"Tst_MED_SHOW");
HTM_TD_End ();
HTM_TR_End ();

View File

@ -1861,8 +1861,7 @@ static void ExaRes_WriteQstAndAnsExam (struct UsrData *UsrDat,
struct Qst_Question *Question,
unsigned Visibility)
{
extern const char *The_ClassDatSmall[The_NUM_THEMES];
extern const char *The_ClassDatSmallRed[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_Score;
extern const char *Txt_Invalid_question;
bool ICanView[TstVis_NUM_ITEMS_VISIBILITY];
@ -1871,20 +1870,20 @@ static void ExaRes_WriteQstAndAnsExam (struct UsrData *UsrDat,
[Qst_INVALID_QUESTION] = "BIG_INDEX_RED",
[Qst_VALID_QUESTION ] = "BIG_INDEX",
};
const char *ClassAnswerType[Qst_NUM_VALIDITIES] =
static const char *ClassAnswerType[Qst_NUM_VALIDITIES] =
{
[Qst_INVALID_QUESTION] = The_ClassDatSmallRed[Gbl.Prefs.Theme],
[Qst_VALID_QUESTION ] = The_ClassDatSmall[Gbl.Prefs.Theme],
[Qst_INVALID_QUESTION] = "DAT_SMALL_RED",
[Qst_VALID_QUESTION ] = "DAT_SMALL",
};
static const char *ClassTxt[Qst_NUM_VALIDITIES] =
{
[Qst_INVALID_QUESTION] = "TEST_TXT_RED",
[Qst_VALID_QUESTION ] = "TEST_TXT",
[Qst_INVALID_QUESTION] = "Qst_TXT_RED",
[Qst_VALID_QUESTION ] = "Qst_TXT",
};
static const char *ClassFeedback[Qst_NUM_VALIDITIES] =
{
[Qst_INVALID_QUESTION] = "TEST_TXT_LIGHT_RED",
[Qst_VALID_QUESTION ] = "TEST_TXT_LIGHT",
[Qst_INVALID_QUESTION] = "Qst_TXT_LIGHT_RED",
[Qst_VALID_QUESTION ] = "Qst_TXT_LIGHT",
};
/***** Check if I can view each part of the question *****/
@ -1921,7 +1920,8 @@ static void ExaRes_WriteQstAndAnsExam (struct UsrData *UsrDat,
/***** Number of question and answer type *****/
HTM_TD_Begin ("class=\"RT %s\"",The_GetColorRows ());
Qst_WriteNumQst (QstInd + 1,ClassNumQst[Question->Validity]);
Qst_WriteAnswerType (Question->Answer.Type,ClassAnswerType[Question->Validity]);
Qst_WriteAnswerType (Question->Answer.Type,
ClassAnswerType[Question->Validity]);
HTM_TD_End ();
/***** Stem, media and answers *****/
@ -1934,8 +1934,8 @@ static void ExaRes_WriteQstAndAnsExam (struct UsrData *UsrDat,
/* Media */
if (ICanView[TstVis_VISIBLE_QST_ANS_TXT])
Med_ShowMedia (&Question->Media,
"TEST_MED_SHOW_CONT",
"TEST_MED_SHOW");
"Tst_MED_SHOW_CONT",
"Tst_MED_SHOW");
/* Answers */
ExaPrn_ComputeAnswerScore (&Print->PrintedQuestions[QstInd],Question);
@ -1947,14 +1947,15 @@ static void ExaRes_WriteQstAndAnsExam (struct UsrData *UsrDat,
/* Write score retrieved from database */
if (ICanView[TstVis_VISIBLE_EACH_QST_SCORE])
{
HTM_DIV_Begin ("class=\"%s LM\"",
The_ClassDatSmall[Gbl.Prefs.Theme]);
HTM_DIV_Begin ("class=\"LM DAT_SMALL_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtColonNBSP (Txt_Score);
HTM_SPAN_Begin ("class=\"%s\"",
HTM_SPAN_Begin ("class=\"%s_%s\"",
Print->PrintedQuestions[QstInd].StrAnswers[0] ?
(Print->PrintedQuestions[QstInd].Score > 0 ? "ANS_OK" : // Correct/semicorrect
"ANS_BAD") : // Wrong
"ANS_0"); // Blank answer
(Print->PrintedQuestions[QstInd].Score > 0 ? "Qst_ANS_OK" : // Correct
"Qst_ANS_BAD") : // Wrong
"Qst_ANS_0", // Blank answer
The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (Print->PrintedQuestions[QstInd].Score);
if (Question->Validity == Qst_INVALID_QUESTION)
HTM_TxtF (" (%s)",Txt_Invalid_question);
@ -1964,7 +1965,8 @@ static void ExaRes_WriteQstAndAnsExam (struct UsrData *UsrDat,
/* Question feedback */
if (ICanView[TstVis_VISIBLE_FEEDBACK_TXT])
Qst_WriteQstFeedback (Question->Feedback,ClassFeedback[Question->Validity]);
Qst_WriteQstFeedback (Question->Feedback,
ClassFeedback[Question->Validity]);
HTM_TD_End ();

View File

@ -1185,8 +1185,6 @@ void ExaSet_GetQstDataFromDB (struct Qst_Question *Question)
static void ExaSet_ListQuestionForEdition (struct Qst_Question *Question,
unsigned QstInd,const char *Anchor)
{
extern const char *The_ClassDatSmall[The_NUM_THEMES];
extern const char *The_ClassDatSmallRed[The_NUM_THEMES];
static const char *ClassNumQst[Qst_NUM_VALIDITIES] =
{
[Qst_INVALID_QUESTION] = "BIG_INDEX_RED",
@ -1194,24 +1192,25 @@ static void ExaSet_ListQuestionForEdition (struct Qst_Question *Question,
};
const char *ClassAnswerType[Qst_NUM_VALIDITIES] =
{
[Qst_INVALID_QUESTION] = The_ClassDatSmallRed[Gbl.Prefs.Theme],
[Qst_VALID_QUESTION ] = The_ClassDatSmall[Gbl.Prefs.Theme],
[Qst_INVALID_QUESTION] = "DAT_SMALL_RED",
[Qst_VALID_QUESTION ] = "DAT_SMALL",
};
static const char *ClassTxt[Qst_NUM_VALIDITIES] =
{
[Qst_INVALID_QUESTION] = "TEST_TXT_RED",
[Qst_VALID_QUESTION ] = "TEST_TXT",
[Qst_INVALID_QUESTION] = "Qst_TXT_RED",
[Qst_VALID_QUESTION ] = "Qst_TXT",
};
static const char *ClassFeedback[Qst_NUM_VALIDITIES] =
{
[Qst_INVALID_QUESTION] = "TEST_TXT_LIGHT_RED",
[Qst_VALID_QUESTION ] = "TEST_TXT_LIGHT",
[Qst_INVALID_QUESTION] = "Qst_TXT_LIGHT_RED",
[Qst_VALID_QUESTION ] = "Qst_TXT_LIGHT",
};
/***** Number of question and answer type (row[1]) *****/
HTM_TD_Begin ("class=\"RT %s\"",The_GetColorRows ());
Qst_WriteNumQst (QstInd,ClassNumQst[Question->Validity]);
Qst_WriteAnswerType (Question->Answer.Type,ClassAnswerType[Question->Validity]);
Qst_WriteAnswerType (Question->Answer.Type,
ClassAnswerType[Question->Validity]);
HTM_TD_End ();
/***** Write stem (row[3]) and media *****/
@ -1224,11 +1223,12 @@ static void ExaSet_ListQuestionForEdition (struct Qst_Question *Question,
/* Show media */
Med_ShowMedia (&Question->Media,
"TEST_MED_EDIT_LIST_CONT",
"TEST_MED_EDIT_LIST");
"Tst_MED_EDIT_LIST_CONT",
"Tst_MED_EDIT_LIST");
/* Show feedback */
Qst_WriteQstFeedback (Question->Feedback,ClassFeedback[Question->Validity]);
Qst_WriteQstFeedback (Question->Feedback,
ClassFeedback[Question->Validity]);
/* Show answers */
Qst_WriteAnswersBank (Question,

View File

@ -2860,8 +2860,8 @@ static void Mch_ShowQuestionAndAnswersTch (const struct Mch_Match *Match)
/* Show media */
Med_ShowMedia (&Question.Media,
"TEST_MED_EDIT_LIST_CONT",
"TEST_MED_EDIT_LIST");
"Tst_MED_EDIT_LIST_CONT",
"Tst_MED_EDIT_LIST");
/***** Write answers? *****/
switch (Match->Status.Showing)
@ -2966,8 +2966,8 @@ static void Mch_WriteChoiceAnsViewMatch (const struct Mch_Match *Match,
HTM_Txt (Question->Answer.Options[Indexes[NumOpt]].Text);
HTM_LABEL_End ();
Med_ShowMedia (&Question->Answer.Options[Indexes[NumOpt]].Media,
"TEST_MED_SHOW_CONT",
"TEST_MED_SHOW");
"Tst_MED_SHOW_CONT",
"Tst_MED_SHOW");
/* Show result (number of users who answered? */
if (ShowResult)

View File

@ -1243,6 +1243,7 @@ static void Prj_ShowOneProject (struct Prj_Projects *Projects,
{
extern const char *The_ClassDat[The_NUM_THEMES];
extern const char *The_ClassDatLight[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_Project_files;
extern const char *Txt_Assigned_QUESTION;
extern const char *Txt_Yes;
@ -1290,7 +1291,8 @@ static void Prj_ShowOneProject (struct Prj_Projects *Projects,
switch (ProjectView)
{
case Prj_LIST_PROJECTS:
HTM_TD_Begin ("rowspan=\"3\" class=\"BIG_INDEX RT %s\"",
HTM_TD_Begin ("rowspan=\"3\" class=\"RT BIG_INDEX_%s %s\"",
The_Colors[Gbl.Prefs.Theme],
The_GetColorRows ());
HTM_Unsigned (NumIndex);
if (PrjIsFaulty)

View File

@ -518,22 +518,19 @@ void Qst_ListQuestionForEdition (struct Qst_Question *Question,
unsigned QstInd,bool QuestionExists,
const char *Anchor)
{
extern const char *The_ClassDatLight[The_NUM_THEMES];
extern const char *The_ClassDatSmall[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_Question_removed;
/***** Number of question and answer type (row[1]) *****/
HTM_TD_Begin ("class=\"RT %s\"",The_GetColorRows ());
Qst_WriteNumQst (QstInd,"BIG_INDEX");
if (QuestionExists)
Qst_WriteAnswerType (Question->Answer.Type,
The_ClassDatSmall[Gbl.Prefs.Theme]);
Qst_WriteAnswerType (Question->Answer.Type,"DAT_SMALL");
HTM_TD_End ();
/***** Write question code *****/
HTM_TD_Begin ("class=\"%s %s CT\"",
The_ClassDatSmall[Gbl.Prefs.Theme],
The_GetColorRows ());
HTM_TD_Begin ("class=\"CT DAT_SMALL_%s %s CT\"",
The_Colors[Gbl.Prefs.Theme],The_GetColorRows ());
HTM_TxtF ("%ld ",Question->QstCod);
HTM_TD_End ();
@ -549,23 +546,24 @@ void Qst_ListQuestionForEdition (struct Qst_Question *Question,
if (QuestionExists)
{
/* Write stem */
Qst_WriteQstStem (Question->Stem,"TEST_TXT",
Qst_WriteQstStem (Question->Stem,"Qst_TXT",
true); // Visible
/* Show media */
Med_ShowMedia (&Question->Media,
"TEST_MED_EDIT_LIST_CONT",
"TEST_MED_EDIT_LIST");
"Tst_MED_EDIT_LIST_CONT",
"Tst_MED_EDIT_LIST");
/* Show feedback */
Qst_WriteQstFeedback (Question->Feedback,"TEST_TXT_LIGHT");
Qst_WriteQstFeedback (Question->Feedback,"Qst_TXT_LIGHT");
/* Show answers */
Qst_WriteAnswersBank (Question,"TEST_TXT","TEST_TXT_LIGHT");
Qst_WriteAnswersBank (Question,"Qst_TXT","Qst_TXT_LIGHT");
}
else
{
HTM_SPAN_Begin ("class=\"%s\"",The_ClassDatLight[Gbl.Prefs.Theme]);
HTM_SPAN_Begin ("class=\"DAT_LIGHT_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Txt_Question_removed);
HTM_SPAN_End ();
}
@ -580,7 +578,9 @@ void Qst_ListQuestionForEdition (struct Qst_Question *Question,
void Qst_WriteNumQst (unsigned NumQst,const char *Class)
{
HTM_DIV_Begin ("class=\"%s\"",Class);
extern const char *The_Colors[The_NUM_THEMES];
HTM_DIV_Begin ("class=\"%s_%s\"",Class,The_Colors[Gbl.Prefs.Theme]);
HTM_Unsigned (NumQst);
HTM_DIV_End ();
}
@ -591,9 +591,10 @@ void Qst_WriteNumQst (unsigned NumQst,const char *Class)
void Qst_WriteAnswerType (Qst_AnswerType_t AnswerType,const char *Class)
{
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_TST_STR_ANSWER_TYPES[Qst_NUM_ANS_TYPES];
HTM_DIV_Begin ("class=\"%s\"",Class);
HTM_DIV_Begin ("class=\"%s_%s\"",Class,The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Txt_TST_STR_ANSWER_TYPES[AnswerType]);
HTM_DIV_End ();
}
@ -604,11 +605,12 @@ void Qst_WriteAnswerType (Qst_AnswerType_t AnswerType,const char *Class)
void Qst_WriteQstStem (const char *Stem,const char *ClassStem,bool Visible)
{
extern const char *The_Colors[The_NUM_THEMES];
unsigned long StemLength;
char *StemRigorousHTML;
/***** DIV begin *****/
HTM_DIV_Begin ("class=\"%s\"",ClassStem);
HTM_DIV_Begin ("class=\"%s_%s\"",ClassStem,The_Colors[Gbl.Prefs.Theme]);
/***** Write stem *****/
if (Stem && Visible)
@ -660,7 +662,7 @@ void Qst_PutFormToEditQstMedia (const struct Med_Media *Media,int NumMedia,
Med_SetParamNames (&ParamUploadMedia,NumMedia);
/***** Begin container *****/
HTM_DIV_Begin ("class=\"TEST_MED_EDIT_FORM\"");
HTM_DIV_Begin ("class=\"Tst_MED_EDIT_FORM\"");
/***** Choice 1: No media *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
@ -681,8 +683,8 @@ void Qst_PutFormToEditQstMedia (const struct Med_Media *Media,int NumMedia,
HTM_Txt (Txt_Current_image_video);
HTM_LABEL_End ();
Med_ShowMedia (Media,
"TEST_MED_EDIT_ONE_CONT",
"TEST_MED_EDIT_ONE");
"Tst_MED_EDIT_ONE_CONT",
"Tst_MED_EDIT_ONE");
/***** Choice 3: Change media *****/
UniqueId++;
@ -694,7 +696,7 @@ void Qst_PutFormToEditQstMedia (const struct Med_Media *Media,int NumMedia,
OptionsDisabled ? " disabled=\"disabled\"" : "");
HTM_TxtColonNBSP (Txt_Change_image_video);
HTM_LABEL_End ();
if (asprintf (&ClassInput,"TEST_MED_INPUT %s",The_ClassInput[Gbl.Prefs.Theme]) < 0)
if (asprintf (&ClassInput,"Tst_MED_INPUT %s",The_ClassInput[Gbl.Prefs.Theme]) < 0)
Err_NotEnoughMemoryExit ();
Med_PutMediaUploader (NumMedia,ClassInput);
free (ClassInput);
@ -705,7 +707,7 @@ void Qst_PutFormToEditQstMedia (const struct Med_Media *Media,int NumMedia,
else // No current image
{
/***** Attached media *****/
if (asprintf (&ClassInput,"TEST_MED_INPUT %s",The_ClassInput[Gbl.Prefs.Theme]) < 0)
if (asprintf (&ClassInput,"Tst_MED_INPUT %s",The_ClassInput[Gbl.Prefs.Theme]) < 0)
Err_NotEnoughMemoryExit ();
Med_PutMediaUploader (NumMedia,ClassInput);
free (ClassInput);
@ -718,6 +720,7 @@ void Qst_PutFormToEditQstMedia (const struct Med_Media *Media,int NumMedia,
void Qst_WriteQstFeedback (const char *Feedback,const char *ClassFeedback)
{
extern const char *The_Colors[The_NUM_THEMES];
unsigned long FeedbackLength;
char *FeedbackRigorousHTML;
@ -733,7 +736,8 @@ void Qst_WriteQstFeedback (const char *Feedback,const char *ClassFeedback)
FeedbackRigorousHTML,FeedbackLength,false);
/***** Write the feedback *****/
HTM_DIV_Begin ("class=\"%s\"",ClassFeedback);
HTM_DIV_Begin ("class=\"%s_%s\"",
ClassFeedback,The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (FeedbackRigorousHTML);
HTM_DIV_End ();
@ -967,7 +971,6 @@ void Qst_WriteQuestionListing (struct Qst_Questions *Questions,unsigned QstInd)
{
extern const char *The_ClassDatSmall[The_NUM_THEMES];
static unsigned UniqueId = 0;
char *Class;
char *Id;
/***** Get and show question data *****/
@ -992,11 +995,7 @@ void Qst_WriteQuestionListing (struct Qst_Questions *Questions,unsigned QstInd)
/* Number of question and answer type */
HTM_TD_Begin ("class=\"RT %s\"",The_GetColorRows ());
Qst_WriteNumQst (QstInd + 1,"BIG_INDEX");
if (asprintf (&Class,"%s",
The_ClassDatSmall[Gbl.Prefs.Theme]) < 0)
Err_NotEnoughMemoryExit ();
Qst_WriteAnswerType (Questions->Question.Answer.Type,Class);
free (Class);
Qst_WriteAnswerType (Questions->Question.Answer.Type,"DAT_SMALL");
HTM_TD_End ();
/* Question code */
@ -1044,17 +1043,17 @@ void Qst_WriteQuestionListing (struct Qst_Questions *Questions,unsigned QstInd)
/* Stem (row[3]) */
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
Qst_WriteQstStem (Questions->Question.Stem,"TEST_TXT",
Qst_WriteQstStem (Questions->Question.Stem,"Qst_TXT",
true); // Visible
/***** Get and show media (row[5]) *****/
Med_ShowMedia (&Questions->Question.Media,
"TEST_MED_EDIT_LIST_CONT",
"TEST_MED_EDIT_LIST");
"Tst_MED_EDIT_LIST_CONT",
"Tst_MED_EDIT_LIST");
/* Feedback (row[4]) and answers */
Qst_WriteQstFeedback (Questions->Question.Feedback,"TEST_TXT_LIGHT");
Qst_WriteAnswersBank (&Questions->Question,"TEST_TXT","TEST_TXT_LIGHT");
Qst_WriteQstFeedback (Questions->Question.Feedback,"Qst_TXT_LIGHT");
Qst_WriteAnswersBank (&Questions->Question,"Qst_TXT","Qst_TXT_LIGHT");
HTM_TD_End ();
/* Number of times this question has been answered */
@ -1355,19 +1354,19 @@ void Qst_WriteQuestionRowForSelection (unsigned QstInd,
/* Write stem */
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
Qst_WriteQstStem (Question->Stem,"TEST_TXT",
Qst_WriteQstStem (Question->Stem,"Qst_TXT",
true); // Visible
/***** Get and show media *****/
Med_ShowMedia (&Question->Media,
"TEST_MED_EDIT_LIST_CONT",
"TEST_MED_EDIT_LIST");
"Tst_MED_EDIT_LIST_CONT",
"Tst_MED_EDIT_LIST");
/* Write feedback */
Qst_WriteQstFeedback (Question->Feedback,"TEST_TXT_LIGHT");
Qst_WriteQstFeedback (Question->Feedback,"Qst_TXT_LIGHT");
/* Write answers */
Qst_WriteAnswersBank (Question,"TEST_TXT","TEST_TXT_LIGHT");
Qst_WriteAnswersBank (Question,"Qst_TXT","Qst_TXT_LIGHT");
HTM_TD_End ();
/***** End table row *****/
@ -1466,7 +1465,9 @@ void Qst_WriteIntAnsBank (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
{
HTM_SPAN_Begin ("class=\"%s\"",ClassTxt);
extern const char *The_Colors[The_NUM_THEMES];
HTM_SPAN_Begin ("class=\"%s_%s\"",ClassTxt,The_Colors[Gbl.Prefs.Theme]);
HTM_TxtF ("(%ld)",Question->Answer.Integer);
HTM_SPAN_End ();
}
@ -1479,7 +1480,9 @@ void Qst_WriteFltAnsBank (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
{
HTM_SPAN_Begin ("class=\"%s\"",ClassTxt);
extern const char *The_Colors[The_NUM_THEMES];
HTM_SPAN_Begin ("class=\"%s_%s\"",ClassTxt,The_Colors[Gbl.Prefs.Theme]);
HTM_Txt ("([");
HTM_Double (Question->Answer.FloatingPoint[0]);
HTM_Txt ("; ");
@ -1496,8 +1499,10 @@ void Qst_WriteTF_AnsBank (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
{
extern const char *The_Colors[The_NUM_THEMES];
/***** Write answer *****/
HTM_SPAN_Begin ("class=\"%s\"",ClassTxt);
HTM_SPAN_Begin ("class=\"%s_%s\"",ClassTxt,The_Colors[Gbl.Prefs.Theme]);
HTM_Txt ("(");
Qst_WriteAnsTF (Question->Answer.TF);
HTM_Txt (")");
@ -1512,6 +1517,7 @@ void Qst_WriteChoAnsBank (struct Qst_Question *Question,
const char *ClassTxt,
const char *ClassFeedback)
{
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_TST_Answer_given_by_the_teachers;
unsigned NumOpt;
@ -1536,22 +1542,25 @@ void Qst_WriteChoAnsBank (struct Qst_Question *Question,
HTM_TD_End ();
/* Write the number of option */
HTM_TD_Begin ("class=\"%s LT\"",ClassTxt);
HTM_TD_Begin ("class=\"LT %s_%s\"",
ClassTxt,The_Colors[Gbl.Prefs.Theme]);
HTM_TxtF ("%c)&nbsp;",'a' + (char) NumOpt);
HTM_TD_End ();
HTM_TD_Begin ("class=\"LT\"");
/* Write the text of the answer and the media */
HTM_DIV_Begin ("class=\"%s\"",ClassTxt);
HTM_DIV_Begin ("class=\"%s_%s\"",
ClassTxt,The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Question->Answer.Options[NumOpt].Text);
Med_ShowMedia (&Question->Answer.Options[NumOpt].Media,
"TEST_MED_EDIT_LIST_CONT",
"TEST_MED_EDIT_LIST");
"Tst_MED_EDIT_LIST_CONT",
"Tst_MED_EDIT_LIST");
HTM_DIV_End ();
/* Write the text of the feedback */
HTM_DIV_Begin ("class=\"%s\"",ClassFeedback);
HTM_DIV_Begin ("class=\"%s_%s\"",
ClassFeedback,The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Question->Answer.Options[NumOpt].Feedback);
HTM_DIV_End ();
@ -2154,7 +2163,7 @@ void Qst_PutFormEditOneQst (struct Qst_Question *Question)
HTM_TR_Begin (NULL);
/***** Left column: selectors *****/
HTM_TD_Begin ("class=\"TEST_EDI_ANS_LEFT_COL %s\"",
HTM_TD_Begin ("class=\"Tst_EDI_ANS_LEFT_COL %s\"",
The_GetColorRows ());
/* Radio selector for unique choice answers */
@ -2180,7 +2189,7 @@ void Qst_PutFormEditOneQst (struct Qst_Question *Question)
HTM_TD_End ();
/***** Center column: letter of the answer and expand / contract icon *****/
HTM_TD_Begin ("class=\"%s TEST_EDI_ANS_CENTER_COL %s\"",
HTM_TD_Begin ("class=\"%s Tst_EDI_ANS_CENTER_COL %s\"",
The_ClassFormInBox[Gbl.Prefs.Theme],
The_GetColorRows ());
HTM_TxtF ("%c)",'a' + (char) NumOpt);
@ -2214,7 +2223,7 @@ void Qst_PutFormEditOneQst (struct Qst_Question *Question)
HTM_TD_End ();
/***** Right column: content of the answer *****/
HTM_TD_Begin ("class=\"TEST_EDI_ANS_RIGHT_COL %s\"",
HTM_TD_Begin ("class=\"Tst_EDI_ANS_RIGHT_COL %s\"",
The_GetColorRows ());
HTM_DIV_Begin ("id=\"ans_%u\"%s",
NumOpt,

View File

@ -489,7 +489,7 @@ static void QstImp_ImportQuestionsFromXMLBuffer (const char *XMLBuffer)
Hlp_ASSESSMENT_Tests,Box_NOT_CLOSABLE);
/***** Print XML tree *****/
HTM_DIV_Begin ("class=\"TEST_FILE_CONTENT\"");
HTM_DIV_Begin ("class=\"Tst_FILE_CONTENT\"");
HTM_TEXTAREA_Begin ("title=\"%s\" cols=\"60\" rows=\"5\""
" spellcheck=\"false\" readonly",
Txt_XML_file_content);
@ -856,6 +856,7 @@ static void QstImp_WriteRowImportedQst (struct XMLElement *StemElem,
{
extern const char *The_ClassDatSmall[The_NUM_THEMES];
extern const char *The_ClassDatSmallLight[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_Existing_question;
extern const char *Txt_New_question;
extern const char *Txt_no_tags;
@ -875,8 +876,8 @@ static void QstImp_WriteRowImportedQst (struct XMLElement *StemElem,
size_t AnswerFeedbackLength;
const char *ClassData = QuestionExists ? The_ClassDatSmallLight[Gbl.Prefs.Theme] :
The_ClassDatSmall[Gbl.Prefs.Theme];
const char *ClassStem = QuestionExists ? "TEST_TXT_LIGHT" :
"TEST_TXT";
const char *ClassStem = QuestionExists ? "Qst_TXT_LIGHT" :
"Qst_TXT";
NumQst++;
@ -954,7 +955,7 @@ static void QstImp_WriteRowImportedQst (struct XMLElement *StemElem,
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
Qst_WriteQstStem (Stem,ClassStem,
true); // Visible
Qst_WriteQstFeedback (Feedback,"TEST_TXT_LIGHT");
Qst_WriteQstFeedback (Feedback,"Qst_TXT_LIGHT");
switch (Question->Answer.Type)
{
case Qst_ANS_INT:
@ -1032,13 +1033,15 @@ static void QstImp_WriteRowImportedQst (struct XMLElement *StemElem,
/* Write the text and the feedback of the answer */
HTM_TD_Begin ("class=\"LT\"");
HTM_DIV_Begin ("class=\"%s\"",ClassStem);
HTM_DIV_Begin ("class=\"%s_%s\"",
ClassStem,The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (AnswerText);
HTM_DIV_End ();
if (AnswerFeedbackLength)
{
HTM_DIV_Begin ("class=\"TEST_TXT_LIGHT\"");
HTM_DIV_Begin ("class=\"Qst_TXT_LIGHT_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (AnswerFeedback);
HTM_DIV_End ();
}

View File

@ -519,7 +519,7 @@ void Tag_GetAndWriteTagsQst (long QstCod)
if ((NumTags = Tag_DB_GetTagsQst (&mysql_res,QstCod)))
{
/***** Write the tags *****/
HTM_UL_Begin ("class=\"TEST_TAG_LIST %s\"",
HTM_UL_Begin ("class=\"Tst_TAG_LIST %s\"",
The_ClassDatSmall[Gbl.Prefs.Theme]);
for (NumTag = 0;
NumTag < NumTags;

View File

@ -304,6 +304,7 @@ void Tst_AssessTest (void)
{
extern const char *Hlp_ASSESSMENT_Tests;
extern const char *The_ClassDatStrong[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_Result;
extern const char *Txt_Test_No_X_that_you_make_in_this_course;
extern const char *Txt_Score;
@ -361,7 +362,8 @@ void Tst_AssessTest (void)
/***** Header *****/
if (Gbl.Usrs.Me.IBelongToCurrentCrs)
{
HTM_DIV_Begin ("class=\"TEST_SUBTITLE\"");
HTM_DIV_Begin ("class=\"Tst_SUBTITLE DAT_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtF (Txt_Test_No_X_that_you_make_in_this_course,NumTst);
HTM_DIV_End ();
}

View File

@ -283,16 +283,13 @@ static void TstPrn_WriteQstAndAnsToFill (struct TstPrn_PrintedQuestion *PrintedQ
unsigned QstInd,
struct Qst_Question *Question)
{
extern const char *The_ClassDatSmall[The_NUM_THEMES];
/***** Begin row *****/
HTM_TR_Begin (NULL);
/***** Number of question and answer type *****/
HTM_TD_Begin ("class=\"RT %s\"",The_GetColorRows ());
Qst_WriteNumQst (QstInd + 1,"BIG_INDEX");
Qst_WriteAnswerType (Question->Answer.Type,
The_ClassDatSmall[Gbl.Prefs.Theme]);
Qst_WriteAnswerType (Question->Answer.Type,"DAT_SMALL");
HTM_TD_End ();
/***** Stem, media and answers *****/
@ -302,12 +299,12 @@ static void TstPrn_WriteQstAndAnsToFill (struct TstPrn_PrintedQuestion *PrintedQ
Qst_WriteParamQstCod (QstInd,Question->QstCod);
/* Stem */
Qst_WriteQstStem (Question->Stem,"TEST_TXT",true);
Qst_WriteQstStem (Question->Stem,"Qst_TXT",true);
/* Media */
Med_ShowMedia (&Question->Media,
"TEST_MED_SHOW_CONT",
"TEST_MED_SHOW");
"Tst_MED_SHOW_CONT",
"Tst_MED_SHOW");
/* Answers */
TstPrn_WriteAnswersToFill (PrintedQuestion,QstInd,Question);
@ -412,6 +409,7 @@ static void TstPrn_WriteChoAnsToFill (const struct TstPrn_PrintedQuestion *Print
unsigned QstInd,
struct Qst_Question *Question)
{
extern const char *The_Colors[The_NUM_THEMES];
unsigned NumOpt;
unsigned Indexes[Qst_MAX_OPTIONS_PER_QUESTION]; // Indexes of all answers of this question
bool UsrAnswers[Qst_MAX_OPTIONS_PER_QUESTION];
@ -464,19 +462,21 @@ static void TstPrn_WriteChoAnsToFill (const struct TstPrn_PrintedQuestion *Print
HTM_TD_End ();
HTM_TD_Begin ("class=\"LT\"");
HTM_LABEL_Begin ("for=\"Ans%010u_%u\" class=\"TEST_TXT\"",QstInd,NumOpt);
HTM_LABEL_Begin ("for=\"Ans%010u_%u\" class=\"Qst_TXT_%s\"",
QstInd,NumOpt,The_Colors[Gbl.Prefs.Theme]);
HTM_TxtF ("%c)&nbsp;",'a' + (char) NumOpt);
HTM_LABEL_End ();
HTM_TD_End ();
/***** Write the option text *****/
HTM_TD_Begin ("class=\"LT\"");
HTM_LABEL_Begin ("for=\"Ans%010u_%u\" class=\"TEST_TXT\"",QstInd,NumOpt);
HTM_LABEL_Begin ("for=\"Ans%010u_%u\" class=\"Qst_TXT_%s\"",
QstInd,NumOpt,The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Question->Answer.Options[Indexes[NumOpt]].Text);
HTM_LABEL_End ();
Med_ShowMedia (&Question->Answer.Options[Indexes[NumOpt]].Media,
"TEST_MED_SHOW_CONT",
"TEST_MED_SHOW");
"Tst_MED_SHOW_CONT",
"Tst_MED_SHOW");
HTM_TD_End ();
HTM_TR_End ();
@ -595,7 +595,7 @@ static void TstPrn_WriteQstAndAnsExam (struct UsrData *UsrDat,
bool QuestionExists,
unsigned Visibility)
{
extern const char *The_ClassDatSmall[The_NUM_THEMES];
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_Score;
extern const char *Txt_Question_removed;
extern const char *Txt_Question_modified;
@ -644,8 +644,7 @@ static void TstPrn_WriteQstAndAnsExam (struct UsrData *UsrDat,
HTM_TD_Begin ("class=\"RT %s\"",The_GetColorRows ());
Qst_WriteNumQst (QstInd + 1,"BIG_INDEX");
if (QuestionUneditedAfterExam)
Qst_WriteAnswerType (Question->Answer.Type,
The_ClassDatSmall[Gbl.Prefs.Theme]);
Qst_WriteAnswerType (Question->Answer.Type,"DAT_SMALL");
HTM_TD_End ();
/***** Stem, media and answers *****/
@ -655,18 +654,19 @@ static void TstPrn_WriteQstAndAnsExam (struct UsrData *UsrDat,
if (QuestionUneditedAfterExam)
{
/* Stem */
Qst_WriteQstStem (Question->Stem,"TEST_TXT",ICanView[TstVis_VISIBLE_QST_ANS_TXT]);
Qst_WriteQstStem (Question->Stem,"Qst_TXT",
ICanView[TstVis_VISIBLE_QST_ANS_TXT]);
/* Media */
if (ICanView[TstVis_VISIBLE_QST_ANS_TXT])
Med_ShowMedia (&Question->Media,
"TEST_MED_SHOW_CONT",
"TEST_MED_SHOW");
"Tst_MED_SHOW_CONT",
"Tst_MED_SHOW");
/* Answers */
TstPrn_ComputeAnswerScore (&PrintedQuestions[QstInd],Question);
TstPrn_WriteAnswersExam (UsrDat,&PrintedQuestions[QstInd],Question,
ICanView,"TEST_TXT","TEST_TXT_LIGHT");
ICanView,"Qst_TXT","Qst_TXT_LIGHT");
}
else
Ale_ShowAlert (Ale_WARNING,Txt_Question_modified);
@ -677,13 +677,15 @@ static void TstPrn_WriteQstAndAnsExam (struct UsrData *UsrDat,
/* Write score retrieved from database */
if (ICanView[TstVis_VISIBLE_EACH_QST_SCORE])
{
HTM_DIV_Begin ("class=\"%s LM\"",The_ClassDatSmall[Gbl.Prefs.Theme]);
HTM_DIV_Begin ("class=\"LM DAT_SMALL_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtColonNBSP (Txt_Score);
HTM_SPAN_Begin ("class=\"%s\"",
HTM_SPAN_Begin ("class=\"%s_%s\"",
PrintedQuestions[QstInd].StrAnswers[0] ?
(PrintedQuestions[QstInd].Score > 0 ? "ANS_OK" : // Correct/semicorrect
"ANS_BAD") : // Wrong
"ANS_0"); // Blank answer
(PrintedQuestions[QstInd].Score > 0 ? "Qst_ANS_OK" : // Correct
"Qst_ANS_BAD") : // Wrong
"Qst_ANS_0", // Blank answer
The_Colors[Gbl.Prefs.Theme]);
HTM_Double2Decimals (PrintedQuestions[QstInd].Score);
HTM_SPAN_End ();
HTM_DIV_End ();
@ -692,7 +694,7 @@ static void TstPrn_WriteQstAndAnsExam (struct UsrData *UsrDat,
/* Question feedback */
if (QuestionUneditedAfterExam)
if (ICanView[TstVis_VISIBLE_FEEDBACK_TXT])
Qst_WriteQstFeedback (Question->Feedback,"TEST_TXT_LIGHT");
Qst_WriteQstFeedback (Question->Feedback,"Qst_TXT_LIGHT");
HTM_TD_End ();
@ -1197,6 +1199,7 @@ static void TstPrn_WriteIntAnsPrint (struct UsrData *UsrDat,
__attribute__((unused)) const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
{
extern const char *The_Colors[The_NUM_THEMES];
long IntAnswerUsr;
/***** Check if number of rows is correct *****/
@ -1217,17 +1220,19 @@ static void TstPrn_WriteIntAnsPrint (struct UsrData *UsrDat,
{
if (sscanf (PrintedQuestion->StrAnswers,"%ld",&IntAnswerUsr) == 1)
{
HTM_TD_Begin ("class=\"%s CM\"",
HTM_TD_Begin ("class=\"CM %s_%s\"",
ICanView[TstVis_VISIBLE_CORRECT_ANSWER] ?
(IntAnswerUsr == Question->Answer.Integer ? "ANS_OK" :
"ANS_BAD") :
"ANS_0");
(IntAnswerUsr == Question->Answer.Integer ? "Qst_ANS_OK" : // Correct
"Qst_ANS_BAD") : // Wrong
"Qst_ANS_0", // Blank answer
The_Colors[Gbl.Prefs.Theme]);
HTM_Long (IntAnswerUsr);
HTM_TD_End ();
}
else
{
HTM_TD_Begin ("class=\"ANS_0 CM\"");
HTM_TD_Begin ("class=\"CM Qst_ANS_0_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Txt ("?");
HTM_TD_End ();
}
@ -1236,7 +1241,7 @@ static void TstPrn_WriteIntAnsPrint (struct UsrData *UsrDat,
HTM_TD_Empty (1);
/***** Write the correct answer *****/
HTM_TD_Begin ("class=\"ANS_0 CM\"");
HTM_TD_Begin ("class=\"CM Qst_ANS_0_%s\"",The_Colors[Gbl.Prefs.Theme]);
if (ICanView[TstVis_VISIBLE_CORRECT_ANSWER])
HTM_Long (Question->Answer.Integer);
else
@ -1259,6 +1264,7 @@ static void TstPrn_WriteFltAnsPrint (struct UsrData *UsrDat,
__attribute__((unused)) const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
{
extern const char *The_Colors[The_NUM_THEMES];
double FloatAnsUsr = 0.0;
/***** Check if number of rows is correct *****/
@ -1280,12 +1286,13 @@ static void TstPrn_WriteFltAnsPrint (struct UsrData *UsrDat,
{
FloatAnsUsr = Str_GetDoubleFromStr (PrintedQuestion->StrAnswers);
// A bad formatted floating point answer will interpreted as 0.0
HTM_TD_Begin ("class=\"%s CM\"",
HTM_TD_Begin ("class=\"CM %s_%s\"",
ICanView[TstVis_VISIBLE_CORRECT_ANSWER] ?
((FloatAnsUsr >= Question->Answer.FloatingPoint[0] &&
FloatAnsUsr <= Question->Answer.FloatingPoint[1]) ? "ANS_OK" :
"ANS_BAD") :
"ANS_0");
FloatAnsUsr <= Question->Answer.FloatingPoint[1]) ? "Qst_ANS_OK" : // Correct
"Qst_ANS_BAD") : // Wrong
"Qst_ANS_0", // Blank answer
The_Colors[Gbl.Prefs.Theme]);
HTM_Double (FloatAnsUsr);
HTM_TD_End ();
}
@ -1293,7 +1300,7 @@ static void TstPrn_WriteFltAnsPrint (struct UsrData *UsrDat,
HTM_TD_Empty (1);
/***** Write the correct answer *****/
HTM_TD_Begin ("class=\"ANS_0 CM\"");
HTM_TD_Begin ("class=\"CM Qst_ANS_0_%s\"",The_Colors[Gbl.Prefs.Theme]);
if (ICanView[TstVis_VISIBLE_CORRECT_ANSWER])
{
HTM_Txt ("[");
@ -1322,6 +1329,7 @@ static void TstPrn_WriteTF_AnsPrint (struct UsrData *UsrDat,
__attribute__((unused)) const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
{
extern const char *The_Colors[The_NUM_THEMES];
char AnsTFUsr;
/***** Check if number of rows is correct *****/
@ -1341,16 +1349,17 @@ static void TstPrn_WriteTF_AnsPrint (struct UsrData *UsrDat,
HTM_TR_Begin (NULL);
/***** Write the user answer *****/
HTM_TD_Begin ("class=\"%s CM\"",
HTM_TD_Begin ("class=\"CM %s_%s\"",
ICanView[TstVis_VISIBLE_CORRECT_ANSWER] ?
(AnsTFUsr == Question->Answer.TF ? "ANS_OK" :
"ANS_BAD") :
"ANS_0");
(AnsTFUsr == Question->Answer.TF ? "Qst_ANS_OK" : // Correct
"Qst_ANS_BAD") : // Wrong
"Qst_ANS_0", // Blank answer
The_Colors[Gbl.Prefs.Theme]);
Qst_WriteAnsTF (AnsTFUsr);
HTM_TD_End ();
/***** Write the correct answer *****/
HTM_TD_Begin ("class=\"ANS_0 CM\"");
HTM_TD_Begin ("class=\"CM Qst_ANS_0_%s\"",The_Colors[Gbl.Prefs.Theme]);
if (ICanView[TstVis_VISIBLE_CORRECT_ANSWER])
Qst_WriteAnsTF (Question->Answer.TF);
else
@ -1373,6 +1382,7 @@ static void TstPrn_WriteChoAnsPrint (struct UsrData *UsrDat,
const char *ClassTxt,
const char *ClassFeedback)
{
extern const char *The_Colors[The_NUM_THEMES];
extern const char *Txt_TST_Answer_given_by_the_user;
extern const char *Txt_TST_Answer_given_by_the_teachers;
unsigned NumOpt;
@ -1419,23 +1429,24 @@ static void TstPrn_WriteChoAnsPrint (struct UsrData *UsrDat,
{
if (Question->Answer.Options[Indexes[NumOpt]].Correct)
{
Ans.Class = "ANS_OK";
Ans.Class = "Qst_ANS_OK"; // Correct
Ans.Str = "&check;";
}
else
{
Ans.Class = "ANS_BAD";
Ans.Class = "Qst_ANS_BAD"; // Wrong
Ans.Str = "&cross;";
}
}
else
{
Ans.Class = "ANS_0";
Ans.Class = "Qst_ANS_0"; // Blank answer
Ans.Str = "&bull;";
}
HTM_TD_Begin ("class=\"%s CT\" title=\"%s\"",
Ans.Class,Txt_TST_Answer_given_by_the_user);
HTM_TD_Begin ("class=\"CT %s_%s\" title=\"%s\"",
Ans.Class,The_Colors[Gbl.Prefs.Theme],
Txt_TST_Answer_given_by_the_user);
HTM_Txt (Ans.Str);
HTM_TD_End ();
}
@ -1447,7 +1458,8 @@ static void TstPrn_WriteChoAnsPrint (struct UsrData *UsrDat,
{
if (Question->Answer.Options[Indexes[NumOpt]].Correct)
{
HTM_TD_Begin ("class=\"ANS_0 CT\" title=\"%s\"",
HTM_TD_Begin ("class=\"CT Qst_ANS_0_%s\" title=\"%s\"",
The_Colors[Gbl.Prefs.Theme],
Txt_TST_Answer_given_by_the_teachers);
HTM_Txt ("&bull;");
HTM_TD_End ();
@ -1457,26 +1469,29 @@ static void TstPrn_WriteChoAnsPrint (struct UsrData *UsrDat,
}
else
{
HTM_TD_Begin ("class=\"ANS_0 CT\"");
HTM_TD_Begin ("class=\"CT Qst_ANS_0_%s\"",
The_Colors[Gbl.Prefs.Theme]);
Ico_PutIconNotVisible ();
HTM_TD_End ();
}
/* Answer letter (a, b, c,...) */
HTM_TD_Begin ("class=\"%s LT\"",ClassTxt);
HTM_TD_Begin ("class=\"LT %s_%s\"",
ClassTxt,The_Colors[Gbl.Prefs.Theme]);
HTM_TxtF ("%c)&nbsp;",'a' + (char) NumOpt);
HTM_TD_End ();
/* Answer text and feedback */
HTM_TD_Begin ("class=\"LT\"");
HTM_DIV_Begin ("class=\"%s\"",ClassTxt);
HTM_DIV_Begin ("class=\"%s_%s\"",
ClassTxt,The_Colors[Gbl.Prefs.Theme]);
if (ICanView[TstVis_VISIBLE_QST_ANS_TXT])
{
HTM_Txt (Question->Answer.Options[Indexes[NumOpt]].Text);
Med_ShowMedia (&Question->Answer.Options[Indexes[NumOpt]].Media,
"TEST_MED_SHOW_CONT",
"TEST_MED_SHOW");
"Tst_MED_SHOW_CONT",
"Tst_MED_SHOW");
}
else
Ico_PutIconNotVisible ();
@ -1486,7 +1501,8 @@ static void TstPrn_WriteChoAnsPrint (struct UsrData *UsrDat,
if (Question->Answer.Options[Indexes[NumOpt]].Feedback)
if (Question->Answer.Options[Indexes[NumOpt]].Feedback[0])
{
HTM_DIV_Begin ("class=\"%s\"",ClassFeedback);
HTM_DIV_Begin ("class=\"%s_%s\"",
ClassFeedback,The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Question->Answer.Options[Indexes[NumOpt]].Feedback);
HTM_DIV_End ();
}
@ -1511,6 +1527,7 @@ static void TstPrn_WriteTxtAnsPrint (struct UsrData *UsrDat,
__attribute__((unused)) const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
{
extern const char *The_Colors[The_NUM_THEMES];
unsigned NumOpt;
char TextAnsUsr[Qst_MAX_BYTES_ANSWERS_ONE_QST + 1];
char TextAnsOK[Qst_MAX_BYTES_ANSWERS_ONE_QST + 1];
@ -1560,10 +1577,11 @@ static void TstPrn_WriteTxtAnsPrint (struct UsrData *UsrDat,
break;
}
}
HTM_TD_Begin ("class=\"%s CT\"",
ICanView[TstVis_VISIBLE_CORRECT_ANSWER] ? (Correct ? "ANS_OK" :
"ANS_BAD") :
"ANS_0");
HTM_TD_Begin ("class=\"CT %s_%s\"",
ICanView[TstVis_VISIBLE_CORRECT_ANSWER] ? (Correct ? "Qst_ANS_OK" : // Correct
"Qst_ANS_BAD") : // Wrong
"Qst_ANS_0", // Blank answer
The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (PrintedQuestion->StrAnswers);
HTM_TD_End ();
}
@ -1583,14 +1601,16 @@ static void TstPrn_WriteTxtAnsPrint (struct UsrData *UsrDat,
HTM_TR_Begin (NULL);
/* Answer letter (a, b, c,...) */
HTM_TD_Begin ("class=\"ANS_0 LT\"");
HTM_TD_Begin ("class=\"LT Qst_ANS_0_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_TxtF ("%c)&nbsp;",'a' + (char) NumOpt);
HTM_TD_End ();
/* Answer text and feedback */
HTM_TD_Begin ("class=\"LT\"");
HTM_DIV_Begin ("class=\"ANS_0\"");
HTM_DIV_Begin ("class=\"Qst_ANS_0_%s\"",
The_Colors[Gbl.Prefs.Theme]);
HTM_Txt (Question->Answer.Options[NumOpt].Text);
HTM_DIV_End ();
@ -1598,7 +1618,7 @@ static void TstPrn_WriteTxtAnsPrint (struct UsrData *UsrDat,
if (Question->Answer.Options[NumOpt].Feedback)
if (Question->Answer.Options[NumOpt].Feedback[0])
{
HTM_DIV_Begin ("class=\"TEST_TXT_LIGHT\"");
HTM_DIV_Begin ("class=\"Qst_TXT_LIGHT\"");
HTM_Txt (Question->Answer.Options[NumOpt].Feedback);
HTM_DIV_End ();
}
@ -1613,7 +1633,8 @@ static void TstPrn_WriteTxtAnsPrint (struct UsrData *UsrDat,
}
else
{
HTM_TD_Begin ("class=\"ANS_0 CT\"");
HTM_TD_Begin ("class=\"CT Qst_ANS_0_%s\"",
The_Colors[Gbl.Prefs.Theme]);
Ico_PutIconNotVisible ();
HTM_TD_End ();
}