add library description and calculate total progress of Character
This commit is contained in:
parent
647428d417
commit
ea6ca0bd81
5 changed files with 35 additions and 15 deletions
|
|
@ -62,19 +62,25 @@
|
|||
$character = SeminaryRoleController::$character;
|
||||
|
||||
// Get Quest topics
|
||||
$totalQuestcount = 0;
|
||||
$totalCharacterQuestcount = 0;
|
||||
$questtopics = $this->Questtopics->getQuesttopicsForSeminary($seminary['id']);
|
||||
foreach($questtopics as &$questtopic)
|
||||
{
|
||||
// Get Quest count
|
||||
$questtopic['questcount'] = $this->Questtopics->getQuestCountForQuesttopic($questtopic['id']);
|
||||
$totalQuestcount += $questtopic['questcount'];
|
||||
|
||||
// Get Character progress
|
||||
$questtopic['characterQuestcount'] = $this->Questtopics->getCharacterQuestCountForQuesttopic($questtopic['id'], $character['id']);
|
||||
$totalCharacterQuestcount += $questtopic['characterQuestcount'];
|
||||
}
|
||||
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('totalQuestcount', $totalQuestcount);
|
||||
$this->set('totalCharacterQuestcount', $totalCharacterQuestcount);
|
||||
$this->set('questtopics', $questtopics);
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,8 +1,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: The Legend of Z\n"
|
||||
"POT-Creation-Date: 2014-04-21 21:12+0100\n"
|
||||
"PO-Revision-Date: 2014-04-21 21:12+0100\n"
|
||||
"POT-Creation-Date: 2014-04-21 21:42+0100\n"
|
||||
"PO-Revision-Date: 2014-04-22 00:29+0100\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: de_DE\n"
|
||||
|
|
@ -147,17 +147,17 @@ msgstr "Platz"
|
|||
msgid "You achieved %d of %d Achievements so far"
|
||||
msgstr "Du hast bislang %d von insgesamt %d Errungenschaften erreicht"
|
||||
|
||||
#: views/html/achievements/index.tpl:66 views/html/characters/character.tpl:39
|
||||
#: views/html/achievements/index.tpl:61 views/html/characters/character.tpl:39
|
||||
#: views/html/seminarybar/index.tpl:28
|
||||
#, php-format
|
||||
msgid "achieved at: %s"
|
||||
msgstr "erhalten am: %s"
|
||||
|
||||
#: views/html/achievements/index.tpl:77
|
||||
#: views/html/achievements/index.tpl:72
|
||||
msgid "Secret Achievement"
|
||||
msgstr "Geheime Errungenschaft"
|
||||
|
||||
#: views/html/achievements/index.tpl:82
|
||||
#: views/html/achievements/index.tpl:77
|
||||
msgid "Continue playing to unlock this secret Achievement"
|
||||
msgstr "Spiele weiter, um diesen geheimen Erfolg freizuschalten"
|
||||
|
||||
|
|
@ -319,6 +319,20 @@ msgstr "registriere dich"
|
|||
msgid "Questtopics"
|
||||
msgstr "Themen"
|
||||
|
||||
#: views/html/library/index.tpl:10
|
||||
#, php-format
|
||||
msgid "Library description, %s, %s"
|
||||
msgstr ""
|
||||
"Hier findest du alle Themen aus der Vorlesung „%s“ und die passenden Quests "
|
||||
"zum Nachschlagen und Wiederholen. Dein Fortschritt in „%s“ beeinflusst den "
|
||||
"Umfang der Bibliothek, spiele also regelmäßig weiter und schalte so Quest "
|
||||
"für Quest alle Inhalte frei."
|
||||
|
||||
#: views/html/library/index.tpl:12
|
||||
#, php-format
|
||||
msgid "Total progress: %d %%"
|
||||
msgstr "Gesamtfortschritt: %d %%"
|
||||
|
||||
#: views/html/menu/index.tpl:2 views/html/users/create.tpl:1
|
||||
#: views/html/users/delete.tpl:1 views/html/users/edit.tpl:1
|
||||
#: views/html/users/index.tpl:1 views/html/users/login.tpl:1
|
||||
|
|
@ -362,15 +376,15 @@ msgstr "Questgruppe"
|
|||
|
||||
#: views/html/quests/create.tpl:27
|
||||
msgid "XPs"
|
||||
msgstr ""
|
||||
msgstr "XPs"
|
||||
|
||||
#: views/html/quests/create.tpl:34
|
||||
msgid "Entry text"
|
||||
msgstr ""
|
||||
msgstr "Einstiegstext"
|
||||
|
||||
#: views/html/quests/create.tpl:36
|
||||
msgid "Wrong text"
|
||||
msgstr ""
|
||||
msgstr "Text für falsche Antwort"
|
||||
|
||||
#: views/html/quests/create.tpl:37 views/html/quests/quest.tpl:55
|
||||
msgid "Task"
|
||||
|
|
@ -428,7 +442,7 @@ msgstr "Lösung von %s"
|
|||
|
||||
#: views/html/quests/submissions.tpl:15
|
||||
msgid "submitted"
|
||||
msgstr "eingereicht am %s um %s Uhr"
|
||||
msgstr "eingereicht"
|
||||
|
||||
#: views/html/seminaries/create.tpl:7
|
||||
msgid "New seminary"
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
{
|
||||
// Get seminaries
|
||||
return $this->db->query(
|
||||
'SELECT id, created, created_user_id, title, url, description, seminarymedia_id '.
|
||||
'SELECT id, created, created_user_id, title, url, course, description, seminarymedia_id '.
|
||||
'FROM seminaries '.
|
||||
'ORDER BY created DESC'
|
||||
);
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
public function getSeminaryById($seminaryId)
|
||||
{
|
||||
$seminary = $this->db->query(
|
||||
'SELECT id, created, created_user_id, title, url, description, seminarymedia_id '.
|
||||
'SELECT id, created, created_user_id, title, url, course, description, seminarymedia_id '.
|
||||
'FROM seminaries '.
|
||||
'WHERE id = ?',
|
||||
'i',
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
public function getSeminaryByUrl($seminaryUrl)
|
||||
{
|
||||
$seminary = $this->db->query(
|
||||
'SELECT id, created, created_user_id, title, url, description, seminarymedia_id '.
|
||||
'SELECT id, created, created_user_id, title, url, course, description, seminarymedia_id '.
|
||||
'FROM seminaries '.
|
||||
'WHERE url = ?',
|
||||
's',
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
</ul>
|
||||
<h1><i class="fa fa-book fa-fw"></i><?=_('Questtopics')?></h1>
|
||||
<p>Hier findest du alle Themen aus der Vorlesung "Wissensrepräsentation" und die passenden Quests zum Nachschlagen und Wiederholen. Dein Fortschritt in "Die Legende von Zyren" beeinflusst den Umfang der Bibliothek, spiele also regelmäßig weiter und schalte so Quest für Quest alle Inhalte frei.</p>
|
||||
<p><?=sprintf(_('Library description, %s, %s'), $seminary['course'], $seminary['title'])?></p>
|
||||
<div class="libindxpr cf">
|
||||
<p><small>Gesamtfortschritt: 77%</small></p>
|
||||
<p><small><?=sprintf(_('Total progress: %d %%'), ($totalQuestcount > 0) ? $numberFormatter->format(round($totalCharacterQuestcount/$totalQuestcount*100)) : 0) ?></small></p>
|
||||
<div class="xpbar">
|
||||
<span style="width:77%"></span>
|
||||
<span style="width:<?=($totalQuestcount > 0) ? round($totalCharacterQuestcount/$totalQuestcount*100) : 0 ?>%"></span>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="libindx cf">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue