");
/***** Send button *****/
Lay_PutConfirmButton (Txt_Generate_exam);
@@ -363,6 +366,7 @@ void Tst_ShowNewTestExam (void)
{
extern const char *The_ClassForm[The_NUM_THEMES];
extern const char *Txt_No_questions_found_matching_your_search_criteria;
+ extern const char *Txt_Test;
extern const char *Txt_Allow_teachers_to_consult_this_exam;
extern const char *Txt_Done_assess_exam;
MYSQL_RES *mysql_res;
@@ -390,24 +394,27 @@ void Tst_ShowNewTestExam (void)
if (Gbl.Usrs.Me.IBelongToCurrentCrs)
Tst_UpdateMyNumAccessTst (NumAccessesTst);
- /***** List the questions *****/
- /* Start form */
+ /***** Start frame *****/
+ Lay_StartRoundFrame (NULL,Txt_Test,NULL);
+ Lay_WriteHeaderClassPhoto (false,false,
+ Gbl.CurrentIns.Ins.InsCod,
+ Gbl.CurrentDeg.Deg.DegCod,
+ Gbl.CurrentCrs.Crs.CrsCod);
+
+ /***** Start form *****/
Act_FormStart (ActAssTst);
Gbl.Test.NumQsts = (unsigned) NumRows;
Par_PutHiddenParamUnsigned ("NumTst",NumAccessesTst);
Par_PutHiddenParamUnsigned ("NumQst",Gbl.Test.NumQsts);
- /* Write test heading */
- Tst_WriteTestHead (NumAccessesTst);
-
- /* Write the questions */
+ /***** List the questions *****/
+ fprintf (Gbl.F.Out,"
");
- /* End of table */
- Tst_WriteTestFoot ();
-
- /* Exam will be saved? */
- fprintf (Gbl.F.Out,"
"
+ /***** Exam will be saved? *****/
+ fprintf (Gbl.F.Out,"
"
"
",
Txt_Allow_teachers_to_consult_this_exam);
- /* End form */
+ /***** End form *****/
Lay_PutConfirmButton (Txt_Done_assess_exam);
Act_FormEnd ();
+ /***** End frame *****/
+ Lay_EndRoundFrame ();
+
/***** Set test status *****/
Tst_SetTstStatus (NumAccessesTst,Tst_STATUS_SHOWN_BUT_NOT_ASSESSED);
@@ -445,6 +455,8 @@ void Tst_ShowNewTestExam (void)
void Tst_AssessTestExam (void)
{
+ extern const char *Txt_Test_result;
+ extern const char *Txt_Test_No_X_that_you_make_in_this_course;
extern const char *Txt_The_test_X_has_already_been_assessed_previously;
extern const char *Txt_There_was_an_error_in_assessing_the_test_X;
unsigned NumTst;
@@ -477,18 +489,32 @@ void Tst_AssessTestExam (void)
/***** Create new test exam in database to store the result *****/
TstCod = Tst_CreateTestExamInDB ();
- /***** Write head of test *****/
- Tst_WriteTestHead (NumTst);
+ /***** Start frame *****/
+ Lay_StartRoundFrame (NULL,Txt_Test_result,NULL);
+ Lay_WriteHeaderClassPhoto (false,false,
+ Gbl.CurrentIns.Ins.InsCod,
+ Gbl.CurrentDeg.Deg.DegCod,
+ Gbl.CurrentCrs.Crs.CrsCod);
+
+ /***** Header *****/
+ if (Gbl.Usrs.Me.IBelongToCurrentCrs)
+ {
+ fprintf (Gbl.F.Out,"
");
+ fprintf (Gbl.F.Out,Txt_Test_No_X_that_you_make_in_this_course,NumTst);
+ fprintf (Gbl.F.Out,"
");
+ }
/***** Write answers and solutions *****/
+ fprintf (Gbl.F.Out,"
");
Tst_ShowTstResultAfterAssess (TstCod,&NumQstsNotBlank,&TotalScore);
+ fprintf (Gbl.F.Out,"
");
/***** Write total mark of test *****/
if (Gbl.Test.Config.FeedbackType != Tst_FEEDBACK_NOTHING)
Tst_ShowTstTotalMark (TotalScore);
- /***** End of table *****/
- Tst_WriteTestFoot ();
+ /***** End frame *****/
+ Lay_EndRoundFrame ();
/***** Store test result in database *****/
Tst_StoreScoreOfTestExamInDB (TstCod,
@@ -552,11 +578,10 @@ static void Tst_ShowTstTotalMark (double TotalScore)
double TotalScoreOverSCORE_MAX = TotalScore * Tst_SCORE_MAX / (double) Gbl.Test.NumQsts;
/***** Write total mark ****/
- fprintf (Gbl.F.Out,"
"
- ""
+ fprintf (Gbl.F.Out,""
"%s: %.2lf (%.2lf %s %u) "
- "
"
- " ",
+ "
",
Txt_Score,
(TotalScoreOverSCORE_MAX >= (double) TotalScoreOverSCORE_MAX / 2.0) ? "ANS_OK" :
"ANS_BAD",
@@ -733,47 +758,6 @@ static unsigned Tst_GetNumAccessesTst (void)
return NumAccessesTst;
}
-/*****************************************************************************/
-/***************** Write the head of the table with the test *****************/
-/*****************************************************************************/
-
-static void Tst_WriteTestHead (unsigned NumTst)
- {
- extern const char *Txt_Test;
- extern const char *Txt_Test_result;
- extern const char *Txt_Test_No_X_that_you_make_in_this_course;
-
- /***** Start frame *****/
- Lay_StartRoundFrame (NULL,Gbl.Action.Act == ActSeeTst ? Txt_Test :
- Txt_Test_result,NULL);
- Lay_WriteHeaderClassPhoto (false,false,
- Gbl.CurrentIns.Ins.InsCod,
- Gbl.CurrentDeg.Deg.DegCod,
- Gbl.CurrentCrs.Crs.CrsCod);
-
- /***** Header *****/
- if (Gbl.Action.Act == ActAssTst &&
- Gbl.Usrs.Me.IBelongToCurrentCrs)
- {
- fprintf (Gbl.F.Out,"
");
- fprintf (Gbl.F.Out,Txt_Test_No_X_that_you_make_in_this_course,NumTst);
- fprintf (Gbl.F.Out,"
");
- }
-
- /***** Start table *****/
- fprintf (Gbl.F.Out,"
");
- }
-
-/*****************************************************************************/
-/******************* Write the foot of the table with the test ***************/
-/*****************************************************************************/
-
-static void Tst_WriteTestFoot (void)
- {
- fprintf (Gbl.F.Out,"
");
- Lay_EndRoundFrame ();
- }
-
/*****************************************************************************/
/*************************** Write the test questions ************************/
/*****************************************************************************/
@@ -1124,6 +1108,7 @@ void Tst_SetIniEndDates (void)
void Tst_ShowFormAskEditTsts (void)
{
extern const char *Txt_No_test_questions_in_X;
+ extern const char *Txt_Questions;
extern const char *Txt_Show_questions;
MYSQL_RES *mysql_res;
unsigned long NumRows;
@@ -1144,27 +1129,30 @@ void Tst_ShowFormAskEditTsts (void)
}
else
{
+ /***** Start frame *****/
+ Lay_StartRoundFrame (NULL,Txt_Questions,NULL);
+
Act_FormStart (ActLstTstQst);
Par_PutHiddenParamUnsigned ("Order",(unsigned) Tst_ORDER_STEM);
- fprintf (Gbl.F.Out,"
");
+ fprintf (Gbl.F.Out,"
");
/***** Selection of tags *****/
- Tst_ShowFormSelTags (NumRows,mysql_res,false);
+ Tst_ShowFormSelTags (NumRows,mysql_res,false,2);
/***** Selection of types of answers *****/
- Tst_ShowFormAnswerTypes ();
+ Tst_ShowFormAnswerTypes (2);
/***** Starting and ending dates in the search *****/
- fprintf (Gbl.F.Out,"");
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday ();
- fprintf (Gbl.F.Out,"
"
- "");
+ fprintf (Gbl.F.Out,"
");
/***** Send button *****/
Lay_PutConfirmButton (Txt_Show_questions);
Act_FormEnd ();
+
+ /***** End frame *****/
+ Lay_EndRoundFrame ();
}
/* Free structure that stores the query result */
@@ -1404,7 +1392,8 @@ static unsigned long Tst_GetEnabledTagsFromThisCrs (MYSQL_RES **mysql_res)
/********************* Show a form to select test tags ***********************/
/*****************************************************************************/
-static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res,bool ShowOnlyEnabledTags)
+static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res,
+ bool ShowOnlyEnabledTags,unsigned NumCols)
{
extern const char *The_ClassForm[The_NUM_THEMES];
extern const char *Txt_Tags;
@@ -1417,11 +1406,22 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res,bool
const char *Ptr;
char TagText[Tst_MAX_BYTES_TAG+1];
- /***** Start table *****/
- Lay_StartRoundFrameTable (NULL,0,Txt_Tags);
+ /***** Label *****/
+ fprintf (Gbl.F.Out,"
"
+ ""
+ ""
+ "%s:"
+ " "
+ " ",
+ The_ClassForm[Gbl.Prefs.Theme],Txt_Tags);
/***** Select all tags *****/
- fprintf (Gbl.F.Out," ");
+ fprintf (Gbl.F.Out," 1)
+ fprintf (Gbl.F.Out," colspan=\"%u\"",NumCols);
+ fprintf (Gbl.F.Out," class=\"LEFT_TOP\">"
+ ""
+ "");
if (!ShowOnlyEnabledTags)
fprintf (Gbl.F.Out," ");
fprintf (Gbl.F.Out,""
@@ -1479,8 +1479,9 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res,bool
row[1]);
}
- /***** End table *****/
- Lay_EndRoundFrameTable ();
+ fprintf (Gbl.F.Out,"
"
+ " "
+ " ");
}
/*****************************************************************************/
@@ -2017,7 +2018,7 @@ static void Tst_CheckAndCorrectNumbersQst (void)
/***************** Show form for select the types of answers *****************/
/*****************************************************************************/
-static void Tst_ShowFormAnswerTypes (void)
+static void Tst_ShowFormAnswerTypes (unsigned NumCols)
{
extern const char *The_ClassForm[The_NUM_THEMES];
extern const char *Txt_Types_of_answers;
@@ -2027,11 +2028,22 @@ static void Tst_ShowFormAnswerTypes (void)
char UnsignedStr[10+1];
const char *Ptr;
- /***** Table start *****/
- Lay_StartRoundFrameTable (NULL,0,Txt_Types_of_answers);
+ /***** Label *****/
+ fprintf (Gbl.F.Out,"
"
+ ""
+ ""
+ "%s:"
+ " "
+ " ",
+ The_ClassForm[Gbl.Prefs.Theme],Txt_Types_of_answers);
/***** Select all types of answers *****/
- fprintf (Gbl.F.Out," "
+ fprintf (Gbl.F.Out," 1)
+ fprintf (Gbl.F.Out," colspan=\"%u\"",NumCols);
+ fprintf (Gbl.F.Out," class=\"LEFT_TOP\">"
+ ""
+ ""
""
" "
+ " "
+ " ");
}
/*****************************************************************************/
@@ -6525,6 +6538,7 @@ static long Tst_GetParamTstCod (void)
void Tst_ShowOneTestExam (void)
{
+ extern const char *Txt_Test_result;
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
extern const char *Txt_Date;
extern const char *Txt_Today;
@@ -6573,8 +6587,15 @@ void Tst_ShowOneTestExam (void)
/***** Get questions and user's answers of the test exam from database *****/
Tst_GetExamQuestionsFromDB (TstCod);
- /***** Write head of test *****/
- Tst_WriteTestHead (0);
+ /***** Start frame *****/
+ Lay_StartRoundFrame (NULL,Txt_Test_result,NULL);
+ Lay_WriteHeaderClassPhoto (false,false,
+ Gbl.CurrentIns.Ins.InsCod,
+ Gbl.CurrentDeg.Deg.DegCod,
+ Gbl.CurrentCrs.Crs.CrsCod);
+
+ /***** Start table *****/
+ fprintf (Gbl.F.Out,"");
/***** Header row *****/
/* Get data of the user who made the exam */
@@ -6671,8 +6692,11 @@ void Tst_ShowOneTestExam (void)
if (ICanViewScore)
Tst_ShowTstTotalMark (TotalScore);
- /***** End of table *****/
- Tst_WriteTestFoot ();
+ /***** End table *****/
+ fprintf (Gbl.F.Out,"
");
+
+ /***** End frame *****/
+ Lay_EndRoundFrame ();
}
/*****************************************************************************/