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

Commit f7745ee

Browse files
committed
identify contributed questions in the picker
1 parent 7bf9709 commit f7745ee

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

controllers/admin.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,11 +1781,8 @@ def _get_toc_and_questions():
17811781
)
17821782

17831783

1784-
# except Exception as ex:
1785-
# print(ex)
1786-
# return json.dumps({})
1787-
1788-
1784+
# This is the place to add meta information about questions for the
1785+
# assignment builder
17891786
def _add_q_meta_info(qrow):
17901787
res = ""
17911788
qt = {
@@ -1809,8 +1806,13 @@ def _add_q_meta_info(qrow):
18091806
if qrow.questions.autograde:
18101807
res += " ✓"
18111808

1809+
if qrow.questions.from_source:
1810+
book = "📘"
1811+
else:
1812+
book = "👩‍🏫"
1813+
18121814
if res != "":
1813-
res = """ <span style="color: green">[{}] </span>""".format(res)
1815+
res = """ <span style="color: green">[{} {}] </span>""".format(book, res)
18141816

18151817
return res
18161818

views/admin/assignments.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,19 @@ <h4 class="panel-title">
152152
<p>Select the problems which compose this assignment.</p>
153153
<table id="questionTable" style="width:100%;"></table>
154154
<div class="container">
155-
<div class="col-md-12">
155+
<div class="col-md-6">
156156
<a class="btn btn-default" data-toggle="tab" href="#qbrowse" id="browse-button">Browse</a>
157157
<a class="btn btn-default" data-toggle="tab" href="#qbank">Search</a>
158158
<a class="btn btn-default" data-toggle="tab" href="#qwrite">Write</a>
159159
</div>
160+
<div class="col-md-6">
161+
<p>Legend:</p>
162+
<table>
163+
<tr><td>📘</td><td>Question written by author</td></tr>
164+
<tr><td>👩‍🏫</td><td>Community Contributed question</td></tr>
165+
<tr><td></td><td>Question is autograded</td></tr>
166+
</table>
167+
</div>
160168
<div class="tab-content col-md-6">
161169

162170
<!-- Browse tab -->

0 commit comments

Comments
 (0)