Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit 187c4c1

Browse files
committed
fix default for activecode Qs
1 parent e13503c commit 187c4c1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

controllers/admin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,7 @@ def add__or_update_assignment_question():
14741474
question_type = db.questions[question_id].question_type
14751475
chapter = db.questions[question_id].chapter
14761476
subchapter = db.questions[question_id].subchapter
1477+
auto_grade = db.questions[question_id].autograde
14771478
tmpSp = _get_question_sorting_priority(assignment_id, question_id)
14781479
if tmpSp != None:
14791480
sp = 1 + tmpSp
@@ -1510,6 +1511,10 @@ def add__or_update_assignment_question():
15101511

15111512
autograde = request.vars.get('autograde')
15121513
which_to_grade = request.vars.get('which_to_grade')
1514+
if question_type in ('activecode', 'actex'):
1515+
if auto_grade != 'unittest':
1516+
autograde = 'manual'
1517+
which_to_grade = ""
15131518
try:
15141519
# save the assignment_question
15151520
db.assignment_questions.update_or_insert(

views/admin/assignments.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,15 @@ <h4 class="modal-title" id="editModalHeader">Edit Question</h4>
343343
configure_tree_picker(question_picker, eBookConfig.toc.question_picker, $('#search-tree-question-picker'), 3,
344344
// TODO: Remember last user selections for points, autograde, and which_to_grade, instead of hard-coding them here.
345345
// Called when a node is checked.
346-
function (node) { updateAssignmentRaw(node.id, 1, 'pct_correct', 'best_answer'); },
346+
function (node) {
347+
let autograde = 'pct_correct';
348+
let whichto = 'best_answer';
349+
if (node.text.indexOf("✓") === -1) {
350+
autograde = 'manual';
351+
whichto = '';
352+
}
353+
updateAssignmentRaw(node.id, 1, autograde, whichto);
354+
},
347355
// Called when a node is unchecked.
348356
function (node) { remove_question(node.id); }
349357
);

0 commit comments

Comments
 (0)