Skip to content

Commit

Permalink
wip images questions (#10)
Browse files Browse the repository at this point in the history
needs testing. should i also assume that the student’s function return
the image link? that’s what i’m going with but i started wondering.
finishing this tomorrow morning.
  • Loading branch information
dkreimer committed Jun 28, 2016
1 parent bf844f5 commit be6d99f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions grader_result.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<body>

<div class="container">
<h1>PS03 Autograder Results for x</h1>
<h1>PS03 Autochecker Results
</h1>
</div>

<div class="container">
Expand Down Expand Up @@ -117,7 +118,7 @@ <h4 class="alert alert-warning">Not Found</h4>

<div class="container">
<p>This output is for your information only.
You may fix mistakes and re-run the autograder as many times as you like.
You may fix mistakes and re-run the autochecker as many times as you like.
Once you are satisfied with your code,
turn it in by running <code>hwsubmit.py</code>.
</p>
Expand Down
1 change: 0 additions & 1 deletion grading.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def grade(self, gradingModule, funcNotDefined, exceptionMap = {}, bonusPic = Fal
"""

self.undefined = funcNotDefined
print self.undefined
completedQuestions = set([])
for q in self.questions:
self.printedMessage += '\nQuestion %s\n' % q
Expand Down
7 changes: 5 additions & 2 deletions testClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def execute(self, grades):

#TODO: make it hapen
class UngradedImageQuestion(Question):
def execute(self):
def execute(self, grades):
return None

class WeightedCasesQuestion(Question):
Expand Down Expand Up @@ -213,7 +213,10 @@ def evalCode(self, moduleDict):

def execute(self, grades, moduleDict, solutionDict):
result = self.evalCode(moduleDict)
if result == solutionDict['result']:
if isinstance(self.question, UngradedImageQuestion):
grades.addMessage('IMAGE: {0}\n\tExpected image: <img src={1}>\n\tStudent image: <img src={2}>'.format(self.path, solutionDict['result'],result))
return True
elif result == solutionDict['result']:
grades.addMessage('PASS: {0}\n\t{1}\n\tscore: {2}'.format(self.path, self.success, self.weight+'/'+self.weight))
return True
else:
Expand Down

0 comments on commit be6d99f

Please sign in to comment.