Skip to content

Commit

Permalink
resolved issue with swapping of first- and lastname in csv export
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgenfinsveen committed Jun 26, 2023
1 parent 630856c commit 6c21bbf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions classes/bank/jazzquiz_question_bank_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class jazzquiz_question_bank_view extends \core_question\local\bank\view {

/**
* Define the columns we want to be displayed on the question bank
* @return array
* @return array core_question\local\bank\view::$requiredcolumns which are to
* be displayed.
*/
protected function wanted_columns(): array {
// Full class names for question bank columns.
Expand All @@ -64,8 +65,8 @@ protected function wanted_columns(): array {

/**
* Shows the question bank editing interface.
* @param string $tabname
* @param array $pagevars
* @param string $tabname question bank edit tab name
* @param array $pagevars list of page variables
* @throws \coding_exception
*/
public function display($pagevars, $tabname): void {
Expand Down
4 changes: 2 additions & 2 deletions classes/exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ public function export_attendance_csv(jazzquiz_session $session) {
$idnumber = $attendance['idnumber'];
$userFirstLastName = explode(', ', $attendance['name']);
if (count($userFirstLastName) >= 2) {
$lastName = $userFirstLastName[0];
$firstName = $userFirstLastName[1];
$lastName = $userFirstLastName[1];
$firstName = $userFirstLastName[0];
} else {
$lastName = $userFirstLastName[0];
$firstName = $userFirstLastName[0]; //for anonymous, but it doesn't even make sense since if it's anon, no name should display
Expand Down
3 changes: 2 additions & 1 deletion edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function jazzquiz_edit() {
$pagevars) = question_edit_setup('editq', '/mod/jazzquiz/edit.php', true);

$jazzquiz = new jazzquiz($cmid);
$renderer = $jazzquiz->renderer;
$renderer = $jazzquiz->renderer; // Todo: Flytt ned til hvor variabelen blir brukt

$modulename = get_string('modulename', 'jazzquiz');
$quizname = format_string($jazzquiz->data->name, true);
Expand All @@ -182,6 +182,7 @@ function jazzquiz_edit() {

// Process moving, deleting and unhiding questions...
$questionbank = new \core_question\local\bank\view($contexts, $url, $COURSE, $cm);


switch ($action) {
case 'order':
Expand Down

0 comments on commit 6c21bbf

Please sign in to comment.