Installation

Courses not visible on main Webwork page

Courses not visible on main Webwork page

by Harshal Patel -
Number of replies: 12

Hello,

I have installed version 2.17 on RHEL8. I can see the homepage at http://webwork.yourschool.edu/webwork2, where webwork.yourschool.edu is the address where I have hosted the server. I am able to login as admin to http://webwork.yourschool.edu/webwork2/admin and can also create courses.

However, they are not visible on the main page http://webwork.yourschool.edu/webwork2/. On the server, when I go to /opt/webwork/courses, I can see the courses and can also access the course directly as admin through the URL: https://webwork.yourschool.edu/webwork2/[coursename] (where [coursename] is the name of the course I have created). So new courses are not visible on the main page but are being created.

I made sure that there is not a file called "hide_directory" in the course directory. I have added the details added in site.conf. $database_port value is kept as the default, 3306. We are using an on-prem database server at University so I have mentioned that in the $database_host and $database_name fields.

Please let me know what can I do to make the courses visible on the home page.

Thank you!
Harshal


In reply to Harshal Patel

Re: Courses not visible on main Webwork page

by Peter Staab -
If you go into the admin page, there is a Hide Courses tab/section. Can you look there to see if they are hidden? There should be a list of courses and inside ( ) will say either visible or hidden.
In reply to Peter Staab

Re: Courses not visible on main Webwork page

by Harshal Patel -

Hi Peter,

Thank you for replying. Hide Courses tab only show admin course in the list, but again if I go to /opt/webwork/courses on the server, I see the courses there so not sure what's missing at this point.

Harshal

In reply to Harshal Patel

Re: Courses not visible on main Webwork page

by Glenn Rice -

It really doesn't make sense that the courses would show up in the admin course, but not show up on the webwork2 main page.  Both of those pages call the same method to list courses.

Do you have local modifications to the webwork2 files that might be causing an issue?  Run "git status" from the /opt/webwork/webwork2 directory.  That should output:

    On branch main
    Your branch is up to date with 'origin/main'.

    nothing to commit, working tree clean

It is generally okay if you also see something like

    Untracked files:
      (use "git add <file>..." to include in what will be committed)
      ... list of files

But if it shows something like

    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
        modified:   lib/WeBWorK/ContentGenerator/CourseAdmin.pm
        modified:   lib/WeBWorK/ContentGenerator/Home.pm

for example, then you have local modifications that are most likely the issue.  You could run "git checkout -- ." to restore the files to the default.  Although you might want to see what those changes are before you do so, and probably back things up.

If you are saying the courses don't even show up in the admin course, then the problem is clear.  Your database connection is not working.  You say you see the course directories, but those are NOT the courses.  The courses are in the database, and most likely the directories are being created when you create courses, but the actual database tables are not being created.  Do you get errors when you try to add a course from the admin course?

In reply to Glenn Rice

Re: Courses not visible on main Webwork page

by Harshal Patel -
Hi Glenn,

Thanks for helping out. There were some unstaged files. I restored them using "git checkout --." but nothing changed. I am using an external MySQL database server, I checked the database tables for a course I recently created called "harshal_may12" and can see tables such as
harshal_may12_achievement
harshal_may12_achievement_user
harshal_may12_key
harshal_may12_password
harshal_may12_permission

and few other tables. I do not get any error when I add a course from the admin course.

Harshal
In reply to Harshal Patel

Re: Courses not visible on main Webwork page

by Glenn Rice -
So if you run "git status" now, it doesn't show any unstaged changes?

Also, did you restart apache2 after doing that?


In reply to Glenn Rice

Re: Courses not visible on main Webwork page

by Harshal Patel -
It shows

On branch main
Your branch is ahead of 'origin/main' by 2 commits.
(use "git push" to publish your local commits)

Untracked files:
(use "git add ..." to include in what will be committed)
check_latex.log

nothing added to commit but untracked files present (use "git add" to track)

Yes I did restart apache2.
In reply to Harshal Patel

Re: Courses not visible on main Webwork page

