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 ,它可以输出相应的分数。