Skip to content

Commit

Permalink
Merge pull request #603 from wikispeedruns/revert-581-hints-feature
Browse files Browse the repository at this point in the history
Revert "hints feature"
  • Loading branch information
dqian3 authored Sep 3, 2024
2 parents c95fa4d + a99ef60 commit cb4b68e
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 312 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ config/prod.json

node_modules
frontend/static/js-build
data/
static/js-build

.DS_Store
Expand Down
21 changes: 0 additions & 21 deletions apis/sprints_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,14 @@

import json
import datetime
import wsbot

from app.db import get_db
from pymysql.cursors import DictCursor

from util.decorators import check_admin, check_request_json
from wikispeedruns import prompts
from wsbot.search import GreedySearch, BeamSearch
from wsbot.embeddings import LocalEmbeddings
from wsbot.graph import APIGraph, SQLGraph

sprint_api = Blueprint('sprints', __name__, url_prefix='/api/sprints')
# this script doesn't work
# !./get_embeddings.sh
embeddings_provider = LocalEmbeddings("data/wiki2vec.txt")
graph_provider = APIGraph()


### Prompt Management Endpoints
Expand Down Expand Up @@ -176,16 +168,3 @@ def check_duplicate_prompt():
res = prompts.check_for_sprint_duplicates(start, end)
return jsonify(res)

# get the next hint
@sprint_api.get('/hint')
# @check_request_json({"start": str, "end": str})
def get_hint():
start = request.args.get('start')
end = request.args.get('end')

if (start is None or end is None): return "Invalid Request", 400

greedy_search = GreedySearch(embeddings_provider, graph_provider)
hint = greedy_search.get_next_greedy_link(start, end)

return [hint]
37 changes: 0 additions & 37 deletions frontend/static/js/pages/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ let app = new Vue({

pageCallback: function(page, loadTime) {
window.scrollTo(0, 0);
// makes sure hint box is reset after each link is clicked
document.getElementById('hint').innerText = ""
this.hidePreview();
if (this.isScroll) {
document.getElementById("wikipedia-frame").scrollTo(0, 0);
Expand Down Expand Up @@ -264,41 +262,6 @@ let app = new Vue({

},

async getHint(start, end) {
document.getElementById('hint').innerText = "Getting hint..."
const searchParams = new URLSearchParams({
start: start,
end: end
})
console.log("/api/sprints/hint?" + searchParams)

let hint
try{
const response = await fetch("/api/sprints/hint?" + searchParams)
let tmpData;
try {
tmpData = await response.json()
}
catch (err){
console.log(err)
}
hint = tmpData
if(!hint){
throw err;
}
}
catch(err){
document.getElementById('hint').innerText = "Sorry, couldn't find a hint!"
}

if(!hint){
document.getElementById('hint').innerText = "Sorry, couldn't find a hint!"
}else{
document.getElementById('hint').innerText = hint
}
return hint
},

async start() {
this.countdownTime = (Date.now() - this.startTime) / 1000;

Expand Down
6 changes: 0 additions & 6 deletions frontend/templates/play.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@
</div>

</div>
<div style="float: right;" >
<button class="col text-nowrap px-1 pt-1" @click="getHint([[currentArticle]], [[endArticle]])">
Need a hint?
</button>
<div id="hint"></div>
</div>
</div>
</div>
<div v-else class="HUDwrapper HUDwrapper-fade container-xxl">
Expand Down
Empty file removed wsbot/__init__.py
Empty file.
17 changes: 0 additions & 17 deletions wsbot/embeddings.py

This file was deleted.

78 changes: 0 additions & 78 deletions wsbot/graph.py

This file was deleted.

152 changes: 0 additions & 152 deletions wsbot/search.py

This file was deleted.

0 comments on commit cb4b68e

Please sign in to comment.