From 4d349cde25915c9040d71a7f4e69460f69f5730e Mon Sep 17 00:00:00 2001 From: Eric Kean Date: Wed, 4 Jan 2023 08:51:34 -0800 Subject: [PATCH] Put in the names of the owners --- app/Question.php | 12 ++ .../components/questions/CreateQuestion.vue | 203 +++++++++--------- 2 files changed, 114 insertions(+), 101 deletions(-) diff --git a/app/Question.php b/app/Question.php index 36ec9aed9..93db5a11f 100644 --- a/app/Question.php +++ b/app/Question.php @@ -2333,6 +2333,17 @@ function formatQuestionFromDatabase(object $question_info): array ->select('subject') ->orderBy('question_learning_outcome.id', 'desc') ->first(); + $question_editor = DB::table('users')->where('id', $question_info['question_editor_user_id'])->first(); + if ($question_editor) { + if ($question_editor->first_name === 'Default Non-Instructor Editor') { + $question_editor_name = $question_editor->first_name; + } else { + $question_editor_name = "$question_editor->first_name $question_editor->last_name"; + } + } else { + $question_editor_name = 'No author name is available.'; + + } $question['title'] = $question_info['title']; $question['subject'] = $learning_outcome ? $learning_outcome->subject : null; $question['id'] = $question_info['id']; @@ -2341,6 +2352,7 @@ function formatQuestionFromDatabase(object $question_info): array $question['public'] = $question_info['public']; $question['page_id'] = $question_info['page_id']; $question['question_editor_user_id'] = $question_info['question_editor_user_id']; + $question['question_editor_name'] = $question_editor_name; $question['iframe_id'] = $this->createIframeId(); $question['technology'] = $question_info['technology']; $question['non_technology'] = $question_info['non_technology']; diff --git a/resources/js/components/questions/CreateQuestion.vue b/resources/js/components/questions/CreateQuestion.vue index 3e6df92a7..2335efbe8 100644 --- a/resources/js/components/questions/CreateQuestion.vue +++ b/resources/js/components/questions/CreateQuestion.vue @@ -1,6 +1,6 @@
- + Fields marked with the - + icon contain expandable text areas.