diff --git a/BUGS.md b/BUGS.md index aa77143..11e9093 100644 --- a/BUGS.md +++ b/BUGS.md @@ -2,21 +2,22 @@ ## BUGS -- review por nome e numero no cabecalho jumbotron -- talvez a base de dados devesse ter como chave do teste um id que fosse único - desse teste particular (não um auto counter, nem ref do teste) - em caso de timeout na submissão (e.g. JOBE ou script nao responde) a correcção não termina e o teste não é guardado. -- reload do teste recomeça a contagem no inicio do tempo. +- modo --review nao implementado em testfactory.py +- talvez a base de dados devesse ter como chave do teste um id que fosse único + desse teste particular (não um auto counter, nem ref do teste) - em admin, quando scale_max não é 20, as cores das barras continuam a reflectir a escala 0,20. a tabela teste na DB não tem a escala desse teste. +- a revisao do teste não mostra as imagens que nao estejam ja em cache. +- reload do teste recomeça a contagem no inicio do tempo. - mensagems de erro do assembler aparecem na mesma linha na correcao e nao - fazerm rendering do `$t`, ver se servidor faz parse do markdown dessas + fazem rendering do `$t`, ver se servidor faz parse do markdown dessas mensagens. -- a revisao do teste não mostra as imagens que nao estejam ja em cache. ## TODO +- pagina de login semelhante ao aprendizations - QuestionTextArea falta reportar nos comments os vários erros que podem ocorrer (timeout, etc) - pergunta com varias partes. @@ -62,6 +63,12 @@ - se ocorrer um erro na correcçao avisar aluno para contactar o professor. - abrir o teste numa janela maximizada e que nao permite que o aluno a redimensione/mova? modo kiosk? -- detectar scroll e enviar posição para servidor (analise de scroll para detectar copianço?) +- detectar scroll e enviar posição para servidor (analise de scroll para + detectar copianço?) - criar perguntas de outros tipos, e.g. associação, ordenação. -- stress tests. use https://locust.io +- stress tests. use [locust](https://locust.io) + +## FIXED + +- textarea vem inicializado com a resposta de outros alunos!!! +- App has no attribute get_grades_csv diff --git a/package.json b/package.json index b682fd5..36e1a79 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "description": "Javascript libraries required to run the server", "email": "mjsb@uevora.pt", "dependencies": { - "@fortawesome/fontawesome-free": "^5.15.3", "bootstrap": "^5.1.0", "bootstrap-icons": "^1.7.2", "codemirror": "^5.61.1", diff --git a/perguntations/app.py b/perguntations/app.py index d617dfb..5b30389 100644 --- a/perguntations/app.py +++ b/perguntations/app.py @@ -372,7 +372,7 @@ class App(): } # ------------------------------------------------------------------------ - def get_test_csv(self): + def get_grades_csv(self): '''generates a CSV with the grades of the test currently running''' test_ref = self._testfactory['ref'] with Session(self._engine, future=True) as session: diff --git a/perguntations/questions.py b/perguntations/questions.py index d93271e..0b9a636 100644 --- a/perguntations/questions.py +++ b/perguntations/questions.py @@ -604,16 +604,14 @@ def question_from(qdict: QDict) -> Question: try: qclass = types[qdict['type']] except KeyError: - logger.error('Invalid type "%s" in "%s"', - qdict['type'], qdict['ref']) + logger.error('Invalid type "%s" in "%s"', qdict['type'], qdict['ref']) raise # Create an instance of Question() of appropriate type try: - qinstance = qclass(QDict(qdict)) + qinstance = qclass(qdict.copy()) except QuestionException: - logger.error('Error generating "%s" in %s/%s', - qdict['ref'], qdict['path'], qdict['filename']) + logger.error('Generating "%s" in %s', qdict['ref'], qdict['filename']) raise return qinstance @@ -625,11 +623,10 @@ class QFactory(): QFactory is a class that can generate question instances, e.g. by shuffling options, running a script to generate the question, etc. - To generate an instance of a question we use the method generate(). + To generate an instance of a question we use the method gen_async(). It returns a question instance of the correct class. - There is also an asynchronous version called gen_async(). This version is - synchronous for all question types (radio, checkbox, etc) except for - generator types which run asynchronously. + The method is async but it only awaits on generator questions. The others + are run until completion. Example: @@ -640,16 +637,13 @@ class QFactory(): 'options': ['a', 'b'] }) - # generate synchronously - question = qfactory.generate() - # generate asynchronously question = await qfactory.gen_async() # answer one question and correct it - question['answer'] = 42 # set answer - question.correct() # correct answer - grade = question['grade'] # get grade + question.set_answer(42) # set answer + question.correct() # correct answer + grade = question['grade'] # get grade ''' def __init__(self, qdict: QDict = QDict({})) -> None: diff --git a/perguntations/templates/admin.html b/perguntations/templates/admin.html index 04a2a01..9242533 100644 --- a/perguntations/templates/admin.html +++ b/perguntations/templates/admin.html @@ -21,8 +21,6 @@ - - @@ -40,27 +38,34 @@ @@ -71,28 +76,25 @@

