-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
be able to copy more things from a course when adding a new course #2290
Conversation
c3dec66
to
295f12a
Compare
Now it's back to only selecting "copy templates and html folders" when you first load the page, but there is a "select all" checkbox too. The "select all" does not include selecting the "copy config file" checkbox. I think this should only be done if someone knows they really want that. In general when creating a course we should let it generate a brand new course.conf file and not propagate something old. |
Can someone explain to me what a "non_native" table is? Before the changes here, there is a check if the Mimicking this, I put checks for "non_native" around the code blocks that do the new things (copy problem set records, etc.) But I'm not sure what I am doing there or why I am doing it. Or if checking the |
The non-native tables are the tables in the database that do not belong to a course, as well as the virtual tables that are not actual tables at all. The latter tables you don't need to worry about for this. Those are the merged and versioned tables. The non-native tables that are actual tables are the "locations", "location_addresses", and "depths" tables. A quick note on the database.conf.dist file. That file is perltidied in #2276. So your changes here will conflict with that. Your changes seem to be indentation cleanup which perltidy takes care of as well as much more. |
Also, the check to see if the |
I was hoping it was the right thing to just remove that check. I will do that. No rush on reviewing this, of course. I isolated that indentation into one commit, so it will be easy to just revert that and avoid the conflict. |
I see a logic problem in one place. Together with the removal of those "non_native" checks, no one should look at this too much until I update. |
I updated a few things mentioned in this thread and this is ready for review. |
7367f11
to
c18608b
Compare
I made this so that when (non-student) users are copied from an old course:
|
dbc8d85
to
c223524
Compare
Overall, I like this. I have a script that does a bunch of this right now, but this may make it superfluous. And I always need to make sure that instructors export their homework sets--which they often don't do. I think your defaults do the right thing even if we have some changing defaults. |
c223524
to
e0c8945
Compare
OK, I see that you have changes in #2172 that will impact much of this with conflicts. I think maybe one or the other of these two should be merged and then sort things out with the other one after that. |
I just updated #2172 and hopefully we can get that merged soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some issues that I see. I will add a pull request that handles these things. It also tweaks the margins on the "Add Course" page. Those seem to have gotten out of sync.
Thanks for all the reviewing you are doing. This is the first week of class at PCC, and I'm pretty busy with day job stuff. I will follow up with your feedback when I can. One thing caught my eye:
So, right or wrong, that was intentional. I don't think it is a good idea to copy the course config file from one course to another new course. Even when you want to copy everything else. I don't know how much it matters, but it sets So I wanted to discourage copying IIRC, I think we hope to one day stop giving instructors access to course.conf at all. Anything the instructor should be able to adjust should be in |
If that is the case, then the copy course configuration file checkbox should not be listed with the rest. It should be separated out below, and perhaps a comment added that gives a warning about using it (or some explanation as to why it is separate from the rest). It is non-intuitive when there is a select all checkbox, but yet it doesn't select "all". If I were to see that in a user interface with no explanation, I think something is broken. Also, we want the course.conf file not to be editable by instructors, but this is the admin course and admin users only have access to this. We do allow admin users to edit the course.conf file. |
Suggestions from my review of openwebwork#2290.
cc0e554
to
7a8af75
Compare
I can move it when I come back to this. (Or I can group it in with the select-all, if you think that is best.) Note that this issue mentioned (lightly) in the help file content that was added with this PR.
What I'm talking about is when I use the admin course to copy things from instructor A's old course to make a new course for instructor B. I might want the new course to have everything from the old course, but I am wary of bringing A's old |
I think that separating this checkbox from the others by moving it below, and adding a brief comment before it would alleviate the issue. If the checkbox is in the middle of all of the rest that are affected by the select all checkbox it is odd.
I just mean that even though A and B are not admin users, the admin user that is doing the copying of the courses is an admin user that has the permission to edit the |
ce1abb9
to
f728cb8
Compare
It think this has conflicts repaired and externalPrograms removed now, and ready for people to test one more time. |
I tested and something is indeed broken here. I'll update once I have looked into it. |
OK, now I have tested this and it worked. A new course was made, and it copied all the things this is supposed to copy (and did not copy student accounts). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that the bin/addcourse
script needs to be updated for the changes to the addCourse
method's optional arguments. It uses the templatesFrom
argument that has been replaced with the copyFrom
argument.
Note that anyone that uses the |
This just uses the simplest possible approach and switches the script from using the now removed `templatesFrom` option to using the new `copyFrom` option. If that option is set, then the new `copyTemplatesHtml` option is also set to be true. Thus the existing behavior of the script is preserved. The script could be updated to actually take advantage of the new options instead if one were ambitious, but this is good enough for now. This also fixes all of the long lines in `lib/WeBWorK/Utils/CourseManagement.pm`, and an issue with comments in the `initNonNativeTables` method.
I added a pull request to this branch that updates the |
Once you either merge my pull request or update the |
Update the `bin/addcourse` script for the new `addCourse` options.
I merged your PR with the 120 character issue and the |
I will merge this now with two approvals. |
There are three lines of code changed. Line 53 of `templates/ContentGenerator/CourseAdmin.html.ep` was deleted. That line should not exist. That saves a list of all courses to the `@courseIDs` variable that is never used. The `listCourses` method is called again on line 56 (now 55). On line 56 (now 55) of that same file, the admin course is omitted from the listing. This is how it used to be, and was removed in openwebwork#2295. I don't believe that the admin course should be listed on the admin course listings page. On line 110 of `templates/ContentGenerator/CourseAdmin/add_course_form.html.ep` the admin course is kept in the listing. This is the list of courses that can be copied. This was how it was set up in openwebwork#2295, but was reverted in openwebwork#2290 (probably in merge resolution, or maybe my changes to that pull request?). The intent was to allow the admin course to be copied to change to a new course to use for the admin course. The first line changed is not controversial, but the second two are up for discussion.
There are three lines of code changed. Line 53 of `templates/ContentGenerator/CourseAdmin.html.ep` was deleted. That line should not exist. That saves a list of all courses to the `@courseIDs` variable that is never used. The `listCourses` method is called again on line 56 (now 55). On line 56 (now 55) of that same file, the admin course is omitted from the listing. This is how it used to be, and was removed in openwebwork#2295. I don't believe that the admin course should be listed on the admin course listings page. On line 110 of `templates/ContentGenerator/CourseAdmin/add_course_form.html.ep` the admin course is kept in the listing. This is the list of courses that can be copied. This was how it was set up in openwebwork#2295, but was reverted in openwebwork#2290 (probably in merge resolution, or maybe my changes to that pull request?). The intent was to allow the admin course to be copied to change to a new course to use for the admin course. The first line changed is not controversial, but the second two are up for discussion.
This changes the "Add Course" sub page of Course Admin, so that when you make a new course, there is more you can copy from some target course (currently, you can copy the
templates
folder,html
folder, andsimple.conf
file).Now you can also copy the
course.conf file
, although this is discouraged in the help file and not selected by default.Addiitionally you can copy certain data from the database. Namely:
For these database-flavored components, I made them all selected for copying when the page loads. I realize it's a change in behavior, and at first I had them all unchecked for that reason. But the more I thought about it, the fewer use cases I could come up with where you would want any of these unchecked. But it's up for discussion.
One thing I did not do: if users and sets are copied, this does not keep users assigned to whichever sets they were assigned to in the older course. Same with achievements. That could be done if desired, but I would only want it to reflect the assignments, not any progress the user made on the sets or the achievements.