Skip to content
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

Problem with grader requirements #11

Open
carsongee opened this issue Jul 30, 2014 · 5 comments
Open

Problem with grader requirements #11

carsongee opened this issue Jul 30, 2014 · 5 comments

Comments

@carsongee
Copy link

I have a grader that needs additional libraries. They are installed no problem, but when the xqueuewatcher imp loads the grader it doesn't have that library: https://github.com/edx/xqueue-watcher/blob/master/xqueue_watcher/jailedgrader.py#L103

The relevant parts from the grader:

import numpy as np
from numpy import array, matrix
import gradelib
reload(gradelib)
from gradelib import Grader, InvokeStudentFunctionTest, must_define_function, rand, generateRandom2DData

fn = "perceptron"

grader = Grader()
grader.add_input_check(must_define_function(fn))

Should I just make a task in the ansible play to install all the individual coder requirements into the root processes' venv, or is there a better way?

@e0d
Copy link
Contributor

e0d commented Jul 31, 2014

Yeah I'm familiar with this problem and I think we need to fix the watcher, I discussed with Ned and DCS a while ago, let me revive that conversation.

@davestgermain
Copy link
Contributor

What is the actual exception? I noticed that generateRandom2DData doesn't exist in gradelib.py

@carsongee
Copy link
Author

I think that will likely turn into another issue after we get past this one that we may just be able to fix in the courseware. The particular class has extended gradelib.py in it's own repo and will stack dump with:

ERROR:xqueue_watcher.client:cannot import name generateRandom2DData
Traceback (most recent call last):
  File "xqueue_watcher/client.py", line 134, in process_one
    success = self._handle_submission(content)
  File "xqueue_watcher/client.py", line 117, in _handle_submission
    result = handler(content)
  File "xqueue_watcher/grader.py", line 107, in __call__
    return self.process_item(content)
  File "xqueue_watcher/grader.py", line 136, in process_item
    results = self.grade(grader_path, grader_config, student_response)
  File "xqueue_watcher/jailedgrader.py", line 103, in grade
    grader_module = imp.load_source("grader_module", grader_path)
  File "/edx/app/xqwatcher/data/MITx-6.s064x/graders/project_1/perceptron/grade_perceptron.py", line 4, in <module>
    from gradelib import Grader, InvokeStudentFunctionTest, must_define_function, rand, generateRandom2DData
ImportError: cannot import name generateRandom2DData

Is there anyway to allow it to have it's own version with xqueue-watcher or is the only way just to move those added functions into another module? Is there a way to have common modules for a course, or does it all have to be inline? I haven't looked too closely yet if it has changed any internal functions in greadelib over what xqwatcher provides to know if an override would be mandatory.

The stack trace for the numpy issue though, which is more specifically what I'd like to address first is:

ERROR:xqueue_watcher.client:No module named numpy
Traceback (most recent call last):
  File "xqueue_watcher/client.py", line 134, in process_one
    success = self._handle_submission(content)
  File "xqueue_watcher/client.py", line 117, in _handle_submission
    result = handler(content)
  File "xqueue_watcher/grader.py", line 107, in __call__
    return self.process_item(content)
  File "xqueue_watcher/grader.py", line 136, in process_item
    results = self.grade(grader_path, grader_config, student_response)
  File "xqueue_watcher/jailedgrader.py", line 103, in grade
    grader_module = imp.load_source("grader_module", grader_path)
  File "/edx/app/xqwatcher/data/MITx-6.s064x/graders/project_1/perceptron/grade_perceptron.py", line 1, in <module>
    import numpy as np
ImportError: No module named numpy

@alexandervaldez
Copy link

hi i am trying to connect xqwatcher to xqueue , how can i create a queue for xqtwatcher? inside the xqueue.env.json?

@nickjm
Copy link

nickjm commented Jun 1, 2018

Hi I would like to revisit this issue. I am helping launch a course that also has common functionality that should be shared across graders as @carsongee describes. My current solution is to copy in a module to the clean directory where the submission code runs, but this is only possible with a custom grade.py file which I'm unable to specify -- see issue #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants