Skip to content

Commit

Permalink
Open-Ended Content instead of the Header HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
kreut committed Oct 6, 2022
1 parent 7fc9f97 commit 13b0058
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/LibretextController.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,12 @@ public function getHeaderHtml($question_id)
if ($question) {
$non_technology_html = $question->non_technology_html;
} else {
$non_technology_html = "We could not locate the Header HTML for Question $question_id";
$non_technology_html = "We could not locate the Open-Ended Content for Question $question_id";
}
}
}
} catch (Exception $e) {
$non_technology_html = "We were not able to retrieve the Header HTML for Question $question_id. Please contact us for assistance.";
$non_technology_html = "We were not able to retrieve the Open-Ended Content for Question $question_id. Please contact us for assistance.";
$h = new Handler(app());
$h->report($e);
}
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/QuestionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function __construct()
'Assignment',
"Template",
'Topic',
"Header HTML",
"Open-Ended Content",
"Auto-Graded Technology",
"Technology ID/File Path",
"Author*",
Expand Down Expand Up @@ -574,7 +574,7 @@ public function validateCSVBulkImport(Request $request,
$messages[] = "Row $row_num is missing a Title.";
}

if ($import_template === 'advanced' && $question['Question Type*'] === 'exposition' && !$question['Header HTML']) {
if ($import_template === 'advanced' && $question['Question Type*'] === 'exposition' && !$question['Open-Ended Content']) {
$messages[] = "Row $row_num is an exposition type question and is missing the source.";
}

Expand All @@ -588,7 +588,7 @@ public function validateCSVBulkImport(Request $request,
$messages[] = "Row $row_num is an exposition type question and should not have Text Question, Answer, Solution, or Hint.";
}

if ($import_template === 'advanced' && $question['Question Type*'] === 'assessment' && !$question['Header HTML'] && !$question['Auto-Graded Technology']) {
if ($import_template === 'advanced' && $question['Question Type*'] === 'assessment' && !$question['Open-Ended Content'] && !$question['Auto-Graded Technology']) {
$messages[] = "Row $row_num is an assessment and needs either an auto-graded technology or source.";
}

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Requests/StoreQuestionRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ function messages()
$messages['webwork_code.required'] = 'WeBWork code is required.';
}
$messages['non_technology_text.required'] = $this->question_type === 'assessment'
? 'Either the header HTML field or the technology field is required.'
: 'The header HTML field is required.';
? 'Either the Open-Ended Content field or the technology field is required.'
: 'The Open-Ended Content field is required.';
$messages['folder_id.required'] = "The folder is required.";

foreach ($this->all() as $key => $value) {
Expand Down
12 changes: 6 additions & 6 deletions tests/Feature/QuestionEditorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function setup(): void
"Assignment" => "",
"Template" => "",
"Topic" => "",
'Header HTML' => 'some source',
'Open-Ended Content' => 'some source',
"Auto-Graded Technology" => "webwork",
"Technology ID/File Path" => "some-file-path",
"Author*" => "some author",
Expand All @@ -101,7 +101,7 @@ public function setup(): void
"Public*" => "0",
"Folder*" => 'Some Folder',
"Title*" => "Some Title",
'Header HTML' => 'some source',
'Open-Ended Content' => 'some source',
"Auto-Graded Technology" => "webwork",
"Technology ID/File Path" => "some-file-path",
"Author*" => "Some author",
Expand All @@ -123,7 +123,7 @@ public function setup(): void
"Assignment" => "",
"Template" => "",
"Topic" => "",
'Header HTML' => 'some source',
'Open-Ended Content' => 'some source',
"Auto-Graded Technology" => "",
"Technology ID/File Path" => "",
"Author*" => "Some Author",
Expand All @@ -142,7 +142,7 @@ public function setup(): void
"Public*" => "0",
"Folder*" => 'Some Folder',
"Title*" => "Some Title",
'Header HTML' => 'some source',
'Open-Ended Content' => 'some source',
"Auto-Graded Technology" => "",
"Technology ID/File Path" => "",
"Author*" => "Some Author",
Expand Down Expand Up @@ -614,7 +614,7 @@ public function uploaded_file_must_have_the_right_structure()
$this->actingAs($this->user)->putJson("/api/questions/validate-bulk-import-questions",
['import_template' => 'advanced',
'csv_file_array' => [['bad structure']]])
->assertJson(['message' => ['The CSV should have a first row with the following headings: Question Type*, Public*, Folder*, Title*, Header HTML, Auto-Graded Technology, Technology ID/File Path, Author*, License*, License Version, Source URL, Tags, Text Question, Answer, Solution, Hint.']]);
->assertJson(['message' => ['The CSV should have a first row with the following headings: Question Type*, Public*, Folder*, Title*, Open-Ended Content, Auto-Graded Technology, Technology ID/File Path, Author*, License*, License Version, Source URL, Tags, Text Question, Answer, Solution, Hint.']]);
}

/** @test */
Expand Down Expand Up @@ -669,7 +669,7 @@ public function exposition_questions_need_source()
{
$csv_file_array = $this->exposition_csv_file_array_my_questions;
$csv_file_array[0]['Question Type*'] = 'exposition';
$csv_file_array[0]['Header HTML'] = '';
$csv_file_array[0]['Open-Ended Content'] = '';

$this->actingAs($this->user)->putJson("/api/questions/validate-bulk-import-questions",
['import_template' => 'advanced',
Expand Down

0 comments on commit 13b0058

Please sign in to comment.