-

- Obter CSV das notas - Obter CSV detalhado -


- - +
+ - - - - - - + + + + + + +
#Autoriz.NúmeroNomeEstadoNota#Autoriz.NúmeroNomeEstadoNota
diff --git a/perguntations/templates/grade.html b/perguntations/templates/grade.html index 633b054..400d560 100644 --- a/perguntations/templates/grade.html +++ b/perguntations/templates/grade.html @@ -1,7 +1,7 @@ - + - Teste + Prova de avaliação @@ -35,9 +35,7 @@
{% if t['state'] == 'CORRECTED' %} -

- Resultado: {{ f'{round(t["grade"], 3)}' }} valores -

+

Resultado: {{ f'{round(t["grade"], 3)}' }} valores

{% elif t['state'] == 'SUBMITTED' %}

A prova foi submetida com sucesso. Vai ser corrigida mais tarde.

{% elif t['state'] == 'QUIT' %} diff --git a/perguntations/templates/review-question-checkbox.html b/perguntations/templates/review-question-checkbox.html index b6bd191..61886c0 100644 --- a/perguntations/templates/review-question-checkbox.html +++ b/perguntations/templates/review-question-checkbox.html @@ -10,45 +10,35 @@ {% if q['answer'] is not None and str(n) in q['answer'] %}
-
{{ md(opt) }}
-
- {% if q['correct'][n] > 0 %} -
- - -
- {% else %} -
- - -
- {% end %} +
+
+ {% if q['correct'][n] > 0 %} + + {% else %} + + {% end %} +
{% else %}
-
{{ md(opt) }}
-
- {% if q['correct'][n] > 0 %} -
- - -
- {% else %} -
- - -
- {% end %} +
+
+ {% if q['correct'][n] > 0 %} + + {% else %} + + {% end %} +
{% end %}
diff --git a/perguntations/templates/review-question-radio.html b/perguntations/templates/review-question-radio.html index 3bd028e..f7f080c 100644 --- a/perguntations/templates/review-question-radio.html +++ b/perguntations/templates/review-question-radio.html @@ -10,39 +10,28 @@ {% if q['answer'] is not None and str(n)==q['answer'] %}
-
{{ md(opt) }}
-
+
{% if q['correct'][n] > 0 %} -
- - -
+ {% else %} -
- - -
+ {% end %}
{% else %}
-
{{ md(opt) }}
-
+
{% if q['correct'][n] > 0 %} -
- - -
+ {% end %}
{% end %} diff --git a/perguntations/templates/review-question.html b/perguntations/templates/review-question.html index 9a3262c..938e610 100644 --- a/perguntations/templates/review-question.html +++ b/perguntations/templates/review-question.html @@ -6,10 +6,9 @@
{{ q['number'] }}. {{ q['title'] }} -
- Classificar  - - +
+ Classificada  +
@@ -38,14 +37,12 @@ {% if q['grade'] > 0.999 %}

- {{ round(q['grade'] * q['points'], 2) }} pontos

{{ md(q['comments']) }}

{% elif q['grade'] >= 0.5 %}

- {{ round(q['grade'] * q['points'], 2) }} pontos

{{ md(q['comments']) }}

@@ -56,7 +53,6 @@ {% else %}

- {{ round(q['grade'] * q['points'], 2) }} pontos

{{ md(q['comments']) }}

@@ -80,10 +76,9 @@
{{ q['number'] }}. {{ q['title'] }} -
- Classificar  - - +
+ Não classificada +
@@ -102,16 +97,10 @@
@@ -157,7 +155,6 @@ $("textarea").each(function(i, ta) { CodeMirror.fromTextArea(ta, { lineNumbers: true, - // theme: "darcula", viewportMargin: Infinity, matchBrackets: true, styleActiveLine: true, diff --git a/perguntations/testfactory.py b/perguntations/testfactory.py index 297b2c3..d9b8217 100644 --- a/perguntations/testfactory.py +++ b/perguntations/testfactory.py @@ -270,6 +270,7 @@ class TestFactory(dict): if question['type'] == 'textarea': _runtests_textarea(qref, question) + # ------------------------------------------------------------------------ async def generate(self): ''' -- libgit2 0.21.2