From 632b4db157753d5fa6a8dd2bf06b5840a37d0647 Mon Sep 17 00:00:00 2001 From: Daniel Nolte Date: Mon, 26 Feb 2024 17:16:52 +0000 Subject: [PATCH 1/2] fix(files): Renamed more files from camelCase to lowercase. --- CHANGES.md | 3 +++ classes/pdfs/{examLabels.php => examlabels.php} | 0 classes/pdfs/{participantsList.php => participantslist.php} | 0 classes/pdfs/{resultsExamReview.php => resultsexamreview.php} | 0 .../pdfs/{resultsPercentages.php => resultspercentages.php} | 0 classes/pdfs/{seatingPlan.php => seatingplan.php} | 0 version.php | 4 ++-- 7 files changed, 5 insertions(+), 2 deletions(-) rename classes/pdfs/{examLabels.php => examlabels.php} (100%) rename classes/pdfs/{participantsList.php => participantslist.php} (100%) rename classes/pdfs/{resultsExamReview.php => resultsexamreview.php} (100%) rename classes/pdfs/{resultsPercentages.php => resultspercentages.php} (100%) rename classes/pdfs/{seatingPlan.php => seatingplan.php} (100%) diff --git a/CHANGES.md b/CHANGES.md index cf36474..d76cc39 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ ## Changelog ## +- [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 100% rename from classes/pdfs/participantsList.php rename to classes/pdfs/participantslist.php 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 100% rename from classes/pdfs/seatingPlan.php rename to classes/pdfs/seatingplan.php diff --git a/version.php b/version.php index 6892df1..02c9782 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.3'; // User-friendly version number. +$plugin->version = 2024022600; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2020061500; // Requires this Moodle version. $plugin->maturity = MATURITY_STABLE; From 0e2fe68126ca0ca564fd8f9a51386a4a99e1dc20 Mon Sep 17 00:00:00 2001 From: Daniel Nolte <> Date: Mon, 26 Feb 2024 18:45:54 +0100 Subject: [PATCH 2/2] fix(documents): Shortened long course names in exported documents. --- CHANGES.md | 3 +++ classes/pdfs/participantslist.php | 9 +++++++-- classes/pdfs/seatingplan.php | 10 ++++++++-- exportresultsexamreview.php | 8 +++++++- exportresultspercentages.php | 8 +++++++- version.php | 4 ++-- 6 files changed, 34 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d76cc39..fcbb766 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ ## Changelog ## +- [2.0.4]: + - Shortened long course names in exported documents. + - [2.0.3]: - Renamed more files from camelCase to lowercase. diff --git a/classes/pdfs/participantslist.php b/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/seatingplan.php b/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 02c9782..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.3'; // User-friendly version number. -$plugin->version = 2024022600; // 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;