Skip to content

Commit

Permalink
Merge pull request #39 from UBC-MDS/ed_documentation
Browse files Browse the repository at this point in the history
update description vig
  • Loading branch information
shlrley authored Feb 4, 2023
2 parents f81a161 + 7bb0a74 commit 3c943bb
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
^\.Rproj\.user$
^LICENSE\.md$
^\.github$
^_pkgdown\.yml$
^docs$
^pkgdown$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
.Rdata
.httr-oauth
.DS_Store
inst/doc
docs
4 changes: 4 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ Imports:
testthat,
tidyr,
utils
Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
7 changes: 7 additions & 0 deletions inst/extdata/dsci524.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Components,Weights (%),Grades (%)
lab1,15,90.15
lab2,15,88.22
lab3,15,86.65
lab4,15,88.75
quiz1,20,90.15
quiz2,20,90.25
4 changes: 3 additions & 1 deletion man/load_course.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/save_course_csv.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/update_component_grade.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions vignettes/gradecalculatorr-vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ library(gradecalculatorr)
Next, let's explore the the function construct_course():

```{r construct course}
construct_course('dsci524','/')
# construct_course('dsci524','/')
#> construct_course('dsci524','/')
# What is name of dsci524 component #1? lab1
# What is weight percentage of dsci524 component #1? 15
Expand All @@ -46,28 +46,30 @@ construct_course('dsci524','/')
# 4 lab4 15 <NA>
# 5 quiz1 20 <NA>
# 6 quiz2 20 <NA>
csv_file <- system.file("extdata", "dsci524.csv", package = "gradecalculatorr")
```
Then, let's update the grades:

```{r update the grades}
update_component_grade('dsci524.csv', 'lab1', 90.15)
update_component_grade('dsci524.csv', 'lab2', 88.22)
update_component_grade('dsci524.csv', 'lab3', 86.65)
update_component_grade('dsci524.csv', 'lab4', 88.75)
update_component_grade('dsci524.csv', 'quiz1', 90.15)
update_component_grade(csv_file, 'lab1', 90.15)
update_component_grade(csv_file, 'lab2', 88.22)
update_component_grade(csv_file, 'lab3', 86.65)
update_component_grade(csv_file, 'lab4', 88.75)
update_component_grade(csv_file, 'quiz1', 90.15)
```
Then, let's calculate how well the quiz2 has to be in order to get 85% total for course 524:

```{r predict quiz2 grade}
predict_final('dsci524.csv', 85)
predict_final(csv_file, 85)
# > [1] 69.5
```

After quiz2, we know we get 90 for quiz2 and let's calculate the overall grade for course 524:

```{r calculate the overall grade}
update_component_grade('dsci524.csv', 'quiz2', 90.25)
calculate_grade('dsci524.csv')
update_component_grade(csv_file, 'quiz2', 90.25)
# calculate_grade(csv_file)
# > [1] "Course grade is 89.15%"
```

Expand Down

0 comments on commit 3c943bb

Please sign in to comment.