add library description and calculate total progress of Character
This commit is contained in:
parent
f061119c29
commit
43245814be
5 changed files with 35 additions and 15 deletions
|
|
@ -62,19 +62,25 @@
|
||||||
$character = SeminaryRoleController::$character;
|
$character = SeminaryRoleController::$character;
|
||||||
|
|
||||||
// Get Quest topics
|
// Get Quest topics
|
||||||
|
$totalQuestcount = 0;
|
||||||
|
$totalCharacterQuestcount = 0;
|
||||||
$questtopics = $this->Questtopics->getQuesttopicsForSeminary($seminary['id']);
|
$questtopics = $this->Questtopics->getQuesttopicsForSeminary($seminary['id']);
|
||||||
foreach($questtopics as &$questtopic)
|
foreach($questtopics as &$questtopic)
|
||||||
{
|
{
|
||||||
// Get Quest count
|
// Get Quest count
|
||||||
$questtopic['questcount'] = $this->Questtopics->getQuestCountForQuesttopic($questtopic['id']);
|
$questtopic['questcount'] = $this->Questtopics->getQuestCountForQuesttopic($questtopic['id']);
|
||||||
|
$totalQuestcount += $questtopic['questcount'];
|
||||||
|
|
||||||
// Get Character progress
|
// Get Character progress
|
||||||
$questtopic['characterQuestcount'] = $this->Questtopics->getCharacterQuestCountForQuesttopic($questtopic['id'], $character['id']);
|
$questtopic['characterQuestcount'] = $this->Questtopics->getCharacterQuestCountForQuesttopic($questtopic['id'], $character['id']);
|
||||||
|
$totalCharacterQuestcount += $questtopic['characterQuestcount'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Pass data to view
|
// Pass data to view
|
||||||
$this->set('seminary', $seminary);
|
$this->set('seminary', $seminary);
|
||||||
|
$this->set('totalQuestcount', $totalQuestcount);
|
||||||
|
$this->set('totalCharacterQuestcount', $totalCharacterQuestcount);
|
||||||
$this->set('questtopics', $questtopics);
|
$this->set('questtopics', $questtopics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,8 +1,8 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: The Legend of Z\n"
|
"Project-Id-Version: The Legend of Z\n"
|
||||||
"POT-Creation-Date: 2014-04-21 21:12+0100\n"
|
"POT-Creation-Date: 2014-04-21 21:42+0100\n"
|
||||||
"PO-Revision-Date: 2014-04-21 21:12+0100\n"
|
"PO-Revision-Date: 2014-04-22 00:29+0100\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: de_DE\n"
|
"Language: de_DE\n"
|
||||||
|
|
@ -147,17 +147,17 @@ msgstr "Platz"
|
||||||
msgid "You achieved %d of %d Achievements so far"
|
msgid "You achieved %d of %d Achievements so far"
|
||||||
msgstr "Du hast bislang %d von insgesamt %d Errungenschaften erreicht"
|
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
|
#: views/html/seminarybar/index.tpl:28
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "achieved at: %s"
|
msgid "achieved at: %s"
|
||||||
msgstr "erhalten am: %s"
|
msgstr "erhalten am: %s"
|
||||||
|
|
||||||
#: views/html/achievements/index.tpl:77
|
#: views/html/achievements/index.tpl:72
|
||||||
msgid "Secret Achievement"
|
msgid "Secret Achievement"
|
||||||
msgstr "Geheime Errungenschaft"
|
msgstr "Geheime Errungenschaft"
|
||||||
|
|
||||||
#: views/html/achievements/index.tpl:82
|
#: views/html/achievements/index.tpl:77
|
||||||
msgid "Continue playing to unlock this secret Achievement"
|
msgid "Continue playing to unlock this secret Achievement"
|
||||||
msgstr "Spiele weiter, um diesen geheimen Erfolg freizuschalten"
|
msgstr "Spiele weiter, um diesen geheimen Erfolg freizuschalten"
|
||||||
|
|
||||||
|
|
@ -319,6 +319,20 @@ msgstr "registriere dich"
|
||||||
msgid "Questtopics"
|
msgid "Questtopics"
|
||||||
msgstr "Themen"
|
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/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/delete.tpl:1 views/html/users/edit.tpl:1
|
||||||
#: views/html/users/index.tpl:1 views/html/users/login.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
|
#: views/html/quests/create.tpl:27
|
||||||
msgid "XPs"
|
msgid "XPs"
|
||||||
msgstr ""
|
msgstr "XPs"
|
||||||
|
|
||||||
#: views/html/quests/create.tpl:34
|
#: views/html/quests/create.tpl:34
|
||||||
msgid "Entry text"
|
msgid "Entry text"
|
||||||
msgstr ""
|
msgstr "Einstiegstext"
|
||||||
|
|
||||||
#: views/html/quests/create.tpl:36
|
#: views/html/quests/create.tpl:36
|
||||||
msgid "Wrong text"
|
msgid "Wrong text"
|
||||||
msgstr ""
|
msgstr "Text für falsche Antwort"
|
||||||
|
|
||||||
#: views/html/quests/create.tpl:37 views/html/quests/quest.tpl:55
|
#: views/html/quests/create.tpl:37 views/html/quests/quest.tpl:55
|
||||||
msgid "Task"
|
msgid "Task"
|
||||||
|
|
@ -428,7 +442,7 @@ msgstr "Lösung von %s"
|
||||||
|
|
||||||
#: views/html/quests/submissions.tpl:15
|
#: views/html/quests/submissions.tpl:15
|
||||||
msgid "submitted"
|
msgid "submitted"
|
||||||
msgstr "eingereicht am %s um %s Uhr"
|
msgstr "eingereicht"
|
||||||
|
|
||||||
#: views/html/seminaries/create.tpl:7
|
#: views/html/seminaries/create.tpl:7
|
||||||
msgid "New seminary"
|
msgid "New seminary"
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
{
|
{
|
||||||
// Get seminaries
|
// Get seminaries
|
||||||
return $this->db->query(
|
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 '.
|
'FROM seminaries '.
|
||||||
'ORDER BY created DESC'
|
'ORDER BY created DESC'
|
||||||
);
|
);
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
public function getSeminaryById($seminaryId)
|
public function getSeminaryById($seminaryId)
|
||||||
{
|
{
|
||||||
$seminary = $this->db->query(
|
$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 '.
|
'FROM seminaries '.
|
||||||
'WHERE id = ?',
|
'WHERE id = ?',
|
||||||
'i',
|
'i',
|
||||||
|
|
@ -91,7 +91,7 @@
|
||||||
public function getSeminaryByUrl($seminaryUrl)
|
public function getSeminaryByUrl($seminaryUrl)
|
||||||
{
|
{
|
||||||
$seminary = $this->db->query(
|
$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 '.
|
'FROM seminaries '.
|
||||||
'WHERE url = ?',
|
'WHERE url = ?',
|
||||||
's',
|
's',
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@
|
||||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h1><i class="fa fa-book fa-fw"></i><?=_('Questtopics')?></h1>
|
<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">
|
<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">
|
<div class="xpbar">
|
||||||
<span style="width:77%"></span>
|
<span style="width:<?=($totalQuestcount > 0) ? round($totalCharacterQuestcount/$totalQuestcount*100) : 0 ?>%"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="libindx cf">
|
<ul class="libindx cf">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue