list.tpl 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. {% extends app.template_style ~ "/layout/layout_1_col.tpl" %}
  2. {% block content %}
  3. <script>
  4. $(function () {
  5. $('#close_button').click(function(){
  6. $('#question_info').hide();
  7. });
  8. $('.loadQuestion').click(function(){
  9. var questionId = $(this).text();
  10. $.ajax({
  11. dataType: "json",
  12. url: "{{ _p.web_ajax }}exercise.ajax.php?a=get_question_info&cidReq={{ course.code }}",
  13. data: "questionId="+questionId+"",
  14. success: function(questionInfo) {
  15. if (questionInfo == 0) {
  16. $('#question_title').html('Pregunta no encontrada');
  17. $('#question_category_list').html(' ');
  18. $('#question_description').html(' ');
  19. $('#question_info').show();
  20. } else {
  21. $('#question_title').html(questionInfo.question);
  22. $('#question_description').html(questionInfo.description);
  23. $('#question_category_list').html(questionInfo.category_list);
  24. $('#question_info').show();
  25. }
  26. }
  27. });
  28. });
  29. });
  30. </script>
  31. <div class="actions">
  32. <a href="{{ exerciseUrl }}">
  33. {{ 'Back' |trans }}
  34. </a>
  35. <a href="{{ url('exercise_distribution.controller:addManyDistributionAction', {'exerciseId' : exerciseId, 'cidReq':course.code, 'id_session' : course_session.id }) }}">
  36. {{ 'Add' |trans }}
  37. </a>
  38. <a href="{{ url('exercise_distribution.controller:showStatsAction', {'exerciseId' : exerciseId, 'cidReq':course.code, 'id_session' : course_session.id }) }}">
  39. {{ 'Stats' |trans }}
  40. </a>
  41. </div>
  42. <span id="question_info" style="display:none">
  43. <div class="well">
  44. <h3><span id="question_title"></span></h3>
  45. <span id="question_description"></span>
  46. <span id="question_category_list"></span>
  47. <span id="close_button" ><a href="#" class="btn">Cerrar</a></span>
  48. </div>
  49. </span>
  50. <table class="table">
  51. <th>{{ 'Name' | trans }}</th>
  52. <th>{{ 'Selected distribution' | trans }}</th>
  53. <th>{{ 'Questions' | trans }}</th>
  54. <th>{{ 'Actions' | trans }}</th>
  55. {% for item in items %}
  56. <tr>
  57. <td>
  58. <a href="{{ url('exercise_distribution.controller:readAction', {
  59. 'exerciseId' : exerciseId,
  60. 'id' : item.id ,
  61. 'cidReq':course.code,
  62. 'id_session' : course_session.id
  63. }) }}">
  64. {{ item.title }}
  65. </a>
  66. </td>
  67. <td>
  68. {% if item.id in selected_distribution_id_list %}
  69. <i class="icon-check"></i>
  70. {% else %}
  71. <i class="icon-check-empty"></i>
  72. {% endif %}
  73. </td>
  74. <td>
  75. {% if item.dataTracking %}
  76. <a class="loadQuestion btn">{{ item.dataTracking |replace({',': '</a> <a class="loadQuestion btn">'}) }}</a>
  77. {% endif %}
  78. </td>
  79. <td>
  80. {% if item.active == 1 %}
  81. <a class="btn" href="{{ url('exercise_distribution.controller:toggleVisibilityAction',{
  82. 'exerciseId' : exerciseId,
  83. 'id' : item.id,
  84. 'cidReq':course.code,
  85. 'id_session' : course_session.id })
  86. }}">
  87. <i class="icon-eye-open"></i>
  88. </a>
  89. {% else %}
  90. <a class="btn" href="{{ url('exercise_distribution.controller:toggleVisibilityAction', {
  91. 'exerciseId' : exerciseId,
  92. 'id': item.id,
  93. 'cidReq':course.code,
  94. 'id_session' : course_session.id
  95. })
  96. }}">
  97. <i class="icon-eye-close"></i>
  98. </a>
  99. {% endif %}
  100. <a class="btn" href="{{ url('exercise_distribution.controller:toggleActivationAction', {
  101. 'exerciseId' : exerciseId,
  102. 'id': item.id,
  103. 'cidReq':course.code,
  104. 'id_session' : course_session.id
  105. }) }}">
  106. {{ 'Change activation' |trans }}
  107. </a>
  108. <a class="btn" href="{{ url('exercise_distribution.controller:showStatsAction', {
  109. 'exerciseId' : exerciseId,
  110. 'id': item.id,
  111. 'cidReq':course.code,
  112. 'id_session': course_session.id
  113. })
  114. }}">
  115. {{ 'Stats' |trans }}
  116. </a>
  117. <a class="btn btn-danger" href="{{ url('exercise_distribution.controller:deleteDistributionAction', {
  118. 'exerciseId' : exerciseId,
  119. 'id': item.id,
  120. 'cidReq': course.code,
  121. 'id_session' : course_session.id
  122. }) }}">
  123. {{ 'Delete' |trans }}
  124. </a>
  125. </td>
  126. </tr>
  127. {% endfor %}
  128. </table>
  129. {% endblock %}