Skip to content

Commit

Permalink
better statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
t-oster committed Jan 22, 2013
1 parent edd78e3 commit 802006a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions model/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ public function getCountAnswers()
return $this->countResult1 + $this->countResult2 + $this->countResult3 + $this->countResult4;
}

public function getCountAllAnswers()
{
return $this->getCountAnswers() + $this->getRepetitions();
}

public function getAverageResult()
{
$count = $this->getCountAnswers();
Expand Down
4 changes: 3 additions & 1 deletion view/tags/show.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
<th>Title</th>
<th>Answered</th>
<th>Average result</th>
<th>SM2 easyness</th>
</tr>
</thead>
<tbody>
{foreach $tag->getCards() as $c}
<tr>
<td><a href="{url controller="Cards" action="show" cardId=$c->getId()}">{$c->getTitle()}</a></td>
<td>{$c->getCountAnswers()}</td>
<td>{$c->getCountAllAnswers()}</td>
<td>{$c->getAverageResultText()}</td>
<td>{$c->getEasiness()}</td>
</tr>
{/foreach}
</tbody>
Expand Down

0 comments on commit 802006a

Please sign in to comment.