work on multiplication begins
This commit is contained in:
parent
1fb7dd0c3d
commit
ccfa2dc8ce
@ -17,7 +17,8 @@ ops = {
|
||||
# Anzahl der zu generierenden Fragen.
|
||||
NUM_QUESTIONS = 5
|
||||
# Algebraische Struktur der Aufgaben
|
||||
STRUCTURE = "(+)-((+)-(+))"
|
||||
#STRUCTURE = "(+)-((+)-(+))"
|
||||
STRUCTURE = "*"
|
||||
# Gleiche Nenner erlauben
|
||||
SAME_ALLOWED = True
|
||||
# Größter Zähler
|
||||
@ -286,6 +287,15 @@ def create_formula_question(ex_number: int):
|
||||
elif has_minus:
|
||||
expression_type = "Subtraktion" + f" ({STRUCTURE})"
|
||||
exercise_text = "Subtrahiere die Brüche"
|
||||
elif has_mult and has_div:
|
||||
expression_type = "Punktrechnung" + f" ({STRUCTURE})"
|
||||
exercise_text = "Berechne den Term"
|
||||
elif has_mult:
|
||||
expression_type = "Multiplikation" + f" ({STRUCTURE})"
|
||||
exercise_text = "Multipliziere die Brüche"
|
||||
elif has_div:
|
||||
expression_type = "Division" + f" ({STRUCTURE})"
|
||||
exercise_text = "Dividiere die Brüche"
|
||||
else:
|
||||
expression_type = "Rechnung" + f" ({STRUCTURE})"
|
||||
exercise_text = "Berechne den Term"
|
||||
@ -456,7 +466,7 @@ def create_formula_question(ex_number: int):
|
||||
latex_calculation = gen_latex_calculate_string(STRUCTURE_PH, fractions_latex_strings)
|
||||
|
||||
sub_q_t_begin = "<![CDATA[ <p>Berechne:</p>"
|
||||
sub_q_t_math = "<p>\$\\Large \\displaystyle " + f"{latex_calculation}" + "=\$</p>"
|
||||
sub_q_t_math = "<p>\(\\Large \\displaystyle " + f"{latex_calculation}" + "=\)</p>"
|
||||
rows_list = [
|
||||
["Zähler:", "{_0}"],
|
||||
["Nenner:", "{_1}"]
|
||||
@ -490,11 +500,11 @@ def create_formula_question(ex_number: int):
|
||||
if shortable:
|
||||
feedback_text = '''<![CDATA[ <h4>Lösungshinweis</h4>
|
||||
<p>Die korrekte Lösung ist:</p>
|
||||
<p>\$\\displaystyle''' + f"{latex_calculation}" +" = " + f"{expanded_latex_calculation}" + ''' = \\frac{{resnum}}{{cd}} = \\frac{{sresnum}}{{sresden}} \$ </p> ]]>'''
|
||||
<p>\(\\displaystyle''' + f"{latex_calculation}" +" = " + f"{expanded_latex_calculation}" + ''' = \\frac{{resnum}}{{cd}} = \\frac{{sresnum}}{{sresden}} \) </p> ]]>'''
|
||||
else:
|
||||
feedback_text = '''<![CDATA[ <h4>Lösungshinweis</h4>
|
||||
<p>Die korrekte Lösung ist:</p>
|
||||
<p>\$ \\displaystyle ''' + f"{latex_calculation}" +" = " + f"{expanded_latex_calculation}" + ''' = \\frac{{resnum}}{{cd}} \$ </p> ]]>'''
|
||||
<p>\( \\displaystyle ''' + f"{latex_calculation}" +" = " + f"{expanded_latex_calculation}" + ''' = \\frac{{resnum}}{{cd}} \) </p> ]]>'''
|
||||
ET.SubElement(feedback_elem, 'text').text = feedback_text
|
||||
|
||||
# correctfeedback
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<quiz><question type="formulas"><name><text>Addition von 2 ungleichnamigen Brüchen 0</text></name><questiontext format="html"><text><![CDATA[ <p>Addiere die Brüche und kürze das Ergebnis so weit wie möglich.</p>
|
||||
<p>{#A} </p> ]]> </text></questiontext><generalfeedback format="html"><text> </text></generalfeedback><defaultgrade>1.0000000</defaultgrade><penalty>0.3333333</penalty><hidden>0</hidden><idnumber> </idnumber><correctfeedback format="html"><text><![CDATA[ <p>Die Antwort ist richtig.</p> ]]> </text></correctfeedback><partiallycorrectfeedback format="html"><text><![CDATA[ <p>Die Antwort ist teilweise richtig.</p> ]]> </text></partiallycorrectfeedback><incorrectfeedback format="html"><text><![CDATA[ <p>Die Antwort ist falsch.</p> ]]></text></incorrectfeedback><shownumcorrect /><varsrandom><text> </text></varsrandom><varsglobal><text>n = [5, 3];
|
||||
d = [9, 6];</text></varsglobal><answernumbering><text>ABCD</text></answernumbering><answers><partindex><text>0</text></partindex><placeholder><text>#A</text></placeholder><answermark><text>1</text></answermark><answertype><text>0</text></answertype><numbox><text>2</text></numbox><vars1><text>g = gcd(d[0],d[1]);
|
||||
<p>{#A} </p> ]]> </text></questiontext><generalfeedback format="html"><text> </text></generalfeedback><defaultgrade>1.0000000</defaultgrade><penalty>0.3333333</penalty><hidden>0</hidden><idnumber> </idnumber><correctfeedback format="html"><text><![CDATA[ <p>Die Antwort ist richtig.</p> ]]> </text></correctfeedback><partiallycorrectfeedback format="html"><text><![CDATA[ <p>Die Antwort ist teilweise richtig.</p> ]]> </text></partiallycorrectfeedback><incorrectfeedback format="html"><text><![CDATA[ <p>Die Antwort ist falsch.</p> ]]></text></incorrectfeedback><shownumcorrect /><varsrandom><text> </text></varsrandom><varsglobal><text>n = [8, 8];
|
||||
d = [4, 10];</text></varsglobal><answernumbering><text>ABCD</text></answernumbering><answers><partindex><text>0</text></partindex><placeholder><text>#A</text></placeholder><answermark><text>1</text></answermark><answertype><text>0</text></answertype><numbox><text>2</text></numbox><vars1><text>g = gcd(d[0],d[1]);
|
||||
cd = d[0]*d[1]/pow(g,2);
|
||||
e = [cd / d[0], cd / d[1]];
|
||||
nums = [n[0]*e[0], n[1]*e[1]];
|
||||
|
Loading…
Reference in New Issue
Block a user