Skip to content

Commit 5bc90b1

Browse files
committed
Merge pull request code-dot-org#8497 from code-dot-org/quick-assessment-fixes
assessment: two quick fixes
2 parents aa1657b + f283a17 commit 5bc90b1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

code-studio/src/js/levels/levelGroup.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ window.initLevelGroup = function (
2222

2323
window.getResult = getResult;
2424

25+
// Temporarily reduce throttling to 2 seconds for small audience, until we
26+
// implement saving on changing via dots at top of page.
2527
var throttledSaveAnswers =
26-
window.dashboard.utils.throttle(saveAnswers, 20 * 1000, {'leading': true, 'trailing': true});
28+
window.dashboard.utils.throttle(saveAnswers, 2 * 1000, {'leading': true, 'trailing': true});
2729

2830
var lastResponse = window.getResult().response;
2931

dashboard/app/controllers/api_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ def section_assessments
184184
level_results = []
185185

186186
script_level.level.levels.each do |level|
187+
188+
if level.is_a? Multi
189+
multi_count += 1
190+
end
191+
187192
level_response = response_parsed[level.id.to_s]
188193

189194
level_result = {}
@@ -197,7 +202,6 @@ def section_assessments
197202
when Multi
198203
answer_indexes = Multi.find_by_id(level.id).correct_answer_indexes
199204
student_result = level_response["result"].split(",").sort.join(",")
200-
multi_count += 1
201205

202206
# Convert "0,1,3" to "A, B, D" for teacher-friendly viewing
203207
level_result[:student_result] = student_result.split(',').map{ |k| multi_answer_characters[k.to_i] }.join(', ')

0 commit comments

Comments
 (0)