[LON-CAPA-cvs] cvs: loncom /homework mathresponse.idea

www lon-capa-cvs@mail.lon-capa.org
Tue, 05 Dec 2006 15:20:22 -0000


www		Tue Dec  5 10:20:22 2006 EDT

  Modified files:              
    /loncom/homework	mathresponse.idea 
  Log:
  Gesundheit ... might as well add this.
  
  
Index: loncom/homework/mathresponse.idea
diff -u loncom/homework/mathresponse.idea:1.1 loncom/homework/mathresponse.idea:1.2
--- loncom/homework/mathresponse.idea:1.1	Wed Jun 14 14:31:37 2006
+++ loncom/homework/mathresponse.idea	Tue Dec  5 10:20:22 2006
@@ -69,3 +69,86 @@
 </mathresponse>
 
 </problem>
+
+
+* Maxima hat keinen echten Servermode.
+
+Das Programm
+
+/loncapa/loncom/lonmaxima
+
+erzeugt fuenf Serverprozesse, die jeweils einen Maxima-Prozess am Laufen halten:
+
+www       8506  0.0  0.5  8880 5324 ?        S    Dec04   0:00 lonmaxima: Parent process, sleeping Mon Dec  4 09:53:10 2006
+www       8507  0.0  0.5  9012 5380 ?        S    Dec04   0:00 lonmaxima: Accepting connections Mon Dec  4 10:23:24 2006
+www       8508  0.0  2.3 885900 24276 pts/2  S    Dec04   0:00 sbcl --core /usr/local/lib/maxima/5.9.2.99rc1/binary-sbcl/maxima.core --noinform --end-runtime-options --eval (cl-user::run) --end-toplevel-options
+www       8510  0.0  0.5  9012 5380 ?        S    Dec04   0:00 lonmaxima: Accepting connections Mon Dec  4 10:23:24 2006
+www       8512  0.0  0.5  9012 5380 ?        S    Dec04   0:00 lonmaxima: Accepting connections Mon Dec  4 10:23:30 2006
+www       8513  0.0  2.3 885900 24308 pts/4  S    Dec04   0:00 sbcl --core /usr/local/lib/maxima/5.9.2.99rc1/binary-sbcl/maxima.core --noinform --end-runtime-options --eval (cl-user::run) --end-toplevel-options
+www       8515  0.0  2.3 885900 24040 pts/5  S    Dec04   0:00 sbcl --core /usr/local/lib/maxima/5.9.2.99rc1/binary-sbcl/maxima.core --noinform --end-runtime-options --eval (cl-user::run) --end-toplevel-options
+www       8621  0.0  0.5  9012 5380 ?        S    Dec04   0:00 lonmaxima: Accepting connections Mon Dec  4 10:23:30 2006
+www       8622  0.0  2.3 885900 24312 pts/3  S    Dec04   0:00 sbcl --core /usr/local/lib/maxima/5.9.2.99rc1/binary-sbcl/maxima.core --noinform --end-runtime-options --eval (cl-user::run) --end-toplevel-options
+www       8648  0.0  0.5  9012 5380 ?        S    Dec04   0:00 lonmaxima: Accepting connections Mon Dec  4 10:23:19 2006
+www       8649  0.0  2.2 885900 22952 pts/6  S    Dec04   0:00 sbcl --core /usr/local/lib/maxima/5.9.2.99rc1/binary-sbcl/maxima.core --noinform --end-runtime-options --eval (cl-user::run) --end-toplevel-options
+
+Dieser Daemon muss laufen, damit LON-CAPA mit Maxima reden kann.
+
+Die Routinen, die dazu benutzt werden sollen, sind in
+
+/loncapa/loncom/homework/lonmaxima.pm
+
+* XML-Umgebung: wir haben zwei Perl-Umgebungen, wenn wir XML-Dateien abarbeiten, naemlich
+  - die Apache-Module-Umgebung: volle Privilegien
+  - die "Safeeval"-Umgebung: die interne Umgebung des Dokuments, in der zum Beispiel die <script>-Bloecke laufen. In dieser Umgebung existieren die Variablen des Problems.
+    Eingeschraenkte Opcodes (no I/O), kein direkter Zugriff auf die Apache-Umgebungen ausser mit "Safe Holes", z.B.,
+    $safehole->wrap(\&Apache::lonmaxima::maxima_check,$safeeval,'&maxima_check');
+
+caparesponse.pm, response.pm, lonmaxima.pm, etc, laufen in der Apache-Umgebung
+default_homework.lcpm laueft in der Safeeval-Umgebung
+
+* formularesponse: Erweiterung der "einfachen" Responsetypes: numerical, string, etc. Das haben wir vom alten CAPA-System geerbt und ist deshalb in
+
+/loncapa/loncom/homework/caparesponse/caparesponse.pm
+
+Alle einfachen Responses gehen in &check_submission(), wo dann sortiert wird, wer es bearbeitet. <formularesponse> ohne Samples soll von Maxima bearbeitet werden (auskommentiert in Production-Version). Ausgefuehrt wird das dann in
+
+/loncapa/loncom/xml/run.pm
+
+das den Uebergang in die Safeeval-Umgebung macht. In der Safeeval-Umgebung kuemmert sich
+
+/loncapa/loncom/homework/default_homework.lcpm
+
+in der Routine &caparesponse_check()
+
+    if ($type eq '9') {
+      $result = &maxima_check(&maxima_cas_formula_fix($response),&maxima_cas_formula_fix($answer),\$reterror);
+    } else {
+        if ($type eq '8') { # fml type
+    ...
+
+* <mathresponse>: neuer Antwork-Typ, aehnlich wie <customresponse>. Das Design ist beschrieben in
+
+/loncapa/loncom/homework/mathresponse.idea
+
+Das Tag ist definiert in
+
+/loncapa/loncom/homework/response.pm
+
+Die Routine
+
+&start_mathresponse()
+
+wird aufgerufen, wenn der Parser auf <mathresponse> trifft. Die Routine
+
+&end_mathresponse()
+
+wird aufgerufen, wenn der Parser auf </mathresponse> trifft. Beide Routinen muessen die verschiedenen Rendering-Targets bedienen:
+* web: Darstellung auf dem Web
+* tex: Darstellung im Druck
+* edit: Darstellung im bunten Editor
+* modified: Zurueckschreiben von Aenderungen im Editor (muss normalerweise nicht geaendert werden)
+* meta: Katalogdaten  (muss normalerweise nicht geaendert werden)
+* answer: Darstellung der richtigen Antwort
+* grade: Benotung der Studierendenantwort
+
+Die Routinen &start_answer and &end_answer (<answer> und </answer>) sammeln nur die Scripts ein und werden von <mathresponse> und <customresponse> genutzt.