Skip to content

Commit 7ba53bb

Browse files
committed
Header HTMl
All tests pass
1 parent e841a6b commit 7ba53bb

8 files changed

Lines changed: 70 additions & 20 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
namespace App\Console\Commands;
4+
5+
use Illuminate\Console\Command;
6+
7+
class getPHPExtensions extends Command
8+
{
9+
/**
10+
* The name and signature of the console command.
11+
*
12+
* @var string
13+
*/
14+
protected $signature = 'get:phpExtensions';
15+
16+
/**
17+
* The console command description.
18+
*
19+
* @var string
20+
*/
21+
protected $description = 'Command description';
22+
23+
/**
24+
* Create a new command instance.
25+
*
26+
* @return void
27+
*/
28+
public function __construct()
29+
{
30+
parent::__construct();
31+
}
32+
33+
/**
34+
* Execute the console command.
35+
*
36+
* @return int
37+
*/
38+
public function handle()
39+
{
40+
exec('php -r "print_r(get_loaded_extensions());"', $output);
41+
dd($output);
42+
43+
}
44+
}

app/Http/Controllers/AutoGradedAndFileSubmissionController.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
use Illuminate\Http\Request;
1212
use Illuminate\Support\Facades\DB;
1313
use Illuminate\Support\Facades\Gate;
14+
use Illuminate\Support\Facades\Storage;
15+
use PhpOffice\PhpSpreadsheet\Spreadsheet;
16+
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
17+
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
18+
use Symfony\Component\HttpFoundation\BinaryFileResponse;
19+
use Throwable;
1420

