Code grader/ External grader Edx

805 views
Skip to first unread message

Colleen Villon

unread,
May 5, 2015, 6:21:58 AM5/5/15
to opene...@googlegroups.com
I'm using Edx open source. My laptop operating system is ubuntu 14.0 LTS
I'm working on Code grader or External grader in Edx. But whenever i paste the right answer on the answer area and click the CHECK button, nothing happens and there is message showing up.-->  "Unable to deliver your submission to grader (Reason: Queue 'edX-DemoX' not found). Please try again later." 

THIS IS THE QUESTION IN THE CODE GRADER:
We are searching for the smallest monthly payment such that we can pay off the entire balance of a loan within a year.
The following values might be useful when writing your solution

Monthly interest rate = (Annual interest rate) / 12
Monthly payment lower bound = Balance / 12
Monthly payment upper bound = (Balance x (1 + Monthly interest rate)12) / 12

The following variables contain values as described below:
balance - the outstanding balance on the credit card
annualInterestRate - annual interest rate as a decimal

Write a program that uses these bounds and bisection search (for more info check out the Wikipedia page on bisection search) to find the smallest monthly payment to the cent such that we can pay off the debt within a year.

Note that if you do not use bisection search, your code will not run - your code only has 30 seconds to run on our servers. If you get a message that states "Your submission could not be graded. Please recheck your submission and try again. If the problem persists, please notify the course staff.", check to be sure your code doesn't take too long to run.

The code you paste into the following box should not specify the values for the variables balance or annualInterestRate - our test code will define those values before testing your submission.


THIS IS THE RIGHT ANSWER I PUT ON ANSWER AREA:
monthlyInterestRate = annualInterestRate/12
lowerBound = balance/12
upperBound = (balance * (1+annualInterestRate/12)**12)/12
originalBalance = balance

# Keep testing new payment values 
#  until the balance is +/- $0.02
while abs(balance) > .02:
    # Reset the value of balance to its original value
    balance = originalBalance
    # Calculate a new monthly payment value from the bounds
    payment = (upperBound - lowerBound)/2 + lowerBound

    # Test if this payment value is sufficient to pay off the 
    #  entire balance in 12 months
    for month in range(12):
        balance -= payment
        balance *= 1+monthlyInterestRate

    # Reset bounds based on the final value of balance
    if balance > 0: 
        # If the balance is too big, need higher payment
    #  so we increase the lower bound
        lowerBound = payment
    else:
        # If the balance is too small, we need a lower
    #  payment, so we decrease the upper bound
        upperBound = payment

# When the while loop terminates, we know we have 
#  our answer!
print "Lowest Payment:", round(payment, 2)
-------

Is there any one here could help me to make my external grader/ code grader work? Thanks!
I attached 2(two) image files, A screenshots of error.
codegrader.jpg
screenshot.jpg

Feanil Patel

unread,
May 5, 2015, 9:09:59 AM5/5/15
to opene...@googlegroups.com
Colleen,

The code grader and the lms are tied together by the xqueue? Is that service running?   If it is, the next thing to check would be whether or not the queue name 'edX-DemoX' is cofigure in that service.

-Feanil

--
You received this message because you are subscribed to the Google Groups "Open edX operations" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openedx-ops...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Colleen Villon

unread,
May 5, 2015, 10:33:08 AM5/5/15
to opene...@googlegroups.com
Yes we already check it, and we set a queue name for it. But still there is an error shows up. It says --> "NO GRADER HAS BEEN SET FOR THIS PROBLEM." What should I do?

Colleen Villon

unread,
May 8, 2015, 4:50:14 AM5/8/15
to opene...@googlegroups.com
Up! Help

Jonathan Sanito

unread,
May 27, 2015, 7:27:03 PM5/27/15
to opene...@googlegroups.com
How do you set a queue name? Tks.

Alexander Valdez

unread,
Jun 2, 2015, 8:14:01 AM6/2/15
to opene...@googlegroups.com
hi Jonathan . can you give me some sample how to this part ? 

xqueue_watcher.grader.Grader

To implement a pull grader:

Subclass xqueue_watcher.grader.Grader and override the grade method. Then add your grader to the config like "handler": "my_module.MyGrader". The arguments for the grade method are: *grader_path: absolute path to the grader defined for the current problem * grader_config: other configuration particular to the problem * student_response: student-supplied code.

Ed Zarecor

unread,
Jun 2, 2015, 4:02:23 PM6/2/15
to opene...@googlegroups.com
The queues are set using the XQUEUE_QUEUES var that is set to the following the the defaults for the role:

XQUEUE_QUEUES:
  # push queue
  'edX-Open_DemoX': 'http://localhost:18050'
  # pull queues
  'test-pull': !!null
  'certificates': !!null
  'open-ended': !!null
  'open-ended-message': !!null

The queues will need to be created by running ansible against the xqueue with the vars overridden.

Ed.

Roberto Wills

unread,
Jun 4, 2015, 7:56:00 AM6/4/15
to opene...@googlegroups.com
I set up my queue name for my course, got an error in checking in studio saying: No grader has been set up for this problem, and when i run it in live: The result is always right, even if i put the wrong answer in the answer box.  


On Tuesday, May 5, 2015 at 6:21:58 PM UTC+8, Colleen Villon wrote:

Ed Zarecor

unread,
Jun 4, 2015, 7:58:57 AM6/4/15
to opene...@googlegroups.com
In a gist, can you provide the XML from your problem and your xqueue configuration with the secrets removed.  Can you also include the exact text of the error message that you are seeing in the LMS and any related messages in the LMS logs.

Best,

Ed.
Reply all
Reply to author
Forward
0 new messages