lilalo

changeset 6:a0f30dd46d1a

В журнале появились секции
* статистика
* справка
* о программе
И оглавление.

В начале журнала выводится информация о том
курсе и слушателе, к которым этот журнал относится
author devi
date Tue May 24 16:09:08 2005 +0300 (2005-05-24)
parents 7d4d067f9823
children 614945eed906
files lm lm-report
line diff
     1.1 --- a/lm	Tue May 24 13:56:12 2005 +0300
     1.2 +++ b/lm	Tue May 24 16:09:08 2005 +0300
     1.3 @@ -336,7 +336,8 @@
     1.4  	for my $student (@{$XMLClass->{"student"}}) {
     1.5  		my $user = $student->{"user"};
     1.6  		my $hostname = $student->{"host"};
     1.7 -		my $encoding = $student->{"encoding"};
     1.8 +		my $encoding = $student->{"charset"};
     1.9 +		my $student_name = $student->{"firstname"}." ".$student->{"surname"};
    1.10  
    1.11  		system("mkdir -p $webdir/$date/$hostname");
    1.12  		system("cp ".$Config{"path_share"}."/*.{ico,css} $webdir/$date/$hostname");
    1.13 @@ -345,12 +346,24 @@
    1.14  			" --diffs ".$Config{"path_lablogs"}."/$course/$date/$hostname/$user ".
    1.15  				   $Config{"path_lablogs"}."/$course/$date/$hostname/root".
    1.16  			" --output $webdir/$date/$hostname/$user.html".
    1.17 +			" --course-name '$course_name'".
    1.18 +			" --course-code '$course'".
    1.19 +			" --course-date '$date'".
    1.20 +			" --course-center '$center'".
    1.21 +			" --course-student '$student_name'".
    1.22 +			" --course-trainer '$instructor'".
    1.23  			" --encoding $encoding"
    1.24  		);
    1.25  		system($Config{"l3-report"}.
    1.26  			" --input ".$Config{"path_lablogs"}."/$course/$date/$hostname/root".
    1.27  			" --diffs ".$Config{"path_lablogs"}."/$course/$date/$hostname/root ".
    1.28  			" --output $webdir/$date/$hostname/root.html".
    1.29 +			" --course-name '$course_name'".
    1.30 +			" --course-code '$course'".
    1.31 +			" --course-date '$date'".
    1.32 +			" --course-center '$center'".
    1.33 +			" --course-student '$student_name'".
    1.34 +			" --course-trainer '$instructor'".
    1.35  			" --encoding $encoding"
    1.36  		);
    1.37  	}
     2.1 --- a/lm-report	Tue May 24 13:56:12 2005 +0300
     2.2 +++ b/lm-report	Tue May 24 16:09:08 2005 +0300
     2.3 @@ -56,6 +56,13 @@
     2.4  		comment_width			=>	"300",
     2.5  		time_width			=>	"60",
     2.6  
     2.7 +		"course-name" => "", 
     2.8 +		"course-code" => "", 
     2.9 +		"course-date" => "", 
    2.10 +		"course-center" => "", 
    2.11 +		"course-trainer" => "", 
    2.12 +		"course-student" => "", 
    2.13 +
    2.14  		);
    2.15  
    2.16  our @Command_Lines;
    2.17 @@ -92,6 +99,10 @@
    2.18  				=> 	"продолжение с помощью tab"
    2.19  );
    2.20  
    2.21 +sub init_variables;
    2.22 +our $Html_Help;
    2.23 +our $Html_About;
    2.24 +
    2.25  
    2.26  sub load_diff_files
    2.27  {
    2.28 @@ -586,10 +597,23 @@
    2.29  
    2.30  }
    2.31  
    2.32 +
    2.33 +=cut 
    2.34 +Вывести результат обработки журнала.
    2.35 +=cut
    2.36 +
    2.37 +
    2.38  sub print_command_lines
    2.39  {
    2.40  	my $output_filename=$_[0];
    2.41  	my $format = $Config{"output_format"};
    2.42 +
    2.43 +	my $course_name = $Config{"course-name"};
    2.44 +	my $course_code = $Config{"course-code"};
    2.45 +	my $course_date = $Config{"course-date"};
    2.46 +	my $course_center = $Config{"course-center"};
    2.47 +	my $course_trainer = $Config{"course-trainer"};
    2.48 +	my $course_student = $Config{"course-student"};
    2.49  	
    2.50  	open(OUT, ">", $output_filename)
    2.51  		or die "Can't open $output_filename for writing\n";
    2.52 @@ -655,6 +679,24 @@
    2.53  
    2.54  		}
    2.55  		</script>
    2.56 +		<h2>Журнал лабораторных работ</h2>
    2.57 +
    2.58 +		<p>
    2.59 +		Выполнил $course_student<br/>
    2.60 +		Проверил $course_trainer <br/>
    2.61 +		Курс $course_name ($course_code),
    2.62 +		$course_date<br/>
    2.63 +		Учебный центр $course_center <br/>
    2.64 +		</p>
    2.65 +
    2.66 +		<ul>
    2.67 +			<li><a href='#log'>Журнал</a></li>
    2.68 +			<li><a href='#stat'>Статистика</a></li>
    2.69 +			<li><a href='#help'>Справка</a></li>
    2.70 +			<li><a href='#about'>О программе</a></li>
    2.71 +		</ul>
    2.72 +
    2.73 +		<h3 id="#log">Журнал</h3>
    2.74  HEADER
    2.75  		print OUT "<table class='visibility_form'><tr><td><form>\n";
    2.76  		for my $element (keys %Elements_Visibility)
    2.77 @@ -857,6 +899,16 @@
    2.78  	}
    2.79  	if ($format eq "html") {
    2.80  		print OUT "</table>\n";
    2.81 +
    2.82 +		print OUT "<hr/>";
    2.83 +		print OUT "<h3 id='stat'>Статистика</h4>";
    2.84 +		print OUT "Статистическая информация о журнале<br/>";
    2.85 +		print OUT "<hr/>";
    2.86 +		print OUT "<h3 id='help'>Справка</h4>";
    2.87 +		print OUT "$Html_Help<br/>";
    2.88 +		print OUT "<hr/>";
    2.89 +		print OUT "<h3 a='about'>О программе</h4>";
    2.90 +		print OUT "$Html_About";
    2.91  		print OUT "</body>\n";
    2.92  		print OUT "</html>\n";
    2.93  	} 
    2.94 @@ -886,11 +938,11 @@
    2.95  
    2.96  my %file_config;
    2.97  my %argv_config;
    2.98 +init_variables;
    2.99  read_config_file(\%file_config, $Config_File);
   2.100  GetOptions(\%argv_config, map "$_=s", keys %Config);
   2.101  %Config = (%Config, %file_config, %argv_config);
   2.102  
   2.103 -
   2.104  my $i=0;
   2.105  
   2.106  for my $lab_log (split (/\s+/, $Config{"diffs"} || $Config{"input"})) 
   2.107 @@ -910,3 +962,20 @@
   2.108  	$i++;
   2.109  }
   2.110  
   2.111 +
   2.112 +sub init_variables
   2.113 +{
   2.114 +$Html_Help = <<HELP;
   2.115 +	Справка по использованию журнала
   2.116 +HELP
   2.117 +
   2.118 +$Html_About = <<ABOUT;
   2.119 +	<p>
   2.120 +	LiLaLo (L3) расшифровывается как Live Lab Log.<br/>
   2.121 +	Программа разработана для повышения эффективности обучения<br/>
   2.122 +	Unix/Linux-системам.<br/>
   2.123 +	(c) Игорь Чубин, 2004-2005<br/>
   2.124 +	\$Id$
   2.125 +	</p>
   2.126 +ABOUT
   2.127 +}