Sfoglia il codice sorgente

implement adding predictions

George C. Privon 6 anni fa
parent
commit
27ac386c93
1 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. 5 2
      code/update_predictions.rkt

+ 5 - 2
code/update_predictions.rkt

@@ -88,8 +88,11 @@
 
 ; add a new forecast to an existing prediction
 (define (reviseprediction ID)
-  (pending)
-  )
+  (define newf (string->number (getinput "What is your new predction")))
+  (define newfdate (getinput "What is the date of the new prediction (YYYY-MM-DD)"))
+  (define comments (getinput "Comments on the new prediction"))
+  (query-exec conn "INSERT INTO predictions (ID, date, forecast, comments) values (?, ?, ?, ?)"
+              ID newfdate newf comments))
 
 ; enter an outcome
 (define (addoutcome ID)