Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1380 from RunestoneInteractive/add_courselevel
Browse files Browse the repository at this point in the history
collect course level
  • Loading branch information
bnmnetp committed Nov 23, 2019
2 parents 8bbe13d + 18a9fad commit 197d4c3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
9 changes: 6 additions & 3 deletions controllers/designer.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ def build():
else:
institution = request.vars.institution

if not request.vars.python3:
python3 = "false"
if not request.vars.courselevel:
courselevel = "unknown"
else:
python3 = "true"
courselevel = request.vars.courselevel

python3 = "true"

if not request.vars.loginreq:
login_required = "false"
Expand All @@ -92,6 +94,7 @@ def build():
base_course=base_course,
login_required=login_required,
python3=python3,
courselevel=courselevel,
)

# enrol the user in their new course
Expand Down
1 change: 1 addition & 0 deletions models/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
Field("allow_pairs", type="boolean", default=False),
Field("student_price", type="integer"),
Field("downloads_enabled", type="boolean", default=False),
Field("courselevel", type="string"),
migrate=table_migrate_prefix + "courses.table",
)

Expand Down
21 changes: 12 additions & 9 deletions views/designer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ <h3>{{=message}}</h3>
<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 able to edit
the table of contents to re-order or remove content, and create assignments for your students. These assignments will be publish
right in the book. As the instructor, You can grade your students homework, and have access to a dashboard that allows you
to monitor student progress. To begin, enter a project name below.</p>
to monitor student progress. To begin, enter a course name below. Selecting an appropriate course level will help us to recommend questions
and practice exercises from the question bank.</p>

<script type="text/javascript">
function validateForm() {
Expand Down Expand Up @@ -41,7 +42,7 @@ <h3>{{=message}}</h3>
<form name="mainform" action="/{{=request.application}}/{{=request.controller}}/build" method="get" onsubmit="return validateForm();">
<div class="form-group row">
<div class="col-md-4">
<label for="projectname">Project Name</label>
<label for="projectname">Course Name</label>
<input type="text" class='form-control' placeholder="myproject" name="projectname" id="projectname" />
</div>
</div>
Expand All @@ -58,6 +59,15 @@ <h3>{{=message}}</h3>
<label for="institution">Institution</label>
<input type="text" class='form-control' placeholder="Your school"
name="institution" id="institution" />
<label for="courselevel">Course Level</label>
<select id="courselevel" class="form-control" name="courselevel">
<option value="unknown" disabled selected>Please Select</option>
<option value="grad">Graduate</option>
<option value="undergradadv">Undergraduate Advanced</option>
<option value="undergradintro">Undergraduate Intro (CS1/2)</option>
<option value="high">High School</option>
<option value="middle">Middle School</option>
</select>
</div>
</div>

Expand Down Expand Up @@ -168,13 +178,6 @@ <h3>{{=message}}</h3>
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" name="python3" value="true" id="python3" checked="checked" />
Use Python3 print function and true division
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" name="allowpairs" value="false" id="allowpairs" />
Expand Down

0 comments on commit 197d4c3

Please sign in to comment.