ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


A few changes to Exams and Surveys section


  • 2007-12-17 22:32:44

    A few changes to Exams and Surveys section

    operating system - Server 2003
    version of ATutor - 1.5.5
    versions of php - 5.2.3
    version of mysq l - 5.0
    webserver & version - Apache 2.2.6
    web browser being used - firefox and I.E.

    [b]Comments: See attached image.[/b]

    1. Is there a way I can change the titles of the different columns in the tables? For example in the first column I have "TITULO" (title), I want to change this word to exams, is this possible?

    2. The column that says "ESTATUS" I want to eliminate completely.

    3. In the column that says "Fecha Inicio" (start date) I want to change the properties of the table... so that instead of showing the full hour it only shows the date in which the exam started.

    4. In the column that starts "Fecha Final" (Final Date) I want the date also not the hour.

    6. The column "PREGUNTAS" (questions) I also want to eliminate.

    So that's basically it :) (I know it's a lot)... I'm going to try and program it myself, but any help or suggestions will be greatly appreciated.

    [b] [/b] [blue] [/blue] [b] [/b] [b] [/b]

  • 2007-12-18 03:53:15

    Re: A few changes to Exams and Surveys section

    hi,

    you can edit all language terms, but it has to be done in the language file. log in as admin -> system prefs -> languages -> editor.

    however, "title" being such a general term, it is most guaranteed used several places. I would either let it be the way it is, or if it is very importaint for you do the following:

    1. create a new term in your language file (in sys prefs -> lang)
    2. open the file tools/my_tests.php in a good text editor, line 27 will read something like:
    [php]
    <th scope="col"><?php echo _AT('title'); ?></th>[/php]

    _AT('title') is what prints out "title" in the users language. change this to reflect your new term. same goes for line 108, where the other table (finished tests) start

    the th tags are the table header tags, here you can remove the ones you do not wish to have, [b]and[/b] you will have to remove the corresponding TD tags further down the code.

    alternatively, try to give the th / td-s you wish to remove a class you can style (to display: none) and see if that works.

    for the dates, I see this at line 68 andf 69:

    [php]
    echo '<td>'.substr($row['start_date'], 0, -3).'</td>';
    [/php]

    but I do not know what you will have to do to change the date output. it might not be that easy.

    in all cases, have a backup! this is not trivial to do if you do not at least read php and html well, and you will have to do it again every time you update Atutor!

    good luck :)

  • 2007-12-18 08:47:42

    Re: A few changes to Exams and Surveys section

    Changing the display of the date is simple. Just change "-3" to "-9" in lines 68 and 69:

    [php]
    echo '<td>'.substr($row['start_date'], 0, -9).'</td>';
    echo '<td>'.substr($row['end_date'], 0, -9).'</td>';
    [/php]

    Should work.

    BTW, this is actually an internationalization issue. I'll probably add it to the bug tracker.
    So thanks for having hinted this issue, remnorz. ;)

  • 2007-12-18 09:30:10

    Re: A few changes to Exams and Surveys section

    It seems from the attached picture that you (or someone else) have changed the PHP code handling the output of the date in the "Fecha Inicio" and "Fecha Final" columns.
    So my previous post won't help. I'm sorry.

    If the date output is now handled by _AT() function, you should change the term it uses like you probably did in http://www.atutor.ca/view/7/11929/1.html .
    Or, you just may use another, more appropriate, formatting variable with the _AT().

    If that doesn't help, then write here your changes to the PHP code of the file (if you made any).

  • 2007-12-18 12:17:53

    Re: A few changes to Exams and Surveys section

    I included a rar archive with the jpeg on how it's looking now and the php code.

    Thanks to you both, the programmer that's supposed to work with this is on vacation and I had to modify some things. Thanks to you both it was a snap.

    I decided to comment instead of actually modifying the code so that when he (the programmer) gets back from vacation he can do whatever he feels or wants.

    I'm just glad that Atutor is such a great tool, and that the community that supports it is even better :).

    BTW, where should I go if I want to help with translations? Spanish is my main language and well if needed I can help :).

    Again thanks to you both.

  • 2007-12-19 07:22:38

    Re: A few changes to Exams and Surveys section

    AFAIK, there is no standardized way of contacting other translators.
    You could go to http://www.atutor.ca/my/translate/index.php and mark yourself as a Spanish translator. Then you'll see the names of other translators and try to google for their contact info.

    But if you see some obvious errors, then after registering as a translator you can start updating translation right away.

    P.S. About your changes. You can try replacing _AT('Examenes') with _AT('tests') at line 27. That will remove those ugly [brackets] around the column title.

  • 2007-12-19 14:36:52

    Re: A few changes to Exams and Surveys section

    Indie or Vegard, do you know a way I can organize the examns in the my_tests.php area in the order they where release.

    I know there this line:

    echo '<td>'.$row['date_taken'].'</td>';

    But that is for the Results Area in the my_test.php area... I want to be able to organize the top area (where you see the exams and their links) in the same order as they where release, instead of how they are now, I dunno if they are organized by their sql table value or what, because I tried to remake the exams and the order was always random... at least to me.

    I'm guessing some value in here:

    [php]

    $takes_result= mysql_query($sql, $db);
    $takes = mysql_fetch_assoc($takes_result);

    if ( ($row['us'] <= time() && $row['ue'] >= time()) &&
    ( ($row['num_takes'] == AT_TESTS_TAKE_UNLIMITED) || ($takes['cnt'] < $row['num_takes']) ) ) {
    echo '<strong><a href="tools/take_test.php?tid='.$row['test_id'].'">'.AT_print($row['title'], 'tests.title').'</a></strong>';
    }
    /* else {
    echo '<small class="bigspacer">'.AT_print($row['title'], 'tests.title').'';
    }
    [/php]

  • 2007-12-20 03:36:21

    Re: A few changes to Exams and Surveys section

    Why random? As I see from your screenshot and your code, the results are now ordered according to their start day, from earlier to later.

    If you want to change that, you should modify the very first SQL query in that file, line 20.

    The sorting order is specified with "ORDER BY T.start_date, T.title". You can replace T.start_date with whichever column you need.
    Reversing the order is possible by appending " DESC" (i.e. "descending order") to the end.