Gradelist

- added additional Informations for courses
   - only display courses where the person is assigned to
   - added SWS Sum
   - Improved Multilanguage support
This commit is contained in:
Andreas Österreicher
2019-05-28 18:37:21 +02:00
parent 0c05e18949
commit 8d5742136c
7 changed files with 276 additions and 27 deletions
+67 -4
View File
@@ -28,6 +28,7 @@ class Gradelist extends Auth_Controller
$this->load->model('education/zeugnisnote_model', 'ZeugnisnoteModel');
$this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel');
$this->load->model('codex/note_model', 'NoteModel');
$this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel');
$this->loadPhrases(
array(
@@ -163,6 +164,14 @@ class Gradelist extends Auth_Controller
'studienplan_bezeichnung' => $stpl_bezeichnung,
);
}
$result_zuordnung = $this->LehrveranstaltungModel->getLvsByStudent($uid, $row_status->studiensemester_kurzbz);
if(isSuccess($result_zuordnung) && hasData($result_zuordnung))
{
$this->setZuordnung(
$result_zuordnung,
$courses['semester'][$row_status->studiensemester_kurzbz]['lvs']
);
}
}
// Load Grades and add to studyplan
@@ -186,6 +195,7 @@ class Gradelist extends Auth_Controller
if (!isset($row_noten->found))
{
$result_lv = $this->LehrveranstaltungModel->load($row_noten->lehrveranstaltung_id);
$result_stg = $this->StudiengangModel->load($result_lv->retval[0]->studiengang_kz);
$courses['semester'][$row_noten->studiensemester_kurzbz]['lvs_nonstpl'][] = array(
'lehrveranstaltung_id' => $row_noten->lehrveranstaltung_id,
'lehrtyp_kurzbz' => $result_lv->retval[0]->lehrtyp_kurzbz,
@@ -194,13 +204,20 @@ class Gradelist extends Auth_Controller
'sws' => $result_lv->retval[0]->sws,
'zeugnis' => $result_lv->retval[0]->zeugnis,
'bezeichnung' => $result_lv->retval[0]->bezeichnung,
'kurzbz' => $result_lv->retval[0]->kurzbz,
'ects' => $result_lv->retval[0]->ects,
'semester' => $result_lv->retval[0]->semester,
'note' => $row_noten->note,
'datum' => $row_noten->benotungsdatum
'datum' => $row_noten->benotungsdatum,
'zugeordnet' => true,
'studiengang_kurzbz' => $result_stg->retval[0]->kurzbzlang
);
if(!isset($courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl']))
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl'] = 0;
if(!isset($courses['semester'][$row_noten->studiensemester_kurzbz]['data']['swssumme_nonstpl']))
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['swssumme_nonstpl'] = 0;
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl'] += $result_lv->retval[0]->ects;
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['swssumme_nonstpl'] += $result_lv->retval[0]->sws;
}
}
@@ -210,6 +227,8 @@ class Gradelist extends Auth_Controller
$num_grades_overall = 0;
$sum_ects_overall = 0;
$sum_ects_positiv_overall = 0;
$sum_sws_overall = 0;
$sum_sws_positiv_overall = 0;
// Calculate Sum and Average
foreach ($courses['semester'] as $stsem => $row_lvs)
@@ -219,6 +238,8 @@ class Gradelist extends Auth_Controller
$num_grades = 0;
$sum_ects = 0;
$sum_ects_positiv = 0;
$sum_sws = 0;
$sum_sws_positiv = 0;
$sum_grades = 0;
$notendurchschnitt = 0;
$sum_gradeweighted = 0;
@@ -235,8 +256,12 @@ class Gradelist extends Auth_Controller
$sum_gradeweighted += $row['ects'] * $this->_grades[$row['note']]['notenwert'];
}
$sum_ects += $row['ects'];
$sum_sws += $row['sws'];
if ($this->_grades[$row['note']]['positiv'])
{
$sum_ects_positiv += $row['ects'];
$sum_sws_positiv += $row['sws'];
}
}
if ($num_grades > 0)
$notendurchschnitt = $sum_grades / $num_grades;
@@ -254,11 +279,15 @@ class Gradelist extends Auth_Controller
$sum_ectsweighted_overall += $sum_ectsweighted;
$sum_ects_overall += $sum_ects;
$sum_ects_positiv_overall += $sum_ects_positiv;
$sum_sws_overall += $sum_sws;
$sum_sws_positiv_overall += $sum_sws_positiv;
$courses['semester'][$stsem]['data']['notendurchschnitt'] = number_format($notendurchschnitt, 2);
$courses['semester'][$stsem]['data']['notendurchschnittgewichtet'] = number_format($notendurchschnittgewichtet, 2);
$courses['semester'][$stsem]['data']['ectssumme'] = number_format($sum_ects,2);
$courses['semester'][$stsem]['data']['ectssumme_positiv'] = number_formaT($sum_ects_positiv,2);
$courses['semester'][$stsem]['data']['ectssumme_positiv'] = number_format($sum_ects_positiv,2);
$courses['semester'][$stsem]['data']['swssumme'] = number_format($sum_sws,2);
$courses['semester'][$stsem]['data']['swssumme_positiv'] = number_format($sum_sws_positiv,2);
}
if ($num_grades_overall > 0)
@@ -275,7 +304,9 @@ class Gradelist extends Auth_Controller
'notendurchschnitt' => number_format($notendurchschnitt, 2),
'notendurchschnittgewichtet' => number_format($notendurchschnittgewichtet, 2),
'ectssumme' => $sum_ects_overall,
'ectssumme_positiv' => $sum_ects_positiv_overall
'ectssumme_positiv' => $sum_ects_positiv_overall,
'swssumme' => $sum_sws_overall,
'swssumme_positiv' => $sum_sws_positiv_overall
);
return $courses;
}
@@ -306,6 +337,37 @@ class Gradelist extends Auth_Controller
}
}
/**
* Checks if the Student is Assigned to this course and marks the course
* @param $zuordnung reference to array of all assigned courses.
* @param $courses reference to array of all courses.
* @param $studiensemester_kurzbz Studiensemester of the Course and Grades
*/
private function setZuordnung(&$zuordnung, &$courses)
{
$subtree_zugeordnet = false;
foreach ($courses as $key => $value)
{
foreach ($zuordnung->retval as $zuordnungkey => $row_zuordnung)
{
if ($row_zuordnung->lehrveranstaltung_id == $value['lehrveranstaltung_id'])
{
$courses[$key]['zugeordnet'] = true;
$subtree_zugeordnet = true;
}
if (isset($value['childs']))
{
if ($this->setZuordnung($zuordnung, $courses[$key]['childs']) === true)
{
$courses[$key]['zugeordnet'] = true;
$subtree_zugeordnet = true;
}
}
}
}
return $subtree_zugeordnet;
}
/**
* Reads all the Courses recursivly and Returns an Array with the Grades and ECTS
* @param $courses array of courses
@@ -320,7 +382,8 @@ class Gradelist extends Auth_Controller
{
$grades[] = array(
'note' => $row['note'],
'ects' => $row['ects']
'ects' => $row['ects'],
'sws' => $row['sws']
);
}
+6 -2
View File
@@ -37,7 +37,9 @@ class StudienplanLib
'pflicht' => $row->pflicht,
'zeugnis' => $row->zeugnis,
'bezeichnung' => $row->bezeichnung,
'ects' => $row->ects
'kurzbz' => $row->kurzbz,
'ects' => $row->ects,
'semester' => $row->semester
);
$childs = $this->getChildElements($row->studienplan_lehrveranstaltung_id);
if(is_array($childs) && count($childs) > 0)
@@ -65,7 +67,9 @@ class StudienplanLib
'pflicht' => $row->pflicht,
'zeugnis' => $row->zeugnis,
'bezeichnung' => $row->bezeichnung,
'ects' => $row->ects
'kurzbz' => $row->kurzbz,
'ects' => $row->ects,
'semester' => $row->semester
);
$childs = $this->getChildElements($row->studienplan_lehrveranstaltung_id);
if(is_array($childs))
+17 -3
View File
@@ -3,16 +3,27 @@ if(isset($course['note']) && isset($grades[$course['note']]))
$gradeclass = ($grades[$course['note']]['positiv']?'gradelist_row_grade_positiv':'gradelist_row_grade_negativ');
else
$gradeclass = '';
// Only Display the Course if the person is assigned to the course
// (no additional elective courses are displayed)
if(isset($course['zugeordnet']) && $course['zugeordnet'] === true)
{
?>
<tr class="gradelist_row_<?php echo $course['lehrtyp_kurzbz']; ?> gradelist_row_depth_<?php echo $depth; ?>">
<td><?php echo $course['bezeichnung']; ?></td>
<td><?php echo $course['kurzbz']; ?></td>
<td align="center">
<?php
echo $course['semester'].'. Sem ';
if(isset($course['studiengang_kurzbz']))
echo '( '.$course['studiengang_kurzbz'].' )';
?></td>
<td><?php echo (isset($course['lehrform_kurzbz'])?$course['lehrform_kurzbz']:''); ?></td>
<td align="right"><?php echo (isset($course['ects'])?$course['ects']:''); ?></td>
<!--
<td align="right"><?php echo (isset($course['sws'])?$course['sws']:''); ?></td>
<td align="right"><?php echo (isset($course['lehrform_kurzbz'])?$course['lehrform_kurzbz']:''); ?></td>
<td align="right"><?php echo (isset($course['pflicht'])?($course['pflicht']?'Ja':'Nein'):''); ?></td>
<td align="right"><?php echo (isset($course['zeugnis'])?($course['zeugnis']?'Ja':'Nein'):''); ?></td>
-->
<td class="<?php echo $gradeclass; ?>">
<?php
if (isset($course['note']) && isset($grades[$course['note']]['anmerkung']))
@@ -20,3 +31,6 @@ else
?>
</td>
</tr>
<?php
}
?>
@@ -31,9 +31,11 @@
</div>
</div>
<div>
<b><?php echo $this->p->t('lehre', 'notendurchschnitt'); ?>:</b>
<b><?php echo $this->p->t('lehre', 'notendurchschnitt'); ?>
<img src="../../../../skin/images/information.png" title="<?php echo htmlentities($this->p->t('lehre', 'info_notendurchschnitt')); ?>" />:</b>
<?php echo $courses['overall']['notendurchschnitt'] ?><br>
<b><?php echo $this->p->t('lehre', 'gewichteternotendurchschnitt'); ?>:</b>
<b><?php echo $this->p->t('lehre', 'gewichteternotendurchschnitt'); ?>
<img src="../../../../skin/images/information.png" title="<?php echo htmlentities($this->p->t('lehre', 'info_notendurchschnitt_gewichtet')); ?>" />:</b>
<?php echo $courses['overall']['notendurchschnittgewichtet'] ?><br>
<b><?php echo $this->p->t('lehre', 'ects'); ?>:</b>
<?php echo $courses['overall']['ectssumme_positiv'] ?><br>
+35 -12
View File
@@ -38,13 +38,13 @@
<thead>
<tr>
<th><?php echo $this->p->t('lehre','lehrveranstaltung');?></th>
<th><?php echo $this->p->t('lehre','kurzbz');?></th>
<th><?php echo $this->p->t('lehre','semester');?></th>
<th><?php echo $this->p->t('lehre','lehrform');?></th>
<th style="text-align: right"><?php echo $this->p->t('lehre','ects');?></th>
<!--
<th>SWS</th>
<th>Lehrform</th>
<th>Pflichtfach</th>
<th>Zeugnis</th>
-->
<th style="text-align: right"><?php echo $this->p->t('lehre','sws');?></th>
<th><?php echo $this->p->t('lehre','pflichtfach');?></th>
<th><?php echo $this->p->t('lehre','zeugnis');?></th>
<th><?php echo $this->p->t('lehre','note');?></th>
</tr>
</thead>
@@ -58,6 +58,9 @@
</tbody>
<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th style="text-align: right">
<?php
@@ -71,6 +74,20 @@
}
?>
</th>
<th style="text-align: right">
<?php
echo (isset($semesterdata['swssumme_positiv'])?$semesterdata['swssumme_positiv']:'');
if (isset($semesterdata['swssumme'])
&& isset($semesterdata['swssumme_positiv'])
&& $semesterdata['swssumme'] != $semesterdata['swssumme_positiv'])
{
echo ' ('.$semesterdata['swssumme'].')';
}
?>
</th>
<th></th>
<th></th>
<th></th>
</tr>
</tfoot>
@@ -84,13 +101,13 @@
<thead>
<tr>
<th><?php echo $this->p->t('lehre','lehrveranstaltung');?></th>
<th><?php echo $this->p->t('lehre','kurzbz');?></th>
<th><?php echo $this->p->t('lehre','semester');?></th>
<th><?php echo $this->p->t('lehre','lehrform');?></th>
<th><?php echo $this->p->t('lehre','ects');?></th>
<!--
<th>SWS</th>
<th>Lehrform</th>
<th>Pflichtfach</th>
<th>Zeugnis</th>
-->
<th><?php echo $this->p->t('lehre','sws');?></th>
<th><?php echo $this->p->t('lehre','pflichtfach');?></th>
<th><?php echo $this->p->t('lehre','zeugnis');?></th>
<th><?php echo $this->p->t('lehre','note');?></th>
</tr>
</thead>
@@ -107,8 +124,14 @@
</tbody>
<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th style="text-align: right"><?php echo (isset($semesterdata['ectssumme_nonstpl'])?number_format($semesterdata['ectssumme_nonstpl'],2):''); ?></th>
<th style="text-align: right"><?php echo (isset($semesterdata['swssumme_nonstpl'])?number_format($semesterdata['swssumme_nonstpl'],2):''); ?></th>
<th></th>
<th></th>
<th></th>
</tr>
</tfoot>
+2
View File
@@ -16,9 +16,11 @@
.gradelist_row_grade_positiv {
color: green;
font-weight: bold;
}
.gradelist_row_grade_negativ {
color: red;
font-weight: bold;
}
.gradelist_row_depth_1 > td:first-child {
padding-left: 15px !important;
+145 -4
View File
@@ -2223,6 +2223,66 @@ $phrases = array(
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'sws',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'SWS',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'SP/W',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'pflichtfach',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Pflichtfach',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Mandatory',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'zeugnis',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Zeugnis',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Transcript',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
@@ -2303,6 +2363,46 @@ $phrases = array(
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'kurzbz',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Kurzbz',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'ShortDesc',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'semester',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Semester',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Semester',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
@@ -2314,16 +2414,57 @@ $phrases = array(
'text' => 'Nicht studienplanrelevante Lehrveranstaltung',
'description' => '',
'insertvon' => 'system'
),
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'info_notendurchschnitt',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'English',
'text' => 'additional Courses',
'sprache' => 'German',
'text' => 'Notendurchschnitt über alle Noten (inkl. negative)',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'info_notendurchschnitt_gewichtet',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Notendurchschnitt über alle Noten (inkl. negative) gewichtet nach ECTS der LV. = (Summe (Note der LV * ECTS der LV))/Gesamtsumme der ECTS',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'lehrform',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Lehrform',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Course Type',
'description' => '',
'insertvon' => 'system'
)
)
),
//********************** INFOCENTER/infocenter
array(
'app' => 'infocenter',