Skip to content
Snippets Groups Projects
Commit 01306367 authored by tuhe's avatar tuhe
Browse files

mat1 demo

parent f4bc4f28
No related branches found
No related tags found
No related merge requests found
Showing
with 3 additions and 430 deletions
......@@ -2,9 +2,10 @@
"python.testing.unittestArgs": [
"-v",
"-s",
"./irlc",
"./mat1a",
"-p", "*tests.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true
"python.testing.unittestEnabled": true,
"notebook.output.textLineLimit": 1000,
}
\ No newline at end of file
\ No newline at end of file
%% Cell type:markdown id:1cd2586b tags:
# A problem about adding numbers
## Subproblem 1: This problem will surely test your awesome number-adding skills.
In this problem, you should compute $x_1 = a + b$ where $a = 45$ and $b = 48$.
%% Cell type:code id:9d13c5b8 tags:
``` python
x1 = None # Write your result here.
# TODO: 1 lines missing.
raise NotImplementedError("Insert your solution and remove this error.")
```
%% Cell type:markdown id:d725d517 tags:
## Subproblem 2: Multiplication
In this problem, you should compute $x_2 = a b$
%% Cell type:code id:32966dc5 tags:
``` python
x2 = None # Write your result here.
# TODO: 1 lines missing.
raise NotImplementedError("Insert your solution and remove this error.")
```
%% Cell type:markdown id:72838c51 tags:
# A problem with more troublesome derivative
## Subproblem 1: Testing some other stuff
Consider the function $f(x) = \frac{7 x^{a}}{a}$. Suppose that $7= f'(1)$, what is $a$?
%% Cell type:code id:4cf45579 tags:
``` python
a = None # Write your result here.
# TODO: 1 lines missing.
raise NotImplementedError("Insert your solution and remove this error.")
```
from unitgrade import hide, UTestCase
from unitgrade import UTestCase, Report
from exam_generator.exam import Question, jinjafy
from types import SimpleNamespace
import gym
import numpy as np
import sympy as sym
import os
import inspect
from unitgrade import NotebookTestCase
class Question1(NotebookTestCase):
notebook = "exam2024spring.ipynb"
def test_addition(self):
self.assertIsNotNone(self.nb.x1)
def test_multiplication(self):
self.assertIsNotNone(self.nb.x1)
class Question2(NotebookTestCase):
notebook = "exam2024spring.ipynb"
def test_derivative(self):
self.assertIsNotNone(self.nb.a)
class Exam2024spring_0(Report):
title = "Report id exam2024spring"
abbreviate_questions = True
questions = [
(Question1, 10), (Question2, 10), ]
import irlc
pack_imports = [irlc]
if __name__ == "__main__":
from unitgrade import evaluate_report_student
evaluate_report_student(Exam2024spring_0())
This diff is collapsed.
File deleted
File deleted
\ No newline at end of file
%% Cell type:markdown id:bb0323ea tags:
# A problem about subtracting numbers.
This problem set will test your skills in subtracting numbers
## Subproblem 1: This problem will surely test your awesome number-adding skills.
In this problem, you should compute $x_1 = a + b - c$ where $a = 6$ and $b = 9$ and $c = 10$
%% Cell type:code id:530b5ca1 tags:
``` python
x1 = None # Write your result here.
# TODO: 1 lines missing.
print(x1)
```
%% Cell type:markdown id:3fa4acbb tags:
## Subproblem 2: Multiplication and a parenthesis.
In this problem, you should compute $x_2 = a (b-c)$
%% Cell type:code id:5b262dc7 tags:
``` python
x2 = None # Write your result here.
# TODO: 1 lines missing.
print(x2)
```
%% Cell type:markdown id:89e7ff17 tags:
# A problem with more troublesome derivative
## Subproblem 1: Testing some other stuff
Consider the function $f(x) = \frac{10 x^{a}}{a}$. Suppose that $1280= f'(2)$, what is $a$?
%% Cell type:code id:6c3ed12d tags:
``` python
a = None # Write your result here.
a = 7
```
from unitgrade import hide, UTestCase
from unitgrade import UTestCase, Report
from exam_generator.exam import Question, jinjafy
from types import SimpleNamespace
import gym
import numpy as np
import sympy as sym
import os
import inspect
from unitgrade import NotebookTestCase
class Question1(NotebookTestCase):
notebook = "exam2024spring.ipynb"
def test_addition(self):
self.assertIsNotNone(self.nb.x1)
def test_multiplication(self):
self.assertIsNotNone(self.nb.x1)
class Question2(NotebookTestCase):
notebook = "exam2024spring.ipynb"
def test_derivative(self):
self.assertIsNotNone(self.nb.a)
class Exam2024spring_1(Report):
title = "Report id exam2024spring"
abbreviate_questions = True
questions = [
(Question1, 10), (Question2, 10), ]
import irlc
pack_imports = [irlc]
if __name__ == "__main__":
from unitgrade import evaluate_report_student
evaluate_report_student(Exam2024spring_1())
This diff is collapsed.
File deleted
File deleted
File deleted
\ No newline at end of file
%% Cell type:markdown id:ab27cf79 tags:
# A problem about adding numbers
## Subproblem 1: This problem will surely test your awesome number-adding skills.
In this problem, you should compute $x_1 = a + b$ where $a = 41$ and $b = 16$.
%% Cell type:code id:979c206b tags:
``` python
x1 = None # Write your result here.
# TODO: 1 lines missing.
raise NotImplementedError("Insert your solution and remove this error.")
```
%% Cell type:markdown id:f33e65f7 tags:
## Subproblem 2: Multiplication
In this problem, you should compute $x_2 = a b$
%% Cell type:code id:c1611200 tags:
``` python
x2 = None # Write your result here.
# TODO: 1 lines missing.
raise NotImplementedError("Insert your solution and remove this error.")
```
%% Cell type:markdown id:d56a39a0 tags:
# A problem with more troublesome derivative
## Subproblem 1: Testing some other stuff
Consider the function $f(x) = \frac{10 x^{a}}{a}$. Suppose that $160= f'(4)$, what is $a$?
%% Cell type:code id:dcc5f3bf tags:
``` python
a = None # Write your result here.
# TODO: 1 lines missing.
raise NotImplementedError("Insert your solution and remove this error.")
```
from unitgrade import hide, UTestCase
from unitgrade import UTestCase, Report
from exam_generator.exam import Question, jinjafy
from types import SimpleNamespace
import gym
import numpy as np
import sympy as sym
import os
import inspect
from unitgrade import NotebookTestCase
class Question1(NotebookTestCase):
notebook = "exam2024spring.ipynb"
def test_addition(self):
self.assertIsNotNone(self.nb.x1)
def test_multiplication(self):
self.assertIsNotNone(self.nb.x1)
class Question2(NotebookTestCase):
notebook = "exam2024spring.ipynb"
def test_derivative(self):
self.assertIsNotNone(self.nb.a)
class Exam2024spring_2(Report):
title = "Report id exam2024spring"
abbreviate_questions = True
questions = [
(Question1, 10), (Question2, 10), ]
import irlc
pack_imports = [irlc]
if __name__ == "__main__":
from unitgrade import evaluate_report_student
evaluate_report_student(Exam2024spring_2())
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment