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

Commit eefd7e6

Browse files
committed
Merge branch 'master' into use_webpack
2 parents e19c339 + 0d2681f commit eefd7e6

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

controllers/admin.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,9 +1441,30 @@ def createquestion():
14411441
htmlsrc=request.vars["htmlsrc"],
14421442
)
14431443

1444-
db.assignment_questions.insert(
1445-
assignment_id=assignmentid, question_id=newqID, timed=timed, points=points
1446-
)
1444+
if request.vars["template"] == "datafile":
1445+
# datafiles are not questions, but we would like instructors to be able
1446+
# to add their own datafiles for projects or exercises. So we store
1447+
# the datafile contents in the database instead of adding a question
1448+
# to the assignment.
1449+
divid = request.vars["name"].strip()
1450+
q = request.vars["question"].lstrip()
1451+
q = q.split("\n")
1452+
first_blank = q.index("")
1453+
q = "\n".join([x.lstrip() for x in q[first_blank + 1 :]])
1454+
db.source_code.update_or_insert(
1455+
(db.source_code.acid == divid)
1456+
& (db.source_code.course_id == base_course),
1457+
main_code=q,
1458+
course_id=base_course,
1459+
acid=divid,
1460+
)
1461+
else:
1462+
db.assignment_questions.insert(
1463+
assignment_id=assignmentid,
1464+
question_id=newqID,
1465+
timed=timed,
1466+
points=points,
1467+
)
14471468

14481469
returndict = {request.vars["name"]: newqID, "timed": timed, "points": points}
14491470

views/designer/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
<h3>{{=message}}</h3>
1010

11-
<p>This page allows you to select a book for your own class. Once you have selected and built the book, you will also be
11+
<p><strong>For Instructors ONLY</strong> If you are a self learner you DO NOT need to build your own course. If you are a student and think that building your own course will show you the answers, YOU ARE WRONG.</p>
12+
<p>
13+
This page allows you to select a book for your own class. Once you have selected and built the book, you will also be
1214
able to edit
1315
the table of contents to re-order or remove content, and create assignments for your students. These assignments
1416
will be publish

0 commit comments

Comments
 (0)