From 37a0277433144e39c220803023c1d754eb7d1807 Mon Sep 17 00:00:00 2001 From: arnaudbey Date: Tue, 29 Sep 2015 14:15:45 +0200 Subject: [PATCH] fix error at the end of non phased test --- .../SelfBundle/Manager/ScoreManager.php | 10 +- .../views/Player/common/score.html.twig | 111 ++++++++++-------- 2 files changed, 67 insertions(+), 54 deletions(-) diff --git a/src/Innova/SelfBundle/Manager/ScoreManager.php b/src/Innova/SelfBundle/Manager/ScoreManager.php index d12853a6..f4657c47 100644 --- a/src/Innova/SelfBundle/Manager/ScoreManager.php +++ b/src/Innova/SelfBundle/Manager/ScoreManager.php @@ -37,10 +37,14 @@ public function getScoreBySkillByLevelForComponent(Test $test, Session $session, public function calculateScoreByTest(Test $test, Session $session, User $user) { - $traces = $this->traceRepo->findBy(array('user' => $user, 'test' => $test, 'session' => $session)); - $scores = $this->getScoresFromTraces($traces); + if ($test->getPhased()) { + $traces = $this->traceRepo->findBy(array('user' => $user, 'test' => $test, 'session' => $session)); + $scores = $this->getScoresFromTraces($traces); - return $scores; + return $scores; + } + + return; } public function orientateToStep(User $user, Session $session, Component $component) diff --git a/src/Innova/SelfBundle/Resources/views/Player/common/score.html.twig b/src/Innova/SelfBundle/Resources/views/Player/common/score.html.twig index 09ae74a4..e1ae806e 100644 --- a/src/Innova/SelfBundle/Resources/views/Player/common/score.html.twig +++ b/src/Innova/SelfBundle/Resources/views/Player/common/score.html.twig @@ -1,64 +1,73 @@ -{% if session.globalScoreShow %} -
-
-
-

{{ session.globalScoreWording }}

- {% if levelFeedback is not null %} - {{ levelFeedback }} - {% else %} - - - {% endif %} -
-
-
-{% endif %} - -
-
-
-

Compréhension de l'oral

- {% if coFeedback is not null %} - {{ coFeedback }} +{% if session.test.phased %} + {% if session.globalScoreShow %} +
+
+
+

{{ session.globalScoreWording }}

+ {% if levelFeedback is not null %} + {{ levelFeedback }} {% else %} - {% endif %} +
-
+ {% endif %} -
-
-
-

Compréhension de l'écrit

- {% if ceFeedback is not null %} - {{ ceFeedback }} - {% else %} - - - {% endif %} +
+
+
+

Compréhension de l'oral

+ {% if coFeedback is not null %} + {{ coFeedback }} + {% else %} + - + {% endif %} +
-
-
-
-
-

Expression écrite courte

- {% if eecFeedback is not null %} - {{ eecFeedback }} - {% else %} - - - {% endif %} + +
+
+
+

Compréhension de l'écrit

+ {% if ceFeedback is not null %} + {{ ceFeedback }} + {% else %} + - + {% endif %} +
-
- -{% if ceFeedback is null %} -
-
-
- Attention, le résultat en comprehension de l'écrit a bien été pris en compte mais ne peut pas être affiché pour le moment +
+
+
+

Expression écrite courte

+ {% if eecFeedback is not null %} + {{ eecFeedback }} + {% else %} + - + {% endif %} +
-
-{% endif %} - + {% if ceFeedback is null %} +
+
+
+ Attention, le résultat en comprehension de l'écrit a bien été pris en compte mais ne peut pas être affiché pour le moment +
+
+
+ {% endif %} + +{% else %} +
+
+
+ Les résultats ne sont pas calculés pour ce type de test. +
+
+
+{% endif %} \ No newline at end of file