Code reformat, patch score gen
This commit is contained in:
@@ -740,14 +740,18 @@ class CombinedOpenEndedV1Module():
|
||||
scores = []
|
||||
for i in xrange(0,self.current_task_number):
|
||||
last_response = self.get_last_response(i)
|
||||
max_score = last_response['max_score'] * float(self.weight)
|
||||
score = last_response['score'] * float(self.weight)
|
||||
scores.append(score)
|
||||
score = max(scores)
|
||||
try:
|
||||
max_score = last_response['max_score'] * float(self.weight)
|
||||
score = last_response['score'] * float(self.weight)
|
||||
scores.append(score)
|
||||
except:
|
||||
pass
|
||||
if len(scores)>0:
|
||||
score = max(scores)
|
||||
|
||||
score_dict = {
|
||||
'score': score ,
|
||||
'total': max_score ,
|
||||
'score': score,
|
||||
'total': max_score,
|
||||
}
|
||||
|
||||
return score_dict
|
||||
|
||||
@@ -183,12 +183,10 @@ class PeerGradingModule(PeerGradingFields, XModule):
|
||||
score_dict = {
|
||||
'score': score,
|
||||
'total': max_score,
|
||||
}
|
||||
}
|
||||
if self.use_for_single_location not in TRUE_DICT or self.is_graded not in TRUE_DICT:
|
||||
return score_dict
|
||||
|
||||
|
||||
|
||||
try:
|
||||
count_graded = self.student_data_for_location['count_graded']
|
||||
count_required = self.student_data_for_location['count_required']
|
||||
@@ -207,7 +205,7 @@ class PeerGradingModule(PeerGradingFields, XModule):
|
||||
self.student_data_for_location = response
|
||||
|
||||
try:
|
||||
score = int(count_graded >= count_required and count_graded>0) * float(self.weight)
|
||||
score = int(count_graded >= count_required and count_graded > 0) * float(self.weight)
|
||||
total = self.max_grade * float(self.weight)
|
||||
score_dict['score'] = score
|
||||
score_dict['total'] = total
|
||||
@@ -588,5 +586,5 @@ class PeerGradingDescriptor(PeerGradingFields, RawDescriptor):
|
||||
|
||||
stores_state = True
|
||||
has_score = True
|
||||
always_recalculate_grades=True
|
||||
always_recalculate_grades = True
|
||||
template_dir_name = "peer_grading"
|
||||
|
||||
Reference in New Issue
Block a user