R code for grading students using r shinny
RCODE FOR
GRADING STUDENTS
library(shiny)
library(shinythemes)
ui<-fluidPage(theme=shinytheme("superhero"),
sidebarLayout(
sidebarPanel(
titlePanel("ENTER YOUR GRADE"),
numericInput("num","MATH",value=0,min=0,max=100),
numericInput("num1","ENGLISH",value=1,min=0,max=100),
numericInput("num2","KISWAHILI",value=1,min=0,max=100),
numericInput("num3","SCIENCE",value=1,min=0,max=100),
numericInput("num4","CRE",value=1,min=0,max=100),
numericInput("num5","select no of units you
took",value=1,min=1,max=80),
fileInput("fl","upload")
),mainPanel(
titlePanel("Estimate your mean score"),
navbarPage(
tabPanel("dumm"),
tabPanel("How",tags$div(HTML("<i>Use the app by
inputing marks you scored<br>
:</i>"))
),
tabPanel("About",tags$div(HTML("<p>The estimator
app was designed by Harron as a project,
.<br>
contact:0746494596<br>
"))),
tabPanel("Rate me",
radioButtons("r","how would you rate the app on a scale
of 1: 10 ",choices=c("1:4POOR","5:7
AVERAGE","8:10 EXCELLENT"))
,textInput("txt","What
features do you recommend improvement on"),
actionButton("sub","submit") )
),
h1("final score"),
verbatimTextOutput("n"),
actionLink("link","find my
github resipitory")
)
)
)
server<-function(input,output,session){
output$n<-renderPrint({
a<-input$num
b<-input$num1
c<-input$num2
d<- input$num3
e<-input$num4
f<-(a)+(b)+(c)+(d)+e
w<-f/input$num5
w
if(w<=39){
paste(w,"E; FAIL PULL UP YOUR SOCKS")
}
else if(w>=40&w<=49){
paste(w,"D; PASS")
}
else if(w>=50&w<=59){
paste(w,"c: SECOND CLASS LOWER”)
}else if(w>=60&w<=69){
paste(w,"B: SECOND CLASS UPPER")
}else if(w>=70&w<=100){
paste(w,"A: FIRST CLASS")
}
else{
paste(w,"INVALID")
}
Comments
Post a Comment