by Glenn Rice -
I should have just had you post the results of executing "git status" to begin with. It is showing that your branch is "ahead of 'origin/main' by 2 commits". That is a problem. You have 2 commits in the main branch that are not part of webwork.

Run "git log -2" and post the output of that command here.

Also run "git diff origin/main > ~/diff.patch".  That will create a file name "diff.patch" in your home directory (probably /home/wwadmin).  Attach that file here also.

To reset your code to the webwork2 code on github run "git reset --hard origin/main".  That will remove the 2 commits that you have.
In reply to Glenn Rice

Re: Courses not visible on main Webwork page

by Harshal Patel -

Hi Glen,

Here's the output for git log -2:

commit 19d279607d42a8e202ba890677d0acb9da56525e (HEAD -> main)
Merge: c72d48f74 65073f9d4
Author: root <root@FQDN>
Date:   Mon May 15 14:24:03 2023 -0700
    Merge branch 'main' of https://github.com/openwebwork/webwork2
    Commit May 15, 2023
commit c72d48f74391472cad9d9db44419179900b8607e
Author: root <root@FQDN>
Date:   Mon May 15 14:09:45 2023 -0700
    Commit May 15,2023

Attaching the diff.patch file here.

I ran "git reset --hard origin/main" and now the branch is up-to-date. Git status shows the following message:

On branch main
Your branch is up to date with 'origin/main'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        check_latex.log
nothing added to commit but untracked files present (use "git add" to track)

I restarted the apache server, courses are still now showing. When I go to Student Progress from the admin course, I can see all the users that I created while creating the courses.

I really appreciate you assisting me with fixing this issue!

Harshal

In reply to Harshal Patel

Re: Courses not visible on main Webwork page

by Glenn Rice -

So the only changes shown in the diff are permissions changes.  You may have permissions issues.  You might want to check that those are all set right.  See https://webwork.maa.org/wiki/Installation_Manual_for_2.16_on_RHEL8.  Apparently there isn't an installation manual for 2.17 on RHEL8.  I am not sure why not.

You shouldn't see users in the courses from the admin course.  You should only see users in a course when you are signed in to that course.  The users you see in the admin course are the admin course users.  Copies of instructor users are created in the admin course as students when you create a course though.

If you do not see the courses in the admin course, then your database is not set up correctly.  I am not sure how to diagnose that for you.  I don't know how you could be adding courses from the admin course, and not see them from the admin course after they are created.

In reply to Glenn Rice

Re: Courses not visible on main Webwork page

by Harshal Patel -

Hi Glenn,

So I deleted webwork, OPL, and PG directories and cloned them again. I do not see any issues except that the courses are not being displayed on the home page. As I mentioned earlier, I was using an on-prem mySQL server and had added those values in the site.conf file for $database_host, $database_port and $database_name values. When I changed these values to localhost and created a database on the webwork server itself, I was able to see the courses that I created afterwards.

I made sure the user on mySQL server database has all the permissions, and on the back-end, courses are created and I could access them through the URL as well. It's just that when $database_host is localhost, courses are displayed but when $database_host is set to a database on our mySQL server, they do not show.

Do you recommend using the localhost? Or is there some other setting I am missing?

Thanks again for your valuable support!

Harshal

In reply to Harshal Patel

Re: Courses not visible on main Webwork page

by Glenn Rice -

I am a little at a loss as to how the courses could be successfully created from the admin course, and yet not show up in the admin course.  Is that how you are creating courses, that is from the admin course in the browser?  If that is not the case, then how are you creating courses?  Are you using a script or something?

If using localhost is an option and that is working, then you can do that.  Using a database on another server should work fine if it is configured correctly.

In reply to Glenn Rice

Re: Courses not visible on main Webwork page

by Harshal Patel -
Hi Glenn,

Yes I am creating the course from admin course in the browser. I have been trying to use database on another server as we prefer this practice at our university. As I mentioned, I changed the values in the site.conf file for $database_host, $database_port and $database_name. Is there any other setting I am missing? Also, the database gets populated with tables, so what configuration could be missing?