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

Commit dbd0e12

Browse files
committed
New: generate course book list from DB
1 parent f2cb743 commit dbd0e12

File tree

2 files changed

+31
-271
lines changed

2 files changed

+31
-271
lines changed

controllers/designer.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ def index():
3434
To begin, enter a project name below."""
3535
)
3636
# return dict(message=T('Welcome to CourseWare Manager'))
37+
course_list = db.executesql(
38+
"select * from library where for_classes = 'T' and is_visible = 'T'",
39+
as_dict=True,
40+
)
41+
sections = set()
42+
for course in course_list:
43+
if course["shelf_section"] not in sections:
44+
sections.add(course["shelf_section"])
45+
46+
basicvalues["course_list"] = course_list
47+
basicvalues["sections"] = sections
48+
3749
return basicvalues
3850

3951

views/designer/index.html

Lines changed: 19 additions & 271 deletions
Original file line numberDiff line numberDiff line change
@@ -97,278 +97,26 @@ <h3>{{=message}}</h3>
9797
<br />
9898

9999
<div class="form-group">
100-
<label>
101-
Choose one of our ready-made books for your course:
102-
</label>
103-
<h3>AP Computer Science</h3>
100+
{{ for section in sorted(sections): }}
101+
<h4>{{=section}}</h4>
102+
{{ for course in course_list: }}
103+
{{ if course["shelf_section"] == section:}}
104+
<div class="radio">
105+
<label>
106+
<input type="radio" name="coursetype" value="{{=course["basecourse"]}}" />
107+
{{=course["title"]}}
108+
{{ if course["subtitle"]:}}
109+
: {{=course["subtitle"]}}
110+
{{ pass }}
111+
{{ if course["authors"]: }}
112+
by {{=course["authors"]}}
113+
{{pass}}
114+
</label>
115+
</div>
116+
{{ pass }}
117+
{{pass}}
118+
{{ pass }}
104119

105-
<div class="radio">
106-
<label>
107-
<input type="radio" name="coursetype" value="csawesome" />
108-
CSAwesome AP CSA Java Course, by Barbara Ericson and Beryl Hoffman
109-
</label>
110-
</div>
111-
112-
<div class="radio">
113-
<label>
114-
<input type="radio" name="coursetype" value="StudentCSP" />
115-
CS Principles: Big Ideas in Programming in Python, by Mark Guzdial, Barbara Ericson, and Briana Morrison
116-
</label>
117-
</div>
118-
119-
<div class="radio">
120-
<label>
121-
<input type="radio" name="coursetype" value="mobilecsp" />
122-
Mobile CSP using App Inventor
123-
</label>
124-
</div>
125-
126-
127-
<h3>Intro to Computer Science</h3>
128-
<div class="radio">
129-
<label>
130-
<input type="radio" name="coursetype" value="fopp" />
131-
Foundations of Python Programming
132-
</label>
133-
</div>
134-
135-
<div class="radio">
136-
<label>
137-
<input type="radio" name="coursetype" value="thinkcspy" checked="checked" />
138-
How to Think Like a Computer Scientist: Interactive Edition
139-
</label>
140-
</div>
141-
142-
<div class="radio">
143-
<label>
144-
<input type="radio" name="coursetype" value="httlacs"/>
145-
How to Think Like a Computer Scientist: PreTeXt Interactive Edition <strong>New!</strong>
146-
</label>
147-
</div>
148-
149-
<div class="radio">
150-
<label>
151-
<input type="radio" name="coursetype" value="thinkcpp" />
152-
How to Think Like a Computer Scientist: C++ Interactive Version, Allen Downey, Interaction by Barb Ericson
153-
</label>
154-
</div>
155-
156-
<div class="radio">
157-
<label>
158-
<input type="radio" name="coursetype" value="csjava" />
159-
Introduction to Programming with Java (csjava) - a derivative of CSAwesome for College Students - Adapted by Linda Seiter
160-
</label>
161-
</div>
162-
<div class="radio">
163-
<label>
164-
<input type="radio" name="coursetype" value="javajavajava" />
165-
Java. Java, Java: Object-Oriented Problem Solving by Ralph Morelli, Ralph Walde, and Beryl Hoffman
166-
</label>
167-
</div>
168-
<div class="radio">
169-
<label>
170-
<input type="radio" name="coursetype" value="Subgoals" />
171-
Java Subgoals (Subgoals) - Learn Java through Worked Examples and Subgoals with practice - By Briana Morrison
172-
</label>
173-
</div>
174-
<div class="radio">
175-
<label>
176-
<input type="radio" name="coursetype" value="py4e-int" />
177-
Python for Everybody by Charles Severance Interactive Edition: Barbara Ericson
178-
</label>
179-
</div>
180-
<div class="radio">
181-
<label>
182-
<input type="radio" name="coursetype" value="engr101umich" />
183-
Using Computing to Solve Engineering Problems University of Michigan
184-
</label>
185-
</div>
186-
187-
<div class="radio">
188-
<label>
189-
<input type="radio" name="coursetype" value="welcomecs" />
190-
Welcome to CS - An introduction to computation and Python programming. Designed for a CS0 level introductory/exploratory course.
191-
</label>
192-
</div>
193-
194-
<h3>Data Structures</h3>
195-
<div class="radio">
196-
<label>
197-
<input type="radio" name="coursetype" value="pythonds3" />
198-
Problem Solving with Algorithms and Data Structures using Python (Third Edition), Brad Miller and David Ranum
199-
</label>
200-
</div>
201-
202-
<div class="radio">
203-
<label>
204-
<input type="radio" name="coursetype" value="pythonds" />
205-
Problem Solving with Algorithms and Data Structures using Python (2nd Edition), Brad Miller and David Ranum
206-
</label>
207-
</div>
208-
209-
<div class="radio">
210-
<label>
211-
<input type="radio" name="coursetype" value="cppds" />
212-
Problem Solving with Algorithms and Data Structures using C++, Jan Pearce, Brad Miller and David Ranum
213-
</label>
214-
</div>
215-
216-
<div class="radio">
217-
<label>
218-
<input type="radio" name="coursetype" value="pythoned" />
219-
Solución de problemas con algoritmos y estructuras de datos, Brad Miller y David Ranum, Traducido por Mauricio Orozco-Alzate
220-
</label>
221-
</div>
222-
223-
<h3>Intro to Data Science</h3>
224-
<div class="radio">
225-
<label>
226-
<input type="radio" name="coursetype" value="httlads" />
227-
How to Think Like a Data Scientist
228-
</label>
229-
</div>
230-
231-
<div class="radio">
232-
<label>
233-
<input type="radio" name="coursetype" value="ac1" />
234-
Introduction to Google Sheets and SQL
235-
</label>
236-
</div>
237-
238-
<h3>Advanced Topics</h3>
239-
<div class="radio">
240-
<label>
241-
<input type="radio" name="coursetype" value="MasteringDatabases" />
242-
Mastering Relational Databases by Libby Shoop
243-
</label>
244-
</div>
245-
<div class="radio">
246-
<label>
247-
<input type="radio" name="coursetype" value="practical_db" />
248-
A Practical Introduction to Databases by Christopher Painter-Wakefield
249-
</label>
250-
</div>
251-
<div class="radio">
252-
<label>
253-
<input type="radio" name="coursetype" value="webfundamentals" />
254-
Fundamentals of Web Development (HTML, CSS, and intro to Javascript), Brad Miller
255-
</label>
256-
</div>
257-
<div class="radio">
258-
<label>
259-
<input type="radio" name="coursetype" value="complex" />
260-
On Complexity, A remix by Jan Pearce, Based on Think Complexity by Allen Downey and
261-
<code>pythonds</code> by Brad Miller and David Ranum
262-
</label>
263-
</div>
264-
265-
<h3>Language Transition Books</h3>
266-
<div class="radio">
267-
<label>
268-
<input type="radio" name="coursetype" value="java4python" />
269-
Java for Python Programmers, by Bradley Miller
270-
</label>
271-
</div>
272-
273-
<div class="radio">
274-
<label>
275-
<input type="radio" name="coursetype" value="cpp4python" />
276-
C++ for Python Programmers, by Jan Pearce and Bradley Miller
277-
</label>
278-
</div>
279-
280-
<div class="radio">
281-
<label>
282-
<input type="radio" name="coursetype" value="JS4Python" />
283-
Javascript for Python Programmers
284-
</label>
285-
</div>
286-
287-
<h3>Misc</h3>
288-
<div class="radio">
289-
<label>
290-
<input type="radio" name="coursetype" value="technovation" />
291-
Technovation -- Virtual Coding Club by Laura Dillon and Andrew McDonald
292-
</label>
293-
</div>
294-
295-
<div class="radio">
296-
<label>
297-
<input type="radio" name="coursetype" value="bluebook" />
298-
The Runestone Blue Book -- A blank book where you can create your own exams
299-
</label>
300-
</div>
301-
302-
<h3>Math Books</h3>
303-
<div class="radio">
304-
<label>
305-
<input type="radio" name="coursetype" value="int-algebra" />
306-
Intermediate Algebra, Functions and Graphs by Katherine Yoshiwara
307-
</label>
308-
</div>
309-
<div class="radio">
310-
<label>
311-
<input type="radio" name="coursetype" value="fcla" />
312-
A First Course in Linear Algebra, by Rob Beezer
313-
</label>
314-
</div>
315-
<div class="radio">
316-
<label>
317-
<input type="radio" name="coursetype" value="aata" />
318-
Abstract Algebra: Theory and Applications by Thomas W. Judson
319-
</label>
320-
</div>
321-
<!--
322-
<div class="radio">
323-
<label>
324-
<input type="radio" name="coursetype" value="orcca" />
325-
Open Resources for Community College Algebra
326-
</label>
327-
</div> -->
328-
<div class="radio">
329-
<label>
330-
<input type="radio" name="coursetype" value="odeproject" />
331-
The Ordinary Differential Equations Project by Tom Judson
332-
</label>
333-
</div>
334-
<div class="radio">
335-
<label>
336-
<input type="radio" name="coursetype" value="dmoi" />
337-
Discrete Mathematics and Open Introduction by Oscar Levin
338-
</label>
339-
</div>
340-
341-
<div class="radio">
342-
<label>
343-
<input type="radio" name="coursetype" value="boelkins-ACS" />
344-
Active Calculus by Matthew Boelkins
345-
</label>
346-
</div>
347-
348-
<div class="radio">
349-
<label>
350-
<input type="radio" name="coursetype" value="APEX" />
351-
Apex Calculus by Gregory Hartman, Ph.D., Sean Fitzpatrick, Ph.D. (Editor), Alex Jordan, Ph.D. (Editor), Carly Vollet, M.S. (Editor)
352-
</label>
353-
</div>
354-
355-
<div class="radio">
356-
<label>
357-
<input type="radio" name="coursetype" value="ExcelCalculus" />
358-
Business Calculus with Excel by Mike May and Anneke Bart
359-
</label>
360-
</div>
361-
362-
<!-- <label>
363-
OR
364-
</label>
365-
366-
<div class="radio">
367-
<label>
368-
<input type="radio" name="coursetype" value="custom" />
369-
Build a Custom Course
370-
</label>
371-
</div> -->
372120
</div>
373121
<script>
374122
var rad = document.forms.mainform.coursetype;

0 commit comments

Comments
 (0)