Skip to content

Commit

Permalink
separate course config file copy option
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Jordan committed Feb 7, 2024
1 parent 2f21006 commit ce1abb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
5 changes: 3 additions & 2 deletions lib/WeBWorK/ContentGenerator/CourseAdmin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,9 @@ sub do_add_course ($c) {
# Include any optional arguments, including a template course and the course title and course institution.
my %optional_arguments;
if ($copy_from_course ne '') {
%optional_arguments = map { $_ => 1 } $c->param('copy_component');
$optional_arguments{copyFrom} = $copy_from_course;
%optional_arguments = map { $_ => 1 } $c->param('copy_component');
$optional_arguments{copyFrom} = $copy_from_course;
$optional_arguments{copyConfig} = $c->param('copy_config_file');
}
if ($add_courseTitle ne '') {
$optional_arguments{courseTitle} = $add_courseTitle;
Expand Down
22 changes: 16 additions & 6 deletions templates/ContentGenerator/CourseAdmin/add_course_form.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@
<%= maketext('simple configuration file') =%>
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<%= check_box copy_component => 'copyConfig', class => 'form-check-input' =%>
<%= maketext('course configuration file') =%>
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<%= check_box copy_component => 'copyNonStudents', class => 'form-check-input' =%>
Expand Down Expand Up @@ -178,6 +172,22 @@
<%= maketext('course institution (will override "Institution" input above)') =%>
</label>
</div>
<div class="form-check mt-3 mb-2">
<label class="form-check-label">
<%= check_box copy_config_file => 1, class => 'form-check-input' =%>
<%= maketext('course configuration file') =%>
<a class="help-popup" role="button" tabindex="0" data-bs-placement="top" data-bs-toggle="popover"
data-bs-content="<%= maketext('Copying the course configuration file may copy configuration '
. 'settings that are specific to the original course instructor. If this is a new course '
. 'for a new instructor, use the fields above to add the new instructor and do not copy '
. 'the course configuration file. Then if there is something in the course configuration '
. 'file that should be carried into the new course, the administrator can copy that manually. '
. 'Alternatively, do copy the course configuration file, but then the administrator should '
. 'inspect the new course configuration file and make adjustments for the new instructor.') =%>">
<i class="icon fas fa-question-circle" data="<%= maketext('Help Icon') =%>" aria-hidden="true"></i>
</a>
</label>
</div>
</fieldset>
<%= hidden_field add_dbLayout => 'sql_single' =%>
<%= submit_button maketext('Add Course'), name => 'add_course', class => 'btn btn-primary' =%>
Expand Down

0 comments on commit ce1abb9

Please sign in to comment.