Skip to content

Commit

Permalink
Added canvas mapping script and app
Browse files Browse the repository at this point in the history
  • Loading branch information
Shankar Dutt Salwan authored and Shankar Dutt Salwan committed Mar 18, 2020
1 parent 2390e2e commit 196f756
Show file tree
Hide file tree
Showing 12 changed files with 1,213 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ The *outdated* code that used to power the Douglas backend, and return helper re
This is a python script to collect completed learning modules by members of DTR. The script dumps the information into a csv.


## canvas-sections-completed
This is a python script to collect information on sections completed in the cavnas. The script dumps the information into a csv.
## dtr-canvas-mapping
This is a python flask app hosted on heroku to provide an interface to get canvas sections completed.
1 change: 1 addition & 0 deletions dtr-canvas-mapping/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
1 change: 1 addition & 0 deletions dtr-canvas-mapping/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn app:app
1 change: 1 addition & 0 deletions dtr-canvas-mapping/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# dtr-canvas-mapping
50 changes: 50 additions & 0 deletions dtr-canvas-mapping/app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import json
import sys
from flask import Flask
from flask import request, redirect
from flask import render_template

def recommend(section_query):
with open("app/canvasSections.json") as canvas_json:
canvas_map = json.load(canvas_json)
search_dict = {}
for user in canvas_map:
name = unicode(user["name"])
sections = user["sections"][0]
for section in sections:
for prompt_list in sections[section]:
# pdb.set_trace()
cur_key = unicode(section) + " --> " + unicode(prompt_list["prompt"])
if cur_key in search_dict:
search_dict[cur_key].append((name, unicode(prompt_list["status"])))
else:
search_dict[cur_key] = [(name, unicode(prompt_list["status"]))]
if section_query in search_dict:
# result = search_dict[section_query]
# for helper in result:
# print("Helper: " + helper[0] + " (" + helper[1] + ')')
return search_dict[section_query]
else:
return [section_query + " not found in the canvas"]
return

app = Flask(__name__)
@app.route('/', methods=["GET", "POST"])
def index():
with open("app/canvasKeys.json") as f:
canvasKeys = json.load(f)
canvasKeys = sorted(canvasKeys.keys())
helpers = []
not_found = False
sectionCell = ""
if request.form:
sectionCell = request.form["section"] + " -- " + request.form["cell"]
query = request.form["section"] + " --> " + request.form["cell"]
helpers = recommend(query)
if len(helpers) == 1:
not_found = True
return render_template('index.html', canvasKeys=canvasKeys, helpers=helpers, not_found=not_found, sectionCell=sectionCell)

if __name__ == '__main__':
# pdb.set_trace()
app.run(debug=True, host='0.0.0.0')
1 change: 1 addition & 0 deletions dtr-canvas-mapping/app/canvasKeys.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Section 4-7: Design Arguments": ["What should users do? (And what should happen when they do it?)", "Where can designs go wrong? What may prevent a user from reaching their goal?", "What are the core characteristics of your design?", "Why would the design work?"], "Section 10: Interface Arguments": ["Problem Statement", "Why Important?", "Desired Outcome", "Core Obstacles", "Interface Feature", "Interface Argument"], "Section 8-9: Check you Design Argument": ["What is your conceptual approach to solving the problem?", "What is your design argument?", "Will your design work? Is it novel?"], "Section 14a: Study Aims and Expected Outcomes": ["What is the goal of conducting your study?"], "Section 16: Data Collection": ["How will you collect data?", "What specific data will you collect?", "What measures and claims does the collected data inform?"], "Section 13: System Models": ["How does the system actually work?", "Does the system solve the technical challenges?"], "Section 3: Describe Broader Impact": ["Who is the practical audience?", "Why do they care (is this problem important?)", "What\u2019s your problem statement? (Does it capture a core tension? Agent wants X but Y)"], "Section 12: System Arguments": ["Problem Statement", "Why Important?", "Desired Outcome", "Core Obstacles", "Method or Technique", "Technical Argument"], "Section 11: Interface Models": ["From the user perspective, how does the system work? (Journey Map, Storyboard, Lofi Prototype)", "Does the interface solve the user\u2019s problem?"], "Section 15b: Study Setup (Scenario)": ["What are the testing conditions?", "When and where will they use the app?", "How often will they use the app, and how long at a time?", "What are the dates of testing, and the total duration?", "What high-level tasks will the users be asked to perform?"], "Section 15a: Study Setup (Participants)": ["Demographics", "Recruitment Method", "Additional User Requirements", "How will they communicate with you during study?", "How will they be compensated?"], "Section 1: Identify a Design Situation": ["Who are the users?", "What are their high level tasks and goals?"], "Section 18: Design Implications": ["Based on your findings, what are your revised design arguments?", "Based on your findings, how will your interface model change?", "Based on your findings, how will your system model change?", "Based on your findings, how will your study design change?"], "Section 2: Test if a Design Problem": ["Are users struggling to accomplish their goals (what are their struggles?)", "Are these struggles the result of a design challenge?", "Can the problem already be solved with current technology?"], "Section 17: Core Findings": ["What is your core finding?", "Statement of research question", "Re-state core finding", "Provide evidence for core finding", "What parts of your design argument were correct?", "What parts of your design argument were incorrect?", "What parts of your design argument or claims couldn't be tested?", "What new obstacles were encountered for reaching the desired outcomes?"], "Section 14b: Study Aims and Expected Outcomes": ["What research question will your study answer?", "What are your design arguments and claims going into the study?", "What are your measures for your design argument/claims?"]}
1 change: 1 addition & 0 deletions dtr-canvas-mapping/app/canvasSections.json

Large diffs are not rendered by default.

Loading

0 comments on commit 196f756

Please sign in to comment.