RunestoneInteractive / RunestoneComponents

Packaging of the Runestone tools for publishing educational materials using github pages
http://runestoneinteractive.org
Other
101 stars 225 forks source link

assignment not loading #1098

Closed irunestone closed 3 years ago

irunestone commented 3 years ago

Error reported in course CS128Seiter on page /runestone/assignments/doAssignment?assignment_id=51456 by user lseiter@jcu.edu lseiter@jcu.edu I have been receiving an error several times this past week when I create an assignment for my students.
I can create an assignment without any problem attached and the students and I can view the assignment. When I add a problem, the assignment is no longer accessible. I made a copy of existing problems that work in other assignments, and just change the activecode id and class name, but the assignment won't load.

I have to go through this process about 5 times, trying to creaate a new problem to add to my assignment, and after about the 5th time it works.

This is a new bug that has been happening for about a week now.

---------------- Traceback --------------
Traceback (most recent call last):

File "/home/bmiller/Runestone/web2py/gluon/packages/dal/pydal/objects.py", line 116, in getattr return self.getitem(k) File "/home/bmiller/Runestone/web2py/gluon/packages/dal/pydal/objects.py", line 103, in getitem raise KeyError(key) KeyError: 'chapters'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/bmiller/Runestone/web2py/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "/home/bmiller/Runestone/web2py/applications/runestone/controllers/assignments.py", line 1188, in File "/home/bmiller/Runestone/web2py/gluon/globals.py", line 421, in self._caller = lambda f: f() File "/home/bmiller/Runestone/web2py/gluon/tools.py", line 3869, in f return action(*a, **b) File "/home/bmiller/Runestone/web2py/applications/runestone/controllers/assignments.py", line 639, in doAssignment chapter_name=q.chapters.chapter_name or q.questions.chapter, File "/home/bmiller/Runestone/web2py/gluon/packages/dal/pydal/objects.py", line 118, in getattr raise AttributeError AttributeError

bnmnetp commented 3 years ago

I don't think I'm following your sequence of events.

  1. You create a blank assignment with no questions???
  2. You and your students can see the empty assignment.
  3. You add a problem. An existing problem? A new problem you write?
  4. The assignment is no longer accessible?? Meaning it does not show up in the list anymore? Is the visible to students box unchecked?

What exactly are you doing that leads to the traceback???

What exactly do you have to do 5 times before it works? That is very odd indeed as there should not be randomness in the system.

Can you send me the name of an assignment that is giving you problems so I can do some database investigation?

I'm a bit mystified as I'm not hearing about this from anyone else, nor am I seeing similar crashes in the crash log. Looking at the git log I have not made changes since the end of October.

lseiter commented 3 years ago

Before this week I did not have any issue creating assignments. Currently there seems to be an issue when I create new problems to attach to assignments.

I normally create a new assignment and add several activecode problems. Previously the students had no problem accessing the assignment and the problems. For some reason this stopped working this past week and I get a github error page when the students attempt to view the assignment. If however I remove all problems from the assignment we are able to view the empty assignment. If I add a problem from an old assignment we are able to view the assignment. But if I create new problems to add to the assignment we are not able to view the assignment. Runestone seems to make me recreate each new problem about 5 times before it actually accepts the new problem and allows me to add it to an assignment.

lseiter commented 3 years ago

I was having issues with my homework 8 and test 2. Currently they are working but I had to create quick a few versions of each problem before it work view.

bnmnetp commented 3 years ago

I've been trying to recreate this both on my dev server and on academy. I made my own course based on csjava, created an assignment, added a couple of questions that I wrote at the time. No problem.

If you have an assignment that is crashing maybe you can leave it in that state and send me the details so I can try to figure something out when it is in a bad way.

lseiter commented 3 years ago

I created a homework named tmperror. The tmperror assignment contains one problem with id test2_seiter_task2

bnmnetp commented 3 years ago

Thanks!

I understand what is going on now. Every chapter MUST have an Exercises.rst file in it. And that Exercises.rst file should have the title Exercises.

This is imperative because it is the Subchapter that Runestone assigns all instructor generated questions to go into. Without that chapter in the database the query fails to return the rows needed.

I just added an empty exercises subchapter for Unit5-Writing-Methods.

The query is now returning the proper rows for that. I'm not sure if your recent assignments have all been referencing Unit5 but this is a recurring issue that crops up with every new books all the time and I have to rediscover the solution. I thought I had coded a nice workaround, but it was that workaround that is causing your crash.

Try to view your tmperror assignment. I think it should work now.

Brad

lseiter commented 3 years ago

ok it is visible now.

thanks!

bnmnetp commented 3 years ago

I've implemented a better workaround for a missing Exercises.rst file. Will be live tomorrow.