Code grader/ External Grader Edx

240 views
Skip to first unread message

Colleen Villon

unread,
May 5, 2015, 6:19:19 AM5/5/15
to edx-...@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.
screenshot.jpg
codegrader.jpg

Sarina Canelake

unread,
May 5, 2015, 2:02:30 PM5/5/15
to edx-code
Hi Colleen,

To use the 6.00x graders, you need to have XQueue set up. This is not set up by default, and I'm not sure how to do it or if we provide documentation on it.

This is probably a better question for the openedx-ops mailing list. Also, please do not cross post to mailing lists: try to ask your question on one mailing list, only cross posting if you don't get a response after at least a few days.

--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/f2dea457-b8b7-4310-a48e-575f1cb123f6%40googlegroups.com.

Colleen Villon

unread,
May 6, 2015, 3:20:29 AM5/6/15
to edx-...@googlegroups.com
I already set up the Xqueue for it. But there is an error occured again in studio view. it says --> "NO GRADER HAS BEEN SET FOR THIS PROBLEM." What should I do?

--
You received this message because you are subscribed to a topic in the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/CAGrrCpG2doSnWBxcsoNSRN3wZkQX7PAt_oztu4rP6-GUZvUEDA%40mail.gmail.com.

Sarina Canelake

unread,
May 7, 2015, 11:04:18 AM5/7/15
to edx-code
Hi Colleen,

As I said in my response, This is probably a better question for the openedx-ops mailing list. Also, please do not cross post to mailing lists: try to ask your question on one mailing list, only cross posting if you don't get a response after at least a few days.

Reply all
Reply to author
Forward
0 new messages