Version19.124

This commit is contained in:
Antonio Cañas Vargas 2020-02-17 09:31:32 +01:00
parent d6d3567fcb
commit 67cdf9f0ff
7 changed files with 199 additions and 2 deletions

View File

@ -497,7 +497,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.123 (2020-02-16)"
#define Log_PLATFORM_VERSION "SWAD 19.124 (2020-02-17)"
#define CSS_FILE "swad19.118.css"
#define JS_FILE "swad19.91.1.js"
/*
@ -507,6 +507,7 @@ ps2pdf source.ps destination.pdf
// TODO: En la lista de conectados central, poner el logo de la institución a la que pertenece el usuario
// TODO: Urgente: Añadir nuevos niveles de realimentación tras sugerencia de Mancia y conversación con Javier.
Version 19.124: Feb 17, 2020 New form for result visibility in tests. (279001 lines)
Version 19.123: Feb 16, 2020 New module swad_test_result for test results. (278815 lines)
Version 19.122.4: Feb 14, 2020 Fixed bug refreshing degree average photo. (278699 lines)
Version 19.122.3: Feb 14, 2020 Fixed bug in games, reported by Gustavo Romero López.

View File

@ -356,6 +356,7 @@ void Gbl_InitializeGlobals (void)
/* Tests */
Gbl.Test.Config.Pluggable = Tst_PLUGGABLE_UNKNOWN;
Gbl.Test.Config.Visibility = TsR_VISIBILITY_DEFAULT;
Gbl.Test.NumQsts = Tst_CONFIG_DEFAULT_DEF_QUESTIONS;
Gbl.Test.AllowTeachers = false; // Must the test result be saved?
Gbl.Test.AllAnsTypes = false;

View File

@ -1812,6 +1812,7 @@ static void Tst_ShowFormConfigTst (void)
extern const char *Txt_default;
extern const char *Txt_maximum;
extern const char *Txt_Minimum_time_seconds_per_question_between_two_tests;
extern const char *Txt_Result_visibility;
extern const char *Txt_Feedback_to_students;
extern const char *Txt_TST_STR_FEEDBACK[TsR_NUM_TYPES_FEEDBACK];
extern const char *Txt_Save_changes;
@ -1893,6 +1894,19 @@ static void Tst_ShowFormConfigTst (void)
HTM_TR_End ();
/***** Visibility of results *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"%s RT\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_TxtF ("%s:",Txt_Result_visibility);
HTM_TD_End ();
HTM_TD_Begin ("class=\"LB\"");
TsR_PutVisibilityCheckboxes (Gbl.Test.Config.Visibility);
HTM_TD_End ();
HTM_TR_End ();
/***** Feedback to students *****/
HTM_TR_Begin (NULL);

View File

@ -82,6 +82,7 @@ struct Tst_Config
unsigned Def; // Default number of questions
unsigned Max; // Maximum number of questions
unsigned long MinTimeNxtTstPerQst;
unsigned Visibility; // One bit for each visibility item
TsR_Feedback_t Feedback;
};

View File

@ -58,6 +58,7 @@ Visibility of results:
* Score of each question
* Total score
*/
// strings are limited to TsR_MAX_BYTES_FEEDBACK_TYPE bytes
const char *TsR_FeedbackXML[TsR_NUM_TYPES_FEEDBACK] =
{
@ -1165,3 +1166,27 @@ TsR_Feedback_t TsR_GetFeedbackTypeFromForm (void)
(unsigned long) TsR_FEEDBACK_DEFAULT);
}
/*****************************************************************************/
/************ Put checkboxes in form to select result visibility *************/
/*****************************************************************************/
void TsR_PutVisibilityCheckboxes (unsigned SelectedVisibility)
{
extern const char *Txt_TST_STR_VISIBILITY[TsR_NUM_ITEMS_VISIBILITY];
TsR_ResultVisibility_t Visibility;
for (Visibility = (TsR_ResultVisibility_t) 0;
Visibility <= (TsR_ResultVisibility_t) (TsR_NUM_ITEMS_VISIBILITY - 1);
Visibility++)
{
HTM_LABEL_Begin ("class=\"DAT\"");
HTM_INPUT_CHECKBOX ("Visibility",false,
"value=\"%u\"%s",
(unsigned) Visibility,
(SelectedVisibility & (1 << Visibility)) != 0 ? " checked=\"checked\"" :
"");
HTM_Txt (Txt_TST_STR_VISIBILITY[Visibility]);
HTM_LABEL_End ();
HTM_BR ();
}
}

View File

@ -27,7 +27,6 @@
/********************************* Headers ***********************************/
/*****************************************************************************/
// #include "swad_game.h"
#include "swad_user.h"
/*****************************************************************************/
@ -41,6 +40,31 @@
/*****************************************************************************/
/******************************* Public types ********************************/
/*****************************************************************************/
/*
Visibilidad de resultados:
* Texto de preguntas y respuestas
* Texto de realimentación
* Respuestas correctas
* Puntuación de cada pregunta
* Puntuación total
Visibility of results:
* Text of questions and answers
* Feedback text
* Correct answers
* Score of each question
* Total score
*/
#define TsR_NUM_ITEMS_VISIBILITY 5
typedef enum
{
TsR_VISIBLE_QST_ANS_TEXT = 0, // Questions and answers text
TsR_VISIBLE_FEEDBACK_TEXT = 1, // Feedback text
TsR_VISIBLE_CORRECT_ANSWER = 2, // Correct answers
TsR_VISIBLE_EACH_QST_SCORE = 3, // Score of each question
TsR_VISIBLE_TOTAL_SCORE = 4, // Total score
} TsR_ResultVisibility_t;
#define TsR_VISIBILITY_DEFAULT ((1 << TsR_NUM_ITEMS_VISIBILITY) - 1) // All visible
#define TsR_NUM_TYPES_FEEDBACK 5
typedef enum
@ -74,4 +98,6 @@ void TsR_RemoveCrsTestResults (long CrsCod);
TsR_Feedback_t TsR_GetFeedbackTypeFromForm (void);
void TsR_PutVisibilityCheckboxes (unsigned SelectedVisibility);
#endif

