diff --git a/DESCRIPTION b/DESCRIPTION index 48ccc1e..85aed29 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ottr Title: An R Autograding Extension for Otter-Grader -Version: 1.2.0 +Version: 1.3.0 Authors@R: c( person(given = "Christopher", family = "Pyles", diff --git a/R/TestFileResult.R b/R/TestFileResult.R index 640122f..56aa711 100644 --- a/R/TestFileResult.R +++ b/R/TestFileResult.R @@ -84,13 +84,10 @@ TestFileResult <- R6::R6Class( ret <- list( filename = self$filename, + points = self$points, test_case_results = tcr_lists ) - if (!nullish(self$points)) { - ret$points <- self$points - } - return(ret) } ) diff --git a/R/utils.R b/R/utils.R index 49ba254..60c6fc5 100644 --- a/R/utils.R +++ b/R/utils.R @@ -58,12 +58,3 @@ valid_syntax <- function(script) { ) return(!error) } - -#' Check whether a value is nullish (i.e. NULL or NA) -#' -#' @param x The value to cehck -#' -#' @return Whether the value is nullish -nullish <- function(x) { - return(is.null(x) || is.na(x)) -} diff --git a/man/nullish.Rd b/man/nullish.Rd deleted file mode 100644 index 8d8d69d..0000000 --- a/man/nullish.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R -\name{nullish} -\alias{nullish} -\title{Check whether a value is nullish (i.e. NULL or NA)} -\usage{ -nullish(x) -} -\arguments{ -\item{x}{The value to cehck} -} -\value{ -Whether the value is nullish -} -\description{ -Check whether a value is nullish (i.e. NULL or NA) -} diff --git a/tests/testthat/files/integration_expected_results/fails_2_hidden.json b/tests/testthat/files/integration_expected_results/fails_2_hidden.json index b81c959..7f7e340 100644 --- a/tests/testthat/files/integration_expected_results/fails_2_hidden.json +++ b/tests/testthat/files/integration_expected_results/fails_2_hidden.json @@ -2,6 +2,7 @@ "test_file_results": [ { "filename": "files/integration_test_cases/q1.R", + "points": null, "test_case_results": [ { "passed": true, @@ -31,6 +32,7 @@ }, { "filename": "files/integration_test_cases/q2.R", + "points": null, "test_case_results": [ { "passed": true, @@ -60,6 +62,7 @@ }, { "filename": "files/integration_test_cases/q3.R", + "points": null, "test_case_results": [ { "passed": true, diff --git a/tests/testthat/files/integration_expected_results/fails_3.json b/tests/testthat/files/integration_expected_results/fails_3.json index be854e5..f631075 100644 --- a/tests/testthat/files/integration_expected_results/fails_3.json +++ b/tests/testthat/files/integration_expected_results/fails_3.json @@ -2,6 +2,7 @@ "test_file_results": [ { "filename": "files/integration_test_cases/q1.R", + "points": null, "test_case_results": [ { "passed": true, @@ -31,6 +32,7 @@ }, { "filename": "files/integration_test_cases/q2.R", + "points": null, "test_case_results": [ { "passed": true, @@ -60,6 +62,7 @@ }, { "filename": "files/integration_test_cases/q3.R", + "points": null, "test_case_results": [ { "passed": false, diff --git a/tests/testthat/files/integration_expected_results/passes_all.json b/tests/testthat/files/integration_expected_results/passes_all.json index e55b8bc..5277cb5 100644 --- a/tests/testthat/files/integration_expected_results/passes_all.json +++ b/tests/testthat/files/integration_expected_results/passes_all.json @@ -2,6 +2,7 @@ "test_file_results": [ { "filename": "files/integration_test_cases/q1.R", + "points": null, "test_case_results": [ { "passed": true, @@ -31,6 +32,7 @@ }, { "filename": "files/integration_test_cases/q2.R", + "points": null, "test_case_results": [ { "passed": true, @@ -60,6 +62,7 @@ }, { "filename": "files/integration_test_cases/q3.R", + "points": null, "test_case_results": [ { "passed": true, diff --git a/tests/testthat/test_TestFileResult.R b/tests/testthat/test_TestFileResult.R index 0d6f02c..78bdca8 100644 --- a/tests/testthat/test_TestFileResult.R +++ b/tests/testthat/test_TestFileResult.R @@ -82,8 +82,9 @@ test_that("$to_list() returns the test file results as a list", { tfr_list <- tfr$to_list() expect_true(is.list(tfr_list)) - expect_equal(length(tfr_list), 2) + expect_equal(length(tfr_list), 3) expect_equal(tfr_list$filename, filename) + expect_equal(tfr_list$points, NULL) expect_equal(tfr_list$test_case_results, lapply(tcrs, function(tcr) tcr$to_list())) tfr <- TestFileResult$new(filename, tcrs, 2)