diff --git a/css/swad17.0.css b/css/swad17.0.css index 885e6dd68..890b341c1 100644 --- a/css/swad17.0.css +++ b/css/swad17.0.css @@ -2258,9 +2258,9 @@ a:hover img.CENTRE_PHOTO_SHOW .TAG_SEL {box-sizing:border-box; width:346px;} .TAG_TXT {box-sizing:border-box; width:346px;} .STEM {box-sizing:border-box; width:700px;} -.ANS {color:#404040; font-size:13pt; font-weight:bold;} -.ANS_OK {color:#008000; font-size:13pt; font-weight:bold;} -.ANS_BAD {color:red; font-size:13pt; font-weight:bold;} +.ANS {color:#404040; font-size:12pt;} +.ANS_OK {color:#008000; font-size:12pt; font-weight:bold;} +.ANS_BAD {color:red; font-size:12pt; font-weight:bold;} .ANS_STR {box-sizing:border-box; width:600px;} .TEST_SUBTITLE { @@ -2271,7 +2271,6 @@ a:hover img.CENTRE_PHOTO_SHOW vertical-align:middle; } .TEST_NUM_QST {color:#808080; font-size:20pt; font-weight:bold;} -.TEST {color:#404040; font-size:12pt;} .TEST_EXA {color:#404040; font-size:12pt;} .TEST_EXA_LIGHT {color:#A0A0A0; font-size:12pt;} .TEST_EDI {color:#404040; font-size:12pt;} diff --git a/swad_changelog.h b/swad_changelog.h index 1f12629b9..60ea906a0 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -232,6 +232,8 @@ // TODO: Cuando sólo se cambian los grupos y no el rol de un profesor ya existente, no sale ningún mensaje. se haga lo que se haga en la edición debería salir un mensaje del tipo "Cambios realizados" +// TODO: Debería haber un modo "ver" en las actividades, como en los documentos, para que el profesor tenga la visión del estudiante. + // TODO: "Solicitar inscripción" como superusuario: "Usted no tiene permiso para realizar esta acción" // TODO: Poner icono con enlace a días festivos en calendario de centro, titulación y asignatura, además del actual calendario de institución @@ -250,13 +252,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 17.0.3 (2017-09-14)" +#define Log_PLATFORM_VERSION "SWAD 17.0.4 (2017-09-15)" #define CSS_FILE "swad17.0.css" #define JS_FILE "swad16.206.3.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 17.0.4: Sep 14, 2017 Show current question with answers when playing a game. (227379 lines) Version 17.0.3: Sep 14, 2017 Action to show current question with answers when playing a game. (227350 lines) 1 change necessary in database: INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1673','es','N','Mostrar respuestas de pregunta juego'); diff --git a/swad_game.c b/swad_game.c index 856a1d377..e63aedb02 100644 --- a/swad_game.c +++ b/swad_game.c @@ -2954,7 +2954,8 @@ static void Gam_ListOneOrMoreQuestionsForEdition (struct Game *Game, "TEST_IMG_EDIT_LIST_STEM_CONTAINER", "TEST_IMG_EDIT_LIST_STEM"); Tst_WriteQstFeedback (row[3],"TEST_EDI_LIGHT"); - Tst_WriteAnswersGameResult (Game,NumQst,QstCod); + Tst_WriteAnswersGameResult (Game,NumQst,QstCod, + "TEST_EDI",true); // Show result fprintf (Gbl.F.Out,"" ""); @@ -3535,12 +3536,13 @@ void Gam_PlayGameShowAnswers (void) static void Gam_PlayGameShowQuestionAndAnswers (bool ShowAnswers) { - char Query[256]; + char Query[512]; MYSQL_RES *mysql_res; MYSQL_ROW row; struct Game Game; unsigned QstInd; int NxtQstInd; + long QstCod; /***** Get parameters *****/ /* Get game code */ @@ -3552,14 +3554,17 @@ static void Gam_PlayGameShowQuestionAndAnswers (bool ShowAnswers) /***** Get data of question from database *****/ /* - row[0] QstCod - row[1] Stem - row[2] ImageName - row[3] ImageTitle - row[4] ImageURL + row[0] AnsType + row[1] QstCod + row[2] Stem + row[3] ImageName + row[4] ImageTitle + row[5] ImageURL */ - sprintf (Query,"SELECT tst_questions.QstCod," - "tst_questions.Stem," + sprintf (Query,"SELECT " + "tst_questions.QstCod," + "tst_questions.AnsType," + "tst_questions.Stem," "tst_questions.ImageName," "tst_questions.ImageTitle," "tst_questions.ImageURL" @@ -3580,15 +3585,28 @@ static void Gam_PlayGameShowQuestionAndAnswers (bool ShowAnswers) fprintf (Gbl.F.Out,"
%u
", QstInd + 1); - /* Write the stem (row[1]) and the image (row[2], row[3], row[4]) */ + /* Write the stem (row[2]) and the image (row[3], row[4], row[5]) */ fprintf (Gbl.F.Out,"
"); - Tst_WriteQstStem (row[1],"GAM_PLAY_QST"); - Img_GetImageNameTitleAndURLFromRow (row[2],row[3],row[4],&Gbl.Test.Image); + Tst_WriteQstStem (row[2],"GAM_PLAY_QST"); + Img_GetImageNameTitleAndURLFromRow (row[3],row[4],row[5],&Gbl.Test.Image); Img_ShowImage (&Gbl.Test.Image, "TEST_IMG_EDIT_LIST_STEM_CONTAINER", "TEST_IMG_EDIT_LIST_STEM"); + + /* Write answers? */ if (ShowAnswers) - fprintf (Gbl.F.Out,"answers"); + { + /* Get question code (row[0]) */ + if ((QstCod = Str_ConvertStrCodToLongCod (row[0])) <= 0) + Lay_ShowErrorAndExit ("Error: wrong question code."); + + /* Get answer type (row[1]) */ + Gbl.Test.AnswerType = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[1]); + + /* Write answers */ + Tst_WriteAnswersGameResult (&Game,QstInd,QstCod, + "GAM_PLAY_QST",false); // Don't show result + } fprintf (Gbl.F.Out,"
"); /* End container for number and question */ diff --git a/swad_test.c b/swad_test.c index 53064b08b..2098fcfec 100644 --- a/swad_test.c +++ b/swad_test.c @@ -204,7 +204,10 @@ static void Tst_WriteTFAnsAssessTest (unsigned NumQst,MYSQL_RES *mysql_res, static void Tst_WriteChoiceAnsViewTest (unsigned NumQst,long QstCod,bool Shuffle); static void Tst_WriteChoiceAnsAssessTest (unsigned NumQst,MYSQL_RES *mysql_res, double *ScoreThisQst,bool *AnswerIsNotBlank); -static void Tst_WriteChoiceAnsViewGame (struct Game *Game,unsigned NumQst,long QstCod); +static void Tst_WriteChoiceAnsViewGame (struct Game *Game, + unsigned NumQst,long QstCod, + const char *Class, + bool ShowResult); static void Tst_WriteTextAnsViewTest (unsigned NumQst); static void Tst_WriteTextAnsAssessTest (unsigned NumQst,MYSQL_RES *mysql_res, @@ -1038,11 +1041,12 @@ void Tst_WriteQstAndAnsTest (Tst_ActionToDoWithQuestions_t ActionToDoWithQuestio case Tst_SELECT_QUESTIONS_FOR_GAME: break; case Tst_SHOW_GAME_TO_ANSWER: - // TODO: Change this!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - Tst_WriteAnswersTestToAnswer (NumQst,QstCod,(row[3][0] == 'Y')); + Tst_WriteAnswersGameResult (Game,NumQst,QstCod, + "GAM_PLAY_QST",false); // Don't show result break; case Tst_SHOW_GAME_RESULT: - Tst_WriteAnswersGameResult (Game,NumQst,QstCod); + Tst_WriteAnswersGameResult (Game,NumQst,QstCod, + "GAM_PLAY_QST",true); // Show result break; } fprintf (Gbl.F.Out,"" @@ -3537,10 +3541,11 @@ static void Tst_WriteAnswersTestResult (unsigned NumQst,long QstCod, /************** Write answers of a question when viewing a game **************/ /*****************************************************************************/ -void Tst_WriteAnswersGameResult (struct Game *Game,unsigned NumQst,long QstCod) +void Tst_WriteAnswersGameResult (struct Game *Game,unsigned NumQst,long QstCod, + const char *Class,bool ShowResult) { /***** Write parameter with question code *****/ - Tst_WriteParamQstCod (NumQst,QstCod); + // Tst_WriteParamQstCod (NumQst,QstCod); /***** Write answer depending on type *****/ switch (Gbl.Test.AnswerType) @@ -3553,7 +3558,8 @@ void Tst_WriteAnswersGameResult (struct Game *Game,unsigned NumQst,long QstCod) break; case Tst_ANS_UNIQUE_CHOICE: case Tst_ANS_MULTIPLE_CHOICE: - Tst_WriteChoiceAnsViewGame (Game,NumQst,QstCod); + Tst_WriteChoiceAnsViewGame (Game,NumQst,QstCod, + Class,ShowResult); break; default: break; @@ -3765,7 +3771,7 @@ static void Tst_WriteChoiceAnsViewTest (unsigned NumQst,long QstCod,bool Shuffle NumQst,NumOpt, NumQst,Index); fprintf (Gbl.F.Out,"" - "