View File

@ -51574,6 +51574,114 @@ const char *Txt_TST_STR_ORDER_SHORT[Tst_NUM_TYPES_ORDER_QST] =
#endif
};
const char *Txt_TST_STR_VISIBILITY[TsR_NUM_ITEMS_VISIBILITY] =
{
[TsR_VISIBLE_QST_ANS_TEXT] =
#if L==1 // ca
"Text de preguntes i respostes"
#elif L==2 // de
"Fragen und Antworten Text"
#elif L==3 // en
"Questions and answers text"
#elif L==4 // es
"Texto de preguntas y respuestas"
#elif L==5 // fr
"Texte de questions et r&eacute;ponses."
#elif L==6 // gn
"Texto de preguntas y respuestas" // Okoteve traducción
#elif L==7 // it
"Testo di domande e risposte"
#elif L==8 // pl
"Tekst pyta&nacute; i odpowiedzi"
#elif L==9 // pt
"Texto de perguntas e respostas"
#endif
,
[TsR_VISIBLE_FEEDBACK_TEXT] =
#if L==1 // ca
"Text de realimentaci&oacute;"
#elif L==2 // de
"Feedback-Text"
#elif L==3 // en
"Feedback text"
#elif L==4 // es
"Texto de realimentaci&oacute;n"
#elif L==5 // fr
"Texte de r&eacute;troaction"
#elif L==6 // gn
"Texto de realimentaci&oacute;n" // Okoteve traducción
#elif L==7 // it
"Testo di feedback"
#elif L==8 // pl
"Tekst feedback"
#elif L==9 // pt
"Texto de feedback"
#endif
,
[TsR_VISIBLE_CORRECT_ANSWER] =
#if L==1 // ca
"Respostes correctes"
#elif L==2 // de
"Richtige Antworten"
#elif L==3 // en
"Correct answers"
#elif L==4 // es
"Respuestas correctas"
#elif L==5 // fr
"Bonnes r&eacute;ponses"
#elif L==6 // gn
"Respuestas correctas" // Okoteve traducción
#elif L==7 // it
"Risposte corrette"
#elif L==8 // pl
"Prawid&lstrok;owe odpowiedzi"
#elif L==9 // pt
"Respostas corretas"
#endif
,
[TsR_VISIBLE_EACH_QST_SCORE] =
#if L==1 // ca
"Puntuaci&oacute; de cada pregunta"
#elif L==2 // de
"Punktzahl jeder Frage"
#elif L==3 // en
"Score of each question"
#elif L==4 // es
"Puntuaci&oacute;n de cada pregunta"
#elif L==5 // fr
"Score de chaque question"
#elif L==6 // gn
"Puntuaci&oacute;n de cada pregunta" // Okoteve traducción
#elif L==7 // it
"Punteggio di ogni domanda"
#elif L==8 // pl
"Wynik ka&zdot;dego pytania"
#elif L==9 // pt
"Pontua&ccedil;&atilde;o de cada pergunta"
#endif
,
[TsR_VISIBLE_TOTAL_SCORE] =
#if L==1 // ca
"Puntuaci&oacute; total"
#elif L==2 // de
"Gesamtpunktzahl"
#elif L==3 // en
"Total score"
#elif L==4 // es
"Puntuaci&oacute;n total"
#elif L==5 // fr
"Score total"
#elif L==6 // gn
"Puntuaci&oacute;n total" // Okoteve traducción
#elif L==7 // it
"Punteggio totale"
#elif L==8 // pl
"&Lstrok;&aogon;czny wynik"
#elif L==9 // pt
"Pontua&ccedil;&atilde;o total"
#endif
};
const char *Txt_TF_QST[2] =
{
#if L==1 // ca // True
@ -53712,6 +53820,27 @@ const char *Txt_View_homework =
"Ver trabalhos";
#endif
const char *Txt_Result_visibility =
#if L==1 // ca
"Visibilitat de resultats";
#elif L==2 // de
"Ergebnis Sichtbarkeit";
#elif L==3 // en
"Result visibility";
#elif L==4 // es
"Visibilidad de resultados";
#elif L==5 // fr
"Visibilit&eacute; des r&eacute;sultats";
#elif L==6 // gn
"Visibilidad de resultados"; // Okoteve traducción
#elif L==7 // it
"Visibilit&agrave; dei risultati";
#elif L==8 // pl
"Widoczno&sacute;&cacute; wynik&oacute;w";
#elif L==9 // pt
"Visibilidade dos resultados";
#endif
const char *Txt_Visible_by_BR_the_student =
#if L==1 // ca
"&iquest;Visible por<br />el estudiante?"; // Necessita traduccio