Skip to content

Commit f7c3eb3

Browse files
authored
Merge branch 'openwebwork:main' into main
2 parents 8a812c0 + c93645e commit f7c3eb3

File tree

50 files changed

+1550
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1550
-284
lines changed

.github/workflows/bin/generate-OPL-set-def-lists.pl

Lines changed: 0 additions & 85 deletions
This file was deleted.

.github/workflows/generate-opl-release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ jobs:
4848
MYSQL_PWD: opl_passwd
4949
run: |
5050
.github/workflows/bin/generate-OPL-tables.pl
51-
.github/workflows/bin/generate-OPL-set-def-lists.pl
5251
tar czf webwork-open-problem-library-METADATA.tar.gz webwork-open-problem-library
5352
tar cjf webwork-open-problem-library-METADATA.tar.bz2 webwork-open-problem-library
5453
zip -r9 --quiet webwork-open-problem-library-METADATA.zip webwork-open-problem-library

Contrib/CCCS/AlgebraicLiteracy/IA_9.3/OpenStax_IA_9.3_137.pg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Solve the equation using the quadratic formula. If there is more than one correc
6464

6565
[``\frac{1}{[$d1]}{[$var]}^{2} + \frac{1}{[$d3]}[$var] = \frac{1}{[$d2]}``]
6666

67-
[`[$var] =`] [________________________]{$ans} [@ AnswerFormatHelp("numbers") @]*
67+
[`[$var] =`] [________________________]{$ans} [@ AnswerFormatHelp("numbers") @]*
6868

6969

7070

@@ -75,7 +75,7 @@ END_PGML
7575
# Solution
7676

7777
BEGIN_PGML_SOLUTION
78-
Multipy every term by [$d3] to clear the fractions.
78+
Multiply every term by [$d3] to clear the fractions.
7979

8080
[`[$d2][$var]^2 + [$var] = [$d1]`]
8181

@@ -89,4 +89,4 @@ END_PGML_SOLUTION
8989

9090
COMMENT('MathObject version. Uses PGML.');
9191

92-
ENDDOCUMENT();
92+
ENDDOCUMENT();

Contrib/CCCS/QuantitativeLiteracy/IA_9.3/OpenStax_IA_9.3_137.pg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Solve the equation using the quadratic formula. If there is more than one correc
6464

6565
[``\frac{1}{[$d1]}{[$var]}^{2} + \frac{1}{[$d3]}[$var] = \frac{1}{[$d2]}``]
6666

67-
[`[$var] =`] [________________________]{$ans} [@ AnswerFormatHelp("numbers") @]*
67+
[`[$var] =`] [________________________]{$ans} [@ AnswerFormatHelp("numbers") @]*
6868

6969

7070

@@ -75,7 +75,7 @@ END_PGML
7575
# Solution
7676

7777
BEGIN_PGML_SOLUTION
78-
Multipy every term by [$d3] to clear the fractions.
78+
Multiply every term by [$d3] to clear the fractions.
7979

8080
[`[$d2][$var]^2 + [$var] = [$d1]`]
8181

@@ -89,4 +89,4 @@ END_PGML_SOLUTION
8989

9090
COMMENT('MathObject version. Uses PGML.');
9191

