Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4174031
  • 博文数量: 601
  • 博客积分: 15410
  • 博客等级: 上将
  • 技术积分: 6884
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-16 08:11
个人简介

独学而无友,则孤陋而寡闻!

文章分类

全部博文(601)

文章存档

2020年(1)

2018年(4)

2017年(7)

2016年(42)

2015年(25)

2014年(15)

2013年(36)

2012年(46)

2011年(117)

2010年(148)

2009年(82)

2008年(37)

2007年(41)

分类: Python/Ruby

2012-04-08 19:36:02

思路一:把原文的习题类型移到上方,
 1、编辑时的追踪点:\claroline\exercise\admin\edit_question.php文件290-330行:
     

点击(此处)折叠或打开

  1. if( is_null($quId) )
  2.     {
  3.         $out .= '' . "\n"
  4.         . ''.get_lang('Answer type').' :' . "\n"
  5.         . '' . "\n"
  6.         . '
  7.         . ( $form['type'] == 'MCUA'?' checked="checked"':' ') . ' />'
  8.         . ' .get_lang('Multiple choice (Unique answer)').''
  9.         . '
    '
    . "\n"
  10.         . '
  11.         . ( $form['type'] == 'MCMA'?' checked="checked"':' ') . ' />'
  12.         . ' .get_lang('Multiple choice (Multiple answers)').''
  13.         . '
    '
    . "\n"
  14.         . '
  15.         . ( $form['type'] == 'TF'?' checked="checked"':' ') . ' />'
  16.         . ' .get_lang('True/False').''
  17.         . '
    '
    . "\n"
  18.         . '
  19.         . ( $form['type'] == 'FIB'?' checked="checked"':' ') . ' />'
  20.         . ' .get_lang('Fill in blanks').''
  21.         . '
    '
    . "\n"
  22.         . '
  23.         . ( $form['type'] == 'MATCHING'?' checked="checked"':' ') . ' />'
  24.         . ' .get_lang('Matching').''
  25.         . "\n"
  26.         . '' . "\n"
  27.         . '' . "\n\n"
  28.         ;
  29.     }
  30.     else
  31.     {
  32.         $out .= '' . "\n"
  33.         . ''.get_lang('Answer type').' :' . "\n"
  34.         . '';

  35.         if( isset($localizedQuestionType[$form['type']]) ) $out .= $localizedQuestionType[$form['type']];

  36.         $out .= '' . "\n"
  37.         . '' . "\n\n";
  38.     }
  把这部分移到234行的前面:

点击(此处)折叠或打开

  1. if( $askDuplicate )
  2.     {
  3.         $out .= '' . "\n"
  4.         . ' ' . "\n"
  5.         . ''
  6.         . html_ask_duplicate()
  7.         . '' . "\n"
  8.         . '' . "\n\n";
  9.     }
  2、显示时的追踪点,文件最后: 

点击(此处)折叠或打开

  1. $out .= $question->getQuestionAnswerHtml();
  这个getQuestionAnswerHtml函数又连接到各个类型习题的getAnswerHtml函数,比如填空题的claroline\exercise\lib\answer_fib.class.php文件443行:

点击(此处)折叠或打开

  1. . '

    ' . get_lang('Fill in blanks') . '

    '
    . "\n";
  把这行提到本out.=的最前方就可以了。


  但是这样必须每种答案类型的文件都修改,在exercise\lib下的以answer开头的文件,都需要修改,比较麻烦。

思路二:直接添加一个类型说明,在上文件最后有

点击(此处)折叠或打开

  1. $out .= $question->getQuestionAnswerHtml();
在此行上面添加一行:
  

点击(此处)折叠或打开

  1. $out .= "

    " . $localizedQuestionType[$question->getType()] ."

    "
    ;


思路三:做练习时上方添加类型提醒:exercise_submit.php的778行

点击(此处)折叠或打开

  1. else
  2.                 {
  3.                     $out .= '' . "\n"
  4.                     . ''
  5.                     . get_lang('Question') . ' ' . $questionIterator
  6.                     . ' / '.$questionCount
  7.                     . '' . "\n"
  8.                     . '' . "\n\n";
,此内容后添加:

点击(此处)折叠或打开

  1. $type_text=array('MCUA'=>get_lang('Multiple choice (Unique answer)'),
  2.                                      'MCMA'=>get_lang('Multiple choice (Multiple answers)'),
  3.                                      'TF'=>get_lang('True/False'),
  4.                                      'FIB'=>get_lang('Fill in blanks'),
  5.                                      'MATCHING'=>get_lang('Matching')
  6.                                  );
  7.                                         $out .= '

    ' . $type_text[$question->getType()]. '

    '
    ;








阅读(1291) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~