<form id="question-search-form" class="form-inline well well-sm" action="{{ path('course_set_manage_question_picker', {id:courseSet.id,targetType:'testpaper',replace:replace}) }}" novalidate>
  <div class="form-group">
    <select class="form-control width-150" name="courseId" data-url="{{ path('course_set_manage_show_tasks',{courseSetId:courseSet.id})}}">
      <option value="0" {% if not app.request.get('courseId',0) %}selected{% endif %}>{{'按课程'|trans}}</option>
      {% for course in courses if course %}
        <option value="{{ course.id }}" {% if app.request.get('courseId','') == course.id %}selected{% endif %}>{{ course.title }}</option>
      {% endfor %}
    </select>
    <select class="form-control width-150" {% if not courseTasks|default(null) %}style="display:none;"{% endif %} name="lessonId">
      <option value="0" {% if not app.request.get('lessonId',0) %}selected{% endif %}>{{'请选择'|trans}}</option>
      {% for task in courseTasks|default([]) if task %}
        <option value="{{ task.id }}" {% if app.request.get('lessonId','') == task.id %}selected{% endif %}>{{ task.title }}</option>
      {% endfor %}
    </select>
  </div>

  <div class="form-group">
    <input type="text" id="keyword" name="keyword" class="form-control" value="{{ app.request.query.get('keyword') }}" placeholder="{{'关键词'|trans}}">
  </div>

  <input type="hidden" name="excludeIds" value="{{ conditions.excludeIds|default('')|join(',')|default(null) }}">
  <input type="hidden" name="type" value="{{ conditions.type|default(null)}}">

  <button class="btn btn-primary btn-sm search-question-btn" data-role="search-btn">{{'搜索'|trans}}</button>

</form>