92-
ENDDOCUMENT();
92+
ENDDOCUMENT();
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
## DESCRIPTION
2+
## Generates arithmetic expressions in ML and asks for value and type.
3+
## ENDDESCRIPTION
4+
5+
## DBsubject(Programming Languages)
6+
## DBchapter(ML)
7+
## DBsection(BasicTypesOperators)
8+
## Date(12/04/2025)
9+
## Institution(Louisiana Tech)
10+
## Author(Jason Terry)
11+
## Level(2)
12+
## KEYWORDS('programming languages','ml','sml','expressions','type','operators')
13+
14+
15+
DOCUMENT();
16+
17+
## Load libraries
18+
loadMacros(
19+
"PGstandard.pl",
20+
"PGcourse.pl",
21+
"parserPopUp.pl",
22+
"PGML.pl"
23+
);
24+
25+
## Change context to numeric answers
26+
Context("Numeric");
27+
28+
## Generate random numbers for problems.
29+
$a = random(1,3,1);
30+
$b = random(4,6,1);
31+
$c = random(7,9,1);
32+
$d = random(1,7,2);
33+
34+
## Generate solutions to problems
35+
$ans1 = $a + $b * $c;
36+
$ans2 = ($a + $b) * $c;
37+
$ans3 = $c - $d/2.0;
38+
$ans4 = int(($b*$c)/3);
39+
$ans5 = ($b*$c) % 3;
40+
41+
## Create the popup menus with the correct ML type answers
42+
$popInt = PopUp(["Choose...","int","bool","real","char","string"], 1);
43+
$popBool = PopUp(["Choose...","int","bool","real","char","string"], 2);
44+
$popReal = PopUp(["Choose...","int","bool","real","char","string"], 3);
45+
$popChar = PopUp(["Choose...","int","bool","real","char","string"], 4);
46+
$popString = PopUp(["Choose...","int","bool","real","char","string"], 5);
47+
48+
## Display question
49+
TEXT(beginproblem());
50+
51+
BEGIN_PGML
52+
Determine the value and type returned when the following ML expressions are evaluated.
53+
54+
*[$a] + [$b] * [$c];*
55+
56+
*val it = [__________]{$ans1} : [_____]{$popInt}*
57+
===
58+
*([$a] + [$b]) * [$c];*
59+
60+
*val it = [__________]{$ans2} : [_____]{$popInt}*
61+
===
62+
*[$c].0 - [$d].0 / 2.0;*
63+
64+
*val it = [__________]{$ans3} : [_____]{$popReal}*
65+
===
66+
*([$b]\*[$c]) div 3;*
67+
68+
*val it = [__________]{$ans4} : [_____]{$popInt}*
69+
===
70+
*([$b]\*[$c]) mod 3;*
71+
72+
*val it = [__________]{$ans5} : [_____]{$popInt}*
73+
74+
75+
END_PGML
76+
77+
BEGIN_PGML_SOLUTION
78+
Solution:
79+
80+
*[$a] + [$b] * [$c];*
81+
82+
*val it = [$ans1] : [$popInt] *
83+
===
84+
*([$a] + [$b]) * [$c];*
85+
86+
*val it = [$ans2] : [$popInt] *
87+
===
88+
*[$c].0 - [$d].0 / 2.0;*
89+
90+
*val it = [$ans3] : [$popReal] *
91+
===
92+
*([$b]\*[$c]) div 3;*
93+
94+
*val it = [$ans4] : [$popInt] *
95+
===
96+
*([$b]\*[$c]) mod 3;*
97+
98+
*val it = [$ans5] : [$popInt] *
99+
100+
END_PGML_SOLUTION
101+
102+
ENDDOCUMENT();
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
## DESCRIPTION
2+
## Generates bool, string, and int expressions in ML
3+
## using if-then-else and asks for their values and types.
4+
## ENDDESCRIPTION
5+
6+
## DBsubject(Programming Languages)
7+
## DBchapter(ML)
8+
## DBsection(BasicTypesOperators)
9+
## Date(12/04/2025)
10+
## Institution(Louisiana Tech)
11+
## Author(Jason Terry)
12+
## Level(2)
13+
## KEYWORDS('programming languages','ml','sml','expressions','type','operators','string','ifthenelse','bool')
14+
15+
16+
DOCUMENT();
17+
18+
## Load libraries
19+
loadMacros(
20+
"PGstandard.pl",
21+
"PGcourse.pl",
22+
"contextArbitraryString.pl",
23+
"parserPopUp.pl",
24+
"PGML.pl"
25+
);
26+
27+
## Change context to strings answers
28+
Context("ArbitraryString");
29+
30+
## Create answer to static problem
31+
$ans1 = String("~~"arcsine~~"");
32+
33+
## Create parameters for boolean statements
34+
$a = random(1,20,1);
35+
$b = random(1,20,1);
36+
$c = random(1,3,1);
37+
$d = random(21,30,1);
38+
$e = random(31,40,1);
39+
40+
## Create answers to boolean statements
41+
if ($a < $b) { $ans2 = String("~~"yes~~""); } else { $ans2 = String("~~"no~~""); }
42+
if ($c == 2) {$ans3 = $d;} else {$ans3 = $e;}
43+
if ($c == 3) {$ans4 = String("false");} else {$ans4 = String("true");}
44+
if ($a < $b || $c == 2) {$ans5 = String("true");} else {$ans5 = String("false");}
45+
46+
## Create the popup menus with the correct ML type answers
47+
$popInt = PopUp(["Choose...","int","bool","real","char","string"], 1);
48+
$popBool = PopUp(["Choose...","int","bool","real","char","string"], 2);
49+
$popReal = PopUp(["Choose...","int","bool","real","char","string"], 3);
50+
$popChar = PopUp(["Choose...","int","bool","real","char","string"], 4);
51+
$popString = PopUp(["Choose...","int","bool","real","char","string"], 5);
52+
53+
## Display question
54+
TEXT(beginproblem());
55+
56+
BEGIN_PGML
57+
Determine the value and type returned when the following ML expressions are evaluated.
58+
59+
*\"arc\" ^ \"sine\" ^ \"\";*
60+
61+
*val it = [__________]{$ans1} : [_____]{$popString}*
62+
===
63+
*if ([$a] < [$b]) then \"yes\" else \"no\";*
64+
65+
*val it = [__________]{$ans2} : [_____]{$popString}*
66+
===
67+
*if ([$c] = 2) then [$d] else [$e];*
68+
69+
*val it = [__________]{$ans3} : [_____]{$popInt}*
70+
===
71+
*if ([$c] = 3) then false else true;*
72+
73+
*val it = [__________]{$ans4} : [_____]{$popBool}*
74+
===
75+
*[$a] < [$b] orelse [$c] = 2;*
76+
77+
*val it = [__________]{$ans5} : [_____]{$popBool}*
78+
79+
80+
END_PGML
81+
82+
BEGIN_PGML_SOLUTION
83+
Solution:
84+
85+
*\"arc\" ^ \"sine\" ^ \"\";*
86+
87+
*val it = [$ans1] : [$popString] *
88+
===
89+
*if ([$a] < [$b]) then \"yes\" else \"no\";*
90+
91+
*val it = [$ans2] : [$popString] *
92+
===
93+
*if ([$c] = 2) then [$d] else [$e];*
94+
95+
*val it = [$ans3] : [$popInt] *
96+
===
97+
*if ([$c] = 3) then false else true;*
98+
99+
*val it = [$ans4] : [$popBool] *
100+
===
101+
*[$a] < [$b] orelse [$c] = 2;*
102+
103+
*val it = [$ans5] : [$popBool] *
104+
105+
END_PGML_SOLUTION
106+
107+
ENDDOCUMENT();

0 commit comments

Comments
 (0)