Skip to content

Commit

Permalink
fix error at the end of non phased test
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudbey committed Sep 29, 2015
1 parent cd2e6b8 commit 37a0277
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 54 deletions.
10 changes: 7 additions & 3 deletions src/Innova/SelfBundle/Manager/ScoreManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
111 changes: 60 additions & 51 deletions src/Innova/SelfBundle/Resources/views/Player/common/score.html.twig
Original file line number Diff line number Diff line change
@@ -1,64 +1,73 @@
{% if session.globalScoreShow %}
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body text-center">
<h4><span class="glyphicon glyphicon-thumbs-up"></span> {{ session.globalScoreWording }} </h4>
{% if levelFeedback is not null %}
{{ levelFeedback }}
{% else %}
-
{% endif %}
</div>
</div>
</div>
{% endif %}

<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body text-center">
<h4><span class=" glyphicon glyphicon-headphones"></span> Compréhension de l'oral</h4>
{% if coFeedback is not null %}
{{ coFeedback }}
{% if session.test.phased %}
{% if session.globalScoreShow %}
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body text-center">
<h4><span class="glyphicon glyphicon-thumbs-up"></span> {{ session.globalScoreWording }} </h4>
{% if levelFeedback is not null %}
{{ levelFeedback }}
{% else %}
-
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}

<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body text-center">
<h4><span class="glyphicon glyphicon-book"></span> Compréhension de l'écrit</h4>
{% if ceFeedback is not null %}
{{ ceFeedback }}
{% else %}
-
{% endif %}
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body text-center">
<h4><span class=" glyphicon glyphicon-headphones"></span> Compréhension de l'oral</h4>
{% if coFeedback is not null %}
{{ coFeedback }}
{% else %}
-
{% endif %}
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body text-center">
<h4><span class="glyphicon glyphicon-pencil"></span> Expression écrite courte</h4>
{% if eecFeedback is not null %}
{{ eecFeedback }}
{% else %}
-
{% endif %}

<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body text-center">
<h4><span class="glyphicon glyphicon-book"></span> Compréhension de l'écrit</h4>
{% if ceFeedback is not null %}
{{ ceFeedback }}
{% else %}
-
{% endif %}
</div>
</div>
</div>
</div>

{% if ceFeedback is null %}
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body text-center">
Attention, le résultat en comprehension de l'écrit a bien été pris en compte mais ne peut pas être affiché pour le moment
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body text-center">
<h4><span class="glyphicon glyphicon-pencil"></span> Expression écrite courte</h4>
{% if eecFeedback is not null %}
{{ eecFeedback }}
{% else %}
-
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}


{% if ceFeedback is null %}
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body text-center">
Attention, le résultat en comprehension de l'écrit a bien été pris en compte mais ne peut pas être affiché pour le moment
</div>
</div>
</div>
{% endif %}

{% else %}
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body text-center">
Les résultats ne sont pas calculés pour ce type de test.
</div>
</div>
</div>
{% endif %}

0 comments on commit 37a0277

Please sign in to comment.