Skip to content

Commit

Permalink
Put in the names of the owners
Browse files Browse the repository at this point in the history
  • Loading branch information
kreut committed Jan 4, 2023
1 parent 8d00ac3 commit 4d349cd
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 101 deletions.
12 changes: 12 additions & 0 deletions app/Question.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand All @@ -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'];
Expand Down
Loading

0 comments on commit 4d349cd

Please sign in to comment.