Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,8 @@ def make_correct_count_table(chapters, chapter, thecourse, dburl, course):
union
(select div_id, sid, correct, percent from clickablearea_answers where course_name = '{course}')
union
(select div_id, sid, correct, percent from splice_answers where course_name = '{course}')
union
(select div_id, sid, correct, percent from dragndrop_answers where course_name = '{course}')
union
(select div_id, sid, correct, percent from unittest_answers where course_name = '{course}')
Expand Down Expand Up @@ -1179,6 +1181,22 @@ def subchapdetail():
row["correct"] = "Yes"
else:
row["correct"] = "No"
elif row["question_type"] == "splice":
# Mirror the implementation in GRADEABLE_TYPES, as `splice_answers` also has a "correct"
# column which tracks whether the answer is correct or not
isc = (
db(
(db["splice_answers"].sid == request.vars.sid)
& (db["splice_answers"].correct == "T")
& (db["splice_answers"].div_id == row["name"])
)
.select()
.first()
)
if isc:
row["correct"] = "Yes"
else:
row["correct"] = "No"
else:
row["correct"] = "NA"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def update_metrics(self, course_name):
"dragndrop_answers",
"codelens_answers",
"webwork_answers",
"splice_answers",
]
for tbl in tbl_list:
res[tbl] = current.db(
Expand Down
6 changes: 0 additions & 6 deletions components/rsptx/build_tools/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,12 +1003,6 @@ def _process_single_question(
if dynamic is not None and "id" in dynamic.attrib:
idchild = dynamic.attrib["id"]
qtype = dynamic.attrib["data-component"]
# well maybe not...
else:
dynamic = el.find(".//iframe")
if dynamic is not None and "id" in dynamic.attrib:
idchild = dynamic.attrib["id"]
qtype = "splice"
if qtype == "doenet":
# rewrite the url in the dbtext to use the course name in the path
dbtext = re.sub(
Expand Down