1521
class AutoGradedAndFileSubmissionController extends Controller
1622
{
@@ -19,7 +25,7 @@ class AutoGradedAndFileSubmissionController extends Controller
1925
* @param Assignment $assignment
2026
* @param Submission $submission
2127
* @return array
22-
* @throws \Throwable
28+
* @throws Throwable
2329
*/
2430
public function getAutoGradedSubmissionsByAssignment(Assignment $assignment,
2531
Submission $submission): array
@@ -32,6 +38,7 @@ public function getAutoGradedSubmissionsByAssignment(Assignment $assignment,
3238
$response['message'] = $authorized->message();
3339
return $response;
3440
}
41+
3542
try {
3643
$enrolled_users = $assignment->course->enrolledUsers->sortBy('first_name', SORT_NATURAL|SORT_FLAG_CASE);
3744
$questions = DB::table('assignment_question')
@@ -125,7 +132,7 @@ public function getAutoGradedSubmissionsByAssignment(Assignment $assignment,
125132
* @param Submission $Submission
126133
* @param SubmissionFile $submissionFile
127134
* @return array
128-
* @throws \Throwable
135+
* @throws Throwable
129136
*/
130137
public function getAutoGradedAndFileSubmissionsByAsssignmentAndQuestionAndStudent(Request $request,
131138
Assignment $assignment,

app/Http/Controllers/QuestionController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function __construct()
8181
'Assignment',
8282
"Template",
8383
'Topic',
84-
"Source",
84+
"Header HTML",
8585
"Auto-Graded Technology",
8686
"Technology ID/File Path",
8787
"Author",
@@ -454,7 +454,7 @@ public function validateCSVBulkImport(Request $request,
454454
$messages[] = "Row $row_num is missing a Title.";
455455
}
456456

457-
if ($import_template === 'advanced' && $question['Question Type*'] === 'exposition' && !$question['Source']) {
457+
if ($import_template === 'advanced' && $question['Question Type*'] === 'exposition' && !$question['Header HTML']) {
458458
$messages[] = "Row $row_num is an exposition type question and is missing the source.";
459459
}
460460

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

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

app/Http/Requests/StoreQuestionRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ function messages()
169169
$messages['webwork_code.required'] = 'WeBWork code is required.';
170170
}
171171
$messages['non_technology_text.required'] = $this->question_type === 'assessment'
172-
? 'Either the source field or the technology field is required.'
173-
: 'The source field is required.';
172+
? 'Either the header HTML field or the technology field is required.'
173+
: 'The header HTML field is required.';
174174
$messages['folder_id.required'] = "The folder is required.";
175175

176176
foreach ($this->all() as $key => $value) {

resources/js/components/questions/BulkImportQuestions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ export default {
14771477
course_id: this.importToCourse,
14781478
assignment: question['Assignment'],
14791479
topic: question['Topic'],
1480-
non_technology_text: question['Source'],
1480+
non_technology_text: question['Header HTML'],
14811481
technology: question['Auto-Graded Technology'],
14821482
technology_id: question['Technology ID/File Path'],
14831483
text_question: question['Text Question'],

resources/js/components/questions/CreateQuestion.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@
367367
>
368368
<template v-slot:label>
369369
<span style="cursor: pointer;" @click="toggleExpanded ('non_technology_text')">
370-
{{ questionForm.question_type === 'assessment' ? 'Source (Optional)' : 'Source*' }}
370+
{{ questionForm.question_type === 'assessment' ? 'Header HTML (Optional)' : 'Header HTML*' }}
371371
<font-awesome-icon v-if="!editorGroups.find(group => group.id === 'non_technology_text').expanded"
372372
:icon="caretRightIcon" size="lg"
373373
/>
@@ -1642,7 +1642,7 @@ export default {
16421642
editorGroups: [
16431643
{ id: 'technology', expanded: false },
16441644
{ id: 'a11y_technology', expanded: false },
1645-
{ id: 'non_technology_text', label: 'Source', expanded: false },
1645+
{ id: 'non_technology_text', label: 'Header HTML', expanded: false },
16461646
{ label: 'Text Question', id: 'text_question', expanded: false },
16471647
{ label: 'Answer', id: 'answer_html', expanded: false },
16481648
{ label: 'Solution', id: 'solution_html', expanded: false },
@@ -2001,7 +2001,7 @@ export default {
20012001
this.webworkEditorShown = false
20022002
if (technology === 'qti') {
20032003
if (this.questionForm.non_technology_text) {
2004-
this.$noty.info('Please remove any Source before changing to Native. You can always move your Source into the Prompt of your Native question.')
2004+
this.$noty.info('Please remove any Header HTML before changing to Native. You can always move your Header HTML into the Prompt of your Native question.')
20052005
this.questionFormTechnology = this.questionForm.technology
20062006
} else {
20072007
this.editorGroups.find(editorGroup => editorGroup.id === 'non_technology_text').expanded = false
@@ -2245,7 +2245,7 @@ export default {
22452245
},
22462246
toggleExpanded (id) {
22472247
if (id === 'non_technology_text' && this.questionForm.technology === 'qti') {
2248-
this.$noty.info('Please enter your Source within the Prompt textarea.')
2248+
this.$noty.info('Please enter your Header HTML within the Prompt textarea.')
22492249
return false
22502250
}
22512251
let editorGroup = this.editorGroups.find(group => group.id === id)

tests/Feature/Instructors/AutoGradedSubmissionsTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public function setup(): void
3333

3434

3535
/** @test */
36-
3736
public function non_owner_cannot_get_auto_graded_submissions()
3837
{
3938

@@ -44,7 +43,7 @@ public function non_owner_cannot_get_auto_graded_submissions()
4443
}
4544
/** @test */
4645

47-
public function owner_cannot_get_auto_graded_submissions()
46+
public function owner_can_get_auto_graded_submissions()
4847
{
4948

5049
$this->actingAs($this->user)

tests/Feature/QuestionEditorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function setup(): void
8282
"Assignment" => "",
8383
"Template" => "",
8484
"Topic" => "",
85-
'Source' => 'some source',
85+
'Header HTML' => 'some source',
8686
"Auto-Graded Technology" => "webwork",
8787
"Technology ID/File Path" => "some-file-path",
8888
"Author" => "",
@@ -99,7 +99,7 @@ public function setup(): void
9999
"Public*" => "0",
100100
"Folder*" => 'Some Folder',
101101
"Title*" => "Some Title",
102-
'Source' => 'some source',
102+
'Header HTML' => 'some source',
103103
"Auto-Graded Technology" => "webwork",
104104
"Technology ID/File Path" => "some-file-path",
105105
"Author" => "",
@@ -120,7 +120,7 @@ public function setup(): void
120120
"Assignment" => "",
121121
"Template" => "",
122122
"Topic" => "",
123-
'Source' => 'some source',
123+
'Header HTML' => 'some source',
124124
"Auto-Graded Technology" => "",
125125
"Technology ID/File Path" => "",
126126
"Author" => "",
@@ -138,7 +138,7 @@ public function setup(): void
138138
"Public*" => "0",
139139
"Folder*" => 'Some Folder',
140140
"Title*" => "Some Title",
141-
'Source' => 'some source',
141+
'Header HTML' => 'some source',
142142
"Auto-Graded Technology" => "",
143143
"Technology ID/File Path" => "",
144144
"Author" => "",
@@ -568,7 +568,7 @@ public function uploaded_file_must_have_the_right_structure()
568568
$this->actingAs($this->user)->putJson("/api/questions/validate-bulk-import-questions",
569569
['import_template' => 'advanced',
570570
'csv_file_array' => [['bad structure']]])
571-
->assertJson(['message' => ['The CSV should have a first row with the following headings: Question Type*, Public*, Folder*, Title*, Source, Auto-Graded Technology, Technology ID/File Path, Author, License, License Version, Tags, Text Question, Answer, Solution, Hint.']]);
571+
->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, Tags, Text Question, Answer, Solution, Hint.']]);
572572
}
573573

574574
/** @test */
@@ -623,7 +623,7 @@ public function exposition_questions_need_source()
623623
{
624624
$csv_file_array = $this->exposition_csv_file_array_my_questions;
625625
$csv_file_array[0]['Question Type*'] = 'exposition';
626-
$csv_file_array[0]['Source'] = '';
626+
$csv_file_array[0]['Header HTML'] = '';
627627

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

0 commit comments

Comments
 (0)