diff --git a/CHANGES.md b/CHANGES.md index cf36474..fcbb766 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ ## Changelog ## +- [2.0.4]: + - Shortened long course names in exported documents. + +- [2.0.3]: + - Renamed more files from camelCase to lowercase. + - [2.0.2]: - Renamed files from camelCase to lowercase. diff --git a/classes/pdfs/examLabels.php b/classes/pdfs/examlabels.php similarity index 100% rename from classes/pdfs/examLabels.php rename to classes/pdfs/examlabels.php diff --git a/classes/pdfs/participantsList.php b/classes/pdfs/participantslist.php similarity index 93% rename from classes/pdfs/participantsList.php rename to classes/pdfs/participantslist.php index dc4de2f..c9bc71d 100644 --- a/classes/pdfs/participantsList.php +++ b/classes/pdfs/participantslist.php @@ -60,6 +60,12 @@ public function header() { throw new moodle_exception('missingparameter'); } + if (strlen($course->fullname) <= 40) { + $coursename = $course->fullname; + } else { + $coursename = $course->shortname; + } + if (file_exists(__DIR__.'/../../data/logo_full.ai')) { $this->ImageEps(__DIR__.'/../../data/logo_full.ai', 25, 12, 70); $this->SetFont('freeserif', 'B', 22); @@ -79,8 +85,7 @@ public function header() { $this->SetTextColor(0, 0, 0); $this->SetFont('freeserif', '', 14); $this->MultiCell(130, 50, strtoupper(helper::getcleancoursecategoryname()) . ' / ' . - $course->fullname . ' ('. $moduleinstance->name . - ')', 0, 'L', 0, 0, 25, 40); + $coursename . ' (' . $moduleinstance->name . ')', 0, 'L', 0, 0, 25, 40); $this->MultiCell(26, 50, helper::gethrexamtime($moduleinstance), 0, 'R', 0, 0, 159, 40); } diff --git a/classes/pdfs/resultsExamReview.php b/classes/pdfs/resultsexamreview.php similarity index 100% rename from classes/pdfs/resultsExamReview.php rename to classes/pdfs/resultsexamreview.php diff --git a/classes/pdfs/resultsPercentages.php b/classes/pdfs/resultspercentages.php similarity index 100% rename from classes/pdfs/resultsPercentages.php rename to classes/pdfs/resultspercentages.php diff --git a/classes/pdfs/seatingPlan.php b/classes/pdfs/seatingplan.php similarity index 92% rename from classes/pdfs/seatingPlan.php rename to classes/pdfs/seatingplan.php index 8501ae0..4aefc92 100644 --- a/classes/pdfs/seatingPlan.php +++ b/classes/pdfs/seatingplan.php @@ -59,6 +59,13 @@ public function header() { } else { throw new moodle_exception('missingparameter'); } + + if (strlen($course->fullname) <= 40) { + $coursename = $course->fullname; + } else { + $coursename = $course->shortname; + } + if (file_exists(__DIR__.'/../../data/logo_full.ai')) { $this->ImageEps(__DIR__.'/../../data/logo_full.ai', 25, 12, 70); $this->SetFont('helvetica', 'B', 22); @@ -70,8 +77,7 @@ public function header() { $this->SetFont('helvetica', 'B', 14); $this->MultiCell(130, 5, strtoupper(helper::getcleancoursecategoryname()) . ' / ' . - $course->fullname . ' ('. $moduleinstance->name .')', - 0, 'L', 0, 0, 25, 40); + $coursename . ' (' . $moduleinstance->name . ')', 0, 'L', 0, 0, 25, 40); $this->MultiCell(26, 5, helper::gethrexamtime($moduleinstance), 0, 'R', 0, 0, 159, 40); } diff --git a/exportresultsexamreview.php b/exportresultsexamreview.php index 98881da..2b285c8 100644 --- a/exportresultsexamreview.php +++ b/exportresultsexamreview.php @@ -129,8 +129,14 @@ $pdf->SetFont('helvetica', '', 16); $pdf->MultiCell(130, 3, get_string('pointslist_examreview', 'mod_exammanagement'), 0, 'C', 0, 0, 50, 17); +if (strlen($course->fullname) <= 40) { + $coursename = $course->fullname; +} else { + $coursename = $course->shortname; +} + $pdf->SetFont('helvetica', 'B', 16); -$pdf->MultiCell(130, 3, $course->fullname . ', ' . $moduleinstance->name, 0, 'C', 0, 0, 50, 25); +$pdf->MultiCell(130, 3, $coursename . ', ' . $moduleinstance->name, 0, 'C', 0, 0, 50, 25); $pdf->SetFont('helvetica', '', 16); $date = helper::gethrexamtime($moduleinstance); diff --git a/exportresultspercentages.php b/exportresultspercentages.php index e300555..3413373 100644 --- a/exportresultspercentages.php +++ b/exportresultspercentages.php @@ -131,8 +131,14 @@ $pdf->SetFont('helvetica', '', 16); $pdf->MultiCell(130, 3, get_string('pointslist_examreview', 'mod_exammanagement'), 0, 'C', 0, 0, 50, 17); +if (strlen($course->fullname) <= 40) { + $coursename = $course->fullname; +} else { + $coursename = $course->shortname; +} + $pdf->SetFont('helvetica', 'B', 16); -$pdf->MultiCell(130, 3, $course->fullname . ', ' . $moduleinstance->name, 0, 'C', 0, 0, 50, 25); +$pdf->MultiCell(130, 3, $coursename . ', ' . $moduleinstance->name, 0, 'C', 0, 0, 50, 25); $pdf->SetFont('helvetica', '', 16); $date = helper::gethrexamtime($moduleinstance); diff --git a/version.php b/version.php index 6892df1..a268cb1 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'mod_exammanagement'; // Full name of the plugin (used for diagnostics). -$plugin->release = '2.0.2'; // User-friendly version number. -$plugin->version = 2024022301; // The current module version (Date: YYYYMMDDXX). +$plugin->release = '2.0.4'; // User-friendly version number. +$plugin->version = 2024022601; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2020061500; // Requires this Moodle version. $plugin->maturity = MATURITY_STABLE;