0
我想製作一個簡單的閃亮分數查詢系統。也就是說,當有人輸入他的學生證時,他可以得到他的分數。我嘗試了很多,但無法得到結果。以下是我構建的框架。那麼有誰能告訴我我的程序有什麼問題嗎?閃亮做分數查詢系統
ui.R
library(shiny)
shinyUI(
pageWithSidebar(
headerPanel("Midterm score"),
sidebarPanel(
numericInput("studentid","Student ID:",17220131181990),
submitButton("Submit")
),
mainPanel(
h3("You score"),
h4("You student id:"),
verbatimTextOutput("inputValue"),
h4("You midterm score:"),
verbatimTextOutput("score")
)
)
)
server.R
library(shiny)
data <- read.csv("C:/Users/hmw20_000/Desktop/score.csv")
shinyServer(
function(input,output){
output$inputValue <- renderPrint({input$studentid})
output$score <- renderPrint({data$score})
}
)
分數csv文件有兩列:一個是studentid,另一種是當score.So輸入studentid ,它可以輸出相應的分數。